From 66d25567fe424bb55fde088f3d45e9ed044400c1 Mon Sep 17 00:00:00 2001 From: Eric Norum Date: Thu, 19 Dec 2002 15:34:54 +0000 Subject: Latest ncurses add-on --- ncurses-5.3/ANNOUNCE | 391 + ncurses-5.3/Ada95/Makefile.in | 68 + ncurses-5.3/Ada95/README | 34 + ncurses-5.3/Ada95/TODO | 27 + ncurses-5.3/Ada95/gen/Makefile.in | 442 + ncurses-5.3/Ada95/gen/gen.c | 1437 ++ ncurses-5.3/Ada95/gen/html.m4 | 11 + ncurses-5.3/Ada95/gen/normal.m4 | 8 + ncurses-5.3/Ada95/gen/table.m4 | 6 + .../Ada95/gen/terminal_interface-curses-aux.ads.m4 | 105 + ...minal_interface-curses-forms-field_types.ads.m4 | 239 + ...l_interface-curses-forms-field_user_data.ads.m4 | 71 + ...al_interface-curses-forms-form_user_data.ads.m4 | 71 + .../gen/terminal_interface-curses-forms.ads.m4 | 700 + ...al_interface-curses-menus-item_user_data.ads.m4 | 76 + ...al_interface-curses-menus-menu_user_data.ads.m4 | 71 + .../gen/terminal_interface-curses-menus.ads.m4 | 604 + .../gen/terminal_interface-curses-mouse.ads.m4 | 184 + ...rminal_interface-curses-panels-user_data.ads.m4 | 71 + .../gen/terminal_interface-curses-panels.ads.m4 | 147 + .../gen/terminal_interface-curses-trace.ads.m4 | 78 + .../Ada95/gen/terminal_interface-curses.ads.m4 | 1557 ++ ncurses-5.3/Ada95/samples/Makefile.in | 154 + ncurses-5.3/Ada95/samples/README | 6 + ncurses-5.3/Ada95/samples/explain.txt | 186 + ncurses-5.3/Ada95/samples/ncurses.adb | 47 + .../Ada95/samples/ncurses2-acs_and_scroll.adb | 722 + .../Ada95/samples/ncurses2-acs_and_scroll.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-acs_display.adb | 231 + ncurses-5.3/Ada95/samples/ncurses2-acs_display.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-attr_test.adb | 367 + ncurses-5.3/Ada95/samples/ncurses2-attr_test.ads | 42 + ncurses-5.3/Ada95/samples/ncurses2-color_edit.adb | 264 + ncurses-5.3/Ada95/samples/ncurses2-color_edit.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-color_test.adb | 164 + ncurses-5.3/Ada95/samples/ncurses2-color_test.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-demo_forms.adb | 496 + ncurses-5.3/Ada95/samples/ncurses2-demo_forms.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-demo_pad.adb | 671 + ncurses-5.3/Ada95/samples/ncurses2-demo_pad.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-demo_panels.adb | 379 + ncurses-5.3/Ada95/samples/ncurses2-demo_panels.ads | 41 + .../Ada95/samples/ncurses2-flushinp_test.adb | 135 + .../Ada95/samples/ncurses2-flushinp_test.ads | 43 + ncurses-5.3/Ada95/samples/ncurses2-genericputs.adb | 126 + ncurses-5.3/Ada95/samples/ncurses2-genericputs.ads | 73 + ncurses-5.3/Ada95/samples/ncurses2-getch.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-getch_test.adb | 251 + ncurses-5.3/Ada95/samples/ncurses2-getch_test.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-getopt.adb | 168 + ncurses-5.3/Ada95/samples/ncurses2-getopt.ads | 59 + ncurses-5.3/Ada95/samples/ncurses2-m.adb | 460 + ncurses-5.3/Ada95/samples/ncurses2-m.ads | 43 + ncurses-5.3/Ada95/samples/ncurses2-menu_test.adb | 165 + ncurses-5.3/Ada95/samples/ncurses2-menu_test.ads | 41 + .../Ada95/samples/ncurses2-overlap_test.adb | 156 + .../Ada95/samples/ncurses2-overlap_test.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-slk_test.adb | 171 + ncurses-5.3/Ada95/samples/ncurses2-slk_test.ads | 41 + .../Ada95/samples/ncurses2-test_sgr_attributes.adb | 186 + .../Ada95/samples/ncurses2-test_sgr_attributes.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-trace_set.adb | 481 + ncurses-5.3/Ada95/samples/ncurses2-trace_set.ads | 41 + ncurses-5.3/Ada95/samples/ncurses2-util.adb | 199 + ncurses-5.3/Ada95/samples/ncurses2-util.ads | 79 + ncurses-5.3/Ada95/samples/ncurses2.ads | 44 + ncurses-5.3/Ada95/samples/rain.adb | 163 + ncurses-5.3/Ada95/samples/rain.ads | 44 + .../samples/sample-curses_demo-attributes.adb | 123 + .../samples/sample-curses_demo-attributes.ads | 46 + .../Ada95/samples/sample-curses_demo-mouse.adb | 221 + .../Ada95/samples/sample-curses_demo-mouse.ads | 46 + ncurses-5.3/Ada95/samples/sample-curses_demo.adb | 143 + ncurses-5.3/Ada95/samples/sample-curses_demo.ads | 46 + ncurses-5.3/Ada95/samples/sample-explanation.adb | 409 + ncurses-5.3/Ada95/samples/sample-explanation.ads | 60 + ncurses-5.3/Ada95/samples/sample-form_demo-aux.adb | 260 + ncurses-5.3/Ada95/samples/sample-form_demo-aux.ads | 93 + .../Ada95/samples/sample-form_demo-handler.adb | 98 + .../Ada95/samples/sample-form_demo-handler.ads | 65 + ncurses-5.3/Ada95/samples/sample-form_demo.adb | 135 + ncurses-5.3/Ada95/samples/sample-form_demo.ads | 46 + .../Ada95/samples/sample-function_key_setting.adb | 214 + .../Ada95/samples/sample-function_key_setting.ads | 83 + .../Ada95/samples/sample-header_handler.adb | 181 + .../Ada95/samples/sample-header_handler.ads | 54 + ncurses-5.3/Ada95/samples/sample-helpers.adb | 70 + ncurses-5.3/Ada95/samples/sample-helpers.ads | 55 + .../Ada95/samples/sample-keyboard_handler.adb | 192 + .../Ada95/samples/sample-keyboard_handler.ads | 56 + ncurses-5.3/Ada95/samples/sample-manifest.ads | 68 + ncurses-5.3/Ada95/samples/sample-menu_demo-aux.adb | 205 + ncurses-5.3/Ada95/samples/sample-menu_demo-aux.ads | 72 + .../Ada95/samples/sample-menu_demo-handler.adb | 108 + .../Ada95/samples/sample-menu_demo-handler.ads | 65 + ncurses-5.3/Ada95/samples/sample-menu_demo.adb | 391 + ncurses-5.3/Ada95/samples/sample-menu_demo.ads | 46 + ncurses-5.3/Ada95/samples/sample-my_field_type.adb | 66 + ncurses-5.3/Ada95/samples/sample-my_field_type.ads | 63 + ncurses-5.3/Ada95/samples/sample-text_io_demo.adb | 181 + ncurses-5.3/Ada95/samples/sample-text_io_demo.ads | 46 + ncurses-5.3/Ada95/samples/sample.adb | 219 + ncurses-5.3/Ada95/samples/sample.ads | 44 + ncurses-5.3/Ada95/samples/status.adb | 58 + ncurses-5.3/Ada95/samples/status.ads | 61 + ncurses-5.3/Ada95/samples/tour.adb | 47 + ncurses-5.3/Ada95/samples/tour.ads | 42 + ncurses-5.3/Ada95/src/Makefile.in | 390 + .../Ada95/src/terminal_interface-curses-aux.adb | 117 + ...al_interface-curses-forms-field_types-alpha.adb | 69 + ...al_interface-curses-forms-field_types-alpha.ads | 54 + ...rface-curses-forms-field_types-alphanumeric.adb | 69 + ...rface-curses-forms-field_types-alphanumeric.ads | 55 + ...ce-curses-forms-field_types-enumeration-ada.adb | 81 + ...ce-curses-forms-field_types-enumeration-ada.ads | 60 + ...erface-curses-forms-field_types-enumeration.adb | 120 + ...erface-curses-forms-field_types-enumeration.ads | 99 + ...interface-curses-forms-field_types-intfield.adb | 73 + ...interface-curses-forms-field_types-intfield.ads | 56 + ...rface-curses-forms-field_types-ipv4_address.adb | 69 + ...rface-curses-forms-field_types-ipv4_address.ads | 52 + ..._interface-curses-forms-field_types-numeric.adb | 75 + ..._interface-curses-forms-field_types-numeric.ads | 56 + ...l_interface-curses-forms-field_types-regexp.adb | 72 + ...l_interface-curses-forms-field_types-regexp.ads | 56 + ...erface-curses-forms-field_types-user-choice.adb | 111 + ...erface-curses-forms-field_types-user-choice.ads | 97 + ...nal_interface-curses-forms-field_types-user.adb | 133 + ...nal_interface-curses-forms-field_types-user.ads | 98 + ...terminal_interface-curses-forms-field_types.adb | 297 + ...inal_interface-curses-forms-field_user_data.adb | 86 + ...minal_interface-curses-forms-form_user_data.adb | 87 + .../Ada95/src/terminal_interface-curses-forms.adb | 1161 ++ ...minal_interface-curses-menus-item_user_data.adb | 78 + ...minal_interface-curses-menus-menu_user_data.adb | 77 + .../Ada95/src/terminal_interface-curses-menus.adb | 1022 + .../Ada95/src/terminal_interface-curses-mouse.adb | 215 + .../terminal_interface-curses-panels-user_data.adb | 79 + .../Ada95/src/terminal_interface-curses-panels.adb | 165 + .../Ada95/src/terminal_interface-curses-putwin.adb | 78 + .../Ada95/src/terminal_interface-curses-putwin.ads | 51 + .../src/terminal_interface-curses-termcap.adb | 164 + .../src/terminal_interface-curses-termcap.ads | 81 + .../src/terminal_interface-curses-terminfo.adb | 162 + .../src/terminal_interface-curses-terminfo.ads | 82 + .../src/terminal_interface-curses-text_io-aux.adb | 129 + .../src/terminal_interface-curses-text_io-aux.ads | 56 + ...erminal_interface-curses-text_io-complex_io.adb | 74 + ...erminal_interface-curses-text_io-complex_io.ads | 71 + ...erminal_interface-curses-text_io-decimal_io.adb | 76 + ...erminal_interface-curses-text_io-decimal_io.ads | 67 + ...nal_interface-curses-text_io-enumeration_io.adb | 81 + ...nal_interface-curses-text_io-enumeration_io.ads | 64 + .../terminal_interface-curses-text_io-fixed_io.adb | 76 + .../terminal_interface-curses-text_io-fixed_io.ads | 67 + .../terminal_interface-curses-text_io-float_io.adb | 77 + .../terminal_interface-curses-text_io-float_io.ads | 67 + ...erminal_interface-curses-text_io-integer_io.adb | 71 + ...erminal_interface-curses-text_io-integer_io.ads | 64 + ...erminal_interface-curses-text_io-modular_io.adb | 71 + ...erminal_interface-curses-text_io-modular_io.ads | 64 + .../src/terminal_interface-curses-text_io.adb | 337 + .../src/terminal_interface-curses-text_io.ads | 137 + .../src/terminal_interface-curses-trace.adb_p | 92 + .../Ada95/src/terminal_interface-curses.adb | 2561 +++ ncurses-5.3/Ada95/src/terminal_interface.ads | 49 + ncurses-5.3/INSTALL | 1151 ++ ncurses-5.3/MANIFEST | 981 + ncurses-5.3/Makefile.glibc | 405 + ncurses-5.3/Makefile.in | 93 + ncurses-5.3/Makefile.os2 | 234 + ncurses-5.3/NEWS | 5802 ++++++ ncurses-5.3/README | 175 + ncurses-5.3/README.emx | 45 + ncurses-5.3/README.glibc | 5 + ncurses-5.3/TO-DO | 191 + ncurses-5.3/aclocal.m4 | 2932 +++ ncurses-5.3/announce.html.in | 436 + ncurses-5.3/c++/Makefile.in | 220 + ncurses-5.3/c++/NEWS | 42 + ncurses-5.3/c++/PROBLEMS | 5 + ncurses-5.3/c++/README-first | 58 + ncurses-5.3/c++/cursesapp.cc | 147 + ncurses-5.3/c++/cursesapp.h | 164 + ncurses-5.3/c++/cursesf.cc | 427 + ncurses-5.3/c++/cursesf.h | 825 + ncurses-5.3/c++/cursesm.cc | 383 + ncurses-5.3/c++/cursesm.h | 593 + ncurses-5.3/c++/cursesmain.cc | 58 + ncurses-5.3/c++/cursesp.cc | 130 + ncurses-5.3/c++/cursesp.h | 222 + ncurses-5.3/c++/cursespad.cc | 276 + ncurses-5.3/c++/cursesw.cc | 456 + ncurses-5.3/c++/cursesw.h | 1397 ++ ncurses-5.3/c++/cursslk.cc | 123 + ncurses-5.3/c++/cursslk.h | 206 + ncurses-5.3/c++/demo.cc | 493 + ncurses-5.3/c++/edit_cfg.sh | 70 + ncurses-5.3/c++/etip.h.in | 292 + ncurses-5.3/c++/headers | 39 + ncurses-5.3/c++/internal.h | 50 + ncurses-5.3/c++/modules | 43 + ncurses-5.3/config.guess | 1363 ++ ncurses-5.3/config.log | 152 + ncurses-5.3/config.sub | 1470 ++ ncurses-5.3/configure | 11969 ++++++++++++ ncurses-5.3/configure.in | 1335 ++ ncurses-5.3/convert_configure.pl | 90 + ncurses-5.3/dist.mk | 136 + ncurses-5.3/doc/hackguide.doc | 687 + ncurses-5.3/doc/html/Ada95.html | 168 + ncurses-5.3/doc/html/ada/files.htm | 5 + ncurses-5.3/doc/html/ada/files/T.htm | 77 + ncurses-5.3/doc/html/ada/funcs.htm | 27 + ncurses-5.3/doc/html/ada/funcs/A.htm | 19 + ncurses-5.3/doc/html/ada/funcs/B.htm | 10 + ncurses-5.3/doc/html/ada/funcs/C.htm | 36 + ncurses-5.3/doc/html/ada/funcs/D.htm | 22 + ncurses-5.3/doc/html/ada/funcs/E.htm | 11 + ncurses-5.3/doc/html/ada/funcs/F.htm | 46 + ncurses-5.3/doc/html/ada/funcs/G.htm | 32 + ncurses-5.3/doc/html/ada/funcs/H.htm | 13 + ncurses-5.3/doc/html/ada/funcs/I.htm | 33 + ncurses-5.3/doc/html/ada/funcs/K.htm | 10 + ncurses-5.3/doc/html/ada/funcs/L.htm | 14 + ncurses-5.3/doc/html/ada/funcs/M.htm | 44 + ncurses-5.3/doc/html/ada/funcs/N.htm | 28 + ncurses-5.3/doc/html/ada/funcs/O.htm | 9 + ncurses-5.3/doc/html/ada/funcs/P.htm | 44 + ncurses-5.3/doc/html/ada/funcs/Q.htm | 7 + ncurses-5.3/doc/html/ada/funcs/R.htm | 20 + ncurses-5.3/doc/html/ada/funcs/S.htm | 97 + ncurses-5.3/doc/html/ada/funcs/T.htm | 34 + ncurses-5.3/doc/html/ada/funcs/U.htm | 12 + ncurses-5.3/doc/html/ada/funcs/V.htm | 7 + ncurses-5.3/doc/html/ada/funcs/W.htm | 54 + ncurses-5.3/doc/html/ada/index.htm | 41 + ncurses-5.3/doc/html/ada/main.htm | 70 + ncurses-5.3/doc/html/ada/table.html | 339 + .../ada/terminal_interface-curses-aux__adb.htm | 122 + .../ada/terminal_interface-curses-aux__ads.htm | 131 + ...terface-curses-forms-field_types-alpha__adb.htm | 74 + ...terface-curses-forms-field_types-alpha__ads.htm | 59 + ...-curses-forms-field_types-alphanumeric__adb.htm | 74 + ...-curses-forms-field_types-alphanumeric__ads.htm | 60 + ...rses-forms-field_types-enumeration-ada__adb.htm | 86 + ...rses-forms-field_types-enumeration-ada__ads.htm | 65 + ...e-curses-forms-field_types-enumeration__adb.htm | 125 + ...e-curses-forms-field_types-enumeration__ads.htm | 104 + ...face-curses-forms-field_types-intfield__adb.htm | 78 + ...face-curses-forms-field_types-intfield__ads.htm | 61 + ...-curses-forms-field_types-ipv4_address__adb.htm | 74 + ...-curses-forms-field_types-ipv4_address__ads.htm | 57 + ...rface-curses-forms-field_types-numeric__adb.htm | 80 + ...rface-curses-forms-field_types-numeric__ads.htm | 61 + ...erface-curses-forms-field_types-regexp__adb.htm | 77 + ...erface-curses-forms-field_types-regexp__ads.htm | 61 + ...e-curses-forms-field_types-user-choice__adb.htm | 116 + ...e-curses-forms-field_types-user-choice__ads.htm | 102 + ...nterface-curses-forms-field_types-user__adb.htm | 138 + ...nterface-curses-forms-field_types-user__ads.htm | 103 + ...nal_interface-curses-forms-field_types__adb.htm | 302 + ...nal_interface-curses-forms-field_types__ads.htm | 246 + ...interface-curses-forms-field_user_data__adb.htm | 91 + ...interface-curses-forms-field_user_data__ads.htm | 76 + ..._interface-curses-forms-form_user_data__adb.htm | 92 + ..._interface-curses-forms-form_user_data__ads.htm | 76 + .../ada/terminal_interface-curses-forms__adb.htm | 1166 ++ .../ada/terminal_interface-curses-forms__ads.htm | 789 + ..._interface-curses-menus-item_user_data__adb.htm | 83 + ..._interface-curses-menus-item_user_data__ads.htm | 81 + ..._interface-curses-menus-menu_user_data__adb.htm | 82 + ..._interface-curses-menus-menu_user_data__ads.htm | 76 + .../ada/terminal_interface-curses-menus__adb.htm | 1027 + .../ada/terminal_interface-curses-menus__ads.htm | 683 + .../ada/terminal_interface-curses-mouse__adb.htm | 220 + .../ada/terminal_interface-curses-mouse__ads.htm | 237 + ...inal_interface-curses-panels-user_data__adb.htm | 84 + ...inal_interface-curses-panels-user_data__ads.htm | 76 + .../ada/terminal_interface-curses-panels__adb.htm | 170 + .../ada/terminal_interface-curses-panels__ads.htm | 153 + .../ada/terminal_interface-curses-putwin__adb.htm | 83 + .../ada/terminal_interface-curses-putwin__ads.htm | 56 + .../ada/terminal_interface-curses-termcap__adb.htm | 169 + .../ada/terminal_interface-curses-termcap__ads.htm | 86 + .../terminal_interface-curses-terminfo__adb.htm | 167 + .../terminal_interface-curses-terminfo__ads.htm | 87 + .../terminal_interface-curses-text_io-aux__adb.htm | 134 + .../terminal_interface-curses-text_io-aux__ads.htm | 61 + ...al_interface-curses-text_io-complex_io__adb.htm | 79 + ...al_interface-curses-text_io-complex_io__ads.htm | 76 + ...al_interface-curses-text_io-decimal_io__adb.htm | 81 + ...al_interface-curses-text_io-decimal_io__ads.htm | 72 + ...nterface-curses-text_io-enumeration_io__adb.htm | 86 + ...nterface-curses-text_io-enumeration_io__ads.htm | 69 + ...inal_interface-curses-text_io-fixed_io__adb.htm | 81 + ...inal_interface-curses-text_io-fixed_io__ads.htm | 72 + ...inal_interface-curses-text_io-float_io__adb.htm | 82 + ...inal_interface-curses-text_io-float_io__ads.htm | 72 + ...al_interface-curses-text_io-integer_io__adb.htm | 76 + ...al_interface-curses-text_io-integer_io__ads.htm | 69 + ...al_interface-curses-text_io-modular_io__adb.htm | 76 + ...al_interface-curses-text_io-modular_io__ads.htm | 69 + .../ada/terminal_interface-curses-text_io__adb.htm | 342 + .../ada/terminal_interface-curses-text_io__ads.htm | 142 + .../ada/terminal_interface-curses-trace__adb.htm | 60 + .../ada/terminal_interface-curses-trace__ads.htm | 119 + .../html/ada/terminal_interface-curses__adb.htm | 2566 +++ .../html/ada/terminal_interface-curses__ads.htm | 1940 ++ .../doc/html/ada/terminal_interface__ads.htm | 54 + ncurses-5.3/doc/html/announce.html | 436 + ncurses-5.3/doc/html/hackguide.html | 890 + ncurses-5.3/doc/html/index.html | 30 + ncurses-5.3/doc/html/man/captoinfo.1m.html | 229 + ncurses-5.3/doc/html/man/clear.1.html | 112 + ncurses-5.3/doc/html/man/curs_add_wch.3x.html | 172 + ncurses-5.3/doc/html/man/curs_add_wchstr.3x.html | 172 + ncurses-5.3/doc/html/man/curs_addch.3x.html | 227 + ncurses-5.3/doc/html/man/curs_addchstr.3x.html | 118 + ncurses-5.3/doc/html/man/curs_addstr.3x.html | 118 + ncurses-5.3/doc/html/man/curs_addwstr.3x.html | 118 + ncurses-5.3/doc/html/man/curs_attr.3x.html | 279 + ncurses-5.3/doc/html/man/curs_beep.3x.html | 118 + ncurses-5.3/doc/html/man/curs_bkgd.3x.html | 172 + ncurses-5.3/doc/html/man/curs_bkgrnd.3x.html | 170 + ncurses-5.3/doc/html/man/curs_border.3x.html | 172 + ncurses-5.3/doc/html/man/curs_border_set.3x.html | 170 + ncurses-5.3/doc/html/man/curs_clear.3x.html | 172 + ncurses-5.3/doc/html/man/curs_color.3x.html | 280 + ncurses-5.3/doc/html/man/curs_delch.3x.html | 118 + ncurses-5.3/doc/html/man/curs_deleteln.3x.html | 118 + ncurses-5.3/doc/html/man/curs_extend.3x.html | 117 + ncurses-5.3/doc/html/man/curs_get_wch.3x.html | 170 + ncurses-5.3/doc/html/man/curs_get_wstr.3x.html | 172 + ncurses-5.3/doc/html/man/curs_getcchar.3x.html | 170 + ncurses-5.3/doc/html/man/curs_getch.3x.html | 335 + ncurses-5.3/doc/html/man/curs_getstr.3x.html | 172 + ncurses-5.3/doc/html/man/curs_getyx.3x.html | 118 + ncurses-5.3/doc/html/man/curs_in_wch.3x.html | 118 + ncurses-5.3/doc/html/man/curs_in_wchstr.3x.html | 118 + ncurses-5.3/doc/html/man/curs_inch.3x.html | 117 + ncurses-5.3/doc/html/man/curs_inchstr.3x.html | 118 + ncurses-5.3/doc/html/man/curs_initscr.3x.html | 172 + ncurses-5.3/doc/html/man/curs_inopts.3x.html | 280 + ncurses-5.3/doc/html/man/curs_ins_wch.3x.html | 116 + ncurses-5.3/doc/html/man/curs_ins_wstr.3x.html | 170 + ncurses-5.3/doc/html/man/curs_insch.3x.html | 118 + ncurses-5.3/doc/html/man/curs_insstr.3x.html | 173 + ncurses-5.3/doc/html/man/curs_instr.3x.html | 118 + ncurses-5.3/doc/html/man/curs_inwstr.3x.html | 116 + ncurses-5.3/doc/html/man/curs_kernel.3x.html | 226 + ncurses-5.3/doc/html/man/curs_mouse.3x.html | 281 + ncurses-5.3/doc/html/man/curs_move.3x.html | 118 + ncurses-5.3/doc/html/man/curs_outopts.3x.html | 226 + ncurses-5.3/doc/html/man/curs_overlay.3x.html | 118 + ncurses-5.3/doc/html/man/curs_pad.3x.html | 172 + ncurses-5.3/doc/html/man/curs_print.3x.html | 118 + ncurses-5.3/doc/html/man/curs_printw.3x.html | 116 + ncurses-5.3/doc/html/man/curs_refresh.3x.html | 172 + ncurses-5.3/doc/html/man/curs_scanw.3x.html | 170 + ncurses-5.3/doc/html/man/curs_scr_dump.3x.html | 172 + ncurses-5.3/doc/html/man/curs_scroll.3x.html | 118 + ncurses-5.3/doc/html/man/curs_slk.3x.html | 226 + ncurses-5.3/doc/html/man/curs_termattrs.3x.html | 172 + ncurses-5.3/doc/html/man/curs_termcap.3x.html | 172 + ncurses-5.3/doc/html/man/curs_terminfo.3x.html | 334 + ncurses-5.3/doc/html/man/curs_touch.3x.html | 173 + ncurses-5.3/doc/html/man/curs_trace.3x.html | 170 + ncurses-5.3/doc/html/man/curs_util.3x.html | 170 + ncurses-5.3/doc/html/man/curs_window.3x.html | 228 + ncurses-5.3/doc/html/man/default_colors.3x.html | 175 + ncurses-5.3/doc/html/man/define_key.3x.html | 119 + ncurses-5.3/doc/html/man/form.3x.html | 284 + ncurses-5.3/doc/html/man/form_cursor.3x.html | 121 + ncurses-5.3/doc/html/man/form_data.3x.html | 119 + ncurses-5.3/doc/html/man/form_driver.3x.html | 337 + ncurses-5.3/doc/html/man/form_field.3x.html | 175 + .../doc/html/man/form_field_attributes.3x.html | 175 + ncurses-5.3/doc/html/man/form_field_buffer.3x.html | 176 + ncurses-5.3/doc/html/man/form_field_info.3x.html | 121 + ncurses-5.3/doc/html/man/form_field_just.3x.html | 121 + ncurses-5.3/doc/html/man/form_field_new.3x.html | 175 + ncurses-5.3/doc/html/man/form_field_opts.3x.html | 173 + .../doc/html/man/form_field_userptr.3x.html | 121 + .../doc/html/man/form_field_validation.3x.html | 228 + ncurses-5.3/doc/html/man/form_fieldtype.3x.html | 175 + ncurses-5.3/doc/html/man/form_hook.3x.html | 175 + ncurses-5.3/doc/html/man/form_new.3x.html | 121 + ncurses-5.3/doc/html/man/form_new_page.3x.html | 121 + ncurses-5.3/doc/html/man/form_opts.3x.html | 175 + ncurses-5.3/doc/html/man/form_page.3x.html | 175 + ncurses-5.3/doc/html/man/form_post.3x.html | 175 + ncurses-5.3/doc/html/man/form_requestname.3x.html | 121 + ncurses-5.3/doc/html/man/form_userptr.3x.html | 121 + ncurses-5.3/doc/html/man/form_win.3x.html | 175 + ncurses-5.3/doc/html/man/infocmp.1m.html | 447 + ncurses-5.3/doc/html/man/infotocap.1m.html | 117 + ncurses-5.3/doc/html/man/keybound.3x.html | 119 + ncurses-5.3/doc/html/man/keyok.3x.html | 119 + ncurses-5.3/doc/html/man/menu.3x.html | 283 + ncurses-5.3/doc/html/man/menu_attributes.3x.html | 175 + ncurses-5.3/doc/html/man/menu_cursor.3x.html | 121 + ncurses-5.3/doc/html/man/menu_driver.3x.html | 228 + ncurses-5.3/doc/html/man/menu_format.3x.html | 175 + ncurses-5.3/doc/html/man/menu_hook.3x.html | 175 + ncurses-5.3/doc/html/man/menu_items.3x.html | 175 + ncurses-5.3/doc/html/man/menu_mark.3x.html | 121 + ncurses-5.3/doc/html/man/menu_new.3x.html | 121 + ncurses-5.3/doc/html/man/menu_opts.3x.html | 175 + ncurses-5.3/doc/html/man/menu_pattern.3x.html | 120 + ncurses-5.3/doc/html/man/menu_post.3x.html | 175 + ncurses-5.3/doc/html/man/menu_requestname.3x.html | 121 + ncurses-5.3/doc/html/man/menu_spacing.3x.html | 121 + ncurses-5.3/doc/html/man/menu_userptr.3x.html | 121 + ncurses-5.3/doc/html/man/menu_win.3x.html | 175 + ncurses-5.3/doc/html/man/mitem_current.3x.html | 176 + ncurses-5.3/doc/html/man/mitem_name.3x.html | 121 + ncurses-5.3/doc/html/man/mitem_new.3x.html | 121 + ncurses-5.3/doc/html/man/mitem_opts.3x.html | 121 + ncurses-5.3/doc/html/man/mitem_userptr.3x.html | 121 + ncurses-5.3/doc/html/man/mitem_value.3x.html | 120 + ncurses-5.3/doc/html/man/mitem_visible.3x.html | 119 + ncurses-5.3/doc/html/man/ncurses.3x.html | 1046 + ncurses-5.3/doc/html/man/panel.3x.html | 232 + ncurses-5.3/doc/html/man/resizeterm.3x.html | 174 + ncurses-5.3/doc/html/man/term.5.html | 222 + ncurses-5.3/doc/html/man/term.7.html | 277 + ncurses-5.3/doc/html/man/terminfo.5.html | 2290 +++ ncurses-5.3/doc/html/man/tic.1m.html | 335 + ncurses-5.3/doc/html/man/toe.1m.html | 114 + ncurses-5.3/doc/html/man/tput.1.html | 340 + ncurses-5.3/doc/html/man/tset.1.html | 341 + ncurses-5.3/doc/html/man/wresize.3x.html | 119 + ncurses-5.3/doc/html/ncurses-intro.html | 2690 +++ ncurses-5.3/doc/ncurses-intro.doc | 2505 +++ ncurses-5.3/form/Makefile.in | 160 + ncurses-5.3/form/READ.ME | 16 + ncurses-5.3/form/fld_arg.c | 95 + ncurses-5.3/form/fld_attr.c | 112 + ncurses-5.3/form/fld_current.c | 128 + ncurses-5.3/form/fld_def.c | 354 + ncurses-5.3/form/fld_dup.c | 99 + ncurses-5.3/form/fld_ftchoice.c | 65 + ncurses-5.3/form/fld_ftlink.c | 86 + ncurses-5.3/form/fld_info.c | 95 + ncurses-5.3/form/fld_just.c | 84 + ncurses-5.3/form/fld_link.c | 92 + ncurses-5.3/form/fld_max.c | 76 + ncurses-5.3/form/fld_move.c | 64 + ncurses-5.3/form/fld_newftyp.c | 128 + ncurses-5.3/form/fld_opts.c | 129 + ncurses-5.3/form/fld_pad.c | 81 + ncurses-5.3/form/fld_page.c | 79 + ncurses-5.3/form/fld_stat.c | 76 + ncurses-5.3/form/fld_type.c | 95 + ncurses-5.3/form/fld_user.c | 70 + ncurses-5.3/form/form.h | 384 + ncurses-5.3/form/form.priv.h | 129 + ncurses-5.3/form/frm_cursor.c | 68 + ncurses-5.3/form/frm_data.c | 184 + ncurses-5.3/form/frm_def.c | 382 + ncurses-5.3/form/frm_driver.c | 3858 ++++ ncurses-5.3/form/frm_hook.c | 141 + ncurses-5.3/form/frm_opts.c | 121 + ncurses-5.3/form/frm_page.c | 103 + ncurses-5.3/form/frm_post.c | 120 + ncurses-5.3/form/frm_req_name.c | 166 + ncurses-5.3/form/frm_scale.c | 65 + ncurses-5.3/form/frm_sub.c | 72 + ncurses-5.3/form/frm_user.c | 70 + ncurses-5.3/form/frm_win.c | 73 + ncurses-5.3/form/fty_alnum.c | 138 + ncurses-5.3/form/fty_alpha.c | 139 + ncurses-5.3/form/fty_enum.c | 296 + ncurses-5.3/form/fty_int.c | 161 + ncurses-5.3/form/fty_ipv4.c | 81 + ncurses-5.3/form/fty_num.c | 196 + ncurses-5.3/form/fty_regex.c | 258 + ncurses-5.3/form/headers | 31 + ncurses-5.3/form/llib-lform | 694 + ncurses-5.3/form/llib-lformw | 692 + ncurses-5.3/form/modules | 73 + ncurses-5.3/include/Caps | 1264 ++ ncurses-5.3/include/Caps.aix4 | 1255 ++ ncurses-5.3/include/Caps.hpux11 | 1275 ++ ncurses-5.3/include/Caps.keys | 1354 ++ ncurses-5.3/include/Caps.osf1r5 | 1274 ++ ncurses-5.3/include/Caps.uwin | 1090 ++ ncurses-5.3/include/MKhashsize.sh | 14 + ncurses-5.3/include/MKkey_defs.sh | 178 + ncurses-5.3/include/MKncurses_def.sh | 80 + ncurses-5.3/include/MKparametrized.sh | 35 + ncurses-5.3/include/MKterm.h.awk.in | 309 + ncurses-5.3/include/Makefile.in | 126 + ncurses-5.3/include/capdefaults.c | 84 + ncurses-5.3/include/curses.h.in | 1023 + ncurses-5.3/include/curses.tail | 140 + ncurses-5.3/include/curses.wide | 237 + ncurses-5.3/include/edit_cfg.sh | 67 + ncurses-5.3/include/headers | 35 + ncurses-5.3/include/nc_alloc.h | 91 + ncurses-5.3/include/nc_panel.h | 66 + ncurses-5.3/include/ncurses_cfg.hin | 62 + ncurses-5.3/include/ncurses_defs | 165 + ncurses-5.3/include/ncurses_dll.h | 48 + ncurses-5.3/include/term_entry.h | 162 + ncurses-5.3/include/termcap.h.in | 75 + ncurses-5.3/include/tic.h | 303 + ncurses-5.3/include/unctrl.h.in | 63 + ncurses-5.3/install-sh | 250 + ncurses-5.3/man/MKterminfo.sh | 110 + ncurses-5.3/man/Makefile.in | 79 + ncurses-5.3/man/captoinfo.1m | 189 + ncurses-5.3/man/clear.1 | 48 + ncurses-5.3/man/curs_add_wch.3x | 134 + ncurses-5.3/man/curs_add_wchstr.3x | 98 + ncurses-5.3/man/curs_addch.3x | 170 + ncurses-5.3/man/curs_addchstr.3x | 83 + ncurses-5.3/man/curs_addstr.3x | 87 + ncurses-5.3/man/curs_addwstr.3x | 91 + ncurses-5.3/man/curs_attr.3x | 232 + ncurses-5.3/man/curs_beep.3x | 63 + ncurses-5.3/man/curs_bkgd.3x | 99 + ncurses-5.3/man/curs_bkgrnd.3x | 107 + ncurses-5.3/man/curs_border.3x | 138 + ncurses-5.3/man/curs_border_set.3x | 202 + ncurses-5.3/man/curs_clear.3x | 94 + ncurses-5.3/man/curs_color.3x | 216 + ncurses-5.3/man/curs_delch.3x | 70 + ncurses-5.3/man/curs_deleteln.3x | 87 + ncurses-5.3/man/curs_extend.3x | 84 + ncurses-5.3/man/curs_get_wch.3x | 161 + ncurses-5.3/man/curs_get_wstr.3x | 164 + ncurses-5.3/man/curs_getcchar.3x | 144 + ncurses-5.3/man/curs_getch.3x | 305 + ncurses-5.3/man/curs_getstr.3x | 107 + ncurses-5.3/man/curs_getyx.3x | 97 + ncurses-5.3/man/curs_in_wch.3x | 68 + ncurses-5.3/man/curs_in_wchstr.3x | 117 + ncurses-5.3/man/curs_inch.3x | 73 + ncurses-5.3/man/curs_inchstr.3x | 88 + ncurses-5.3/man/curs_initscr.3x | 124 + ncurses-5.3/man/curs_inopts.3x | 214 + ncurses-5.3/man/curs_ins_wch.3x | 65 + ncurses-5.3/man/curs_ins_wstr.3x | 104 + ncurses-5.3/man/curs_insch.3x | 70 + ncurses-5.3/man/curs_insstr.3x | 95 + ncurses-5.3/man/curs_instr.3x | 89 + ncurses-5.3/man/curs_inwstr.3x | 95 + ncurses-5.3/man/curs_kernel.3x | 159 + ncurses-5.3/man/curs_mouse.3x | 239 + ncurses-5.3/man/curs_move.3x | 63 + ncurses-5.3/man/curs_outopts.3x | 193 + ncurses-5.3/man/curs_overlay.3x | 76 + ncurses-5.3/man/curs_pad.3x | 110 + ncurses-5.3/man/curs_print.3x | 74 + ncurses-5.3/man/curs_printw.3x | 84 + ncurses-5.3/man/curs_refresh.3x | 126 + ncurses-5.3/man/curs_scanw.3x | 97 + ncurses-5.3/man/curs_scr_dump.3x | 94 + ncurses-5.3/man/curs_scroll.3x | 84 + ncurses-5.3/man/curs_slk.3x | 149 + ncurses-5.3/man/curs_termattrs.3x | 133 + ncurses-5.3/man/curs_termcap.3x | 158 + ncurses-5.3/man/curs_terminfo.3x | 294 + ncurses-5.3/man/curs_touch.3x | 96 + ncurses-5.3/man/curs_trace.3x | 149 + ncurses-5.3/man/curs_util.3x | 134 + ncurses-5.3/man/curs_window.3x | 159 + ncurses-5.3/man/default_colors.3x | 125 + ncurses-5.3/man/define_key.3x | 64 + ncurses-5.3/man/form.3x | 200 + ncurses-5.3/man/form_cursor.3x | 74 + ncurses-5.3/man/form_data.3x | 63 + ncurses-5.3/man/form_driver.3x | 272 + ncurses-5.3/man/form_field.3x | 97 + ncurses-5.3/man/form_field_attributes.3x | 91 + ncurses-5.3/man/form_field_buffer.3x | 99 + ncurses-5.3/man/form_field_info.3x | 84 + ncurses-5.3/man/form_field_just.3x | 78 + ncurses-5.3/man/form_field_new.3x | 96 + ncurses-5.3/man/form_field_opts.3x | 120 + ncurses-5.3/man/form_field_userptr.3x | 73 + ncurses-5.3/man/form_field_validation.3x | 127 + ncurses-5.3/man/form_fieldtype.3x | 126 + ncurses-5.3/man/form_hook.3x | 100 + ncurses-5.3/man/form_new.3x | 79 + ncurses-5.3/man/form_new_page.3x | 77 + ncurses-5.3/man/form_opts.3x | 90 + ncurses-5.3/man/form_page.3x | 95 + ncurses-5.3/man/form_post.3x | 90 + ncurses-5.3/man/form_requestname.3x | 69 + ncurses-5.3/man/form_userptr.3x | 73 + ncurses-5.3/man/form_win.3x | 95 + ncurses-5.3/man/infocmp.1m | 410 + ncurses-5.3/man/infotocap.1m | 74 + ncurses-5.3/man/keybound.3x | 61 + ncurses-5.3/man/keyok.3x | 63 + ncurses-5.3/man/make_sed.sh | 83 + ncurses-5.3/man/man_db.renames | 138 + ncurses-5.3/man/manlinks.sed | 69 + ncurses-5.3/man/menu.3x | 190 + ncurses-5.3/man/menu_attributes.3x | 100 + ncurses-5.3/man/menu_cursor.3x | 73 + ncurses-5.3/man/menu_driver.3x | 170 + ncurses-5.3/man/menu_format.3x | 84 + ncurses-5.3/man/menu_hook.3x | 101 + ncurses-5.3/man/menu_items.3x | 91 + ncurses-5.3/man/menu_mark.3x | 84 + ncurses-5.3/man/menu_new.3x | 79 + ncurses-5.3/man/menu_opts.3x | 104 + ncurses-5.3/man/menu_pattern.3x | 82 + ncurses-5.3/man/menu_post.3x | 91 + ncurses-5.3/man/menu_requestname.3x | 69 + ncurses-5.3/man/menu_spacing.3x | 84 + ncurses-5.3/man/menu_userptr.3x | 73 + ncurses-5.3/man/menu_win.3x | 95 + ncurses-5.3/man/mitem_current.3x | 101 + ncurses-5.3/man/mitem_name.3x | 64 + ncurses-5.3/man/mitem_new.3x | 83 + ncurses-5.3/man/mitem_opts.3x | 84 + ncurses-5.3/man/mitem_userptr.3x | 72 + ncurses-5.3/man/mitem_value.3x | 76 + ncurses-5.3/man/mitem_visible.3x | 59 + ncurses-5.3/man/ncurses.3x | 914 + ncurses-5.3/man/panel.3x | 182 + ncurses-5.3/man/resizeterm.3x | 92 + ncurses-5.3/man/term.5 | 208 + ncurses-5.3/man/term.7 | 204 + ncurses-5.3/man/terminfo.head | 95 + ncurses-5.3/man/terminfo.tail | 1585 ++ ncurses-5.3/man/tic.1m | 311 + ncurses-5.3/man/toe.1m | 81 + ncurses-5.3/man/tput.1 | 288 + ncurses-5.3/man/tset.1 | 250 + ncurses-5.3/man/wresize.3x | 64 + ncurses-5.3/menu/Makefile.in | 162 + ncurses-5.3/menu/READ.ME | 15 + ncurses-5.3/menu/eti.h | 53 + ncurses-5.3/menu/headers | 32 + ncurses-5.3/menu/llib-lmenu | 508 + ncurses-5.3/menu/llib-lmenuw | 508 + ncurses-5.3/menu/m_attribs.c | 142 + ncurses-5.3/menu/m_cursor.c | 112 + ncurses-5.3/menu/m_driver.c | 544 + ncurses-5.3/menu/m_format.c | 128 + ncurses-5.3/menu/m_global.c | 492 + ncurses-5.3/menu/m_hook.c | 150 + ncurses-5.3/menu/m_item_cur.c | 110 + ncurses-5.3/menu/m_item_nam.c | 71 + ncurses-5.3/menu/m_item_new.c | 232 + ncurses-5.3/menu/m_item_opt.c | 151 + ncurses-5.3/menu/m_item_top.c | 105 + ncurses-5.3/menu/m_item_use.c | 75 + ncurses-5.3/menu/m_item_val.c | 103 + ncurses-5.3/menu/m_item_vis.c | 68 + ncurses-5.3/menu/m_items.c | 107 + ncurses-5.3/menu/m_new.c | 111 + ncurses-5.3/menu/m_opts.c | 175 + ncurses-5.3/menu/m_pad.c | 93 + ncurses-5.3/menu/m_pattern.c | 120 + ncurses-5.3/menu/m_post.c | 371 + ncurses-5.3/menu/m_req_name.c | 122 + ncurses-5.3/menu/m_scale.c | 73 + ncurses-5.3/menu/m_spacing.c | 102 + ncurses-5.3/menu/m_sub.c | 83 + ncurses-5.3/menu/m_userptr.c | 75 + ncurses-5.3/menu/m_win.c | 83 + ncurses-5.3/menu/menu.h | 255 + ncurses-5.3/menu/menu.priv.h | 123 + ncurses-5.3/menu/mf_common.h | 98 + ncurses-5.3/menu/modules | 60 + ncurses-5.3/misc/Makefile.in | 128 + ncurses-5.3/misc/chkdef.cmd | 86 + ncurses-5.3/misc/cleantic.cmd | 16 + ncurses-5.3/misc/cmpdef.cmd | 106 + ncurses-5.3/misc/emx.src | 825 + ncurses-5.3/misc/form.def | 101 + ncurses-5.3/misc/form.ref | 106 + ncurses-5.3/misc/indent.pro | 35 + ncurses-5.3/misc/makedef.cmd | 151 + ncurses-5.3/misc/makellib | 167 + ncurses-5.3/misc/menu.def | 81 + ncurses-5.3/misc/menu.ref | 73 + ncurses-5.3/misc/ncurses.def | 447 + ncurses-5.3/misc/ncurses.ref | 572 + ncurses-5.3/misc/panel.def | 20 + ncurses-5.3/misc/panel.ref | 18 + ncurses-5.3/misc/run_tic.in | 152 + ncurses-5.3/misc/run_tic.sh | 152 + ncurses-5.3/misc/shlib | 87 + ncurses-5.3/misc/tabset/std | 1 + ncurses-5.3/misc/tabset/stdcrt | 1 + ncurses-5.3/misc/tabset/vt100 | 3 + ncurses-5.3/misc/tabset/vt300 | 3 + ncurses-5.3/misc/tdlint | 113 + ncurses-5.3/misc/terminfo.src | 19551 +++++++++++++++++++ ncurses-5.3/mk-0th.awk | 101 + ncurses-5.3/mk-1st.awk | 364 + ncurses-5.3/mk-2nd.awk | 115 + ncurses-5.3/mkinstalldirs | 38 + ncurses-5.3/ncurses/Makefile.in | 275 + ncurses-5.3/ncurses/README | 2 + ncurses-5.3/ncurses/README.IZ | 65 + ncurses-5.3/ncurses/SigAction.h | 117 + ncurses-5.3/ncurses/base/MKkeyname.awk | 90 + ncurses-5.3/ncurses/base/MKlib_gen.sh | 400 + ncurses-5.3/ncurses/base/MKunctrl.awk | 69 + ncurses-5.3/ncurses/base/README | 7 + ncurses-5.3/ncurses/base/define_key.c | 60 + ncurses-5.3/ncurses/base/keybound.c | 46 + ncurses-5.3/ncurses/base/keyok.c | 73 + ncurses-5.3/ncurses/base/lib_addch.c | 365 + ncurses-5.3/ncurses/base/lib_addstr.c | 253 + ncurses-5.3/ncurses/base/lib_beep.c | 73 + ncurses-5.3/ncurses/base/lib_bkgd.c | 138 + ncurses-5.3/ncurses/base/lib_box.c | 126 + ncurses-5.3/ncurses/base/lib_chgat.c | 62 + ncurses-5.3/ncurses/base/lib_clear.c | 56 + ncurses-5.3/ncurses/base/lib_clearok.c | 55 + ncurses-5.3/ncurses/base/lib_clrbot.c | 76 + ncurses-5.3/ncurses/base/lib_clreol.c | 91 + ncurses-5.3/ncurses/base/lib_color.c | 531 + ncurses-5.3/ncurses/base/lib_colorset.c | 60 + ncurses-5.3/ncurses/base/lib_delch.c | 69 + ncurses-5.3/ncurses/base/lib_delwin.c | 78 + ncurses-5.3/ncurses/base/lib_dft_fgbg.c | 71 + ncurses-5.3/ncurses/base/lib_echo.c | 61 + ncurses-5.3/ncurses/base/lib_endwin.c | 60 + ncurses-5.3/ncurses/base/lib_erase.c | 73 + ncurses-5.3/ncurses/base/lib_flash.c | 73 + ncurses-5.3/ncurses/base/lib_freeall.c | 111 + ncurses-5.3/ncurses/base/lib_getch.c | 537 + ncurses-5.3/ncurses/base/lib_getstr.c | 215 + ncurses-5.3/ncurses/base/lib_hline.c | 80 + ncurses-5.3/ncurses/base/lib_immedok.c | 54 + ncurses-5.3/ncurses/base/lib_inchstr.c | 64 + ncurses-5.3/ncurses/base/lib_initscr.c | 97 + ncurses-5.3/ncurses/base/lib_insch.c | 68 + ncurses-5.3/ncurses/base/lib_insdel.c | 63 + ncurses-5.3/ncurses/base/lib_insstr.c | 83 + ncurses-5.3/ncurses/base/lib_instr.c | 73 + ncurses-5.3/ncurses/base/lib_isendwin.c | 51 + ncurses-5.3/ncurses/base/lib_leaveok.c | 55 + ncurses-5.3/ncurses/base/lib_mouse.c | 1014 + ncurses-5.3/ncurses/base/lib_move.c | 61 + ncurses-5.3/ncurses/base/lib_mvwin.c | 108 + ncurses-5.3/ncurses/base/lib_newterm.c | 209 + ncurses-5.3/ncurses/base/lib_newwin.c | 306 + ncurses-5.3/ncurses/base/lib_nl.c | 79 + ncurses-5.3/ncurses/base/lib_overlay.c | 184 + ncurses-5.3/ncurses/base/lib_pad.c | 313 + ncurses-5.3/ncurses/base/lib_printw.c | 142 + ncurses-5.3/ncurses/base/lib_redrawln.c | 75 + ncurses-5.3/ncurses/base/lib_refresh.c | 187 + ncurses-5.3/ncurses/base/lib_restart.c | 92 + ncurses-5.3/ncurses/base/lib_scanw.c | 106 + ncurses-5.3/ncurses/base/lib_screen.c | 205 + ncurses-5.3/ncurses/base/lib_scroll.c | 152 + ncurses-5.3/ncurses/base/lib_scrollok.c | 55 + ncurses-5.3/ncurses/base/lib_scrreg.c | 60 + ncurses-5.3/ncurses/base/lib_set_term.c | 479 + ncurses-5.3/ncurses/base/lib_slk.c | 201 + ncurses-5.3/ncurses/base/lib_slkatr_set.c | 56 + ncurses-5.3/ncurses/base/lib_slkatrof.c | 53 + ncurses-5.3/ncurses/base/lib_slkatron.c | 53 + ncurses-5.3/ncurses/base/lib_slkatrset.c | 53 + ncurses-5.3/ncurses/base/lib_slkattr.c | 52 + ncurses-5.3/ncurses/base/lib_slkclear.c | 61 + ncurses-5.3/ncurses/base/lib_slkcolor.c | 53 + ncurses-5.3/ncurses/base/lib_slkinit.c | 51 + ncurses-5.3/ncurses/base/lib_slklab.c | 51 + ncurses-5.3/ncurses/base/lib_slkrefr.c | 120 + ncurses-5.3/ncurses/base/lib_slkset.c | 97 + ncurses-5.3/ncurses/base/lib_slktouch.c | 53 + ncurses-5.3/ncurses/base/lib_touch.c | 91 + ncurses-5.3/ncurses/base/lib_ungetch.c | 79 + ncurses-5.3/ncurses/base/lib_vline.c | 79 + ncurses-5.3/ncurses/base/lib_wattroff.c | 56 + ncurses-5.3/ncurses/base/lib_wattron.c | 56 + ncurses-5.3/ncurses/base/lib_winch.c | 54 + ncurses-5.3/ncurses/base/lib_window.c | 248 + ncurses-5.3/ncurses/base/memmove.c | 69 + ncurses-5.3/ncurses/base/nc_panel.c | 41 + ncurses-5.3/ncurses/base/resizeterm.c | 288 + ncurses-5.3/ncurses/base/safe_sprintf.c | 244 + ncurses-5.3/ncurses/base/sigaction.c | 117 + ncurses-5.3/ncurses/base/tries.c | 144 + ncurses-5.3/ncurses/base/version.c | 47 + ncurses-5.3/ncurses/base/vsscanf.c | 356 + ncurses-5.3/ncurses/base/wresize.c | 239 + ncurses-5.3/ncurses/curses.priv.h | 1057 + ncurses-5.3/ncurses/fifo_defs.h | 59 + ncurses-5.3/ncurses/llib-lncurses | 3061 +++ ncurses-5.3/ncurses/llib-lncursesw | 3785 ++++ ncurses-5.3/ncurses/modules | 211 + ncurses-5.3/ncurses/tinfo/MKcaptab.awk | 71 + ncurses-5.3/ncurses/tinfo/MKfallback.sh | 102 + ncurses-5.3/ncurses/tinfo/MKkeys_list.sh | 62 + ncurses-5.3/ncurses/tinfo/MKnames.awk | 98 + ncurses-5.3/ncurses/tinfo/README | 8 + ncurses-5.3/ncurses/tinfo/access.c | 123 + ncurses-5.3/ncurses/tinfo/add_tries.c | 125 + ncurses-5.3/ncurses/tinfo/alloc_entry.c | 252 + ncurses-5.3/ncurses/tinfo/alloc_ttype.c | 491 + ncurses-5.3/ncurses/tinfo/captoinfo.c | 836 + ncurses-5.3/ncurses/tinfo/comp_error.c | 139 + ncurses-5.3/ncurses/tinfo/comp_expand.c | 184 + ncurses-5.3/ncurses/tinfo/comp_hash.c | 331 + ncurses-5.3/ncurses/tinfo/comp_parse.c | 501 + ncurses-5.3/ncurses/tinfo/comp_scan.c | 831 + ncurses-5.3/ncurses/tinfo/doalloc.c | 75 + ncurses-5.3/ncurses/tinfo/free_ttype.c | 72 + ncurses-5.3/ncurses/tinfo/getenv_num.c | 56 + ncurses-5.3/ncurses/tinfo/home_terminfo.c | 65 + ncurses-5.3/ncurses/tinfo/init_keytry.c | 80 + ncurses-5.3/ncurses/tinfo/lib_acs.c | 177 + ncurses-5.3/ncurses/tinfo/lib_baudrate.c | 222 + ncurses-5.3/ncurses/tinfo/lib_cur_term.c | 72 + ncurses-5.3/ncurses/tinfo/lib_data.c | 91 + ncurses-5.3/ncurses/tinfo/lib_has_cap.c | 64 + ncurses-5.3/ncurses/tinfo/lib_kernel.c | 154 + ncurses-5.3/ncurses/tinfo/lib_longname.c | 57 + ncurses-5.3/ncurses/tinfo/lib_napms.c | 69 + ncurses-5.3/ncurses/tinfo/lib_options.c | 257 + ncurses-5.3/ncurses/tinfo/lib_print.c | 92 + ncurses-5.3/ncurses/tinfo/lib_raw.c | 296 + ncurses-5.3/ncurses/tinfo/lib_setup.c | 437 + ncurses-5.3/ncurses/tinfo/lib_termcap.c | 322 + ncurses-5.3/ncurses/tinfo/lib_termname.c | 48 + ncurses-5.3/ncurses/tinfo/lib_tgoto.c | 203 + ncurses-5.3/ncurses/tinfo/lib_ti.c | 103 + ncurses-5.3/ncurses/tinfo/lib_tparm.c | 769 + ncurses-5.3/ncurses/tinfo/lib_tputs.c | 259 + ncurses-5.3/ncurses/tinfo/lib_ttyflags.c | 173 + ncurses-5.3/ncurses/tinfo/make_keys.c | 140 + ncurses-5.3/ncurses/tinfo/name_match.c | 101 + ncurses-5.3/ncurses/tinfo/parse_entry.c | 960 + ncurses-5.3/ncurses/tinfo/read_entry.c | 503 + ncurses-5.3/ncurses/tinfo/read_termcap.c | 1159 ++ ncurses-5.3/ncurses/tinfo/setbuf.c | 144 + ncurses-5.3/ncurses/tinfo/strings.c | 143 + ncurses-5.3/ncurses/tinfo/write_entry.c | 591 + ncurses-5.3/ncurses/trace/README | 5 + ncurses-5.3/ncurses/trace/lib_trace.c | 180 + ncurses-5.3/ncurses/trace/lib_traceatr.c | 301 + ncurses-5.3/ncurses/trace/lib_tracebits.c | 248 + ncurses-5.3/ncurses/trace/lib_tracechr.c | 55 + ncurses-5.3/ncurses/trace/lib_tracedmp.c | 146 + ncurses-5.3/ncurses/trace/lib_tracemse.c | 92 + ncurses-5.3/ncurses/trace/trace_buf.c | 84 + ncurses-5.3/ncurses/trace/trace_tries.c | 76 + ncurses-5.3/ncurses/trace/trace_xnames.c | 75 + ncurses-5.3/ncurses/trace/varargs.c | 182 + ncurses-5.3/ncurses/trace/visbuf.c | 270 + ncurses-5.3/ncurses/tty/MKexpanded.sh | 99 + ncurses-5.3/ncurses/tty/hardscroll.c | 325 + ncurses-5.3/ncurses/tty/hashmap.c | 538 + ncurses-5.3/ncurses/tty/lib_mvcur.c | 1201 ++ ncurses-5.3/ncurses/tty/lib_tstp.c | 399 + ncurses-5.3/ncurses/tty/lib_twait.c | 440 + ncurses-5.3/ncurses/tty/lib_vidattr.c | 310 + ncurses-5.3/ncurses/tty/tty_display.h | 137 + ncurses-5.3/ncurses/tty/tty_input.h | 61 + ncurses-5.3/ncurses/tty/tty_update.c | 1841 ++ ncurses-5.3/ncurses/widechar/lib_box_set.c | 113 + ncurses-5.3/ncurses/widechar/lib_cchar.c | 114 + ncurses-5.3/ncurses/widechar/lib_erasewchar.c | 77 + ncurses-5.3/ncurses/widechar/lib_get_wch.c | 99 + ncurses-5.3/ncurses/widechar/lib_get_wstr.c | 205 + ncurses-5.3/ncurses/widechar/lib_hline_set.c | 79 + ncurses-5.3/ncurses/widechar/lib_in_wch.c | 60 + ncurses-5.3/ncurses/widechar/lib_in_wchnstr.c | 62 + ncurses-5.3/ncurses/widechar/lib_ins_nwstr.c | 84 + ncurses-5.3/ncurses/widechar/lib_ins_wch.c | 65 + ncurses-5.3/ncurses/widechar/lib_inwstr.c | 100 + ncurses-5.3/ncurses/widechar/lib_unget_wch.c | 76 + ncurses-5.3/ncurses/widechar/lib_vid_attr.c | 94 + ncurses-5.3/ncurses/widechar/lib_vline_set.c | 78 + ncurses-5.3/ncurses/widechar/lib_wacs.c | 127 + ncurses-5.3/ncurses/widechar/lib_wunctrl.c | 56 + ncurses-5.3/panel/Makefile.in | 154 + ncurses-5.3/panel/headers | 31 + ncurses-5.3/panel/llib-lpanel | 177 + ncurses-5.3/panel/llib-lpanelw | 177 + ncurses-5.3/panel/modules | 49 + ncurses-5.3/panel/p_above.c | 51 + ncurses-5.3/panel/p_below.c | 53 + ncurses-5.3/panel/p_bottom.c | 70 + ncurses-5.3/panel/p_delete.c | 54 + ncurses-5.3/panel/p_hidden.c | 47 + ncurses-5.3/panel/p_hide.c | 57 + ncurses-5.3/panel/p_move.c | 56 + ncurses-5.3/panel/p_new.c | 104 + ncurses-5.3/panel/p_replace.c | 55 + ncurses-5.3/panel/p_show.c | 67 + ncurses-5.3/panel/p_top.c | 45 + ncurses-5.3/panel/p_update.c | 60 + ncurses-5.3/panel/p_user.c | 56 + ncurses-5.3/panel/p_win.c | 49 + ncurses-5.3/panel/panel.c | 140 + ncurses-5.3/panel/panel.h | 75 + ncurses-5.3/panel/panel.priv.h | 193 + ncurses-5.3/progs/MKtermsort.sh | 164 + ncurses-5.3/progs/Makefile.in | 272 + ncurses-5.3/progs/capconvert | 229 + ncurses-5.3/progs/clear.c | 58 + ncurses-5.3/progs/clear.sh | 1 + ncurses-5.3/progs/dump_entry.c | 1088 ++ ncurses-5.3/progs/dump_entry.h | 67 + ncurses-5.3/progs/infocmp.c | 1508 ++ ncurses-5.3/progs/modules | 41 + ncurses-5.3/progs/progs.priv.h | 176 + ncurses-5.3/progs/tic.c | 1145 ++ ncurses-5.3/progs/toe.c | 308 + ncurses-5.3/progs/tput.c | 428 + ncurses-5.3/progs/tset.c | 1211 ++ ncurses-5.3/sysdeps/unix/sysv/linux/Makefile | 10 + .../sysdeps/unix/sysv/linux/alpha/configure | 2 + ncurses-5.3/sysdeps/unix/sysv/linux/configure | 407 + ncurses-5.3/sysdeps/unix/sysv/linux/edit_man.sed | 100 + ncurses-5.3/sysdeps/unix/sysv/linux/edit_man.sh | 37 + ncurses-5.3/sysdeps/unix/sysv/linux/run_tic.sh | 143 + ncurses-5.3/tack/COPYING | 340 + ncurses-5.3/tack/HISTORY | 44 + ncurses-5.3/tack/Makefile.in | 170 + ncurses-5.3/tack/README | 14 + ncurses-5.3/tack/ansi.c | 854 + ncurses-5.3/tack/charset.c | 711 + ncurses-5.3/tack/color.c | 767 + ncurses-5.3/tack/control.c | 657 + ncurses-5.3/tack/crum.c | 426 + ncurses-5.3/tack/edit.c | 977 + ncurses-5.3/tack/fun.c | 912 + ncurses-5.3/tack/init.c | 304 + ncurses-5.3/tack/menu.c | 421 + ncurses-5.3/tack/modes.c | 913 + ncurses-5.3/tack/modules | 18 + ncurses-5.3/tack/output.c | 818 + ncurses-5.3/tack/pad.c | 1957 ++ ncurses-5.3/tack/scan.c | 261 + ncurses-5.3/tack/sync.c | 436 + ncurses-5.3/tack/sysdep.c | 501 + ncurses-5.3/tack/tack.1 | 311 + ncurses-5.3/tack/tack.c | 620 + ncurses-5.3/tack/tack.h | 405 + ncurses-5.3/tar-copy.sh | 70 + ncurses-5.3/test/Makefile.in | 221 + ncurses-5.3/test/README | 22 + ncurses-5.3/test/blue.c | 432 + ncurses-5.3/test/bs.6 | 42 + ncurses-5.3/test/bs.c | 1228 ++ ncurses-5.3/test/cardfile.c | 534 + ncurses-5.3/test/cardfile.dat | 13 + ncurses-5.3/test/configure | 2401 +++ ncurses-5.3/test/configure.in | 327 + ncurses-5.3/test/ditto.c | 148 + ncurses-5.3/test/dots.c | 140 + ncurses-5.3/test/filter.c | 103 + ncurses-5.3/test/firework.c | 173 + ncurses-5.3/test/firstlast.c | 90 + ncurses-5.3/test/gdc.6 | 22 + ncurses-5.3/test/gdc.c | 316 + ncurses-5.3/test/hanoi.c | 303 + ncurses-5.3/test/hashtest.c | 228 + ncurses-5.3/test/keynames.c | 17 + ncurses-5.3/test/knight.c | 702 + ncurses-5.3/test/lrtest.c | 152 + ncurses-5.3/test/modules | 59 + ncurses-5.3/test/ncurses.c | 4333 ++++ ncurses-5.3/test/ncurses_tst.hin | 56 + ncurses-5.3/test/newdemo.c | 358 + ncurses-5.3/test/railroad.c | 242 + ncurses-5.3/test/rain.c | 136 + ncurses-5.3/test/tclock.c | 250 + ncurses-5.3/test/test.priv.h | 218 + ncurses-5.3/test/testaddch.c | 61 + ncurses-5.3/test/testcurs.c | 708 + ncurses-5.3/test/testscanw.c | 41 + ncurses-5.3/test/tracemunch | 151 + ncurses-5.3/test/view.c | 512 + ncurses-5.3/test/worm.c | 427 + ncurses-5.3/test/xmas.c | 1159 ++ 983 files changed, 259216 insertions(+) create mode 100644 ncurses-5.3/ANNOUNCE create mode 100644 ncurses-5.3/Ada95/Makefile.in create mode 100644 ncurses-5.3/Ada95/README create mode 100644 ncurses-5.3/Ada95/TODO create mode 100644 ncurses-5.3/Ada95/gen/Makefile.in create mode 100644 ncurses-5.3/Ada95/gen/gen.c create mode 100644 ncurses-5.3/Ada95/gen/html.m4 create mode 100644 ncurses-5.3/Ada95/gen/normal.m4 create mode 100644 ncurses-5.3/Ada95/gen/table.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-aux.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-forms.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-menus.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-mouse.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-panels.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses-trace.ads.m4 create mode 100644 ncurses-5.3/Ada95/gen/terminal_interface-curses.ads.m4 create mode 100644 ncurses-5.3/Ada95/samples/Makefile.in create mode 100644 ncurses-5.3/Ada95/samples/README create mode 100644 ncurses-5.3/Ada95/samples/explain.txt create mode 100644 ncurses-5.3/Ada95/samples/ncurses.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-acs_and_scroll.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-acs_and_scroll.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-acs_display.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-acs_display.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-attr_test.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-attr_test.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-color_edit.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-color_edit.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-color_test.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-color_test.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-demo_forms.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-demo_forms.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-demo_pad.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-demo_pad.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-demo_panels.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-demo_panels.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-flushinp_test.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-flushinp_test.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-genericputs.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-genericputs.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-getch.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-getch_test.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-getch_test.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-getopt.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-getopt.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-m.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-m.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-menu_test.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-menu_test.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-overlap_test.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-overlap_test.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-slk_test.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-slk_test.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-test_sgr_attributes.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-test_sgr_attributes.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-trace_set.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-trace_set.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-util.adb create mode 100644 ncurses-5.3/Ada95/samples/ncurses2-util.ads create mode 100644 ncurses-5.3/Ada95/samples/ncurses2.ads create mode 100644 ncurses-5.3/Ada95/samples/rain.adb create mode 100644 ncurses-5.3/Ada95/samples/rain.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-curses_demo-attributes.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-curses_demo-attributes.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-curses_demo-mouse.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-curses_demo-mouse.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-curses_demo.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-curses_demo.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-explanation.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-explanation.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-form_demo-aux.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-form_demo-aux.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-form_demo-handler.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-form_demo-handler.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-form_demo.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-form_demo.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-function_key_setting.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-function_key_setting.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-header_handler.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-header_handler.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-helpers.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-helpers.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-keyboard_handler.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-keyboard_handler.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-manifest.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-menu_demo-aux.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-menu_demo-aux.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-menu_demo-handler.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-menu_demo-handler.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-menu_demo.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-menu_demo.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-my_field_type.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-my_field_type.ads create mode 100644 ncurses-5.3/Ada95/samples/sample-text_io_demo.adb create mode 100644 ncurses-5.3/Ada95/samples/sample-text_io_demo.ads create mode 100644 ncurses-5.3/Ada95/samples/sample.adb create mode 100644 ncurses-5.3/Ada95/samples/sample.ads create mode 100644 ncurses-5.3/Ada95/samples/status.adb create mode 100644 ncurses-5.3/Ada95/samples/status.ads create mode 100644 ncurses-5.3/Ada95/samples/tour.adb create mode 100644 ncurses-5.3/Ada95/samples/tour.ads create mode 100644 ncurses-5.3/Ada95/src/Makefile.in create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-aux.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_user_data.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms-form_user_data.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-forms.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-menus-item_user_data.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-menus.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-mouse.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-panels-user_data.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-panels.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-putwin.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-putwin.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-termcap.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-termcap.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-terminfo.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-terminfo.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-aux.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-aux.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-complex_io.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-complex_io.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-float_io.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-float_io.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-integer_io.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-integer_io.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-modular_io.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-modular_io.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-text_io.ads create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses-trace.adb_p create mode 100644 ncurses-5.3/Ada95/src/terminal_interface-curses.adb create mode 100644 ncurses-5.3/Ada95/src/terminal_interface.ads create mode 100644 ncurses-5.3/INSTALL create mode 100644 ncurses-5.3/MANIFEST create mode 100644 ncurses-5.3/Makefile.glibc create mode 100644 ncurses-5.3/Makefile.in create mode 100644 ncurses-5.3/Makefile.os2 create mode 100644 ncurses-5.3/NEWS create mode 100644 ncurses-5.3/README create mode 100644 ncurses-5.3/README.emx create mode 100644 ncurses-5.3/README.glibc create mode 100644 ncurses-5.3/TO-DO create mode 100644 ncurses-5.3/aclocal.m4 create mode 100644 ncurses-5.3/announce.html.in create mode 100644 ncurses-5.3/c++/Makefile.in create mode 100644 ncurses-5.3/c++/NEWS create mode 100644 ncurses-5.3/c++/PROBLEMS create mode 100644 ncurses-5.3/c++/README-first create mode 100644 ncurses-5.3/c++/cursesapp.cc create mode 100644 ncurses-5.3/c++/cursesapp.h create mode 100644 ncurses-5.3/c++/cursesf.cc create mode 100644 ncurses-5.3/c++/cursesf.h create mode 100644 ncurses-5.3/c++/cursesm.cc create mode 100644 ncurses-5.3/c++/cursesm.h create mode 100644 ncurses-5.3/c++/cursesmain.cc create mode 100644 ncurses-5.3/c++/cursesp.cc create mode 100644 ncurses-5.3/c++/cursesp.h create mode 100644 ncurses-5.3/c++/cursespad.cc create mode 100644 ncurses-5.3/c++/cursesw.cc create mode 100644 ncurses-5.3/c++/cursesw.h create mode 100644 ncurses-5.3/c++/cursslk.cc create mode 100644 ncurses-5.3/c++/cursslk.h create mode 100644 ncurses-5.3/c++/demo.cc create mode 100755 ncurses-5.3/c++/edit_cfg.sh create mode 100644 ncurses-5.3/c++/etip.h.in create mode 100644 ncurses-5.3/c++/headers create mode 100644 ncurses-5.3/c++/internal.h create mode 100644 ncurses-5.3/c++/modules create mode 100755 ncurses-5.3/config.guess create mode 100644 ncurses-5.3/config.log create mode 100755 ncurses-5.3/config.sub create mode 100755 ncurses-5.3/configure create mode 100644 ncurses-5.3/configure.in create mode 100644 ncurses-5.3/convert_configure.pl create mode 100644 ncurses-5.3/dist.mk create mode 100644 ncurses-5.3/doc/hackguide.doc create mode 100644 ncurses-5.3/doc/html/Ada95.html create mode 100644 ncurses-5.3/doc/html/ada/files.htm create mode 100644 ncurses-5.3/doc/html/ada/files/T.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/A.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/B.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/C.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/D.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/E.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/F.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/G.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/H.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/I.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/K.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/L.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/M.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/N.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/O.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/P.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/Q.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/R.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/S.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/T.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/U.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/V.htm create mode 100644 ncurses-5.3/doc/html/ada/funcs/W.htm create mode 100644 ncurses-5.3/doc/html/ada/index.htm create mode 100644 ncurses-5.3/doc/html/ada/main.htm create mode 100644 ncurses-5.3/doc/html/ada/table.html create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-aux__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-aux__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-forms__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-menus__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-menus__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-mouse__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-mouse__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-panels__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-panels__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-putwin__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-putwin__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-termcap__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-termcap__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-terminfo__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-terminfo__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-text_io__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-trace__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses-trace__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses__adb.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface-curses__ads.htm create mode 100644 ncurses-5.3/doc/html/ada/terminal_interface__ads.htm create mode 100644 ncurses-5.3/doc/html/announce.html create mode 100644 ncurses-5.3/doc/html/hackguide.html create mode 100644 ncurses-5.3/doc/html/index.html create mode 100644 ncurses-5.3/doc/html/man/captoinfo.1m.html create mode 100644 ncurses-5.3/doc/html/man/clear.1.html create mode 100644 ncurses-5.3/doc/html/man/curs_add_wch.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_add_wchstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_addch.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_addchstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_addstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_addwstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_attr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_beep.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_bkgd.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_bkgrnd.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_border.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_border_set.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_clear.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_color.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_delch.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_deleteln.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_extend.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_get_wch.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_get_wstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_getcchar.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_getch.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_getstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_getyx.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_in_wch.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_in_wchstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_inch.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_inchstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_initscr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_inopts.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_ins_wch.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_ins_wstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_insch.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_insstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_instr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_inwstr.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_kernel.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_mouse.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_move.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_outopts.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_overlay.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_pad.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_print.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_printw.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_refresh.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_scanw.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_scr_dump.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_scroll.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_slk.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_termattrs.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_termcap.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_terminfo.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_touch.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_trace.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_util.3x.html create mode 100644 ncurses-5.3/doc/html/man/curs_window.3x.html create mode 100644 ncurses-5.3/doc/html/man/default_colors.3x.html create mode 100644 ncurses-5.3/doc/html/man/define_key.3x.html create mode 100644 ncurses-5.3/doc/html/man/form.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_cursor.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_data.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_driver.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_field.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_field_attributes.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_field_buffer.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_field_info.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_field_just.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_field_new.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_field_opts.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_field_userptr.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_field_validation.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_fieldtype.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_hook.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_new.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_new_page.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_opts.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_page.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_post.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_requestname.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_userptr.3x.html create mode 100644 ncurses-5.3/doc/html/man/form_win.3x.html create mode 100644 ncurses-5.3/doc/html/man/infocmp.1m.html create mode 100644 ncurses-5.3/doc/html/man/infotocap.1m.html create mode 100644 ncurses-5.3/doc/html/man/keybound.3x.html create mode 100644 ncurses-5.3/doc/html/man/keyok.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_attributes.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_cursor.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_driver.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_format.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_hook.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_items.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_mark.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_new.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_opts.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_pattern.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_post.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_requestname.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_spacing.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_userptr.3x.html create mode 100644 ncurses-5.3/doc/html/man/menu_win.3x.html create mode 100644 ncurses-5.3/doc/html/man/mitem_current.3x.html create mode 100644 ncurses-5.3/doc/html/man/mitem_name.3x.html create mode 100644 ncurses-5.3/doc/html/man/mitem_new.3x.html create mode 100644 ncurses-5.3/doc/html/man/mitem_opts.3x.html create mode 100644 ncurses-5.3/doc/html/man/mitem_userptr.3x.html create mode 100644 ncurses-5.3/doc/html/man/mitem_value.3x.html create mode 100644 ncurses-5.3/doc/html/man/mitem_visible.3x.html create mode 100644 ncurses-5.3/doc/html/man/ncurses.3x.html create mode 100644 ncurses-5.3/doc/html/man/panel.3x.html create mode 100644 ncurses-5.3/doc/html/man/resizeterm.3x.html create mode 100644 ncurses-5.3/doc/html/man/term.5.html create mode 100644 ncurses-5.3/doc/html/man/term.7.html create mode 100644 ncurses-5.3/doc/html/man/terminfo.5.html create mode 100644 ncurses-5.3/doc/html/man/tic.1m.html create mode 100644 ncurses-5.3/doc/html/man/toe.1m.html create mode 100644 ncurses-5.3/doc/html/man/tput.1.html create mode 100644 ncurses-5.3/doc/html/man/tset.1.html create mode 100644 ncurses-5.3/doc/html/man/wresize.3x.html create mode 100644 ncurses-5.3/doc/html/ncurses-intro.html create mode 100644 ncurses-5.3/doc/ncurses-intro.doc create mode 100644 ncurses-5.3/form/Makefile.in create mode 100644 ncurses-5.3/form/READ.ME create mode 100644 ncurses-5.3/form/fld_arg.c create mode 100644 ncurses-5.3/form/fld_attr.c create mode 100644 ncurses-5.3/form/fld_current.c create mode 100644 ncurses-5.3/form/fld_def.c create mode 100644 ncurses-5.3/form/fld_dup.c create mode 100644 ncurses-5.3/form/fld_ftchoice.c create mode 100644 ncurses-5.3/form/fld_ftlink.c create mode 100644 ncurses-5.3/form/fld_info.c create mode 100644 ncurses-5.3/form/fld_just.c create mode 100644 ncurses-5.3/form/fld_link.c create mode 100644 ncurses-5.3/form/fld_max.c create mode 100644 ncurses-5.3/form/fld_move.c create mode 100644 ncurses-5.3/form/fld_newftyp.c create mode 100644 ncurses-5.3/form/fld_opts.c create mode 100644 ncurses-5.3/form/fld_pad.c create mode 100644 ncurses-5.3/form/fld_page.c create mode 100644 ncurses-5.3/form/fld_stat.c create mode 100644 ncurses-5.3/form/fld_type.c create mode 100644 ncurses-5.3/form/fld_user.c create mode 100644 ncurses-5.3/form/form.h create mode 100644 ncurses-5.3/form/form.priv.h create mode 100644 ncurses-5.3/form/frm_cursor.c create mode 100644 ncurses-5.3/form/frm_data.c create mode 100644 ncurses-5.3/form/frm_def.c create mode 100644 ncurses-5.3/form/frm_driver.c create mode 100644 ncurses-5.3/form/frm_hook.c create mode 100644 ncurses-5.3/form/frm_opts.c create mode 100644 ncurses-5.3/form/frm_page.c create mode 100644 ncurses-5.3/form/frm_post.c create mode 100644 ncurses-5.3/form/frm_req_name.c create mode 100644 ncurses-5.3/form/frm_scale.c create mode 100644 ncurses-5.3/form/frm_sub.c create mode 100644 ncurses-5.3/form/frm_user.c create mode 100644 ncurses-5.3/form/frm_win.c create mode 100644 ncurses-5.3/form/fty_alnum.c create mode 100644 ncurses-5.3/form/fty_alpha.c create mode 100644 ncurses-5.3/form/fty_enum.c create mode 100644 ncurses-5.3/form/fty_int.c create mode 100644 ncurses-5.3/form/fty_ipv4.c create mode 100644 ncurses-5.3/form/fty_num.c create mode 100644 ncurses-5.3/form/fty_regex.c create mode 100644 ncurses-5.3/form/headers create mode 100644 ncurses-5.3/form/llib-lform create mode 100644 ncurses-5.3/form/llib-lformw create mode 100644 ncurses-5.3/form/modules create mode 100644 ncurses-5.3/include/Caps create mode 100644 ncurses-5.3/include/Caps.aix4 create mode 100644 ncurses-5.3/include/Caps.hpux11 create mode 100644 ncurses-5.3/include/Caps.keys create mode 100644 ncurses-5.3/include/Caps.osf1r5 create mode 100644 ncurses-5.3/include/Caps.uwin create mode 100755 ncurses-5.3/include/MKhashsize.sh create mode 100755 ncurses-5.3/include/MKkey_defs.sh create mode 100755 ncurses-5.3/include/MKncurses_def.sh create mode 100755 ncurses-5.3/include/MKparametrized.sh create mode 100644 ncurses-5.3/include/MKterm.h.awk.in create mode 100644 ncurses-5.3/include/Makefile.in create mode 100644 ncurses-5.3/include/capdefaults.c create mode 100644 ncurses-5.3/include/curses.h.in create mode 100644 ncurses-5.3/include/curses.tail create mode 100644 ncurses-5.3/include/curses.wide create mode 100755 ncurses-5.3/include/edit_cfg.sh create mode 100644 ncurses-5.3/include/headers create mode 100644 ncurses-5.3/include/nc_alloc.h create mode 100644 ncurses-5.3/include/nc_panel.h create mode 100644 ncurses-5.3/include/ncurses_cfg.hin create mode 100644 ncurses-5.3/include/ncurses_defs create mode 100644 ncurses-5.3/include/ncurses_dll.h create mode 100644 ncurses-5.3/include/term_entry.h create mode 100644 ncurses-5.3/include/termcap.h.in create mode 100644 ncurses-5.3/include/tic.h create mode 100644 ncurses-5.3/include/unctrl.h.in create mode 100755 ncurses-5.3/install-sh create mode 100755 ncurses-5.3/man/MKterminfo.sh create mode 100644 ncurses-5.3/man/Makefile.in create mode 100644 ncurses-5.3/man/captoinfo.1m create mode 100644 ncurses-5.3/man/clear.1 create mode 100644 ncurses-5.3/man/curs_add_wch.3x create mode 100644 ncurses-5.3/man/curs_add_wchstr.3x create mode 100644 ncurses-5.3/man/curs_addch.3x create mode 100644 ncurses-5.3/man/curs_addchstr.3x create mode 100644 ncurses-5.3/man/curs_addstr.3x create mode 100644 ncurses-5.3/man/curs_addwstr.3x create mode 100644 ncurses-5.3/man/curs_attr.3x create mode 100644 ncurses-5.3/man/curs_beep.3x create mode 100644 ncurses-5.3/man/curs_bkgd.3x create mode 100644 ncurses-5.3/man/curs_bkgrnd.3x create mode 100644 ncurses-5.3/man/curs_border.3x create mode 100644 ncurses-5.3/man/curs_border_set.3x create mode 100644 ncurses-5.3/man/curs_clear.3x create mode 100644 ncurses-5.3/man/curs_color.3x create mode 100644 ncurses-5.3/man/curs_delch.3x create mode 100644 ncurses-5.3/man/curs_deleteln.3x create mode 100644 ncurses-5.3/man/curs_extend.3x create mode 100644 ncurses-5.3/man/curs_get_wch.3x create mode 100644 ncurses-5.3/man/curs_get_wstr.3x create mode 100644 ncurses-5.3/man/curs_getcchar.3x create mode 100644 ncurses-5.3/man/curs_getch.3x create mode 100644 ncurses-5.3/man/curs_getstr.3x create mode 100644 ncurses-5.3/man/curs_getyx.3x create mode 100644 ncurses-5.3/man/curs_in_wch.3x create mode 100644 ncurses-5.3/man/curs_in_wchstr.3x create mode 100644 ncurses-5.3/man/curs_inch.3x create mode 100644 ncurses-5.3/man/curs_inchstr.3x create mode 100644 ncurses-5.3/man/curs_initscr.3x create mode 100644 ncurses-5.3/man/curs_inopts.3x create mode 100644 ncurses-5.3/man/curs_ins_wch.3x create mode 100644 ncurses-5.3/man/curs_ins_wstr.3x create mode 100644 ncurses-5.3/man/curs_insch.3x create mode 100644 ncurses-5.3/man/curs_insstr.3x create mode 100644 ncurses-5.3/man/curs_instr.3x create mode 100644 ncurses-5.3/man/curs_inwstr.3x create mode 100644 ncurses-5.3/man/curs_kernel.3x create mode 100644 ncurses-5.3/man/curs_mouse.3x create mode 100644 ncurses-5.3/man/curs_move.3x create mode 100644 ncurses-5.3/man/curs_outopts.3x create mode 100644 ncurses-5.3/man/curs_overlay.3x create mode 100644 ncurses-5.3/man/curs_pad.3x create mode 100644 ncurses-5.3/man/curs_print.3x create mode 100644 ncurses-5.3/man/curs_printw.3x create mode 100644 ncurses-5.3/man/curs_refresh.3x create mode 100644 ncurses-5.3/man/curs_scanw.3x create mode 100644 ncurses-5.3/man/curs_scr_dump.3x create mode 100644 ncurses-5.3/man/curs_scroll.3x create mode 100644 ncurses-5.3/man/curs_slk.3x create mode 100644 ncurses-5.3/man/curs_termattrs.3x create mode 100644 ncurses-5.3/man/curs_termcap.3x create mode 100644 ncurses-5.3/man/curs_terminfo.3x create mode 100644 ncurses-5.3/man/curs_touch.3x create mode 100644 ncurses-5.3/man/curs_trace.3x create mode 100644 ncurses-5.3/man/curs_util.3x create mode 100644 ncurses-5.3/man/curs_window.3x create mode 100644 ncurses-5.3/man/default_colors.3x create mode 100644 ncurses-5.3/man/define_key.3x create mode 100644 ncurses-5.3/man/form.3x create mode 100644 ncurses-5.3/man/form_cursor.3x create mode 100644 ncurses-5.3/man/form_data.3x create mode 100644 ncurses-5.3/man/form_driver.3x create mode 100644 ncurses-5.3/man/form_field.3x create mode 100644 ncurses-5.3/man/form_field_attributes.3x create mode 100644 ncurses-5.3/man/form_field_buffer.3x create mode 100644 ncurses-5.3/man/form_field_info.3x create mode 100644 ncurses-5.3/man/form_field_just.3x create mode 100644 ncurses-5.3/man/form_field_new.3x create mode 100644 ncurses-5.3/man/form_field_opts.3x create mode 100644 ncurses-5.3/man/form_field_userptr.3x create mode 100644 ncurses-5.3/man/form_field_validation.3x create mode 100644 ncurses-5.3/man/form_fieldtype.3x create mode 100644 ncurses-5.3/man/form_hook.3x create mode 100644 ncurses-5.3/man/form_new.3x create mode 100644 ncurses-5.3/man/form_new_page.3x create mode 100644 ncurses-5.3/man/form_opts.3x create mode 100644 ncurses-5.3/man/form_page.3x create mode 100644 ncurses-5.3/man/form_post.3x create mode 100644 ncurses-5.3/man/form_requestname.3x create mode 100644 ncurses-5.3/man/form_userptr.3x create mode 100644 ncurses-5.3/man/form_win.3x create mode 100644 ncurses-5.3/man/infocmp.1m create mode 100644 ncurses-5.3/man/infotocap.1m create mode 100644 ncurses-5.3/man/keybound.3x create mode 100644 ncurses-5.3/man/keyok.3x create mode 100755 ncurses-5.3/man/make_sed.sh create mode 100644 ncurses-5.3/man/man_db.renames create mode 100644 ncurses-5.3/man/manlinks.sed create mode 100644 ncurses-5.3/man/menu.3x create mode 100644 ncurses-5.3/man/menu_attributes.3x create mode 100644 ncurses-5.3/man/menu_cursor.3x create mode 100644 ncurses-5.3/man/menu_driver.3x create mode 100644 ncurses-5.3/man/menu_format.3x create mode 100644 ncurses-5.3/man/menu_hook.3x create mode 100644 ncurses-5.3/man/menu_items.3x create mode 100644 ncurses-5.3/man/menu_mark.3x create mode 100644 ncurses-5.3/man/menu_new.3x create mode 100644 ncurses-5.3/man/menu_opts.3x create mode 100644 ncurses-5.3/man/menu_pattern.3x create mode 100644 ncurses-5.3/man/menu_post.3x create mode 100644 ncurses-5.3/man/menu_requestname.3x create mode 100644 ncurses-5.3/man/menu_spacing.3x create mode 100644 ncurses-5.3/man/menu_userptr.3x create mode 100644 ncurses-5.3/man/menu_win.3x create mode 100644 ncurses-5.3/man/mitem_current.3x create mode 100644 ncurses-5.3/man/mitem_name.3x create mode 100644 ncurses-5.3/man/mitem_new.3x create mode 100644 ncurses-5.3/man/mitem_opts.3x create mode 100644 ncurses-5.3/man/mitem_userptr.3x create mode 100644 ncurses-5.3/man/mitem_value.3x create mode 100644 ncurses-5.3/man/mitem_visible.3x create mode 100644 ncurses-5.3/man/ncurses.3x create mode 100644 ncurses-5.3/man/panel.3x create mode 100644 ncurses-5.3/man/resizeterm.3x create mode 100644 ncurses-5.3/man/term.5 create mode 100644 ncurses-5.3/man/term.7 create mode 100644 ncurses-5.3/man/terminfo.head create mode 100644 ncurses-5.3/man/terminfo.tail create mode 100644 ncurses-5.3/man/tic.1m create mode 100644 ncurses-5.3/man/toe.1m create mode 100644 ncurses-5.3/man/tput.1 create mode 100644 ncurses-5.3/man/tset.1 create mode 100644 ncurses-5.3/man/wresize.3x create mode 100644 ncurses-5.3/menu/Makefile.in create mode 100644 ncurses-5.3/menu/READ.ME create mode 100644 ncurses-5.3/menu/eti.h create mode 100644 ncurses-5.3/menu/headers create mode 100644 ncurses-5.3/menu/llib-lmenu create mode 100644 ncurses-5.3/menu/llib-lmenuw create mode 100644 ncurses-5.3/menu/m_attribs.c create mode 100644 ncurses-5.3/menu/m_cursor.c create mode 100644 ncurses-5.3/menu/m_driver.c create mode 100644 ncurses-5.3/menu/m_format.c create mode 100644 ncurses-5.3/menu/m_global.c create mode 100644 ncurses-5.3/menu/m_hook.c create mode 100644 ncurses-5.3/menu/m_item_cur.c create mode 100644 ncurses-5.3/menu/m_item_nam.c create mode 100644 ncurses-5.3/menu/m_item_new.c create mode 100644 ncurses-5.3/menu/m_item_opt.c create mode 100644 ncurses-5.3/menu/m_item_top.c create mode 100644 ncurses-5.3/menu/m_item_use.c create mode 100644 ncurses-5.3/menu/m_item_val.c create mode 100644 ncurses-5.3/menu/m_item_vis.c create mode 100644 ncurses-5.3/menu/m_items.c create mode 100644 ncurses-5.3/menu/m_new.c create mode 100644 ncurses-5.3/menu/m_opts.c create mode 100644 ncurses-5.3/menu/m_pad.c create mode 100644 ncurses-5.3/menu/m_pattern.c create mode 100644 ncurses-5.3/menu/m_post.c create mode 100644 ncurses-5.3/menu/m_req_name.c create mode 100644 ncurses-5.3/menu/m_scale.c create mode 100644 ncurses-5.3/menu/m_spacing.c create mode 100644 ncurses-5.3/menu/m_sub.c create mode 100644 ncurses-5.3/menu/m_userptr.c create mode 100644 ncurses-5.3/menu/m_win.c create mode 100644 ncurses-5.3/menu/menu.h create mode 100644 ncurses-5.3/menu/menu.priv.h create mode 100644 ncurses-5.3/menu/mf_common.h create mode 100644 ncurses-5.3/menu/modules create mode 100644 ncurses-5.3/misc/Makefile.in create mode 100644 ncurses-5.3/misc/chkdef.cmd create mode 100644 ncurses-5.3/misc/cleantic.cmd create mode 100644 ncurses-5.3/misc/cmpdef.cmd create mode 100644 ncurses-5.3/misc/emx.src create mode 100644 ncurses-5.3/misc/form.def create mode 100644 ncurses-5.3/misc/form.ref create mode 100644 ncurses-5.3/misc/indent.pro create mode 100644 ncurses-5.3/misc/makedef.cmd create mode 100755 ncurses-5.3/misc/makellib create mode 100644 ncurses-5.3/misc/menu.def create mode 100644 ncurses-5.3/misc/menu.ref create mode 100644 ncurses-5.3/misc/ncurses.def create mode 100644 ncurses-5.3/misc/ncurses.ref create mode 100644 ncurses-5.3/misc/panel.def create mode 100644 ncurses-5.3/misc/panel.ref create mode 100644 ncurses-5.3/misc/run_tic.in create mode 100644 ncurses-5.3/misc/run_tic.sh create mode 100755 ncurses-5.3/misc/shlib create mode 100644 ncurses-5.3/misc/tabset/std create mode 100644 ncurses-5.3/misc/tabset/stdcrt create mode 100644 ncurses-5.3/misc/tabset/vt100 create mode 100644 ncurses-5.3/misc/tabset/vt300 create mode 100755 ncurses-5.3/misc/tdlint create mode 100644 ncurses-5.3/misc/terminfo.src create mode 100644 ncurses-5.3/mk-0th.awk create mode 100644 ncurses-5.3/mk-1st.awk create mode 100644 ncurses-5.3/mk-2nd.awk create mode 100755 ncurses-5.3/mkinstalldirs create mode 100644 ncurses-5.3/ncurses/Makefile.in create mode 100644 ncurses-5.3/ncurses/README create mode 100644 ncurses-5.3/ncurses/README.IZ create mode 100644 ncurses-5.3/ncurses/SigAction.h create mode 100644 ncurses-5.3/ncurses/base/MKkeyname.awk create mode 100755 ncurses-5.3/ncurses/base/MKlib_gen.sh create mode 100644 ncurses-5.3/ncurses/base/MKunctrl.awk create mode 100644 ncurses-5.3/ncurses/base/README create mode 100644 ncurses-5.3/ncurses/base/define_key.c create mode 100644 ncurses-5.3/ncurses/base/keybound.c create mode 100644 ncurses-5.3/ncurses/base/keyok.c create mode 100644 ncurses-5.3/ncurses/base/lib_addch.c create mode 100644 ncurses-5.3/ncurses/base/lib_addstr.c create mode 100644 ncurses-5.3/ncurses/base/lib_beep.c create mode 100644 ncurses-5.3/ncurses/base/lib_bkgd.c create mode 100644 ncurses-5.3/ncurses/base/lib_box.c create mode 100644 ncurses-5.3/ncurses/base/lib_chgat.c create mode 100644 ncurses-5.3/ncurses/base/lib_clear.c create mode 100644 ncurses-5.3/ncurses/base/lib_clearok.c create mode 100644 ncurses-5.3/ncurses/base/lib_clrbot.c create mode 100644 ncurses-5.3/ncurses/base/lib_clreol.c create mode 100644 ncurses-5.3/ncurses/base/lib_color.c create mode 100644 ncurses-5.3/ncurses/base/lib_colorset.c create mode 100644 ncurses-5.3/ncurses/base/lib_delch.c create mode 100644 ncurses-5.3/ncurses/base/lib_delwin.c create mode 100644 ncurses-5.3/ncurses/base/lib_dft_fgbg.c create mode 100644 ncurses-5.3/ncurses/base/lib_echo.c create mode 100644 ncurses-5.3/ncurses/base/lib_endwin.c create mode 100644 ncurses-5.3/ncurses/base/lib_erase.c create mode 100644 ncurses-5.3/ncurses/base/lib_flash.c create mode 100644 ncurses-5.3/ncurses/base/lib_freeall.c create mode 100644 ncurses-5.3/ncurses/base/lib_getch.c create mode 100644 ncurses-5.3/ncurses/base/lib_getstr.c create mode 100644 ncurses-5.3/ncurses/base/lib_hline.c create mode 100644 ncurses-5.3/ncurses/base/lib_immedok.c create mode 100644 ncurses-5.3/ncurses/base/lib_inchstr.c create mode 100644 ncurses-5.3/ncurses/base/lib_initscr.c create mode 100644 ncurses-5.3/ncurses/base/lib_insch.c create mode 100644 ncurses-5.3/ncurses/base/lib_insdel.c create mode 100644 ncurses-5.3/ncurses/base/lib_insstr.c create mode 100644 ncurses-5.3/ncurses/base/lib_instr.c create mode 100644 ncurses-5.3/ncurses/base/lib_isendwin.c create mode 100644 ncurses-5.3/ncurses/base/lib_leaveok.c create mode 100644 ncurses-5.3/ncurses/base/lib_mouse.c create mode 100644 ncurses-5.3/ncurses/base/lib_move.c create mode 100644 ncurses-5.3/ncurses/base/lib_mvwin.c create mode 100644 ncurses-5.3/ncurses/base/lib_newterm.c create mode 100644 ncurses-5.3/ncurses/base/lib_newwin.c create mode 100644 ncurses-5.3/ncurses/base/lib_nl.c create mode 100644 ncurses-5.3/ncurses/base/lib_overlay.c create mode 100644 ncurses-5.3/ncurses/base/lib_pad.c create mode 100644 ncurses-5.3/ncurses/base/lib_printw.c create mode 100644 ncurses-5.3/ncurses/base/lib_redrawln.c create mode 100644 ncurses-5.3/ncurses/base/lib_refresh.c create mode 100644 ncurses-5.3/ncurses/base/lib_restart.c create mode 100644 ncurses-5.3/ncurses/base/lib_scanw.c create mode 100644 ncurses-5.3/ncurses/base/lib_screen.c create mode 100644 ncurses-5.3/ncurses/base/lib_scroll.c create mode 100644 ncurses-5.3/ncurses/base/lib_scrollok.c create mode 100644 ncurses-5.3/ncurses/base/lib_scrreg.c create mode 100644 ncurses-5.3/ncurses/base/lib_set_term.c create mode 100644 ncurses-5.3/ncurses/base/lib_slk.c create mode 100644 ncurses-5.3/ncurses/base/lib_slkatr_set.c create mode 100644 ncurses-5.3/ncurses/base/lib_slkatrof.c create mode 100644 ncurses-5.3/ncurses/base/lib_slkatron.c create mode 100644 ncurses-5.3/ncurses/base/lib_slkatrset.c create mode 100644 ncurses-5.3/ncurses/base/lib_slkattr.c create mode 100644 ncurses-5.3/ncurses/base/lib_slkclear.c create mode 100644 ncurses-5.3/ncurses/base/lib_slkcolor.c create mode 100644 ncurses-5.3/ncurses/base/lib_slkinit.c create mode 100644 ncurses-5.3/ncurses/base/lib_slklab.c create mode 100644 ncurses-5.3/ncurses/base/lib_slkrefr.c create mode 100644 ncurses-5.3/ncurses/base/lib_slkset.c create mode 100644 ncurses-5.3/ncurses/base/lib_slktouch.c create mode 100644 ncurses-5.3/ncurses/base/lib_touch.c create mode 100644 ncurses-5.3/ncurses/base/lib_ungetch.c create mode 100644 ncurses-5.3/ncurses/base/lib_vline.c create mode 100644 ncurses-5.3/ncurses/base/lib_wattroff.c create mode 100644 ncurses-5.3/ncurses/base/lib_wattron.c create mode 100644 ncurses-5.3/ncurses/base/lib_winch.c create mode 100644 ncurses-5.3/ncurses/base/lib_window.c create mode 100644 ncurses-5.3/ncurses/base/memmove.c create mode 100644 ncurses-5.3/ncurses/base/nc_panel.c create mode 100644 ncurses-5.3/ncurses/base/resizeterm.c create mode 100644 ncurses-5.3/ncurses/base/safe_sprintf.c create mode 100644 ncurses-5.3/ncurses/base/sigaction.c create mode 100644 ncurses-5.3/ncurses/base/tries.c create mode 100644 ncurses-5.3/ncurses/base/version.c create mode 100644 ncurses-5.3/ncurses/base/vsscanf.c create mode 100644 ncurses-5.3/ncurses/base/wresize.c create mode 100644 ncurses-5.3/ncurses/curses.priv.h create mode 100644 ncurses-5.3/ncurses/fifo_defs.h create mode 100644 ncurses-5.3/ncurses/llib-lncurses create mode 100644 ncurses-5.3/ncurses/llib-lncursesw create mode 100644 ncurses-5.3/ncurses/modules create mode 100644 ncurses-5.3/ncurses/tinfo/MKcaptab.awk create mode 100755 ncurses-5.3/ncurses/tinfo/MKfallback.sh create mode 100755 ncurses-5.3/ncurses/tinfo/MKkeys_list.sh create mode 100644 ncurses-5.3/ncurses/tinfo/MKnames.awk create mode 100644 ncurses-5.3/ncurses/tinfo/README create mode 100644 ncurses-5.3/ncurses/tinfo/access.c create mode 100644 ncurses-5.3/ncurses/tinfo/add_tries.c create mode 100644 ncurses-5.3/ncurses/tinfo/alloc_entry.c create mode 100644 ncurses-5.3/ncurses/tinfo/alloc_ttype.c create mode 100644 ncurses-5.3/ncurses/tinfo/captoinfo.c create mode 100644 ncurses-5.3/ncurses/tinfo/comp_error.c create mode 100644 ncurses-5.3/ncurses/tinfo/comp_expand.c create mode 100644 ncurses-5.3/ncurses/tinfo/comp_hash.c create mode 100644 ncurses-5.3/ncurses/tinfo/comp_parse.c create mode 100644 ncurses-5.3/ncurses/tinfo/comp_scan.c create mode 100644 ncurses-5.3/ncurses/tinfo/doalloc.c create mode 100644 ncurses-5.3/ncurses/tinfo/free_ttype.c create mode 100644 ncurses-5.3/ncurses/tinfo/getenv_num.c create mode 100644 ncurses-5.3/ncurses/tinfo/home_terminfo.c create mode 100644 ncurses-5.3/ncurses/tinfo/init_keytry.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_acs.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_baudrate.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_cur_term.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_data.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_has_cap.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_kernel.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_longname.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_napms.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_options.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_print.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_raw.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_setup.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_termcap.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_termname.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_tgoto.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_ti.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_tparm.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_tputs.c create mode 100644 ncurses-5.3/ncurses/tinfo/lib_ttyflags.c create mode 100644 ncurses-5.3/ncurses/tinfo/make_keys.c create mode 100644 ncurses-5.3/ncurses/tinfo/name_match.c create mode 100644 ncurses-5.3/ncurses/tinfo/parse_entry.c create mode 100644 ncurses-5.3/ncurses/tinfo/read_entry.c create mode 100644 ncurses-5.3/ncurses/tinfo/read_termcap.c create mode 100644 ncurses-5.3/ncurses/tinfo/setbuf.c create mode 100644 ncurses-5.3/ncurses/tinfo/strings.c create mode 100644 ncurses-5.3/ncurses/tinfo/write_entry.c create mode 100644 ncurses-5.3/ncurses/trace/README create mode 100644 ncurses-5.3/ncurses/trace/lib_trace.c create mode 100644 ncurses-5.3/ncurses/trace/lib_traceatr.c create mode 100644 ncurses-5.3/ncurses/trace/lib_tracebits.c create mode 100644 ncurses-5.3/ncurses/trace/lib_tracechr.c create mode 100644 ncurses-5.3/ncurses/trace/lib_tracedmp.c create mode 100644 ncurses-5.3/ncurses/trace/lib_tracemse.c create mode 100644 ncurses-5.3/ncurses/trace/trace_buf.c create mode 100644 ncurses-5.3/ncurses/trace/trace_tries.c create mode 100644 ncurses-5.3/ncurses/trace/trace_xnames.c create mode 100644 ncurses-5.3/ncurses/trace/varargs.c create mode 100644 ncurses-5.3/ncurses/trace/visbuf.c create mode 100755 ncurses-5.3/ncurses/tty/MKexpanded.sh create mode 100644 ncurses-5.3/ncurses/tty/hardscroll.c create mode 100644 ncurses-5.3/ncurses/tty/hashmap.c create mode 100644 ncurses-5.3/ncurses/tty/lib_mvcur.c create mode 100644 ncurses-5.3/ncurses/tty/lib_tstp.c create mode 100644 ncurses-5.3/ncurses/tty/lib_twait.c create mode 100644 ncurses-5.3/ncurses/tty/lib_vidattr.c create mode 100644 ncurses-5.3/ncurses/tty/tty_display.h create mode 100644 ncurses-5.3/ncurses/tty/tty_input.h create mode 100644 ncurses-5.3/ncurses/tty/tty_update.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_box_set.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_cchar.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_erasewchar.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_get_wch.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_get_wstr.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_hline_set.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_in_wch.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_in_wchnstr.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_ins_nwstr.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_ins_wch.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_inwstr.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_unget_wch.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_vid_attr.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_vline_set.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_wacs.c create mode 100644 ncurses-5.3/ncurses/widechar/lib_wunctrl.c create mode 100644 ncurses-5.3/panel/Makefile.in create mode 100644 ncurses-5.3/panel/headers create mode 100644 ncurses-5.3/panel/llib-lpanel create mode 100644 ncurses-5.3/panel/llib-lpanelw create mode 100644 ncurses-5.3/panel/modules create mode 100644 ncurses-5.3/panel/p_above.c create mode 100644 ncurses-5.3/panel/p_below.c create mode 100644 ncurses-5.3/panel/p_bottom.c create mode 100644 ncurses-5.3/panel/p_delete.c create mode 100644 ncurses-5.3/panel/p_hidden.c create mode 100644 ncurses-5.3/panel/p_hide.c create mode 100644 ncurses-5.3/panel/p_move.c create mode 100644 ncurses-5.3/panel/p_new.c create mode 100644 ncurses-5.3/panel/p_replace.c create mode 100644 ncurses-5.3/panel/p_show.c create mode 100644 ncurses-5.3/panel/p_top.c create mode 100644 ncurses-5.3/panel/p_update.c create mode 100644 ncurses-5.3/panel/p_user.c create mode 100644 ncurses-5.3/panel/p_win.c create mode 100644 ncurses-5.3/panel/panel.c create mode 100644 ncurses-5.3/panel/panel.h create mode 100644 ncurses-5.3/panel/panel.priv.h create mode 100755 ncurses-5.3/progs/MKtermsort.sh create mode 100644 ncurses-5.3/progs/Makefile.in create mode 100755 ncurses-5.3/progs/capconvert create mode 100644 ncurses-5.3/progs/clear.c create mode 100755 ncurses-5.3/progs/clear.sh create mode 100644 ncurses-5.3/progs/dump_entry.c create mode 100644 ncurses-5.3/progs/dump_entry.h create mode 100644 ncurses-5.3/progs/infocmp.c create mode 100644 ncurses-5.3/progs/modules create mode 100644 ncurses-5.3/progs/progs.priv.h create mode 100644 ncurses-5.3/progs/tic.c create mode 100644 ncurses-5.3/progs/toe.c create mode 100644 ncurses-5.3/progs/tput.c create mode 100644 ncurses-5.3/progs/tset.c create mode 100644 ncurses-5.3/sysdeps/unix/sysv/linux/Makefile create mode 100755 ncurses-5.3/sysdeps/unix/sysv/linux/alpha/configure create mode 100755 ncurses-5.3/sysdeps/unix/sysv/linux/configure create mode 100644 ncurses-5.3/sysdeps/unix/sysv/linux/edit_man.sed create mode 100755 ncurses-5.3/sysdeps/unix/sysv/linux/edit_man.sh create mode 100755 ncurses-5.3/sysdeps/unix/sysv/linux/run_tic.sh create mode 100644 ncurses-5.3/tack/COPYING create mode 100644 ncurses-5.3/tack/HISTORY create mode 100644 ncurses-5.3/tack/Makefile.in create mode 100644 ncurses-5.3/tack/README create mode 100644 ncurses-5.3/tack/ansi.c create mode 100644 ncurses-5.3/tack/charset.c create mode 100644 ncurses-5.3/tack/color.c create mode 100644 ncurses-5.3/tack/control.c create mode 100644 ncurses-5.3/tack/crum.c create mode 100644 ncurses-5.3/tack/edit.c create mode 100644 ncurses-5.3/tack/fun.c create mode 100644 ncurses-5.3/tack/init.c create mode 100644 ncurses-5.3/tack/menu.c create mode 100644 ncurses-5.3/tack/modes.c create mode 100644 ncurses-5.3/tack/modules create mode 100644 ncurses-5.3/tack/output.c create mode 100644 ncurses-5.3/tack/pad.c create mode 100644 ncurses-5.3/tack/scan.c create mode 100644 ncurses-5.3/tack/sync.c create mode 100644 ncurses-5.3/tack/sysdep.c create mode 100644 ncurses-5.3/tack/tack.1 create mode 100644 ncurses-5.3/tack/tack.c create mode 100644 ncurses-5.3/tack/tack.h create mode 100755 ncurses-5.3/tar-copy.sh create mode 100644 ncurses-5.3/test/Makefile.in create mode 100644 ncurses-5.3/test/README create mode 100644 ncurses-5.3/test/blue.c create mode 100644 ncurses-5.3/test/bs.6 create mode 100644 ncurses-5.3/test/bs.c create mode 100644 ncurses-5.3/test/cardfile.c create mode 100644 ncurses-5.3/test/cardfile.dat create mode 100755 ncurses-5.3/test/configure create mode 100644 ncurses-5.3/test/configure.in create mode 100644 ncurses-5.3/test/ditto.c create mode 100644 ncurses-5.3/test/dots.c create mode 100644 ncurses-5.3/test/filter.c create mode 100644 ncurses-5.3/test/firework.c create mode 100644 ncurses-5.3/test/firstlast.c create mode 100644 ncurses-5.3/test/gdc.6 create mode 100644 ncurses-5.3/test/gdc.c create mode 100644 ncurses-5.3/test/hanoi.c create mode 100644 ncurses-5.3/test/hashtest.c create mode 100644 ncurses-5.3/test/keynames.c create mode 100644 ncurses-5.3/test/knight.c create mode 100644 ncurses-5.3/test/lrtest.c create mode 100644 ncurses-5.3/test/modules create mode 100644 ncurses-5.3/test/ncurses.c create mode 100644 ncurses-5.3/test/ncurses_tst.hin create mode 100644 ncurses-5.3/test/newdemo.c create mode 100644 ncurses-5.3/test/railroad.c create mode 100644 ncurses-5.3/test/rain.c create mode 100644 ncurses-5.3/test/tclock.c create mode 100644 ncurses-5.3/test/test.priv.h create mode 100644 ncurses-5.3/test/testaddch.c create mode 100644 ncurses-5.3/test/testcurs.c create mode 100644 ncurses-5.3/test/testscanw.c create mode 100755 ncurses-5.3/test/tracemunch create mode 100644 ncurses-5.3/test/view.c create mode 100644 ncurses-5.3/test/worm.c create mode 100644 ncurses-5.3/test/xmas.c diff --git a/ncurses-5.3/ANNOUNCE b/ncurses-5.3/ANNOUNCE new file mode 100644 index 0000000..e39a0be --- /dev/null +++ b/ncurses-5.3/ANNOUNCE @@ -0,0 +1,391 @@ + + Announcing ncurses 5.3 + + 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 is encouraging 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 [1]ftp://ftp.gnu.org/pub/gnu/ncurses. + It is also available at [2]ftp://invisible-island.net/ncurses. + + Release Notes + + This release is designed to be upward compatible from ncurses 5.0 and + 5.2; very few applications will require recompilation, depending on + the platform. These are the highlights from the change-log since + ncurses 5.2 release. + + Interface changes: + * change type for bool used in headers to NCURSES_BOOL, which + usually is the same as the compiler's definition for bool. + * add all but two functions for X/Open curses wide-character + support. These are only available if the library is configured + using the --enable-widec option. Missing functions are + + pecho_wchar() + + slk_wset() + * add environment variable $NCURSES_ASSUMED_COLORS to modify the + assume_default_colors() extension. + + New features and improvements: + * Improved support for termcap applications: + + add logic to dump_entry.c to remove function-key definitions + that do not fit into the 1023-byte limit for generated + termcaps. This makes hds200 fit. + + modify tgetent() to check if exit_attribute_mode resets the + alternate character set, and if so, attempt to adjust the + copy of the termcap "me" string which it will return to + eliminate that part. In particular, 'screen' would lose track + of line-drawing characters. + + add check/fix to comp_parse.c to suppress warning about + missing acsc string. This happens in configurations where raw + termcap information is processed; tic already does this and + other checks. + + add tic -A option to suppress capabilities which are + commented out when translating to termcap. + + modify logic in lib_baudrate.c for ospeed, for FreeBSD to + make it work properly for termcap applications (patch by + Andrey A Chernov). + * add a call to _nc_keypad() in keypad() to accommodate applications + such as nvi, which use curses for output but not for input (fixes + Debian #131263, cf: 20011215). + * correct logic for COLORFGBG environment variable: if rxvt is + compiled with xpm support, the variable has three fields, making + it slightly incompatible with itself. In either case, the + background color is the last field. + + Major bug fixes: + * rewrote limit-checks in wscrl() and associated + _nc_scroll_window(), to ensure that if the parameter of wscrl() is + larger than the size of the scrolling region, then the scrolling + region will be cleared. + * modify tset to restore original I/O modes if an error is + encountered. Also modify to use buffered stderr consistently + rather than mixing with write(). + * move calls to def_shell_mode() and def_prog_mode() before loop + with callbacks in lib_set_term.c, since the c++ demo otherwise + initialized the tty modes before saving them. + * modified wresize() to ensure that a failed realloc will not + corrupt the window structure, and to make subwindows fit within + the resized window. + * altered resizeterm() to avoid having it fail when a child window + cannot be resized because it would be larger than its parent. + * correct/improve logic to produce an exit status for errors in + tput, which did not exit with an error when told to put a string + not in the current terminfo entry. + * modify behavior of can_clear_with() so that if an application is + running in a non-bce terminals with default colors enabled, it + returns true, allowing the user to select/paste text without + picking up extraneous trailing blanks. + * add a check in relative_move() to guard against buffer overflow in + the overwrite logic. + * add some limit/pointer checks to -S option of tputs. + * modify mvcur() to avoid emitting newline characters when nonl() + mode is set. Normally this is not a problem since the actual + terminal mode is set to suppress nl/crlf translations, however it + is useful to allow the caller to manipulate the terminal mode to + avoid staircasing effects after spawning a process which writes + messages (for lynx 2.8.4). + + Portability: + * configure script: + + modify check in --disable-overwrite option so that it is used + by default unless the --prefix/$prefix value is not /usr, in + attempt to work around packagers who do not read the INSTALL + notes. + + correct a typo in configure --enable-colorfgbg option, and + move it to the experimental section (cf: 20011208). + + modify configure script to allow building with termcap only, + or with fallbacks only. In this case, we do not build tic and + toe. + + modify run_tic.sh to check if the build is a cross-compile. + In that case, do not use the build's tic to install the + terminfo database. + + modify c++/Makefile.in to accommodate archive programs that + are different for C++ than for C, and add cases for vendor's + C++ compilers on Solaris and IRIX. + + add several configure script options to aid with + cross-compiling: --with-build-cc, --with-build-cflags, + --with-build-ldflags, and --with-build-libs. + + add experimental --with-caps=XXX option to customize to + similar terminfo database formats such as AIX 4.x + + add configure option --with-ospeed to assist packagers in + transition to 5.3 change to ospeed type. + * library: + + implement a simple vsscanf() fallback function which uses the + %n conversion to help parse the input data. + + various fixes to build/work with different implementations of + vsscanf(). + + add/use macro to suppress sign-extension of char type on + platforms where this is a problem in ctype macros, e.g., + Solaris. + + finish changes needed to build dll's on cygwin. + + add #undef's before possible redefinition of ERR and OK in + curses.h + * programs: + + modify ifdef's in write_entry.c to allow use of symbolic + links on platforms with no hard links, e.g., BeOS. + + modify _nc_write_entry() to allow for the possibility that + linking aliases on a filesystem that ignores case would not + succeed because the source and destination differ only by + case, e.g., NCR260VT300WPP0 on cygwin. + + modify logic in tic, toe, tput and tset which checks for + basename of argv[0] to work properly on systems such as OS/2 + which have case-independent filenames and/or program + suffixes, e.g., ".ext". + + 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, but not all EXTENDED features). Most + EXTENDED-level features not directly concerned with wide-character + support are implemented, including 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 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 16-color terminals, such as aixterm and XFree86 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 + [3]http://invisible-island.net/cdk. + [4]http://www.vexus.ca/CDK.html + + ded + directory-editor + [5]http://invisible-island.net/ded. + + dialog + the underlying application used in Slackware's setup, and the + basis for similar applications on GNU/Linux. + [6]http://invisible-island.net/dialog. + + lynx + the character-screen WWW browser + [7]http://lynx.isc.org/release. + + Midnight Commander + file manager + [8]www.gnome.org/mc/. + + mutt + mail utility + [9]http://www.mutt.org. + + ncftp + file-transfer utility + [10]http://www.ncftp.com. + + nvi + New vi versions 1.50 are able to use ncurses versions 1.9.7 and + later. + [11]http://www.bostic.com/vi/. + + tin + newsreader, supporting color, MIME + [12]http://www.tin.org. + + taper + tape archive utility + [13]http://members.iinet.net.au/~yusuf/taper/. + + vh-1.6 + Volks-Hypertext browser for the Jargon File + [14]http://www.bg.debian.org/Packages/unstable/text/vh.html. + + as well as some that use ncurses for the terminfo support alone: + + minicom + terminal emulator + [15]http://www.pp.clinet.fi/~walker/minicom.html. + + vile + vi-like-emacs + [16]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 + + The original developers of ncurses are [17]Zeyd Ben-Halim and [18]Eric + S. Raymond. Ongoing work is being done by [19]Thomas Dickey and + [20]Jürgen Pfeifer. [21]Thomas Dickey acts as the maintainer for the + Free Software Foundation, which holds the copyright on ncurses. + Contact the current maintainers at [22]bug-ncurses@gnu.org. + + To join the ncurses mailing list, please write email to + bug-ncurses-request@gnu.org containing the line: + subscribe @ + + 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 [23]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. + +Other Related Resources + + The distribution includes and uses a version of the terminfo-format + terminal description file maintained by Eric Raymond. + [24]http://earthspace.net/~esr/terminfo. + + You can find lots of information on terminal-related topics not + covered in the terminfo file at [25]Richard Shuford's archive. + +References + + 1. ftp://ftp.gnu.org/pub/gnu/ncurses + 2. ftp://invisible-island.net/ncurses + 3. http://invisible-island.net/cdk/cdk.html + 4. http://www.vexus.ca/CDK.html + 5. http://invisible-island.net/ded/ded.html + 6. http://invisible-island.net/dialog/dialog.html + 7. http://lynx.isc.org/release/ + 8. file://localhost/usr/build/ncurses/ncurses-5.2-20021012/doc/html/www.gnome.org/mc/ + 9. http://www.mutt.org/ + 10. http://www.ncftp.com/ + 11. http://www.bostic.com/vi/ + 12. http://www.tin.org/ + 13. http://members.iinet.net.au/~yusuf/taper/ + 14. http://www.bg.debian.org/Packages/unstable/text/vh.html + 15. http://www.pp.clinet.fi/~walker/minicom.html + 16. http://invisible-island.net/vile/vile.html + 17. mailto:zmbenhal@netcom.com + 18. http://www.ccil.org/~esr/home.html + 19. mailto:dickey@herndon4.his.com + 20. http://www.familiepfeifer.de/Contact.aspx?Lang=en + 21. mailto:dickey@herndon4.his.com + 22. mailto:bug-ncurses@gnu.org + 23. ftp://invisible-island.net/ncurses + 24. http://earthspace.net/~esr/terminfo + 25. http://www.cs.utk.edu/~shuford/terminal_index.html diff --git a/ncurses-5.3/Ada95/Makefile.in b/ncurses-5.3/Ada95/Makefile.in new file mode 100644 index 0000000..cfce26c --- /dev/null +++ b/ncurses-5.3/Ada95/Makefile.in @@ -0,0 +1,68 @@ +############################################################################## +# 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 +# Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +# +# Version Control +# $Revision$ +# +SHELL = /bin/sh +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 -f Makefile + +install.data : + @ diff --git a/ncurses-5.3/Ada95/README b/ncurses-5.3/Ada95/README new file mode 100644 index 0000000..21e9b4c --- /dev/null +++ b/ncurses-5.3/Ada95/README @@ -0,0 +1,34 @@ +------------------------------------------------------------------------------- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en + +The documentation is provided in HTML format in the ./html +subdirectory. The main document is named index.html + diff --git a/ncurses-5.3/Ada95/TODO b/ncurses-5.3/Ada95/TODO new file mode 100644 index 0000000..ece4d96 --- /dev/null +++ b/ncurses-5.3/Ada95/TODO @@ -0,0 +1,27 @@ +-- $Id$ + +-- 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/ncurses-5.3/Ada95/gen/Makefile.in b/ncurses-5.3/Ada95/gen/Makefile.in new file mode 100644 index 0000000..4ebbd00 --- /dev/null +++ b/ncurses-5.3/Ada95/gen/Makefile.in @@ -0,0 +1,442 @@ +############################################################################## +# 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 +# Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +# +# Version Control +# $Revision$ +# +.SUFFIXES: + +SHELL = /bin/sh +THIS = Makefile + +x = @PROG_EXT@ + +top_srcdir = @top_srcdir@ +DESTDIR = @DESTDIR@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@ +ADA_OBJECTS = $(DESTDIR)@ADA_OBJECTS@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +AWK = @AWK@ +LN_S = @LN_S@ + +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@) + +LINK = $(HOST_CC) +LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) + +RANLIB = @RANLIB@ + +LIB_CURSES = -L../../lib -lncurses@LIB_SUFFIX@ + +M4 = m4 +M4FLAGS = + +GENERATE = ./gen$x '@DFT_ARG_SUFFIX@' +DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d' + +GNATHTML = `type -p gnathtml || type -p gnathtml.pl` +GNATHP = www.gnat.com +MAIL = www.familiepfeifer.de/Contact.aspx?Lang=en +HOMEP = www.familiepfeifer.de/juergen + +################################################################################ +ALIB = @cf_ada_package@ +ABASE = $(ALIB)-curses + +ADA_SRCDIR = ../src + +GEN_FILES0 = Base_Defs + +GEN_FILES1 = Key_Definitions \ + Old_Keys \ + Character_Attribute_Set_Rep \ + AC_Rep \ + Color_Defs \ + ACS_Map \ + Linker_Options \ + Base_Defs \ + Window_Offsets \ + Version_Info \ + Trace_Defs + +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)-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)-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) + @ + +sources: + +$(ADA_INCLUDE) \ +$(ADA_OBJECTS) : + $(top_srcdir)/mkinstalldirs $@ + +install \ +install.libs :: $(ADA_INCLUDE) + @echo installing package $(ALIB) in $(ADA_INCLUDE) + @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE) + @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(srcdir)/../src $(ADA_INCLUDE) + +install \ +install.libs :: $(ADA_OBJECTS) + @echo installing package $(ALIB) in $(ADA_OBJECTS) + @chmod a-wx $(ADA_SRCDIR)/*.ali + @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS) + @chmod u+x $(ADA_SRCDIR)/*.ali + +uninstall \ +uninstall.libs :: + @echo removing package $(ALIB) from $(ADA_INCLUDE) + -@cd $(ADA_INCLUDE) && rm -f $(ALIB)[-.]* + +uninstall \ +uninstall.libs :: + @echo removing package $(ALIB) from $(ADA_OBJECTS) + -@cd $(ADA_OBJECTS) && rm -f $(ALIB)[-.]* + +gen$x: gen.o + @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@ $(LIB_CURSES) + +gen.o: $(srcdir)/gen.c + $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c + +Character_Attribute_Set_Rep: gen$x + $(GENERATE) B A >$@ + +Base_Defs: gen$x + $(GENERATE) B B >$@ + +Color_Defs: gen$x + $(GENERATE) B C >$@ + +Key_Definitions: gen$x + $(GENERATE) B K >$@ + +Old_Keys: gen$x + $(GENERATE) B O >$@ + +ACS_Map: gen$x + $(GENERATE) B M >$@ + +AC_Rep: gen$x + $(GENERATE) B R >$@ + +Linker_Options: gen$x + $(GENERATE) B L >$@ + +Version_Info: gen$x + $(GENERATE) B V >$@ + +Window_Offsets: gen$x + $(GENERATE) B D >$@ + +Trace_Defs: gen$x + $(GENERATE) B T >$@ + +Menu_Opt_Rep: gen$x + $(GENERATE) M R >$@ + +Menu_Base_Defs: gen$x + $(GENERATE) M B >$@ + +Menu_Linker_Options: gen$x + $(GENERATE) M L >$@ + +Item_Rep: gen$x + $(GENERATE) M I >$@ + +Form_Opt_Rep: gen$x + $(GENERATE) F R >$@ + +Form_Base_Defs: gen$x + $(GENERATE) F B >$@ + +Form_Linker_Options: gen$x + $(GENERATE) F L >$@ + +Field_Rep: gen$x + $(GENERATE) F I >$@ + +Mouse_Base_Defs: gen$x + $(GENERATE) P B >$@ + +Mouse_Event_Rep: gen$x + $(GENERATE) P M >$@ + +Mouse_Events: gen$x + $(GENERATE) B E >$@ + +Panel_Linker_Options: gen$x + $(GENERATE) P L >$@ + +Chtype_Def: gen$x + $(GENERATE) E C >$@ + +Eti_Defs: gen$x + $(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)-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] + +TAGS: + etags *.[ch] + +mostlyclean :: + -rm -f a.out core gen$x *.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 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: + @rm -rf $(HTML_DIR)/ + @mkdir -p $(HTML_DIR) + cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb] + ln -sf ../src/*.ali . + for f in $(GEN_SRC); do \ + g=`basename $$f .ads.m4` ;\ + $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\ + 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%Juergen Pfeifer%J\ürgen Pfeifer%g' |\ + sed -e 's%http://$(MAIL)%$(MAIL)%g' |\ + 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 + @ + +############################################################################### +# The remainder of this file is automatically generated during configuration +############################################################################### diff --git a/ncurses-5.3/Ada95/gen/gen.c b/ncurses-5.3/Ada95/gen/gen.c new file mode 100644 index 0000000..7fcc311 --- /dev/null +++ b/ncurses-5.3/Ada95/gen/gen.c @@ -0,0 +1,1437 @@ +/**************************************************************************** + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Juergen Pfeifer, 1996 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +/* + Version Control + $Revision$ + --------------------------------------------------------------------------*/ +/* + 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. + */ + +#include +#include +#include +#include +#include + +#include +#include + +#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 = 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 <<= 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 = 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 Pack (%s);\n",name); + 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 = -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 = -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, len=0, i, 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 + { /* generate the old name, but only if it doesn't conflict with the old + * name (Ada95 isn't case sensitive!) + */ + const char *s = old_name; const char *t = name; + while ( *s && *t && (toupper(*s++) == toupper(*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(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) +{ +#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); +} + +/* + * 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); +} + +#define HAVE_USE_DEFAULT_COLORS 1 + +/* + * Generate all color definitions + */ +static void gen_color (void) +{ +#ifdef 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 strlen(buf); +} + +#define GEN_OFFSET(member,itype) \ + if (sizeof(((WINDOW*)0)->member)==sizeof(itype)) { \ + o = offsetof(WINDOW, member); \ + if ((o%sizeof(itype) == 0)) { \ + printf(" Offset%-*s : constant Natural := %2ld; -- %s\n", \ + 12, #member, o/sizeof(itype),#itype); \ + } \ + } + +static void +gen_offsets(void) +{ + long o; + const char* s_bool = ""; + + GEN_OFFSET(_maxy,short); + GEN_OFFSET(_maxx,short); + GEN_OFFSET(_begy,short); + GEN_OFFSET(_begx,short); + GEN_OFFSET(_cury,short); + GEN_OFFSET(_curx,short); + GEN_OFFSET(_yoffset,short); + GEN_OFFSET(_pary,int); + GEN_OFFSET(_parx,int); + if (sizeof(bool) == sizeof(char)) { + GEN_OFFSET(_notimeout,char); + GEN_OFFSET(_clear,char); + GEN_OFFSET(_leaveok,char); + GEN_OFFSET(_scroll,char); + GEN_OFFSET(_idlok,char); + GEN_OFFSET(_idcok,char); + GEN_OFFSET(_immed,char); + GEN_OFFSET(_sync,char); + GEN_OFFSET(_use_keypad,char); + s_bool = "char"; + } else if (sizeof(bool) == sizeof(short)) { + GEN_OFFSET(_notimeout,short); + GEN_OFFSET(_clear,short); + GEN_OFFSET(_leaveok,short); + GEN_OFFSET(_scroll,short); + GEN_OFFSET(_idlok,short); + GEN_OFFSET(_idcok,short); + GEN_OFFSET(_immed,short); + GEN_OFFSET(_sync,short); + GEN_OFFSET(_use_keypad,short); + s_bool = "short"; + } else if (sizeof(bool) == sizeof(int)) { + GEN_OFFSET(_notimeout,int); + GEN_OFFSET(_clear,int); + GEN_OFFSET(_leaveok,int); + GEN_OFFSET(_scroll,int); + GEN_OFFSET(_idlok,int); + GEN_OFFSET(_idcok,int); + GEN_OFFSET(_immed,int); + GEN_OFFSET(_sync,int); + GEN_OFFSET(_use_keypad,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 'K': /* translation of keycodes */ + gen_keydefs(0); + 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 'M': /* generate constants for the ACS characters */ + gen_acs(); + break; + case 'L': /* generate the Linker_Options pragma */ + gen_linkopts(); + break; + case 'O': /* generate definitions of the old key code names */ + gen_keydefs(1); + break; + case 'R': /* generate representation clause for Attributed character */ + gen_chtype_rep("Attributed_Character"); + break; + case 'V': /* generate version info */ + gen_version_info(); + break; + case 'T': /* generate the Trace info */ + gen_trace("Trace_Attribute_Set"); + 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(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/ncurses-5.3/Ada95/gen/html.m4 b/ncurses-5.3/Ada95/gen/html.m4 new file mode 100644 index 0000000..0b4254d --- /dev/null +++ b/ncurses-5.3/Ada95/gen/html.m4 @@ -0,0 +1,11 @@ +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 +|') +define(`AKA',``AKA': CFUNAME')dnl +define(`ALIAS',``AKA': $1')dnl diff --git a/ncurses-5.3/Ada95/gen/normal.m4 b/ncurses-5.3/Ada95/gen/normal.m4 new file mode 100644 index 0000000..f884c46 --- /dev/null +++ b/ncurses-5.3/Ada95/gen/normal.m4 @@ -0,0 +1,8 @@ +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/ncurses-5.3/Ada95/gen/table.m4 b/ncurses-5.3/Ada95/gen/table.m4 new file mode 100644 index 0000000..48ed6ce --- /dev/null +++ b/ncurses-5.3/Ada95/gen/table.m4 @@ -0,0 +1,6 @@ +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/ncurses-5.3/Ada95/gen/terminal_interface-curses-aux.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-aux.ads.m4 new file mode 100644 index 0000000..8f6337e --- /dev/null +++ b/ncurses-5.3/Ada95/gen/terminal_interface-curses-aux.ads.m4 @@ -0,0 +1,105 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-aux__ads.htm')dnl +include(M4MACRO)------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Aux -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in 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/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 new file mode 100644 index 0000000..9c9b88a --- /dev/null +++ b/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 @@ -0,0 +1,239 @@ +-- -*- 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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Fld_Type : in 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 : in 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/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 new file mode 100644 index 0000000..e4043a2 --- /dev/null +++ b/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 @@ -0,0 +1,71 @@ +-- -*- 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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Data : in User_Access); + -- AKA + pragma Inline (Set_User_Data); + + -- ANCHOR(`field_userptr',`Get_User_Data') + procedure Get_User_Data (Fld : in Field; + Data : out User_Access); + -- AKA + + -- ANCHOR(`field_userptr',`Get_User_Data') + function Get_User_Data (Fld : in Field) return User_Access; + -- AKA + -- Sama as function + pragma Inline (Get_User_Data); + +end Terminal_Interface.Curses.Forms.Field_User_Data; diff --git a/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 new file mode 100644 index 0000000..6895793 --- /dev/null +++ b/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 @@ -0,0 +1,71 @@ +-- -*- 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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Form; + Data : in User_Access); + -- AKA + pragma Inline (Set_User_Data); + + -- ANCHOR(`form_userptr',`Get_User_Data') + procedure Get_User_Data (Frm : in Form; + Data : out User_Access); + -- AKA + + -- ANCHOR(`form_userptr',`Get_User_Data') + function Get_User_Data (Frm : in Form) return User_Access; + -- AKA + -- Same as function + pragma Inline (Get_User_Data); + +end Terminal_Interface.Curses.Forms.Form_User_Data; diff --git a/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms.ads.m4 new file mode 100644 index 0000000..7c95ca0 --- /dev/null +++ b/ncurses-5.3/Ada95/gen/terminal_interface-curses-forms.ads.m4 @@ -0,0 +1,700 @@ +-- -*- 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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in 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 : in 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 : in Field; + Just : in 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 : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; + Str : in String); + -- AKA + -- Not inlined + + -- ANCHOR(`field_buffer()',`Get_Buffer') + procedure Get_Buffer + (Fld : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; + Str : out String); + -- AKA + + function Get_Buffer + (Fld : in Field; + Buffer : in 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 : in Field; + Status : in 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 : in Field; + Max : in Natural := 0); + -- AKA + pragma Inline (Set_Maximum_Size); + + -- MANPAGE(`form_field_opts.3x') + + -- ANCHOR(`set_field_opts()',`Set_Options') + procedure Set_Options (Fld : in Field; + Options : in Field_Option_Set); + -- AKA + -- An overloaded version is defined later. Pragma Inline appears there + + -- ANCHOR(`field_opts_on()',`Switch_Options') + procedure Switch_Options (Fld : in Field; + Options : in 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 : in 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 : in Field; + Fore : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Foreground); + + -- ANCHOR(`field_fore()',`Foreground') + procedure Foreground (Fld : in Field; + Fore : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`field_fore()',`Foreground') + procedure Foreground (Fld : in Field; + Fore : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + pragma Inline (Foreground); + + -- ANCHOR(`set_field_back()',`Set_Background') + procedure Set_Background + (Fld : in Field; + Back : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Background); + + -- ANCHOR(`field_back()',`Background') + procedure Background (Fld : in Field; + Back : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`field_back()',`Background') + procedure Background (Fld : in 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 : in Field; + Pad : in Character := Space); + -- AKA + pragma Inline (Set_Pad_Character); + + -- ANCHOR(`field_pad()',`Pad_Character') + procedure Pad_Character (Fld : in Field; + Pad : out Character); + -- AKA + pragma Inline (Pad_Character); + + -- MANPAGE(`form_field_info.3x') + + -- ANCHOR(`field_info()',`Info') + procedure Info (Fld : in 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 : in 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 : in Form; + Win : in 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 : in Form; + Win : in 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 : in 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 : in Form); + pragma Convention (C, Form_Hook_Function); + + -- ANCHOR(`set_field_init()',`Set_Field_Init_Hook') + procedure Set_Field_Init_Hook (Frm : in Form; + Proc : in Form_Hook_Function); + -- AKA + pragma Inline (Set_Field_Init_Hook); + + -- ANCHOR(`set_field_term()',`Set_Field_Term_Hook') + procedure Set_Field_Term_Hook (Frm : in Form; + Proc : in Form_Hook_Function); + -- AKA + pragma Inline (Set_Field_Term_Hook); + + -- ANCHOR(`set_form_init()',`Set_Form_Init_Hook') + procedure Set_Form_Init_Hook (Frm : in Form; + Proc : in Form_Hook_Function); + -- AKA + pragma Inline (Set_Form_Init_Hook); + + -- ANCHOR(`set_form_term()',`Set_Form_Term_Hook') + procedure Set_Form_Term_Hook (Frm : in Form; + Proc : in 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 : in Form; + Flds : in Field_Array_Access); + -- AKA + pragma Inline (Redefine); + + -- ANCHOR(`set_form_fields()',`Set_Fields') + procedure Set_Fields (Frm : in Form; + Flds : in 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 : in Field; + Line : in Line_Position; + Column : in 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 : in Form; + Options : in Form_Option_Set); + -- AKA + pragma Inline (Set_Options); + + -- ANCHOR(`form_opts_on()',`Switch_Options') + procedure Switch_Options (Frm : in Form; + Options : in Form_Option_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`form_opts_off()') + pragma Inline (Switch_Options); + + -- ANCHOR(`form_opts()',`Get_Options') + procedure Get_Options (Frm : in 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 : in Form; + Post : in 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 : in Form; + Fld : in Field); + -- AKA + pragma Inline (Set_Current); + + -- ANCHOR(`current_field()',`Current') + function Current (Frm : in Form) return Field; + -- AKA + pragma Inline (Current); + + -- ANCHOR(`set_form_page()',`Set_Page') + procedure Set_Page (Frm : in Form; + Page : in 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 : in Field; + New_Page : in 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/ncurses-5.3/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 new file mode 100644 index 0000000..111870d --- /dev/null +++ b/ncurses-5.3/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 @@ -0,0 +1,76 @@ +-- -*- 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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Item; + Data : in User_Access); + -- AKA + pragma Inline (Set_User_Data); + + -- ANCHOR(`item_userptr',`Get_User_Data') + procedure Get_User_Data (Itm : in Item; + Data : out User_Access); + -- AKA + + -- ANCHOR(`item_userptr',`Get_User_Data') + function Get_User_Data (Itm : in Item) return User_Access; + -- AKA + -- Same as function + pragma Inline (Get_User_Data); + +end Terminal_Interface.Curses.Menus.Item_User_Data; + diff --git a/ncurses-5.3/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 new file mode 100644 index 0000000..713e81c --- /dev/null +++ b/ncurses-5.3/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 @@ -0,0 +1,71 @@ +-- -*- 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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Menu; + Data : in User_Access); + -- AKA + pragma Inline (Set_User_Data); + + -- ANCHOR(`menu_userptr',`Get_User_Data') + procedure Get_User_Data (Men : in Menu; + Data : out User_Access); + -- AKA + + -- ANCHOR(`menu_userptr',`Get_User_Data') + function Get_User_Data (Men : in Menu) return User_Access; + -- AKA + -- Same as function + pragma Inline (Get_User_Data); + +end Terminal_Interface.Curses.Menus.Menu_User_Data; diff --git a/ncurses-5.3/Ada95/gen/terminal_interface-curses-menus.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-menus.ads.m4 new file mode 100644 index 0000000..502e7f2 --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in 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 : in Item; + Value : in 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 : in Item; + Options : in 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 : in Item; + Options : in 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 : in 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 : in 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 : in 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 : in Menu; + Itm : in 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 : in Menu; + Line : in 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 : in Menu; + Post : in Boolean := True); + -- AKA + -- ALIAS(`unpost_menu()') + pragma Inline (Post); + + -- MANPAGE(`menu_opts.3x') + + -- ANCHOR(`set_menu_opts()',`Set_Options') + procedure Set_Options (Men : in Menu; + Options : in Menu_Option_Set); + -- AKA + pragma Inline (Set_Options); + + -- ANCHOR(`menu_opts_on()',`Switch_Options') + procedure Switch_Options (Men : in Menu; + Options : in Menu_Option_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`menu_opts_off()') + pragma Inline (Switch_Options); + + -- ANCHOR(`menu_opts()',`Get_Options') + procedure Get_Options (Men : in 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 : in Menu; + Win : in 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 : in Menu; + Win : in 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 : in 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 : in Menu; + Mark : in String); + -- AKA + pragma Inline (Set_Mark); + + -- ANCHOR(`menu_mark()',`Mark') + procedure Mark (Men : in Menu; + Mark : out String); + -- AKA + + function Mark (Men : Menu) return String; + -- AKA + -- Implemented as function + pragma Inline (Mark); + + -- MANPAGE(`menu_attribs.3x') + + -- ANCHOR(`set_menu_fore()',`Set_Foreground') + procedure Set_Foreground + (Men : in Menu; + Fore : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Foreground); + + -- ANCHOR(`menu_fore()',`Foreground') + procedure Foreground (Men : in Menu; + Fore : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`menu_fore()',`Foreground') + procedure Foreground (Men : in Menu; + Fore : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + pragma Inline (Foreground); + + -- ANCHOR(`set_menu_back()',`Set_Background') + procedure Set_Background + (Men : in Menu; + Back : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Background); + + -- ANCHOR(`menu_back()',`Background') + procedure Background (Men : in Menu; + Back : out Character_Attribute_Set); + -- AKA + -- ANCHOR(`menu_back()',`Background') + + procedure Background (Men : in Menu; + Back : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + pragma Inline (Background); + + -- ANCHOR(`set_menu_grey()',`Set_Grey') + procedure Set_Grey + (Men : in Menu; + Grey : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Grey); + + -- ANCHOR(`menu_grey()',`Grey') + procedure Grey (Men : in Menu; + Grey : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`menu_grey()',`Grey') + procedure Grey + (Men : in 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 : in Menu; + Pad : in Character := Space); + -- AKA + pragma Inline (Set_Pad_Character); + + -- ANCHOR(`menu_pad()',`Pad_Character') + procedure Pad_Character (Men : in Menu; + Pad : out Character); + -- AKA + pragma Inline (Pad_Character); + + -- MANPAGE(`menu_spacing.3x') + + -- ANCHOR(`set_menu_spacing()',`Set_Spacing') + procedure Set_Spacing (Men : in Menu; + Descr : in Column_Position := 0; + Row : in Line_Position := 0; + Col : in Column_Position := 0); + -- AKA + pragma Inline (Set_Spacing); + + -- ANCHOR(`menu_spacing()',`Spacing') + procedure Spacing (Men : in 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 : in Menu; + Text : out String); + -- AKA + pragma Inline (Pattern); + + -- MANPAGE(`menu_format.3x') + + -- ANCHOR(`set_menu_format()',`Set_Format') + procedure Set_Format (Men : in Menu; + Lines : in Line_Count; + Columns : in 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 : in 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 : in Menu); + pragma Convention (C, Menu_Hook_Function); + + -- ANCHOR(`set_item_init()',`Set_Item_Init_Hook') + procedure Set_Item_Init_Hook (Men : in Menu; + Proc : in Menu_Hook_Function); + -- AKA + pragma Inline (Set_Item_Init_Hook); + + -- ANCHOR(`set_item_term()',`Set_Item_Term_Hook') + procedure Set_Item_Term_Hook (Men : in Menu; + Proc : in Menu_Hook_Function); + -- AKA + pragma Inline (Set_Item_Term_Hook); + + -- ANCHOR(`set_menu_init()',`Set_Menu_Init_Hook') + procedure Set_Menu_Init_Hook (Men : in Menu; + Proc : in Menu_Hook_Function); + -- AKA + pragma Inline (Set_Menu_Init_Hook); + + -- ANCHOR(`set_menu_term()',`Set_Menu_Term_Hook') + procedure Set_Menu_Term_Hook (Men : in Menu; + Proc : in 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 : in Menu; + Items : in Item_Array_Access); + -- AKA + pragma Inline (Redefine); + + procedure Set_Items (Men : in Menu; + Items : in 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/ncurses-5.3/Ada95/gen/terminal_interface-curses-mouse.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-mouse.ads.m4 new file mode 100644 index 0000000..b1c574d --- /dev/null +++ b/ncurses-5.3/Ada95/gen/terminal_interface-curses-mouse.ads.m4 @@ -0,0 +1,184 @@ +-- -*- 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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Mouse_Button; + State : in 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 : in Mouse_Button; + State : in 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 : in 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 : in 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 : in 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); + pragma Pack (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/ncurses-5.3/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 new file mode 100644 index 0000000..0af8ebc --- /dev/null +++ b/ncurses-5.3/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 @@ -0,0 +1,71 @@ +-- -*- 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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Panel; + Data : in User_Access); + -- AKA + pragma Inline (Set_User_Data); + + -- ANCHOR(`panel_userptr',`Get_User_Data') + procedure Get_User_Data (Pan : in Panel; + Data : out User_Access); + -- AKA + + -- ANCHOR(`panel_userptr',`Get_User_Data') + function Get_User_Data (Pan : in Panel) return User_Access; + -- AKA + -- Same as function + pragma Inline (Get_User_Data); + +end Terminal_Interface.Curses.Panels.User_Data; diff --git a/ncurses-5.3/Ada95/gen/terminal_interface-curses-panels.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-panels.ads.m4 new file mode 100644 index 0000000..a7f6563 --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Panel); + -- AKA + pragma Inline (Bottom); + + -- ANCHOR(`top_panel()',`Top') + procedure Top (Pan : in Panel); + -- AKA + pragma Inline (Top); + + -- ANCHOR(`show_panel()',`Show') + procedure Show (Pan : in 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 : in 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 : in Panel; + Win : in Window); + -- AKA + pragma Inline (Replace); + + -- ANCHOR(`move_panel()',`Move') + procedure Move (Pan : in Panel; + Line : in Line_Position; + Column : in 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/ncurses-5.3/Ada95/gen/terminal_interface-curses-trace.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses-trace.ads.m4 new file mode 100644 index 0000000..525e6fa --- /dev/null +++ b/ncurses-5.3/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$ +-- 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/ncurses-5.3/Ada95/gen/terminal_interface-curses.ads.m4 b/ncurses-5.3/Ada95/gen/terminal_interface-curses.ads.m4 new file mode 100644 index 0000000..e59de0a --- /dev/null +++ b/ncurses-5.3/Ada95/gen/terminal_interface-curses.ads.m4 @@ -0,0 +1,1557 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses__ads.htm')dnl +include(M4MACRO)------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 Natural; + -- That is anything including real characters, special keys and logical + -- request codes. + + subtype Real_Key_Code is Key_Code range 0 .. 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); + + ACS_Map : array (Character'Val (0) .. Character'Val (127)) of + Attributed_Character; + pragma Import (C, ACS_Map, "acs_map"); + -- + -- + -- Constants for several characters from the Alternate Character Set + -- You must use this constants as indices into the ACS_Map array + -- to get the corresponding attributed character at runtime. + -- +include(`ACS_Map')dnl + + -- MANPAGE(`curs_initscr.3x') + -- | Not implemented: newterm, set_term, delscreen, curscr + + -- ANCHOR(`stdscr',`Standard_Window') + function Standard_Window return Window; + -- AKA + pragma Inline (Standard_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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position); + -- AKA + -- ALIAS(`move()') + pragma Inline (Move_Cursor); + + -- MANPAGE(`curs_addch.3x') + + -- ANCHOR(`waddch()',`Add') + procedure Add (Win : in Window := Standard_Window; + Ch : in Attributed_Character); + -- AKA + -- ALIAS(`addch()') + + procedure Add (Win : in Window := Standard_Window; + Ch : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in Attributed_Character); + -- AKA + -- ALIAS(`mvaddch()') + + procedure Add + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in 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 : in Window := Standard_Window; + Ch : in Attributed_Character); + -- AKA + -- ALIAS(`echochar()') + + procedure Add_With_Immediate_Echo + (Win : in Window := Standard_Window; + Ch : in 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 : in Window; + Line : in Line_Position; + Column : in Column_Position); + -- AKA + pragma Inline (Move_Window); + + -- ANCHOR(`mvderwin()',`Move_Derived_Window') + procedure Move_Derived_Window (Win : in Window; + Line : in Line_Position; + Column : in Column_Position); + -- AKA + pragma Inline (Move_Derived_Window); + + -- ANCHOR(`wsyncup()',`Synchronize_Upwards') + procedure Synchronize_Upwards (Win : in Window); + -- AKA + pragma Import (C, Synchronize_Upwards, "wsyncup"); + + -- ANCHOR(`wsyncdown()',`Synchronize_Downwards') + procedure Synchronize_Downwards (Win : in Window); + -- AKA + pragma Import (C, Synchronize_Downwards, "wsyncdown"); + + -- ANCHOR(`syncok()',`Set_Synch_Mode') + procedure Set_Synch_Mode (Win : in Window := Standard_Window; + Mode : in Boolean := False); + -- AKA + pragma Inline (Set_Synch_Mode); + + -- MANPAGE(`curs_addstr.3x') + + -- ANCHOR(`waddnstr()',`Add') + procedure Add (Win : in Window := Standard_Window; + Str : in String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`waddstr()') + -- ALIAS(`addnstr()') + -- ALIAS(`addstr()') + + -- ANCHOR(`mvwaddnstr()',`Add') + procedure Add (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`mvwaddstr()') + -- ALIAS(`mvaddnstr()') + -- ALIAS(`mvaddstr()') + + -- MANPAGE(`curs_addchstr.3x') + + -- ANCHOR(`waddchnstr()',`Add') + procedure Add (Win : in Window := Standard_Window; + Str : in Attributed_String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`waddchstr()') + -- ALIAS(`addchnstr()') + -- ALIAS(`addchstr()') + + -- ANCHOR(`mvwaddchnstr()',`Add') + procedure Add (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in Attributed_String; + Len : in 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 : in Window := Standard_Window; + Left_Side_Symbol : in Attributed_Character := Default_Character; + Right_Side_Symbol : in Attributed_Character := Default_Character; + Top_Side_Symbol : in Attributed_Character := Default_Character; + Bottom_Side_Symbol : in Attributed_Character := Default_Character; + Upper_Left_Corner_Symbol : in Attributed_Character := Default_Character; + Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character; + Lower_Left_Corner_Symbol : in Attributed_Character := Default_Character; + Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character + ); + -- AKA + -- ALIAS(`border()') + pragma Inline (Border); + + -- ANCHOR(`box()',`Box') + procedure Box + (Win : in Window := Standard_Window; + Vertical_Symbol : in Attributed_Character := Default_Character; + Horizontal_Symbol : in Attributed_Character := Default_Character); + -- AKA + pragma Inline (Box); + + -- ANCHOR(`whline()',`Horizontal_Line') + procedure Horizontal_Line + (Win : in Window := Standard_Window; + Line_Size : in Natural; + Line_Symbol : in Attributed_Character := Default_Character); + -- AKA + -- ALIAS(`hline()') + pragma Inline (Horizontal_Line); + + -- ANCHOR(`wvline()',`Vertical_Line') + procedure Vertical_Line + (Win : in Window := Standard_Window; + Line_Size : in Natural; + Line_Symbol : in 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 : in 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 : in Window := Standard_Window; + Attr : in Character_Attribute_Set := Normal_Video; + On : in 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 : in Window := Standard_Window; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + -- ALIAS(`attrset()') + pragma Inline (Set_Character_Attributes); + + -- ANCHOR(`wattr_get()',`Get_Character_Attributes') + function Get_Character_Attribute + (Win : in Window := Standard_Window) return Character_Attribute_Set; + -- AKA + -- ALIAS(`attr_get()') + + -- ANCHOR(`wattr_get()',`Get_Character_Attribute') + function Get_Character_Attribute + (Win : in Window := Standard_Window) return Color_Pair; + -- AKA + pragma Inline (Get_Character_Attribute); + + -- ANCHOR(`wcolor_set()',`Set_Color') + procedure Set_Color (Win : in Window := Standard_Window; + Pair : in Color_Pair); + -- AKA + -- ALIAS(`color_set()') + pragma Inline (Set_Color); + + -- ANCHOR(`wchgat()',`Change_Attributes') + procedure Change_Attributes + (Win : in Window := Standard_Window; + Count : in Integer := -1; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + -- ALIAS(`chgat()') + + -- ANCHOR(`mvwchgat()',`Change_Attributes') + procedure Change_Attributes + (Win : in Window := Standard_Window; + Line : in Line_Position := Line_Position'First; + Column : in Column_Position := Column_Position'First; + Count : in Integer := -1; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in Boolean := True); + -- AKA + -- ALIAS(`nocbreak()') + pragma Inline (Set_Cbreak_Mode); + + -- ANCHOR(`raw()',`Set_Raw_Mode') + procedure Set_Raw_Mode (SwitchOn : in Boolean := True); + -- AKA + -- ALIAS(`noraw()') + pragma Inline (Set_Raw_Mode); + + -- ANCHOR(`echo()',`Set_Echo_Mode') + procedure Set_Echo_Mode (SwitchOn : in Boolean := True); + -- AKA + -- ALIAS(`noecho()') + pragma Inline (Set_Echo_Mode); + + -- ANCHOR(`meta()',`Set_Meta_Mode') + procedure Set_Meta_Mode (Win : in Window := Standard_Window; + SwitchOn : in Boolean := True); + -- AKA + pragma Inline (Set_Meta_Mode); + + -- ANCHOR(`keypad()',`Set_KeyPad_Mode') + procedure Set_KeyPad_Mode (Win : in Window := Standard_Window; + SwitchOn : in Boolean := True); + -- AKA + pragma Inline (Set_KeyPad_Mode); + + function Get_KeyPad_Mode (Win : in 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 : in Half_Delay_Amount); + -- AKA + pragma Inline (Half_Delay); + + -- ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode') + procedure Set_Flush_On_Interrupt_Mode + (Win : in Window := Standard_Window; + Mode : in Boolean := True); + -- AKA + pragma Inline (Set_Flush_On_Interrupt_Mode); + + -- ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode') + procedure Set_Queue_Interrupt_Mode + (Win : in Window := Standard_Window; + Flush : in Boolean := True); + -- AKA + -- ALIAS(`noqiflush()') + pragma Inline (Set_Queue_Interrupt_Mode); + + -- ANCHOR(`nodelay()',`Set_NoDelay_Mode') + procedure Set_NoDelay_Mode + (Win : in Window := Standard_Window; + Mode : in 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 : in Window := Standard_Window; + Mode : in Timeout_Mode; + Amount : in 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 : in Window := Standard_Window; + Timer_Off : in Boolean := False); + -- AKA + pragma Inline (Set_Escape_Timer_Mode); + + -- MANPAGE(`curs_outopts.3x') + + -- ANCHOR(`nl()',`Set_NL_Mode') + procedure Set_NL_Mode (SwitchOn : in Boolean := True); + -- AKA + -- ALIAS(`nonl()') + pragma Inline (Set_NL_Mode); + + -- ANCHOR(`clearok()',`Clear_On_Next_Update') + procedure Clear_On_Next_Update + (Win : in Window := Standard_Window; + Do_Clear : in Boolean := True); + -- AKA + pragma Inline (Clear_On_Next_Update); + + -- ANCHOR(`idlok()',`Use_Insert_Delete_Line') + procedure Use_Insert_Delete_Line + (Win : in Window := Standard_Window; + Do_Idl : in Boolean := True); + -- AKA + pragma Inline (Use_Insert_Delete_Line); + + -- ANCHOR(`idcok()',`Use_Insert_Delete_Character') + procedure Use_Insert_Delete_Character + (Win : in Window := Standard_Window; + Do_Idc : in Boolean := True); + -- AKA + pragma Inline (Use_Insert_Delete_Character); + + -- ANCHOR(`leaveok()',`Leave_Cursor_After_Update') + procedure Leave_Cursor_After_Update + (Win : in Window := Standard_Window; + Do_Leave : in Boolean := True); + -- AKA + pragma Inline (Leave_Cursor_After_Update); + + -- ANCHOR(`immedok()',`Immediate_Update_Mode') + procedure Immediate_Update_Mode + (Win : in Window := Standard_Window; + Mode : in Boolean := False); + -- AKA + pragma Inline (Immediate_Update_Mode); + + -- ANCHOR(`scrollok()',`Allow_Scrolling') + procedure Allow_Scrolling + (Win : in Window := Standard_Window; + Mode : in 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 : in Window := Standard_Window; + Top_Line : in Line_Position; + Bottom_Line : in 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 : in 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 : in Window := Standard_Window); + -- AKA + -- There is an overloaded Refresh_Without_Update for Pads. + -- The Inline pragma appears there + + -- ANCHOR(`redrawwin()',`Redraw') + procedure Redraw (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`wredrawln()',`Redraw') + procedure Redraw (Win : in Window := Standard_Window; + Begin_Line : in Line_Position; + Line_Count : in Positive); + -- AKA + pragma Inline (Redraw); + + -- MANPAGE(`curs_clear.3x') + + -- ANCHOR(`werase()',`Erase') + procedure Erase (Win : in Window := Standard_Window); + -- AKA + -- ALIAS(`erase()') + pragma Inline (Erase); + + -- ANCHOR(`wclear()',`Clear') + procedure Clear + (Win : in Window := Standard_Window); + -- AKA + -- ALIAS(`clear()') + pragma Inline (Clear); + + -- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen') + procedure Clear_To_End_Of_Screen + (Win : in 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 : in 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 : in Window := Standard_Window; + Ch : in Attributed_Character); + -- AKA + -- ALIAS(`bkgdset()') + pragma Inline (Set_Background); + + -- ANCHOR(`wbkgd()',`Change_Background') + procedure Change_Background + (Win : in Window := Standard_Window; + Ch : in 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 : in Window := Standard_Window); + -- AKA + pragma Inline (Untouch); + + -- ANCHOR(`touchwin()',`Touch') + procedure Touch (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`touchline()',`Touch') + procedure Touch (Win : in Window := Standard_Window; + Start : in Line_Position; + Count : in Positive); + -- AKA + pragma Inline (Touch); + + -- ANCHOR(`wtouchln()',`Change_Line_Status') + procedure Change_Lines_Status (Win : in Window := Standard_Window; + Start : in Line_Position; + Count : in Positive; + State : in 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 : in Window; + Destination_Window : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in Column_Position; + Non_Destructive_Mode : in Boolean := True); + -- AKA + pragma Inline (Copy); + + -- ANCHOR(`overwrite()',`Overwrite') + procedure Overwrite (Source_Window : in Window; + Destination_Window : in Window); + -- AKA + pragma Inline (Overwrite); + + -- ANCHOR(`overlay()',`Overlay') + procedure Overlay (Source_Window : in Window; + Destination_Window : in Window); + -- AKA + pragma Inline (Overlay); + + -- MANPAGE(`curs_deleteln.3x') + + -- ANCHOR(`winsdelln()',`Insert_Delete_Lines') + procedure Insert_Delete_Lines + (Win : in Window := Standard_Window; + Lines : in 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 : in Window := Standard_Window); + -- AKA + -- ALIAS(`deleteln()') + pragma Inline (Delete_Line); + + -- ANCHOR(`winsertln()',`Insert_Line') + procedure Insert_Line (Win : in Window := Standard_Window); + -- AKA + -- ALIAS(`insertln()') + pragma Inline (Insert_Line); + + -- MANPAGE(`curs_getyx.3x') + + -- ANCHOR(`getmaxyx()',`Get_Size') + procedure Get_Size + (Win : in 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 : in 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 : in 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 : in 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 : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in Column_Position); + -- AKA + pragma Inline (Refresh); + + -- ANCHOR(`pnoutrefresh()',`Refresh_Without_Update') + procedure Refresh_Without_Update + (Pad : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in 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 : in Window; + Ch : in Attributed_Character); + -- AKA + + procedure Add_Character_To_Pad_And_Echo_It + (Pad : in Window; + Ch : in Character); + pragma Inline (Add_Character_To_Pad_And_Echo_It); + + -- MANPAGE(`curs_scroll.3x') + + -- ANCHOR(`wscrl()',`Scroll') + procedure Scroll (Win : in Window := Standard_Window; + Amount : in Integer := 1); + -- AKA + -- ALIAS(`scroll()') + -- ALIAS(`scrl()') + pragma Inline (Scroll); + + -- MANPAGE(`curs_delch.3x') + + -- ANCHOR(`wdelch()',`Delete_Character') + procedure Delete_Character (Win : in Window := Standard_Window); + -- AKA + -- ALIAS(`delch()') + + -- ANCHOR(`mvwdelch()',`Delete_Character') + procedure Delete_Character + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in 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 : in Window := Standard_Window; + Ch : in Attributed_Character); + -- AKA + -- ALIAS(`insch()') + + -- ANCHOR(`mvwinsch()',`Insert') + procedure Insert (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in Attributed_Character); + -- AKA + -- ALIAS(`mvinsch()') + + -- MANPAGE(`curs_insstr.3x') + + -- ANCHOR(`winsnstr()',`Insert') + procedure Insert (Win : in Window := Standard_Window; + Str : in String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`winsstr()') + -- ALIAS(`insnstr()') + -- ALIAS(`insstr()') + + -- ANCHOR(`mvwinsnstr()',`Insert') + procedure Insert (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`mvwinsstr()') + -- ALIAS(`mvinsnstr()') + -- ALIAS(`mvinsstr()') + pragma Inline (Insert); + + -- MANPAGE(`curs_instr.3x') + + -- ANCHOR(`winnstr()',`Peek') + procedure Peek (Win : in Window := Standard_Window; + Str : out String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`winstr()') + -- ALIAS(`innstr()') + -- ALIAS(`instr()') + + -- ANCHOR(`mvwinnstr()',`Peek') + procedure Peek (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`mvwinstr()') + -- ALIAS(`mvinnstr()') + -- ALIAS(`mvinstr()') + + -- MANPAGE(`curs_inchstr.3x') + + -- ANCHOR(`winchnstr()',`Peek') + procedure Peek (Win : in Window := Standard_Window; + Str : out Attributed_String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`winchstr()') + -- ALIAS(`inchnstr()') + -- ALIAS(`inchstr()') + + -- ANCHOR(`mvwinchnstr()',`Peek') + procedure Peek (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out Attributed_String; + Len : in 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 : in Window := Standard_Window; + Str : out String; + Len : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out String; + Len : in 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 : in 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 : in Label_Number; + Text : in String; + Fmt : in 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 : in Label_Number; + Text : out String); + -- AKA + + -- ANCHOR(`slk_label()',`Get_Soft_Label_Key') + function Get_Soft_Label_Key (Label : in 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 : in Character_Attribute_Set; + On : in 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 : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in 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 : in Special_Key_Code; + Enable : in Boolean := True); + -- AKA + pragma Inline (Enable_Key); + + -- MANPAGE(`define_key.3x') + + -- ANCHOR(`define_key()',`Define_Key') + procedure Define_Key (Definition : in String; + Key : in 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 : in Real_Key_Code; + Name : out String); + -- AKA + -- The external name for a real keystroke. + + -- ANCHOR(`keyname()',`Key_Name') + function Key_Name (Key : in Real_Key_Code) return String; + -- AKA + -- Same as function + -- We don't inline this routine + + -- ANCHOR(`unctrl()',`Un_Control') + procedure Un_Control (Ch : in Attributed_Character; + Str : out String); + -- AKA + + -- ANCHOR(`unctrl()',`Un_Control') + function Un_Control (Ch : in Attributed_Character) return String; + -- AKA + -- Same as function + pragma Inline (Un_Control); + + -- ANCHOR(`delay_output()',`Delay_Output') + procedure Delay_Output (Msecs : in 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 : in Redefinable_Color_Pair; + Fore : in Color_Number; + Back : in Color_Number); + -- AKA + pragma Inline (Init_Pair); + + -- ANCHOR(`pair_content()',`Pair_Content') + procedure Pair_Content (Pair : in 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 : in Color_Number; + Red : in RGB_Value; + Green : in RGB_Value; + Blue : in 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 : in 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 : in Curses_Mode); + -- AKA + -- ALIAS(`def_shell_mode()') + pragma Inline (Save_Curses_Mode); + + -- ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode') + procedure Reset_Curses_Mode (Mode : in 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 : in Integer; + Proc : in 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 : in Natural); + -- AKA + pragma Inline (Nap_Milli_Seconds); + + -- |===================================================================== + -- | Some useful helpers. + -- |===================================================================== + type Transform_Direction is (From_Screen, To_Screen); + procedure Transform_Coordinates + (W : in Window := Standard_Window; + Line : in out Line_Position; + Column : in out Column_Position; + Dir : in 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(`dft_fgbg.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_scr_dump.3x') + + -- ANCHOR(`scr_dump()',`Screen_Dump_To_File') + procedure Screen_Dump_To_File (Filename : in String); + -- AKA + + -- ANCHOR(`scr_restore()',`Screen_Restore_From_File') + procedure Screen_Restore_From_File (Filename : in String); + -- AKA + + -- ANCHOR(`scr_init()',`Screen_Init_From_File') + procedure Screen_Init_From_File (Filename : in String); + -- AKA + + -- ANCHOR(`scr_set()',`Screen_Set_File') + procedure Screen_Set_File (Filename : in 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/ncurses-5.3/Ada95/samples/Makefile.in b/ncurses-5.3/Ada95/samples/Makefile.in new file mode 100644 index 0000000..f751e89 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/Makefile.in @@ -0,0 +1,154 @@ +############################################################################## +# 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 +# Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +# +# Version Control +# $Revision$ +# +.SUFFIXES: + +SHELL = /bin/sh +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@) + +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 -L../../lib @TEST_ARGS@ $(LD_FLAGS) -lAdaCurses @EXTRA_LIBS@ + +PROGS = tour rain ncurses + +TOUR_OBJS = tour.o sample.o sample-curses_demo.o sample-explanation.o \ + sample-form_demo.o sample-function_key_setting.o \ + sample-header_handler.o sample-helpers.o \ + sample-keyboard_handler.o sample-manifest.o sample-menu_demo.o \ + sample-menu_demo-aux.o sample-text_io_demo.o \ + sample-curses_demo-attributes.o sample-curses_demo-mouse.o \ + sample-form_demo-aux.o sample-my_field_type.o + +RAIN_OBJS = rain.o status.o + +NCURSES_OBJS = ncurses.o ncurses2-getch_test.o \ + ncurses2-acs_and_scroll.o ncurses2-m.o \ + ncurses2-acs_display.o ncurses2-menu_test.o \ + ncurses2-attr_test.o ncurses2-overlap_test.o \ + ncurses2-color_edit.o ncurses2-slk_test.o \ + ncurses2-color_test.o ncurses2-test_sgr_attributes.o \ + ncurses2-demo_forms.o ncurses2-trace_set.o \ + ncurses2-demo_pad.o ncurses2-util.o \ + ncurses2-demo_panels.o ncurses2.o \ + ncurses2-flushinp_test.o + + +all :: tour$x rain$x ncurses$x + @ + +sources : + @ + +libs \ +install \ +install.libs :: + @ + +uninstall \ +uninstall.libs :: + @ + +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: + @ + +clean :: mostlyclean + rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \ + explain.msg trace screendump + +distclean :: clean + rm -f Makefile + +realclean :: distclean + @ + + diff --git a/ncurses-5.3/Ada95/samples/README b/ncurses-5.3/Ada95/samples/README new file mode 100644 index 0000000..6ea8a18 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/README @@ -0,0 +1,6 @@ +The intention of the demo at this point in time is not to demonstrate all +the features of (n)curses and it's 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/ncurses-5.3/Ada95/samples/explain.txt b/ncurses-5.3/Ada95/samples/explain.txt new file mode 100644 index 0000000..570f617 --- /dev/null +++ b/ncurses-5.3/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/ncurses-5.3/Ada95/samples/ncurses.adb b/ncurses-5.3/Ada95/samples/ncurses.adb new file mode 100644 index 0000000..4a9d20f --- /dev/null +++ b/ncurses-5.3/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$ +-- 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/ncurses-5.3/Ada95/samples/ncurses2-acs_and_scroll.adb b/ncurses-5.3/Ada95/samples/ncurses2-acs_and_scroll.adb new file mode 100644 index 0000000..7d6d198 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-acs_and_scroll.adb @@ -0,0 +1,722 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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; + + use Ada.Streams.Stream_IO; + + + -- 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 : Boolean := HaveKeyPad (curpw); + do_scroll : 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 : Line_Position := lri - uli + 1; + sj : 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 : 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 HaveScroll (current.wind) then + Scroll (current.wind, 1); + end if; + when Character'Pos ('B') mod 16#20# => -- Ctrl('B') + if current /= null and 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; + Set_Raw_Mode (SwitchOn => True); + Erase; + End_Windows; + +end ncurses2.acs_and_scroll; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-acs_and_scroll.ads b/ncurses-5.3/Ada95/samples/ncurses2-acs_and_scroll.ads new file mode 100644 index 0000000..45f3cdc --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.acs_and_scroll; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-acs_display.adb b/ncurses-5.3/Ada95/samples/ncurses2-acs_display.adb new file mode 100644 index 0000000..7e63b79 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-acs_display.adb @@ -0,0 +1,231 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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 : Boolean := (first = 128); + last : 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 : Line_Position := Line_Position (4 + ((code - first) mod 16)); + col : 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 : Line_Position := Line_Position (4 + (N mod height)); + col : 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)); + + 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/ncurses-5.3/Ada95/samples/ncurses2-acs_display.ads b/ncurses-5.3/Ada95/samples/ncurses2-acs_display.ads new file mode 100644 index 0000000..39d9a0d --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.acs_display; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-attr_test.adb b/ncurses-5.3/Ada95/samples/ncurses2-attr_test.adb new file mode 100644 index 0000000..d062572 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-attr_test.adb @@ -0,0 +1,367 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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 : 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 : + 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 : out Integer; fg, bg : in out Color_Number; + result : out Boolean) is + ch : Key_Code := Getchar; + nc : constant Color_Number := Color_Number (Number_Of_Colors); + curscr : Window; + pragma Import (C, curscr, "curscr"); + -- curscr is not implemented in the Ada binding + 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 (curscr); + 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 : 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/ncurses-5.3/Ada95/samples/ncurses2-attr_test.ads b/ncurses-5.3/Ada95/samples/ncurses2-attr_test.ads new file mode 100644 index 0000000..ef50564 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-attr_test.ads @@ -0,0 +1,42 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.attr_test; + diff --git a/ncurses-5.3/Ada95/samples/ncurses2-color_edit.adb b/ncurses-5.3/Ada95/samples/ncurses2-color_edit.adb new file mode 100644 index 0000000..567235c --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-color_edit.adb @@ -0,0 +1,264 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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; + last_c : Key_Code; +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); + + last_c := this_c; + 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/ncurses-5.3/Ada95/samples/ncurses2-color_edit.ads b/ncurses-5.3/Ada95/samples/ncurses2-color_edit.ads new file mode 100644 index 0000000..23c2b59 --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.color_edit; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-color_test.adb b/ncurses-5.3/Ada95/samples/ncurses2-color_test.adb new file mode 100644 index 0000000..0b69d8d --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-color_test.adb @@ -0,0 +1,164 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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/ncurses-5.3/Ada95/samples/ncurses2-color_test.ads b/ncurses-5.3/Ada95/samples/ncurses2-color_test.ads new file mode 100644 index 0000000..85e1e59 --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.color_test; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-demo_forms.adb b/ncurses-5.3/Ada95/samples/ncurses2-demo_forms.adb new file mode 100644 index 0000000..20fa1f3 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-demo_forms.adb @@ -0,0 +1,496 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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 : 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 : 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 : 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 : 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/ncurses-5.3/Ada95/samples/ncurses2-demo_forms.ads b/ncurses-5.3/Ada95/samples/ncurses2-demo_forms.ads new file mode 100644 index 0000000..1148169 --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.demo_forms; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-demo_pad.adb b/ncurses-5.3/Ada95/samples/ncurses2-demo_pad.adb new file mode 100644 index 0000000..3e37a2a --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-demo_pad.adb @@ -0,0 +1,671 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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 : 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))); + retval.seconds := Integer (t.tv_sec); + retval.microseconds := Integer (t.tv_usec); + 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 : 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 + tmp : Boolean; + begin + tmp := panner_legend (line); + 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 => + basey := pymax - porty; + if basey < 0 then -- basey := max(basey, 0); + basey := 0; + 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 : 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 : 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/ncurses-5.3/Ada95/samples/ncurses2-demo_pad.ads b/ncurses-5.3/Ada95/samples/ncurses2-demo_pad.ads new file mode 100644 index 0000000..09b8b8e --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.demo_pad; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-demo_panels.adb b/ncurses-5.3/Ada95/samples/ncurses2-demo_panels.adb new file mode 100644 index 0000000..f10d9a7 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-demo_panels.adb @@ -0,0 +1,379 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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 nap_msec = 1 then + Getchar; + else + Nap_Milli_Seconds (nap_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 : Window := Panel_Window (pan); + num : 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 - 2 loop + for x in 1 .. maxx - 2 loop + Move_Cursor (win, y, x); + Add (win, num); + end loop; + end loop; + end fill_panel; + + modstr : 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 : User_Data_Access := new User_Data'("p1"); + U2 : User_Data_Access := new User_Data'("p2"); + U3 : User_Data_Access := new User_Data'("p3"); + U4 : User_Data_Access := new User_Data'("p4"); + U5 : 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 : Window := Panel_Window (p4); + w5 : 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/ncurses-5.3/Ada95/samples/ncurses2-demo_panels.ads b/ncurses-5.3/Ada95/samples/ncurses2-demo_panels.ads new file mode 100644 index 0000000..55ebdbd --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.demo_panels (nap_mseci : Integer); diff --git a/ncurses-5.3/Ada95/samples/ncurses2-flushinp_test.adb b/ncurses-5.3/Ada95/samples/ncurses2-flushinp_test.adb new file mode 100644 index 0000000..7257bec --- /dev/null +++ b/ncurses-5.3/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$ +-- 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/ncurses-5.3/Ada95/samples/ncurses2-flushinp_test.ads b/ncurses-5.3/Ada95/samples/ncurses2-flushinp_test.ads new file mode 100644 index 0000000..87efd47 --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; + +procedure ncurses2.flushinp_test (win : Terminal_Interface.Curses.Window); diff --git a/ncurses-5.3/Ada95/samples/ncurses2-genericputs.adb b/ncurses-5.3/Ada95/samples/ncurses2-genericputs.adb new file mode 100644 index 0000000..1921eed --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-genericputs.adb @@ -0,0 +1,126 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Text_IO; use Ada.Text_IO; +with Ada.Strings.Bounded; use Ada.Strings.Bounded; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +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 ncurses2.genericPuts is + + procedure myGet (Win : in Window := Standard_Window; + Str : out BS.Bounded_String; + Len : in Integer := -1) + is + use BS; + 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 : in 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 : in 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/ncurses-5.3/Ada95/samples/ncurses2-genericputs.ads b/ncurses-5.3/Ada95/samples/ncurses2-genericputs.ads new file mode 100644 index 0000000..55e7d02 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-genericputs.ads @@ -0,0 +1,73 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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 : in Terminal_Interface.Curses.Window + := Terminal_Interface.Curses.Standard_Window; + Str : out BS.Bounded_String; + Len : in Integer := -1); + + procedure myPut (Str : out BS.Bounded_String; + i : Integer; + Base : in 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 : in chars_ptr; Str : out BS.Bounded_String); +end ncurses2.genericPuts; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-getch.ads b/ncurses-5.3/Ada95/samples/ncurses2-getch.ads new file mode 100644 index 0000000..eb3ee66 --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure getch_test; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-getch_test.adb b/ncurses-5.3/Ada95/samples/ncurses2-getch_test.adb new file mode 100644 index 0000000..5ed79a9 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-getch_test.adb @@ -0,0 +1,251 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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 : 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 : 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; + + tmp2 := Start_Mouse (No_Events); + 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/ncurses-5.3/Ada95/samples/ncurses2-getch_test.ads b/ncurses-5.3/Ada95/samples/ncurses2-getch_test.ads new file mode 100644 index 0000000..29b8ff6 --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.getch_test; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-getopt.adb b/ncurses-5.3/Ada95/samples/ncurses2-getopt.adb new file mode 100644 index 0000000..306c44d --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-getopt.adb @@ -0,0 +1,168 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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 + + opterr : Character := Character'Val (1); + optopt : Character := '?'; + initialized : Boolean := False; + + 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 : 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); + optopt := 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); + optopt := c; + if optstring (1) = ':' 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/ncurses-5.3/Ada95/samples/ncurses2-getopt.ads b/ncurses-5.3/Ada95/samples/ncurses2-getopt.ads new file mode 100644 index 0000000..64a997d --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-getopt.ads @@ -0,0 +1,59 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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/ncurses-5.3/Ada95/samples/ncurses2-m.adb b/ncurses-5.3/Ada95/samples/ncurses2-m.adb new file mode 100644 index 0000000..5506f91 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-m.adb @@ -0,0 +1,460 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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.color_edit; +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. + type stringa is access String; + 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 Integer (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; + return 0; -- TODO ExitProgram(EXIT_SUCCESS); + end main; + +end ncurses2.m; + + + + + + + diff --git a/ncurses-5.3/Ada95/samples/ncurses2-m.ads b/ncurses-5.3/Ada95/samples/ncurses2-m.ads new file mode 100644 index 0000000..bf85383 --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package ncurses2.m is + function main return Integer; +end ncurses2.m; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-menu_test.adb b/ncurses-5.3/Ada95/samples/ncurses2-menu_test.adb new file mode 100644 index 0000000..18b38cc --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-menu_test.adb @@ -0,0 +1,165 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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 : 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); + + tmp := Start_Mouse (No_Events); +end ncurses2.menu_test; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-menu_test.ads b/ncurses-5.3/Ada95/samples/ncurses2-menu_test.ads new file mode 100644 index 0000000..86a7e10 --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.menu_test; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-overlap_test.adb b/ncurses-5.3/Ada95/samples/ncurses2-overlap_test.adb new file mode 100644 index 0000000..8ffeed6 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-overlap_test.adb @@ -0,0 +1,156 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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/ncurses-5.3/Ada95/samples/ncurses2-overlap_test.ads b/ncurses-5.3/Ada95/samples/ncurses2-overlap_test.ads new file mode 100644 index 0000000..499c98c --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.overlap_test; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-slk_test.adb b/ncurses-5.3/Ada95/samples/ncurses2-slk_test.adb new file mode 100644 index 0000000..483ea5b --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-slk_test.adb @@ -0,0 +1,171 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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 : in Window := Standard_Window; + Str : out Ada.Strings.Unbounded.Unbounded_String; + Len : in Integer := -1); + + procedure myGet (Win : in Window := Standard_Window; + Str : out Ada.Strings.Unbounded.Unbounded_String; + Len : in 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"); + + Txt : char_array (0 .. 10); + begin + Txt (0) := Interfaces.C.char'First; + if Wgetnstr (Win, Txt, 8) = 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/ncurses-5.3/Ada95/samples/ncurses2-slk_test.ads b/ncurses-5.3/Ada95/samples/ncurses2-slk_test.ads new file mode 100644 index 0000000..76d099f --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.slk_test; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-test_sgr_attributes.adb b/ncurses-5.3/Ada95/samples/ncurses2-test_sgr_attributes.adb new file mode 100644 index 0000000..44c07a7 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-test_sgr_attributes.adb @@ -0,0 +1,186 @@ +------------------------------------------------------------------------------ +-- -- +-- 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$ +-- 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/ncurses-5.3/Ada95/samples/ncurses2-test_sgr_attributes.ads b/ncurses-5.3/Ada95/samples/ncurses2-test_sgr_attributes.ads new file mode 100644 index 0000000..7e65327 --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.test_sgr_attributes; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-trace_set.adb b/ncurses-5.3/Ada95/samples/ncurses2-trace_set.adb new file mode 100644 index 0000000..339c140 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-trace_set.adb @@ -0,0 +1,481 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.trace_set -- +-- -- +-- 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$ +-- 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) 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) return Boolean is + i, p : Item; + changed : Boolean; + c, v : Key_Code; + begin + loop + changed := False; + 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 : 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; + 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; + + while run_trace_menu (m) loop + null; + 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/ncurses-5.3/Ada95/samples/ncurses2-trace_set.ads b/ncurses-5.3/Ada95/samples/ncurses2-trace_set.ads new file mode 100644 index 0000000..fd2b0ad --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.trace_set; diff --git a/ncurses-5.3/Ada95/samples/ncurses2-util.adb b/ncurses-5.3/Ada95/samples/ncurses2-util.adb new file mode 100644 index 0000000..d771782 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-util.adb @@ -0,0 +1,199 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.util -- +-- -- +-- 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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +with Ada.Text_IO; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +pragma Warnings (Off); +with Terminal_Interface.Curses.Aux; +pragma Warnings (On); + +with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; + +with Ada.Text_IO; use Ada.Text_IO; + +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 + x : Key_Code; + begin + x := Getchar (win); + 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/ncurses-5.3/Ada95/samples/ncurses2-util.ads b/ncurses-5.3/Ada95/samples/ncurses2-util.ads new file mode 100644 index 0000000..d9df609 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/ncurses2-util.ads @@ -0,0 +1,79 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.util -- +-- -- +-- 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$ +-- 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/ncurses-5.3/Ada95/samples/ncurses2.ads b/ncurses-5.3/Ada95/samples/ncurses2.ads new file mode 100644 index 0000000..8eb8aa4 --- /dev/null +++ b/ncurses-5.3/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$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +package ncurses2 is + pragma Pure (ncurses2); +end ncurses2; diff --git a/ncurses-5.3/Ada95/samples/rain.adb b/ncurses-5.3/Ada95/samples/rain.adb new file mode 100644 index 0000000..7e787e2 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/rain.adb @@ -0,0 +1,163 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Rain -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- -- +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; + + 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); + + 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; + while 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; + + Refresh; + Nap_Milli_Seconds (50); + end loop; + + Visibility := Normal; + Set_Cursor_Visibility (Visibility); + End_Windows; + +end Rain; diff --git a/ncurses-5.3/Ada95/samples/rain.ads b/ncurses-5.3/Ada95/samples/rain.ads new file mode 100644 index 0000000..f8b5c38 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/rain.ads @@ -0,0 +1,44 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- -- +procedure Rain; diff --git a/ncurses-5.3/Ada95/samples/sample-curses_demo-attributes.adb b/ncurses-5.3/Ada95/samples/sample-curses_demo-attributes.adb new file mode 100644 index 0000000..7043973 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-curses_demo-attributes.adb @@ -0,0 +1,123 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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/ncurses-5.3/Ada95/samples/sample-curses_demo-attributes.ads b/ncurses-5.3/Ada95/samples/sample-curses_demo-attributes.ads new file mode 100644 index 0000000..c0d1e15 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-curses_demo-attributes.ads @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Curses_Demo.Attributes is + + procedure Demo; + +end Sample.Curses_Demo.Attributes; diff --git a/ncurses-5.3/Ada95/samples/sample-curses_demo-mouse.adb b/ncurses-5.3/Ada95/samples/sample-curses_demo-mouse.adb new file mode 100644 index 0000000..a97c1ba --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-curses_demo-mouse.adb @@ -0,0 +1,221 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Curses_Demo.Mouse -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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, Integer (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 := (Integer (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, Integer (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/ncurses-5.3/Ada95/samples/sample-curses_demo-mouse.ads b/ncurses-5.3/Ada95/samples/sample-curses_demo-mouse.ads new file mode 100644 index 0000000..44f36b5 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-curses_demo-mouse.ads @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Curses_Demo.Mouse is + + procedure Demo; + +end Sample.Curses_Demo.Mouse; diff --git a/ncurses-5.3/Ada95/samples/sample-curses_demo.adb b/ncurses-5.3/Ada95/samples/sample-curses_demo.adb new file mode 100644 index 0000000..483c8da --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-curses_demo.adb @@ -0,0 +1,143 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Curses_Demo -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : 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/ncurses-5.3/Ada95/samples/sample-curses_demo.ads b/ncurses-5.3/Ada95/samples/sample-curses_demo.ads new file mode 100644 index 0000000..4ca976b --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-curses_demo.ads @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Curses_Demo is + + procedure Demo; + +end Sample.Curses_Demo; diff --git a/ncurses-5.3/Ada95/samples/sample-explanation.adb b/ncurses-5.3/Ada95/samples/sample-explanation.adb new file mode 100644 index 0000000..e24e8d5 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-explanation.adb @@ -0,0 +1,409 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Explanation -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : 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 : in String; + Win : in 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 : in String) + is + begin + Explain (Key, Null_Window); + end Explain; + + procedure Explain (Key : in String; + Win : in 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; + + 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 : in 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/ncurses-5.3/Ada95/samples/sample-explanation.ads b/ncurses-5.3/Ada95/samples/sample-explanation.ads new file mode 100644 index 0000000..b7866e3 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-explanation.ads @@ -0,0 +1,60 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Explanation -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in String); + -- Retrieve the text associated with this key and display it. + + procedure Explain_Context; + -- Explain the current context. + + procedure Notepad (Key : in 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/ncurses-5.3/Ada95/samples/sample-form_demo-aux.adb b/ncurses-5.3/Ada95/samples/sample-form_demo-aux.adb new file mode 100644 index 0000000..5455478 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-form_demo-aux.adb @@ -0,0 +1,260 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Form_Demo.Aux -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in 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 : in 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 : 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 : 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 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/ncurses-5.3/Ada95/samples/sample-form_demo-aux.ads b/ncurses-5.3/Ada95/samples/sample-form_demo-aux.ads new file mode 100644 index 0000000..636da60 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-form_demo-aux.ads @@ -0,0 +1,93 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Form_Demo.Aux -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in 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 : in 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/ncurses-5.3/Ada95/samples/sample-form_demo-handler.adb b/ncurses-5.3/Ada95/samples/sample-form_demo-handler.adb new file mode 100644 index 0000000..f2c27d6 --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in Form; + Title : in 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 : in Form; + Lin : in Line_Position; + Col : in Column_Position; + Title : in 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 : 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/ncurses-5.3/Ada95/samples/sample-form_demo-handler.ads b/ncurses-5.3/Ada95/samples/sample-form_demo-handler.ads new file mode 100644 index 0000000..9b66686 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-form_demo-handler.ads @@ -0,0 +1,65 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Form_Demo.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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in Form; + Lin : in Line_Position; + Col : in Column_Position; + Title : in String := ""); + -- Position the menu at the given point and drive it. + + procedure Drive_Me (F : in Form; + Title : in String := ""); + -- Center menu and drive it. + +end Sample.Form_Demo.Handler; diff --git a/ncurses-5.3/Ada95/samples/sample-form_demo.adb b/ncurses-5.3/Ada95/samples/sample-form_demo.adb new file mode 100644 index 0000000..684ce6b --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-form_demo.adb @@ -0,0 +1,135 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Form_Demo -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 Terminal_Interface.Curses.Forms.Form_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); + + package Frm_U is new + Terminal_Interface.Curses.Forms.Form_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 : 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/ncurses-5.3/Ada95/samples/sample-form_demo.ads b/ncurses-5.3/Ada95/samples/sample-form_demo.ads new file mode 100644 index 0000000..d9cc8bd --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-form_demo.ads @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Form_Demo is + + procedure Demo; + +end Sample.Form_Demo; diff --git a/ncurses-5.3/Ada95/samples/sample-function_key_setting.adb b/ncurses-5.3/Ada95/samples/sample-function_key_setting.adb new file mode 100644 index 0000000..42f0fbf --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in String; + Reset : in 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 : in 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/ncurses-5.3/Ada95/samples/sample-function_key_setting.ads b/ncurses-5.3/Ada95/samples/sample-function_key_setting.ads new file mode 100644 index 0000000..4858c4c --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-function_key_setting.ads @@ -0,0 +1,83 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Function_Key_Setting -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in String; + Reset : in 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 : in 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/ncurses-5.3/Ada95/samples/sample-header_handler.adb b/ncurses-5.3/Ada95/samples/sample-header_handler.adb new file mode 100644 index 0000000..d65e88c --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-header_handler.adb @@ -0,0 +1,181 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Header_Handler -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in 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 : in Integer); + + -- Emit a two digit number and ensure that a leading zero is generated if + -- necessary. + procedure N_Out (N : in 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 : in 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 : Time := Clock; + Sec : Integer := Integer (Seconds (Now)); + Hour : Integer := Sec / 3600; + Minute : Integer := (Sec - Hour * 3600) / 60; + Mon : Month_Number := Month (Now); + D : 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/ncurses-5.3/Ada95/samples/sample-header_handler.ads b/ncurses-5.3/Ada95/samples/sample-header_handler.ads new file mode 100644 index 0000000..ca2f2ab --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-header_handler.ads @@ -0,0 +1,54 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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/ncurses-5.3/Ada95/samples/sample-helpers.adb b/ncurses-5.3/Ada95/samples/sample-helpers.adb new file mode 100644 index 0000000..ee7b8bb --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-helpers.adb @@ -0,0 +1,70 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Helpers -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +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 : in Window; + Title : in 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/ncurses-5.3/Ada95/samples/sample-helpers.ads b/ncurses-5.3/Ada95/samples/sample-helpers.ads new file mode 100644 index 0000000..7b8a1e1 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-helpers.ads @@ -0,0 +1,55 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Helpers -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in Window; + Title : in String); + -- Put a title string into the first line of the window + + procedure Not_Implemented; + +end Sample.Helpers; diff --git a/ncurses-5.3/Ada95/samples/sample-keyboard_handler.adb b/ncurses-5.3/Ada95/samples/sample-keyboard_handler.adb new file mode 100644 index 0000000..66dec91 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-keyboard_handler.adb @@ -0,0 +1,192 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Keyboard_Handler -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 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/ncurses-5.3/Ada95/samples/sample-keyboard_handler.ads b/ncurses-5.3/Ada95/samples/sample-keyboard_handler.ads new file mode 100644 index 0000000..5021068 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-keyboard_handler.ads @@ -0,0 +1,56 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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/ncurses-5.3/Ada95/samples/sample-manifest.ads b/ncurses-5.3/Ada95/samples/sample-manifest.ads new file mode 100644 index 0000000..e50b2a8 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-manifest.ads @@ -0,0 +1,68 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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/ncurses-5.3/Ada95/samples/sample-menu_demo-aux.adb b/ncurses-5.3/Ada95/samples/sample-menu_demo-aux.adb new file mode 100644 index 0000000..6bec082 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-menu_demo-aux.adb @@ -0,0 +1,205 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Menu_Demo.Aux -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in 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 : in 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 : in 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 : in 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/ncurses-5.3/Ada95/samples/sample-menu_demo-aux.ads b/ncurses-5.3/Ada95/samples/sample-menu_demo-aux.ads new file mode 100644 index 0000000..8c6f57f --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-menu_demo-aux.ads @@ -0,0 +1,72 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Menu_Demo.Aux -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in 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 : in 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/ncurses-5.3/Ada95/samples/sample-menu_demo-handler.adb b/ncurses-5.3/Ada95/samples/sample-menu_demo-handler.adb new file mode 100644 index 0000000..fd241a1 --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in Menu; + Title : in 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 : in Menu; + Lin : in Line_Position; + Col : in Column_Position; + Title : in 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 : 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/ncurses-5.3/Ada95/samples/sample-menu_demo-handler.ads b/ncurses-5.3/Ada95/samples/sample-menu_demo-handler.ads new file mode 100644 index 0000000..bfb4995 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-menu_demo-handler.ads @@ -0,0 +1,65 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Menu_Demo.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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : in Menu; + Lin : in Line_Position; + Col : in Column_Position; + Title : in String := ""); + -- Position the menu at the given point and drive it. + + procedure Drive_Me (M : in Menu; + Title : in String := ""); + -- Center menu and drive it. + +end Sample.Menu_Demo.Handler; diff --git a/ncurses-5.3/Ada95/samples/sample-menu_demo.adb b/ncurses-5.3/Ada95/samples/sample-menu_demo.adb new file mode 100644 index 0000000..f70e9c7 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-menu_demo.adb @@ -0,0 +1,391 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Menu_Demo -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 + 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); + Flip_State := True; + + 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 : User_Data_Access := new User_Data'(4711); + U2 : User_Data_Access; + U3 : 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/ncurses-5.3/Ada95/samples/sample-menu_demo.ads b/ncurses-5.3/Ada95/samples/sample-menu_demo.ads new file mode 100644 index 0000000..fa12e6f --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-menu_demo.ads @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Menu_Demo is + + procedure Demo; + +end Sample.Menu_Demo; diff --git a/ncurses-5.3/Ada95/samples/sample-my_field_type.adb b/ncurses-5.3/Ada95/samples/sample-my_field_type.adb new file mode 100644 index 0000000..0251f7f --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-my_field_type.adb @@ -0,0 +1,66 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.My_Field_Type -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; + +-- 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 no field validity checks. + function Field_Check (Fld : Field; + Typ : My_Data) return Boolean + is + begin + 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/ncurses-5.3/Ada95/samples/sample-my_field_type.ads b/ncurses-5.3/Ada95/samples/sample-my_field_type.ads new file mode 100644 index 0000000..aca5442 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-my_field_type.ads @@ -0,0 +1,63 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.My_Field_Type -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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/ncurses-5.3/Ada95/samples/sample-text_io_demo.adb b/ncurses-5.3/Ada95/samples/sample-text_io_demo.adb new file mode 100644 index 0000000..5c6fbc7 --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 : Complex := (0.0, 1.0); + Fx : Fix := 3.14; + Dc : 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/ncurses-5.3/Ada95/samples/sample-text_io_demo.ads b/ncurses-5.3/Ada95/samples/sample-text_io_demo.ads new file mode 100644 index 0000000..fa303cd --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample-text_io_demo.ads @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Text_IO_Demo is + + procedure Demo; + +end Sample.Text_IO_Demo; diff --git a/ncurses-5.3/Ada95/samples/sample.adb b/ncurses-5.3/Ada95/samples/sample.adb new file mode 100644 index 0000000..1df4562 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample.adb @@ -0,0 +1,219 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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 in 1 .. 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 in 1 .. 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 + Clear_Soft_Label_Keys; Restore_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; + + 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/ncurses-5.3/Ada95/samples/sample.ads b/ncurses-5.3/Ada95/samples/sample.ads new file mode 100644 index 0000000..8789c19 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/sample.ads @@ -0,0 +1,44 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample is + procedure Whow; +end Sample; diff --git a/ncurses-5.3/Ada95/samples/status.adb b/ncurses-5.3/Ada95/samples/status.adb new file mode 100644 index 0000000..0a45166 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/status.adb @@ -0,0 +1,58 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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/ncurses-5.3/Ada95/samples/status.ads b/ncurses-5.3/Ada95/samples/status.ads new file mode 100644 index 0000000..706e06d --- /dev/null +++ b/ncurses-5.3/Ada95/samples/status.ads @@ -0,0 +1,61 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- 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/ncurses-5.3/Ada95/samples/tour.adb b/ncurses-5.3/Ada95/samples/tour.adb new file mode 100644 index 0000000..4477ee5 --- /dev/null +++ b/ncurses-5.3/Ada95/samples/tour.adb @@ -0,0 +1,47 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Sample; use Sample; + +procedure Tour is +begin + Whow; +end Tour; diff --git a/ncurses-5.3/Ada95/samples/tour.ads b/ncurses-5.3/Ada95/samples/tour.ads new file mode 100644 index 0000000..5e84c5f --- /dev/null +++ b/ncurses-5.3/Ada95/samples/tour.ads @@ -0,0 +1,42 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure Tour; diff --git a/ncurses-5.3/Ada95/src/Makefile.in b/ncurses-5.3/Ada95/src/Makefile.in new file mode 100644 index 0000000..4667808 --- /dev/null +++ b/ncurses-5.3/Ada95/src/Makefile.in @@ -0,0 +1,390 @@ +############################################################################## +# 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 +# Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +# +# Version Control +# $Revision$ +# +.SUFFIXES: + +SHELL = /bin/sh +THIS = Makefile + +MODEL = ../../@DFT_OBJ_SUBDIR@ +DESTDIR = @DESTDIR@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +ADA_INCLUDE = @ADA_INCLUDE@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +AR = @AR@ +AR_OPTS = @AR_OPTS@ +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) + +ADAMAKE = @cf_ada_make@ +ADAMAKEFLAGS = + +CARGS = -cargs $(ADAFLAGS) +LARGS = + +ALIB = @cf_ada_package@ +ABASE = $(ALIB)-curses + +LIBALIS=$(ALIB).ali \ + $(ABASE)-aux.ali \ + $(ABASE).ali \ + $(ABASE)-terminfo.ali \ + $(ABASE)-termcap.ali \ + $(ABASE)-putwin.ali \ + $(ABASE)-trace.ali \ + $(ABASE)-mouse.ali \ + $(ABASE)-panels.ali \ + $(ABASE)-menus.ali \ + $(ABASE)-forms.ali \ + $(ABASE)-forms-field_types.ali \ + $(ABASE)-forms-field_types-alpha.ali \ + $(ABASE)-forms-field_types-alphanumeric.ali \ + $(ABASE)-forms-field_types-intfield.ali \ + $(ABASE)-forms-field_types-numeric.ali \ + $(ABASE)-forms-field_types-regexp.ali \ + $(ABASE)-forms-field_types-enumeration.ali \ + $(ABASE)-forms-field_types-ipv4_address.ali \ + $(ABASE)-forms-field_types-user.ali \ + $(ABASE)-forms-field_types-user-choice.ali \ + $(ABASE)-text_io.ali \ + $(ABASE)-text_io-aux.ali + +# Ada Library files for generic packages. Since gnat 3.10 they are +# also compiled +GENALIS=$(ABASE)-menus-menu_user_data.ali \ + $(ABASE)-menus-item_user_data.ali \ + $(ABASE)-forms-form_user_data.ali \ + $(ABASE)-forms-field_user_data.ali \ + $(ABASE)-forms-field_types-enumeration-ada.ali \ + $(ABASE)-panels-user_data.ali \ + $(ABASE)-text_io-integer_io.ali \ + $(ABASE)-text_io-float_io.ali \ + $(ABASE)-text_io-fixed_io.ali \ + $(ABASE)-text_io-decimal_io.ali \ + $(ABASE)-text_io-enumeration_io.ali \ + $(ABASE)-text_io-modular_io.ali \ + $(ABASE)-text_io-complex_io.ali + +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 :: libAdaCurses.a + @echo done + +libAdaCurses.a :: dotouch $(LIBOBJS) @cf_generic_objects@ + $(AR) $(AR_OPTS) $@ $(LIBOBJS) @cf_generic_objects@ + +dotouch : + @sh -c 'for f in $(LIBALIS) $(GENALIS); do test -f $$f || touch $$f; done' + +sources : + @ + +libs \ +install \ +install.libs \ +uninstall \ +uninstall.libs :: + @ + +generics: $(GENALIS) + @ + +mostlyclean :: + rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a + +clean :: mostlyclean + rm -f $(LIBALIS) $(GENALIS) $(LIBOBJS) $(GENOBJS) $(ABASE)-trace.adb + +distclean :: clean + rm -f Makefile + +realclean :: distclean + +BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(srcdir)/$(ABASE).adb + +$(ALIB).o: $(srcdir)/$(ALIB).ads + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ALIB).ads + + +$(ABASE)-aux.o: $(srcdir)/$(ABASE)-aux.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-aux.adb + + +$(ABASE).o: $(srcdir)/$(ABASE).adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE).adb + + +$(ABASE)-terminfo.o: \ + $(ABASE)-terminfo.ads \ + $(srcdir)/$(ABASE)-terminfo.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-terminfo.adb + + +$(ABASE)-termcap.o: \ + $(ABASE)-termcap.ads \ + $(srcdir)/$(ABASE)-termcap.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-termcap.adb + + +$(ABASE)-putwin.o: \ + $(ABASE)-putwin.ads \ + $(srcdir)/$(ABASE)-putwin.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-putwin.adb + + +$(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p + rm -f $@ + $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ $(srcdir)/$(ABASE)-trace.adb_p $@ + +$(ABASE)-trace.o: \ + $(ABASE)-trace.ads \ + $(ABASE)-trace.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(ABASE)-trace.adb + + +$(ABASE)-mouse.o: \ + $(ABASE)-mouse.ads \ + $(srcdir)/$(ABASE)-mouse.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-mouse.adb + + +$(ABASE)-panels.o: \ + $(ABASE)-panels.ads \ + $(srcdir)/$(ABASE)-panels.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-panels.adb + + +$(ABASE)-menus.o: \ + $(ABASE)-menus.ads \ + $(srcdir)/$(ABASE)-menus.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus.adb + + +$(ABASE)-forms.o: \ + $(ABASE)-forms.ads \ + $(srcdir)/$(ABASE)-forms.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms.adb + +$(ABASE)-forms-field_types.o: \ + $(ABASE)-forms-field_types.ads \ + $(srcdir)/$(ABASE)-forms-field_types.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types.adb + +$(ABASE)-forms-field_types-alpha.o: \ + $(srcdir)/$(ABASE)-forms-field_types-alpha.ads \ + $(srcdir)/$(ABASE)-forms-field_types-alpha.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-alpha.adb + +$(ABASE)-forms-field_types-alphanumeric.o: \ + $(srcdir)/$(ABASE)-forms-field_types-alphanumeric.ads \ + $(srcdir)/$(ABASE)-forms-field_types-alphanumeric.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-alphanumeric.adb + +$(ABASE)-forms-field_types-intfield.o: \ + $(srcdir)/$(ABASE)-forms-field_types-intfield.ads \ + $(srcdir)/$(ABASE)-forms-field_types-intfield.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-intfield.adb + +$(ABASE)-forms-field_types-numeric.o: \ + $(srcdir)/$(ABASE)-forms-field_types-numeric.ads \ + $(srcdir)/$(ABASE)-forms-field_types-numeric.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-numeric.adb + +$(ABASE)-forms-field_types-regexp.o: \ + $(srcdir)/$(ABASE)-forms-field_types-regexp.ads \ + $(srcdir)/$(ABASE)-forms-field_types-regexp.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-regexp.adb + +$(ABASE)-forms-field_types-enumeration.o: \ + $(srcdir)/$(ABASE)-forms-field_types-enumeration.ads \ + $(srcdir)/$(ABASE)-forms-field_types-enumeration.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-enumeration.adb + +$(ABASE)-forms-field_types-ipv4_address.o: \ + $(srcdir)/$(ABASE)-forms-field_types-ipv4_address.ads \ + $(srcdir)/$(ABASE)-forms-field_types-ipv4_address.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-ipv4_address.adb + +$(ABASE)-forms-field_types-user.o: \ + $(srcdir)/$(ABASE)-forms-field_types-user.ads \ + $(srcdir)/$(ABASE)-forms-field_types-user.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-user.adb + +$(ABASE)-forms-field_types-user-choice.o: \ + $(srcdir)/$(ABASE)-forms-field_types-user-choice.ads \ + $(srcdir)/$(ABASE)-forms-field_types-user-choice.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-user-choice.adb + +$(ABASE)-text_io.o: \ + $(srcdir)/$(ABASE)-text_io.ads \ + $(srcdir)/$(ABASE)-text_io.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io.adb + +$(ABASE)-text_io-aux.o: \ + $(srcdir)/$(ABASE)-text_io-aux.ads \ + $(srcdir)/$(ABASE)-text_io-aux.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-aux.adb + +$(ABASE)-menus-menu_user_data.o: \ + $(ABASE)-menus-menu_user_data.ads \ + $(srcdir)/$(ABASE)-menus-menu_user_data.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus-menu_user_data.adb + +$(ABASE)-menus-item_user_data.o: \ + $(ABASE)-menus-item_user_data.ads \ + $(srcdir)/$(ABASE)-menus-item_user_data.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus-item_user_data.adb + +$(ABASE)-forms-form_user_data.o: \ + $(ABASE)-forms-form_user_data.ads \ + $(srcdir)/$(ABASE)-forms-form_user_data.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-form_user_data.adb + +$(ABASE)-forms-field_user_data.o: \ + $(ABASE)-forms-field_user_data.ads \ + $(srcdir)/$(ABASE)-forms-field_user_data.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_user_data.adb + +$(ABASE)-forms-field_types-enumeration-ada.o: \ + $(srcdir)/$(ABASE)-forms-field_types-enumeration-ada.ads \ + $(srcdir)/$(ABASE)-forms-field_types-enumeration-ada.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-enumeration-ada.adb + +$(ABASE)-panels-user_data.o: \ + $(ABASE)-panels-user_data.ads \ + $(srcdir)/$(ABASE)-panels-user_data.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-panels-user_data.adb + +$(ABASE)-text_io-integer_io.o: \ + $(srcdir)/$(ABASE)-text_io-integer_io.ads \ + $(srcdir)/$(ABASE)-text_io-integer_io.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-integer_io.adb + +$(ABASE)-text_io-float_io.o: \ + $(srcdir)/$(ABASE)-text_io-float_io.ads \ + $(srcdir)/$(ABASE)-text_io-float_io.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-float_io.adb + +$(ABASE)-text_io-fixed_io.o: \ + $(srcdir)/$(ABASE)-text_io-fixed_io.ads \ + $(srcdir)/$(ABASE)-text_io-fixed_io.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-fixed_io.adb + +$(ABASE)-text_io-decimal_io.o: \ + $(srcdir)/$(ABASE)-text_io-decimal_io.ads \ + $(srcdir)/$(ABASE)-text_io-decimal_io.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-decimal_io.adb + +$(ABASE)-text_io-enumeration_io.o: \ + $(srcdir)/$(ABASE)-text_io-enumeration_io.ads \ + $(srcdir)/$(ABASE)-text_io-enumeration_io.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-enumeration_io.adb + +$(ABASE)-text_io-modular_io.o: \ + $(srcdir)/$(ABASE)-text_io-modular_io.ads \ + $(srcdir)/$(ABASE)-text_io-modular_io.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-modular_io.adb + +$(ABASE)-text_io-complex_io.o: \ + $(srcdir)/$(ABASE)-text_io-complex_io.ads \ + $(srcdir)/$(ABASE)-text_io-complex_io.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-complex_io.adb diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-aux.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-aux.adb new file mode 100644 index 0000000..e25e9b0 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-aux.adb @@ -0,0 +1,117 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Aux -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package body Terminal_Interface.Curses.Aux is + -- + -- Some helpers + procedure Fill_String (Cp : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb new file mode 100644 index 0000000..6e6b335 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb @@ -0,0 +1,69 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Alpha -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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.Alpha is + + use type Interfaces.C.int; + + procedure Set_Field_Type (Fld : in Field; + Typ : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads new file mode 100644 index 0000000..73e73bd --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads @@ -0,0 +1,54 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Alpha -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Typ : in Alpha_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.Alpha; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb new file mode 100644 index 0000000..f2e15ef --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb @@ -0,0 +1,69 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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.AlphaNumeric is + + use type Interfaces.C.int; + + procedure Set_Field_Type (Fld : in Field; + Typ : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads new file mode 100644 index 0000000..fb46701 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads @@ -0,0 +1,55 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Typ : in AlphaNumeric_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb new file mode 100644 index 0000000..275c1dc --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 (T (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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads new file mode 100644 index 0000000..3a8b59a --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads @@ -0,0 +1,60 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb new file mode 100644 index 0000000..a04a150 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb @@ -0,0 +1,120 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Typ : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads new file mode 100644 index 0000000..91955f5 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads @@ -0,0 +1,99 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Typ : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb new file mode 100644 index 0000000..7a29821 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb @@ -0,0 +1,73 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.IntField -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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.IntField is + + use type Interfaces.C.int; + + procedure Set_Field_Type (Fld : in Field; + Typ : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads new file mode 100644 index 0000000..d473854 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads @@ -0,0 +1,56 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.IntField -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Typ : in Integer_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.IntField; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb new file mode 100644 index 0000000..889a08d --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb @@ -0,0 +1,69 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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.IPV4_Address is + + use type Interfaces.C.int; + + procedure Set_Field_Type (Fld : in Field; + Typ : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads new file mode 100644 index 0000000..d2db1a3 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads @@ -0,0 +1,52 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Typ : in Internet_V4_Address_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb new file mode 100644 index 0000000..3ad26ab --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb @@ -0,0 +1,75 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Numeric -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 + + use type Interfaces.C.int; + + procedure Set_Field_Type (Fld : in Field; + Typ : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads new file mode 100644 index 0000000..3385864 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads @@ -0,0 +1,56 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Numeric -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Typ : in Numeric_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.Numeric; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb new file mode 100644 index 0000000..48725f5 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb @@ -0,0 +1,72 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.RegExp -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Typ : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads new file mode 100644 index 0000000..6201807 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads @@ -0,0 +1,56 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.RegExp -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Typ : in Regular_Expression_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.RegExp; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb new file mode 100644 index 0000000..129ea2d --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb @@ -0,0 +1,111 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.User.Choice -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Unchecked_Conversion; +with Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is + + use type Interfaces.C.int; + + function To_Argument_Access is new Ada.Unchecked_Conversion + (System.Address, Argument_Access); + + function Generic_Next (Fld : Field; + Usr : System.Address) return C_Int + is + Result : Boolean; + Udf : 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 : 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads new file mode 100644 index 0000000..4df1954 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads @@ -0,0 +1,97 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.User.Choice -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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); + + use type Interfaces.C.int; + 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 + use type Interfaces.C.int; + + 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user.adb new file mode 100644 index 0000000..9d9285d --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Unchecked_Conversion; +with Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.User is + + use type Interfaces.C.int; + + procedure Set_Field_Type (Fld : in Field; + Typ : in 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 : 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; + + function To_Argument_Access is new Ada.Unchecked_Conversion + (System.Address, Argument_Access); + + function Generic_Field_Check (Fld : Field; + Usr : System.Address) return C_Int + is + Result : Boolean; + Udf : 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 : 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user.ads new file mode 100644 index 0000000..9e625fc --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types-user.ads @@ -0,0 +1,98 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.User -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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); + use type Interfaces.C.int; + 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 : in Field; + Typ : in 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 + use type Interfaces.C.int; + + 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types.adb new file mode 100644 index 0000000..69c9c98 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_types.adb @@ -0,0 +1,297 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Interfaces.C; +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 Interfaces.C.int; + use type System.Address; + + function To_Argument_Access is new Ada.Unchecked_Conversion + (System.Address, Argument_Access); + + 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 : in 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 : in 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 : 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_user_data.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_user_data.adb new file mode 100644 index 0000000..91046a7 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-field_user_data.adb @@ -0,0 +1,86 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_User_Data -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Field; + Data : in 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 : in 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 : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-form_user_data.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-form_user_data.adb new file mode 100644 index 0000000..2910d24 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms-form_user_data.adb @@ -0,0 +1,87 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Form_User_Data -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Form; + Data : in 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 : in 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 : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-forms.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-forms.adb new file mode 100644 index 0000000..f65984c --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in 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 : in Field; + Just : in 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 : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; + Str : in 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 : in Field; + Buffer : in 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 : in Field; + Buffer : in 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 : in Field; + Status : in 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 : in Field; + Max : in 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 : in Field; + Options : in 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 : 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 : in Field; + Options : in 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 : 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 : in Field; + Options : out Field_Option_Set) + is + function Field_Opts (Fld : Field) return C_Int; + pragma Import (C, Field_Opts, "field_opts"); + + Res : 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 : in Field; + Fore : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in 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 : in 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 : in Field; + Back : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in 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 : in 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 : in Field; + Pad : in 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 : in 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 : in 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 : in 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 : in Form; + Win : in 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 : in Form; + Win : in 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 : in 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 : in Form; + Proc : in 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 : in Form; + Proc : in 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 : in Form; + Proc : in 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 : in Form; + Proc : in 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 : in Form; + Flds : in 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 not in 1 .. 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 : in Field; + Line : in Line_Position; + Column : in 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 : in Form; + Options : in 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 : 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 : in Form; + Options : in 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 : 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 : in Form; + Options : out Form_Option_Set) + is + function Form_Opts (Frm : Form) return C_Int; + pragma Import (C, Form_Opts, "form_opts"); + + Res : 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 : in Form; + Post : in 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 : 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 : in Form; + Fld : in 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 : in 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 : in Form; + Page : in 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 : in Field; + New_Page : in 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 : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-menus-item_user_data.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-menus-item_user_data.adb new file mode 100644 index 0000000..f5d0bc6 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-menus-item_user_data.adb @@ -0,0 +1,78 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus.Item_User_Data -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Item; + Data : in 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 : in 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 : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb new file mode 100644 index 0000000..2405baa --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb @@ -0,0 +1,77 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus.Menu_User_Data -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Menu; + Data : in 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 : in 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 : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-menus.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-menus.adb new file mode 100644 index 0000000..8d854c1 --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in 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 : Name_String_Ptr := new Name_String; + Desc_Str : 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 : in Item; + Value : in 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 : in Item; + Options : in 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 : 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 : in Item; + Options : in 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 : 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 : in Item; + Options : out Item_Option_Set) + is + function Item_Opts (Itm : Item) return C_Int; + pragma Import (C, Item_Opts, "item_opts"); + + Res : 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 : in 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 : in 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 : in 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 : in 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 : in Menu; + Itm : in 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 : in Menu; + Line : in 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 : in Menu; + Post : in 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 : in Menu; + Options : in 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 : 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 : in Menu; + Options : in Menu_Option_Set; + On : in 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 : 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 : in Menu; + Options : out Menu_Option_Set) + is + function Menu_Opts (Men : Menu) return C_Int; + pragma Import (C, Menu_Opts, "menu_opts"); + + Res : 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 : in Menu; + Win : in 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 : in Menu; + Win : in 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 : in 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 : in Menu; + Mark : in 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 : in 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 : in Menu; + Fore : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in 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 : in 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 : in Menu; + Back : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in 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 : in 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 : in Menu; + Grey : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in 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 : in 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 : in Menu; + Pad : in 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 : in 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 : in Menu; + Descr : in Column_Position := 0; + Row : in Line_Position := 0; + Col : in 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 : in 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 : in 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 : in Menu; + Lines : in Line_Count; + Columns : in 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 : in 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 : in Menu; + Proc : in 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 : in Menu; + Proc : in 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 : in Menu; + Proc : in 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 : in Menu; + Proc : in 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 : in Menu; + Items : in 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 not in 1 .. 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 : 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 : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-mouse.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-mouse.adb new file mode 100644 index 0000000..29275cb --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-mouse.adb @@ -0,0 +1,215 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Mouse -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with System; + +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; + use type Interfaces.C.int; + + function Has_Mouse return Boolean + is + function Mouse_Avail return C_Int; + pragma Import (C, Mouse_Avail, "_nc_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 : in Mouse_Button; + State : in 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 : in Mouse_Button; + State : in 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); + return Old; + end Start_Mouse; + + procedure End_Mouse (Mask : in Event_Mask := No_Events) + is + begin + null; + end End_Mouse; + + procedure Dispatch_Event (Mask : in Event_Mask; + Button : out Mouse_Button; + State : out Button_State); + + procedure Dispatch_Event (Mask : in 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 : in 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 : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-panels-user_data.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-panels-user_data.adb new file mode 100644 index 0000000..14871c0 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-panels-user_data.adb @@ -0,0 +1,79 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Panels.User_Data -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Panel; + Data : in 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 : in 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 : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-panels.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-panels.adb new file mode 100644 index 0000000..03e298c --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in 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 : in 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 : in 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 : in 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 : Window := Panel_Win (Pan); + begin + if Win = Null_Window then + raise Panel_Exception; + end if; + return Win; + end Get_Window; + + procedure Replace (Pan : in Panel; + Win : in 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 : in Panel; + Line : in Line_Position; + Column : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-putwin.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-putwin.adb new file mode 100644 index 0000000..22e0ff4 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-putwin.adb @@ -0,0 +1,78 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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/ncurses-5.3/Ada95/src/terminal_interface-curses-putwin.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-putwin.ads new file mode 100644 index 0000000..8ffee2d --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-putwin.ads @@ -0,0 +1,51 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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/ncurses-5.3/Ada95/src/terminal_interface-curses-termcap.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-termcap.adb new file mode 100644 index 0000000..be845d5 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-termcap.adb @@ -0,0 +1,164 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Termcap -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : 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 : in 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 : t := (0 => 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 : t := (0 => 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/ncurses-5.3/Ada95/src/terminal_interface-curses-termcap.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-termcap.ads new file mode 100644 index 0000000..341e581 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-termcap.ads @@ -0,0 +1,81 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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/ncurses-5.3/Ada95/src/terminal_interface-curses-terminfo.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-terminfo.adb new file mode 100644 index 0000000..004e387 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-terminfo.adb @@ -0,0 +1,162 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Terminfo -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in chars_ptr) return Boolean; + + function Is_MinusOne_Pointer (P : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-terminfo.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-terminfo.ads new file mode 100644 index 0000000..3fe5a7a --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-terminfo.ads @@ -0,0 +1,82 @@ +------------------------------------------------------------------------------ +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-aux.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-aux.adb new file mode 100644 index 0000000..eddbc31 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-aux.adb @@ -0,0 +1,129 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Aux -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package body Terminal_Interface.Curses.Text_IO.Aux is + + procedure Put_Buf + (Win : in Window; + Buf : in String; + Width : in Field; + Signal : in Boolean := True; + Ljust : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-aux.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-aux.ads new file mode 100644 index 0000000..eaf589e --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-aux.ads @@ -0,0 +1,56 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Aux -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; -- The output window + Buf : in String; -- The buffer containing the text + Width : in Field; -- The width of the output field + Signal : in Boolean := True; -- If true, we raise Layout_Error + Ljust : in Boolean := False); -- The Buf is left justified + +end Terminal_Interface.Curses.Text_IO.Aux; + diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-complex_io.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-complex_io.adb new file mode 100644 index 0000000..f418c90 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-complex_io.adb @@ -0,0 +1,74 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Complex_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Complex; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in 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 : in Complex; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-complex_io.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-complex_io.ads new file mode 100644 index 0000000..8ef99d5 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-complex_io.ads @@ -0,0 +1,71 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Complex_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Complex; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + + procedure Put + (Item : in Complex; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Complex_IO; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb new file mode 100644 index 0000000..6c3dee5 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb @@ -0,0 +1,76 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Decimal_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in 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 : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads new file mode 100644 index 0000000..469da7c --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads @@ -0,0 +1,67 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Decimal_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + + procedure Put + (Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Decimal_IO; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb new file mode 100644 index 0000000..026b288 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb @@ -0,0 +1,81 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Enum; + Width : in Field := Default_Width; + Set : in 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 : in Enum; + Width : in Field := Default_Width; + Set : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads new file mode 100644 index 0000000..31829d3 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads @@ -0,0 +1,64 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Enum; + Width : in Field := Default_Width; + Set : in Type_Set := Default_Setting); + + procedure Put + (Item : in Enum; + Width : in Field := Default_Width; + Set : in Type_Set := Default_Setting); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Enumeration_IO; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb new file mode 100644 index 0000000..e9ed86d --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb @@ -0,0 +1,76 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Fixed_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in 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 : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads new file mode 100644 index 0000000..b73b8e6 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads @@ -0,0 +1,67 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Fixed_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + + procedure Put + (Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Fixed_IO; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-float_io.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-float_io.adb new file mode 100644 index 0000000..67c1281 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-float_io.adb @@ -0,0 +1,77 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Float_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in 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 : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-float_io.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-float_io.ads new file mode 100644 index 0000000..b98cf36 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-float_io.ads @@ -0,0 +1,67 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Float_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + + procedure Put + (Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Float_IO; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-integer_io.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-integer_io.adb new file mode 100644 index 0000000..c9e7f27 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-integer_io.adb @@ -0,0 +1,71 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Integer_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Num; + Width : in Field := Default_Width; + Base : in 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 : in Num; + Width : in Field := Default_Width; + Base : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-integer_io.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-integer_io.ads new file mode 100644 index 0000000..b7b1932 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-integer_io.ads @@ -0,0 +1,64 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Integer_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base); + + procedure Put + (Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Integer_IO; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-modular_io.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-modular_io.adb new file mode 100644 index 0000000..48a83a8 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-modular_io.adb @@ -0,0 +1,71 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Modular_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Num; + Width : in Field := Default_Width; + Base : in 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 : in Num; + Width : in Field := Default_Width; + Base : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-modular_io.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-modular_io.ads new file mode 100644 index 0000000..a9264a8 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io-modular_io.ads @@ -0,0 +1,64 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Modular_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window; + Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base); + + procedure Put + (Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Modular_IO; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io.adb new file mode 100644 index 0000000..64ac2b6 --- /dev/null +++ b/ncurses-5.3/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 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package body Terminal_Interface.Curses.Text_IO is + + Default_Window : Window := Null_Window; + + procedure Set_Window (Win : in 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 : in 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 : in 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 : in 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 : in Window; Spacing : in Positive_Count := 1) + is + P_Size : constant Count := Page_Length (Win); + begin + if Spacing not in Positive_Count 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 : in Positive_Count := 1) + is + begin + New_Line (Get_Window, Spacing); + end New_Line; + + procedure New_Page (Win : in Window) + is + begin + Clear (Win); + end New_Page; + + procedure New_Page + is + begin + New_Page (Get_Window); + end New_Page; + + procedure Set_Col (Win : in Window; To : in Positive_Count) + is + Y : Line_Position; + X1 : Column_Position; + X2 : Column_Position; + N : Natural; + begin + if To not in Positive_Count 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 : in Positive_Count) + is + begin + Set_Col (Get_Window, To); + end Set_Col; + + procedure Set_Line (Win : in Window; To : in Positive_Count) + is + Y1 : Line_Position; + Y2 : Line_Position; + X : Column_Position; + N : Natural; + begin + if To not in Positive_Count 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 : in Positive_Count) + is + begin + Set_Line (Get_Window, To); + end Set_Line; + + function Col (Win : in 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 : in 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 : in Window; Item : in 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 : in Character) + is + begin + Put (Get_Window, Item); + end Put; + + -------------------- + -- Strings-Output -- + -------------------- + + procedure Put (Win : in Window; Item : in 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 : in String) + is + begin + Put (Get_Window, Item); + end Put; + + procedure Put_Line + (Win : in Window; + Item : in String) + is + begin + Put (Win, Item); + New_Line (Win, 1); + end Put_Line; + + procedure Put_Line + (Item : in String) + is + begin + Put_Line (Get_Window, Item); + end Put_Line; + +end Terminal_Interface.Curses.Text_IO; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io.ads b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io.ads new file mode 100644 index 0000000..ef170b0 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-text_io.ads @@ -0,0 +1,137 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 : in Window); + -- Set Win as the default window + + function Get_Window return Window; + -- Get the current default window + + procedure Flush (Win : in 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 : in Window) return Count; + function Line_Length return Count; + + function Page_Length (Win : in Window) return Count; + function Page_Length return Count; + + ------------------------------------ + -- Column, Line, and Page Control -- + ------------------------------------ + procedure New_Line (Win : in Window; Spacing : in Positive_Count := 1); + procedure New_Line (Spacing : in Positive_Count := 1); + + procedure New_Page (Win : in Window); + procedure New_Page; + + procedure Set_Col (Win : in Window; To : in Positive_Count); + procedure Set_Col (To : in Positive_Count); + + procedure Set_Line (Win : in Window; To : in Positive_Count); + procedure Set_Line (To : in Positive_Count); + + function Col (Win : in Window) return Positive_Count; + function Col return Positive_Count; + + function Line (Win : in Window) return Positive_Count; + function Line return Positive_Count; + + ----------------------- + -- Characters-Output -- + ----------------------- + + procedure Put (Win : in Window; Item : in Character); + procedure Put (Item : in Character); + + -------------------- + -- Strings-Output -- + -------------------- + + procedure Put (Win : in Window; Item : in String); + procedure Put (Item : in String); + + procedure Put_Line + (Win : in Window; + Item : in String); + + procedure Put_Line + (Item : in 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/ncurses-5.3/Ada95/src/terminal_interface-curses-trace.adb_p b/ncurses-5.3/Ada95/src/terminal_interface-curses-trace.adb_p new file mode 100644 index 0000000..9e8e810 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses-trace.adb_p @@ -0,0 +1,92 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Trace -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 + begin + null; + end Trace_On; + + procedure Trace_Put (str : String) is + begin + null; + end Trace_Put; +#end if; + +end Terminal_Interface.Curses.Trace; diff --git a/ncurses-5.3/Ada95/src/terminal_interface-curses.adb b/ncurses-5.3/Ada95/src/terminal_interface-curses.adb new file mode 100644 index 0000000..359cced --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface-curses.adb @@ -0,0 +1,2561 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- 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 Interfaces.C.Pointers; +with Ada.Characters.Handling; use Ada.Characters.Handling; +with Ada.Strings.Fixed; +with Ada.Unchecked_Conversion; + +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); + +------------------------------------------------------------------------------ + generic + type Element is (<>); + function W_Get_Element (Win : in Window; + Offset : in Natural) return Element; + + function W_Get_Element (Win : in Window; + Offset : in Natural) return Element is + type E_Array is array (Natural range <>) of aliased Element; + package C_E_Array is new + Interfaces.C.Pointers (Natural, Element, E_Array, Element'Val (0)); + use C_E_Array; + + function To_Pointer is new + Ada.Unchecked_Conversion (Window, Pointer); + + P : Pointer := To_Pointer (Win); + begin + if Win = Null_Window then + raise Curses_Exception; + else + P := P + ptrdiff_t (Offset); + return P.all; + end if; + end W_Get_Element; + + function W_Get_Int is new W_Get_Element (C_Int); + function W_Get_Short is new W_Get_Element (C_Short); + function W_Get_Byte is new W_Get_Element (Interfaces.C.unsigned_char); + + function Get_Flag (Win : Window; + Offset : Natural) return Boolean; + + function Get_Flag (Win : Window; + Offset : Natural) return Boolean + is + Res : C_Int; + begin + case Sizeof_bool is + when 1 => Res := C_Int (W_Get_Byte (Win, Offset)); + when 2 => Res := C_Int (W_Get_Short (Win, Offset)); + when 4 => Res := C_Int (W_Get_Int (Win, Offset)); + when others => raise Curses_Exception; + end case; + + case Res is + when 0 => return False; + when others => return True; + end case; + end Get_Flag; + +------------------------------------------------------------------------------ + function Key_Name (Key : in 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 : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in 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 : in Window := Standard_Window; + Ch : in 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 : in Window := Standard_Window; + Ch : in Character) + is + begin + Add (Win, + Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video)); + end Add; + + procedure Add + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in 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 : in Window := Standard_Window; + Ch : in 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 : in Window := Standard_Window; + Ch : in 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 : Window := Dupwin (Win); + begin + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Duplicate; + + procedure Move_Window (Win : in Window; + Line : in Line_Position; + Column : in 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 : in Window; + Line : in Line_Position; + Column : in 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 : in Window := Standard_Window; + Mode : in 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 : in Window := Standard_Window; + Str : in String; + Len : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in String; + Len : in Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Add (Win, Str, Len); + end Add; +------------------------------------------------------------------------------ + procedure Add + (Win : in Window := Standard_Window; + Str : in Attributed_String; + Len : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in Attributed_String; + Len : in Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Add (Win, Str, Len); + end Add; +------------------------------------------------------------------------------ + procedure Border + (Win : in Window := Standard_Window; + Left_Side_Symbol : in Attributed_Character := Default_Character; + Right_Side_Symbol : in Attributed_Character := Default_Character; + Top_Side_Symbol : in Attributed_Character := Default_Character; + Bottom_Side_Symbol : in Attributed_Character := Default_Character; + Upper_Left_Corner_Symbol : in Attributed_Character := Default_Character; + Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character; + Lower_Left_Corner_Symbol : in Attributed_Character := Default_Character; + Lower_Right_Corner_Symbol : in 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 : in Window := Standard_Window; + Vertical_Symbol : in Attributed_Character := Default_Character; + Horizontal_Symbol : in Attributed_Character := Default_Character) + is + begin + Border (Win, + Vertical_Symbol, Vertical_Symbol, + Horizontal_Symbol, Horizontal_Symbol); + end Box; + + procedure Horizontal_Line + (Win : in Window := Standard_Window; + Line_Size : in Natural; + Line_Symbol : in 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 : in Window := Standard_Window; + Line_Size : in Natural; + Line_Symbol : in 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 : in 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 : in Window := Standard_Window; + Attr : in Character_Attribute_Set := Normal_Video; + On : in 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 : in Window := Standard_Window; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in Window := Standard_Window; + Pair : in 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 : in Window := Standard_Window; + Count : in Integer := -1; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in Window := Standard_Window; + Line : in Line_Position := Line_Position'First; + Column : in Column_Position := Column_Position'First; + Count : in Integer := -1; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in 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 : in 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 : in 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 : in Window := Standard_Window; + SwitchOn : in 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 : in Window := Standard_Window; + SwitchOn : in 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 : in Window := Standard_Window) + return Boolean + is + begin + return Get_Flag (Win, Offset_use_keypad); + end Get_KeyPad_Mode; + + procedure Half_Delay (Amount : in 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 : in Window := Standard_Window; + Mode : in 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 : in Window := Standard_Window; + Flush : in Boolean := True) + is + procedure Qiflush; + pragma Import (C, Qiflush, "qiflush"); + procedure No_Qiflush; + pragma Import (C, No_Qiflush, "noqiflush"); + begin + if Flush then + Qiflush; + else + No_Qiflush; + end if; + end Set_Queue_Interrupt_Mode; + + procedure Set_NoDelay_Mode + (Win : in Window := Standard_Window; + Mode : in 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 : in Window := Standard_Window; + Mode : in Timeout_Mode; + Amount : in Natural) + is + function Wtimeout (Win : Window; Amount : C_Int) return 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; + if Wtimeout (Win, Time) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Timeout_Mode; + + procedure Set_Escape_Timer_Mode + (Win : in Window := Standard_Window; + Timer_Off : in 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 : in 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 : in Window := Standard_Window; + Do_Clear : in 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 : in Window := Standard_Window; + Do_Idl : in 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 : in Window := Standard_Window; + Do_Idc : in Boolean := True) + is + function IDC_Ok (W : Window; Flag : Curses_Bool) return C_Int; + pragma Import (C, IDC_Ok, "idcok"); + begin + if IDC_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idc))) = Curses_Err then + raise Curses_Exception; + end if; + end Use_Insert_Delete_Character; + + procedure Leave_Cursor_After_Update + (Win : in Window := Standard_Window; + Do_Leave : in 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 : in Window := Standard_Window; + Mode : in Boolean := False) + is + function Immedok (Win : Window; Mode : Curses_Bool) return C_Int; + pragma Import (C, Immedok, "immedok"); + begin + if Immedok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then + raise Curses_Exception; + end if; + end Immediate_Update_Mode; + + procedure Allow_Scrolling + (Win : in Window := Standard_Window; + Mode : in 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 + begin + return Get_Flag (Win, Offset_scroll); + end Scrolling_Allowed; + + procedure Set_Scroll_Region + (Win : in Window := Standard_Window; + Top_Line : in Line_Position; + Bottom_Line : in 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 : in 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 : in 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 : in 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 : in Window := Standard_Window; + Begin_Line : in Line_Position; + Line_Count : in 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 : in 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 : in 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 : in 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 : in 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 : in Window := Standard_Window; + Ch : in Attributed_Character) + is + procedure WBackground (W : in Window; Ch : in C_Chtype); + pragma Import (C, WBackground, "wbkgdset"); + begin + WBackground (Win, AttrChar_To_Chtype (Ch)); + end Set_Background; + + procedure Change_Background + (Win : in Window := Standard_Window; + Ch : in 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 : in Window := Standard_Window; + Start : in Line_Position; + Count : in Positive; + State : in 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 : in 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 : in 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 : in Window := Standard_Window; + Start : in Line_Position; + Count : in 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 : in Window; + Destination_Window : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in Column_Position; + Non_Destructive_Mode : in 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 : in Window; + Destination_Window : in 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 : in Window; + Destination_Window : in 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 : in Window := Standard_Window; + Lines : in 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 : in Window := Standard_Window) + is + begin + Insert_Delete_Lines (Win, -1); + end Delete_Line; + + procedure Insert_Line (Win : in Window := Standard_Window) + is + begin + Insert_Delete_Lines (Win, 1); + end Insert_Line; +------------------------------------------------------------------------------ + + + procedure Get_Size + (Win : in Window := Standard_Window; + Number_Of_Lines : out Line_Count; + Number_Of_Columns : out Column_Count) + is + -- Please note: in ncurses they are one off. + -- This might be different in other implementations of curses + Y : C_Int := C_Int (W_Get_Short (Win, Offset_maxy)) + C_Int (Offset_XY); + X : C_Int := C_Int (W_Get_Short (Win, Offset_maxx)) + 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 : in Window := Standard_Window; + Top_Left_Line : out Line_Position; + Top_Left_Column : out Column_Position) + is + Y : C_Short := W_Get_Short (Win, Offset_begy); + X : C_Short := W_Get_Short (Win, Offset_begx); + begin + Top_Left_Line := Line_Position (Y); + Top_Left_Column := Column_Position (X); + end Get_Window_Position; + + procedure Get_Cursor_Position + (Win : in Window := Standard_Window; + Line : out Line_Position; + Column : out Column_Position) + is + Y : C_Short := W_Get_Short (Win, Offset_cury); + X : C_Short := W_Get_Short (Win, Offset_curx); + begin + Line := Line_Position (Y); + Column := Column_Position (X); + end Get_Cursor_Position; + + procedure Get_Origin_Relative_To_Parent + (Win : in Window; + Top_Left_Line : out Line_Position; + Top_Left_Column : out Column_Position; + Is_Not_A_Subwindow : out Boolean) + is + Y : C_Int := W_Get_Int (Win, Offset_pary); + X : C_Int := W_Get_Int (Win, Offset_parx); + 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 : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in 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 : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in 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 : in Window; + Ch : in 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 : in Window; + Ch : in 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 : in Window := Standard_Window; + Amount : in 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 : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in 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 : in Window := Standard_Window; + Ch : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in 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 : in Window := Standard_Window; + Str : in String; + Len : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in String; + Len : in 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 : in Window := Standard_Window; + Str : out String; + Len : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out String; + Len : in Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Peek (Win, Str, Len); + end Peek; +------------------------------------------------------------------------------ + procedure Peek + (Win : in Window := Standard_Window; + Str : out Attributed_String; + Len : in 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 : 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out Attributed_String; + Len : in Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Peek (Win, Str, Len); + end Peek; +------------------------------------------------------------------------------ + procedure Get (Win : in Window := Standard_Window; + Str : out String; + Len : in 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 : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out String; + Len : in Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Get (Win, Str, Len); + end Get; +------------------------------------------------------------------------------ + procedure Init_Soft_Label_Keys + (Format : in 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 : in Label_Number; + Text : in String; + Fmt : in 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 : in 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 : in 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 : in Character_Attribute_Set; + On : in 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 : in Character_Attribute_Set := Normal_Video; + Color : in 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 : in Color_Pair) + is + function Slk_Color (Color : in 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 : in Special_Key_Code; + Enable : in 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 : in String; + Key : in 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 : in 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 : in 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 : in 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 : in Redefinable_Color_Pair; + Fore : in Color_Number; + Back : in 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 : in 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 : in Color_Number; + Red : in RGB_Value; + Green : in RGB_Value; + Blue : in 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 : in 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 : in 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 : in 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 : in Integer; + Proc : in 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 : in 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 + Stdscr : Window; + pragma Import (C, Stdscr, "stdscr"); + begin + return Stdscr; + end Standard_Window; + + function Lines return Line_Count + is + C_Lines : C_Int; + pragma Import (C, C_Lines, "LINES"); + begin + return Line_Count (C_Lines); + end Lines; + + function Columns return Column_Count + is + C_Columns : C_Int; + pragma Import (C, C_Columns, "COLS"); + begin + return Column_Count (C_Columns); + end Columns; + + function Tab_Size return Natural + is + C_Tab_Size : C_Int; + pragma Import (C, C_Tab_Size, "TABSIZE"); + begin + return Natural (C_Tab_Size); + end Tab_Size; + + function Number_Of_Colors return Natural + is + C_Number_Of_Colors : C_Int; + pragma Import (C, C_Number_Of_Colors, "COLORS"); + begin + return Natural (C_Number_Of_Colors); + end Number_Of_Colors; + + function Number_Of_Color_Pairs return Natural + is + C_Number_Of_Color_Pairs : C_Int; + pragma Import (C, C_Number_Of_Color_Pairs, "COLOR_PAIRS"); + begin + return Natural (C_Number_Of_Color_Pairs); + end Number_Of_Color_Pairs; +------------------------------------------------------------------------------ + procedure Transform_Coordinates + (W : in Window := Standard_Window; + Line : in out Line_Position; + Column : in out Column_Position; + Dir : in 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 (Black)); + 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; +------------------------------------------------------------------------------ + 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 : in 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 : in 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 : in 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 : in 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/ncurses-5.3/Ada95/src/terminal_interface.ads b/ncurses-5.3/Ada95/src/terminal_interface.ads new file mode 100644 index 0000000..6953421 --- /dev/null +++ b/ncurses-5.3/Ada95/src/terminal_interface.ads @@ -0,0 +1,49 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface -- +-- -- +-- 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 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision$ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Terminal_Interface is + pragma Pure (Terminal_Interface); +-- +-- Everything is in the child units +-- +end Terminal_Interface; + + diff --git a/ncurses-5.3/INSTALL b/ncurses-5.3/INSTALL new file mode 100644 index 0000000..1551842 --- /dev/null +++ b/ncurses-5.3/INSTALL @@ -0,0 +1,1151 @@ +-- $Id$ +--------------------------------------------------------------------- + How to install Ncurses/Terminfo on your system +--------------------------------------------------------------------- + + ************************************************************ + * READ ALL OF THIS FILE BEFORE YOU TRY TO INSTALL NCURSES. * + ************************************************************ + +You should be reading the file INSTALL in a directory called ncurses-d.d, where +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 converting from BSD curses and do not have root access, be sure +to read the BSD CONVERSION NOTES section below. + +If you are using a version of XFree86 xterm older than 3.1.2F, see the section +on RECENT XTERM VERSIONS below. + +If you are trying to build GNU Emacs using ncurses for terminal support, +read the USING NCURSES WITH EMACS section below. + +If you are trying to build applications using gpm with ncurses, +read the USING NCURSES WITH GPM section below. + +If you are running over the Andrew File System see the note below on +USING NCURSES WITH AFS. + +If you are cross-compiling, see the note below on BUILDING NCURSES WITH A +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: +------------ + +You will need the following in order to build and install ncurses under UNIX: + + * ANSI C compiler (gcc, for instance) + * sh (bash will do) + * awk (mawk or gawk will do) + * sed + * BSD or System V style install (a script is enclosed) + +Ncurses has been also built in the OS/2 EMX environment. + + +INSTALLATION PROCEDURE: +---------------------- + +1. First, decide whether you want ncurses to replace your existing library (in + which case you'll need super-user privileges) or be installed in parallel + with it. + + The --prefix option to configure changes the root directory for installing + ncurses. The default is in subdirectories of /usr/local. Use + --prefix=/usr to replace your default curses distribution. This is the + default for Linux and BSD/OS users. + + The package gets installed beneath the --prefix directory as follows: + + In $(prefix)/bin: tic, infocmp, captoinfo, tset, + reset, clear, tput, toe + In $(prefix)/lib: libncurses*.* libcurses.a + In $(prefix)/share/terminfo: compiled terminal descriptions + In $(prefix)/include: C header files + Under $(prefix)/man: the manual pages + + Note however that the configure script attempts to locate previous + installation of ncurses, and will set the default prefix according to where + it finds the ncurses headers. + +2. Type `./configure' in the top-level directory of the distribution to + configure ncurses for your operating system and create the Makefiles. + Besides --prefix, various configuration options are available to customize + the installation; use `./configure --help' to list the available options. + + If your operating system is not supported, read the PORTABILITY section in + the file ncurses/README for information on how to create a configuration + file for your system. + + The `configure' script generates makefile rules for one or more object + models and their associated libraries: + + libncurses.a (normal) + + libcurses.a (normal, a link to libncurses.a) + This gets left out if you configure with --disable-overwrite. + + libncurses.so (shared) + + libncurses_g.a (debug) + + libncurses_p.a (profile) + + libncurses.la (libtool) + + If you configure using the --enable-widec option, a "w" is appended to the + library names (e.g., libncursesw.a), and the resulting libraries support + wide-characters, e.g., via a UTF-8 locale. The corresponding header files + are compatible with the non-wide-character configuration; wide-character + features are provided by ifdef's in the header files. The wide-character + 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. + + If you do not specify any models, the normal and debug libraries will be + configured. Typing `configure' with no arguments is equivalent to: + + ./configure --with-normal --with-debug --enable-overwrite + + Typing + + ./configure --with-shared + + makes the shared libraries the default, resulting in + + ./configure --with-shared --with-normal --with-debug --enable-overwrite + + If you want only shared libraries, type + + ./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 + work on other systems. + + If you have libtool installed, you can type + + ./configure --with-libtool + + to generate the appropriate static and/or shared libraries for your + platform using libtool. + + You can make curses and terminfo fall back to an existing file of termcap + definitions by configuring with --enable-termcap. If you do this, the + library will search /etc/termcap before the terminfo database, and will + also interpret the contents of the TERM environment variable. See the + section BSD CONVERSION NOTES below. + +3. Type `make'. Ignore any warnings, no error messages should be produced. + This should compile the ncurses library, the terminfo compiler tic(1), + captoinfo(1), infocmp(1), toe(1), clear(1) tset(1), reset(1), and tput(1) + programs (see the manual pages for explanation of what they do), some test + programs, and the panels, menus, and forms libraries. + +4. Run ncurses and several other test programs in the test directory to + verify that ncurses functions correctly before doing an install that + may overwrite system files. Read the file test/README for details on + the test programs. + + NOTE: You must have installed the terminfo database, or set the + environment variable $TERMINFO to point to a SVr4-compatible terminfo + database before running the test programs. Not all vendors' terminfo + databases are SVr4-compatible, but most seem to be. Exceptions include + DEC's Digital Unix (formerly known as OSF/1). + + It is possible to configure ncurses to use other terminfo database formats. + A few are provided as examples in the include-directory (see --with-caps). + + The ncurses program is designed specifically to test the ncurses library. + You can use it to verify that the screen highlights work correctly, that + cursor addressing and window scrolling works OK, etc. + +5. Once you've tested, you can type `make install' to install libraries, + the programs, the terminfo database and the manual pages. Alternately, you + can type `make install' in each directory you want to install. In the + top-level directory, you can do a partial install using these commands: + + 'make install.progs' installs tic, infocmp, etc... + 'make install.includes' installs the headers. + 'make install.libs' installs the libraries (and the headers). + 'make install.data' installs the terminfo data. (Note: `tic' must + be installed before the terminfo data can be + compiled). + 'make install.man' installs the manual pages. + + ############################################################################ + # CAVEAT EMPTOR: `install.data' run as root will NUKE any existing # + # terminfo database. If you have any custom or unusual entries SAVE them # + # before you install ncurses. I have a file called terminfo.custom for # + # this purpose. Don't forget to run tic on the file once you're done. # + ############################################################################ + + The terminfo(5) manual page must be preprocessed with tbl(1) before + being formatted by nroff(1). Modern man(1) implementations tend to do + this by default, but you may want to look at your version's manual page + to be sure. You may also install the manual pages after preprocessing + with tbl(1) by specifying the configure option --with-manpage-tbl. + + If the system already has a curses library that you need to keep using + you'll need to distinguish between it and ncurses. See the discussion of + --disable-overwrite. If ncurses is installed outside the standard + directories (/usr/include and /usr/lib) then all your users will need to + use the -I option to compile programs and -L to link them. + + If you have another curses installed in your system and you accidentally + compile using its curses.h you'll end up with a large number of + undefined symbols at link time. + + IF YOU DO NOT HAVE ROOT: Change directory to the `progs' subdirectory + and run the `capconvert' script. This script will deduce various things + about your environment and use them to build you a private terminfo tree, + so you can use ncurses applications. + + If more than one user at your site does this, the space for the duplicate + trees is wasted. Try to get your site administrators to install a system- + wide terminfo tree instead. + + See the BSD CONVERSION NOTES section below for a few more details. + +6. The c++ directory has C++ classes that are built on top of ncurses and + panels. You must have c++ (and its libraries) installed before you can + compile and run the demo. + + Use --without-cxx-binding to tell configure to not build the C++ bindings + and demo. + + If you do not have C++, you must use the --without-cxx option to tell + the configure script to not attempt to determine the type of 'bool' + which may be supported by C++. IF YOU USE THIS OPTION, BE ADVISED THAT + YOU MAY NOT BE ABLE TO COMPILE (OR RUN) NCURSES APPLICATIONS WITH C++. + + +SUMMARY OF CONFIGURE OPTIONS: +---------------------------- + + The configure script provides a short list of its options when you type + + ./configure --help + + The --help and several options are common to all configure scripts that are + generated with autoconf. Those are all listed before the line + + --enable and --with options recognized: + + The other options are specific to this package. We list them in alphabetic + order. + + --disable-assumed-color + With ncurses 5.1, we introduced a new function, assume_default_colors() + which allows applications to specify what the default foreground and + background color are assumed to be. Most color applications use + full-screen color; but a few do not color the background. While the + assumed values can be overridden by invoking assume_default_colors(), + you may find it useful to set the assumed values to the pre-5.1 + convention, using this configure option. + + --disable-big-core + Assume machine has little memory. The configure script attempts to + determine if your machine has enough memory (about 6Mb) to compile the + terminfo database without writing portions to disk. Some allocators + return deceptive results, so you may have to override the configure + script. Or you may be building tic for a smaller machine. + + --disable-database + Use only built-in data. The ncurses libraries normally read terminfo + and termcap data from disk. You can configure ncurses to have a + built-in database, aka "fallback" entries. Embedded applications may + have no need for an external database. Some, but not all of the + programs are useful in this configuration, e.g., reset and tput versus + infocmp and tic. + + --disable-ext-funcs + Disable function-extensions. Configure ncurses without the functions + that are not specified by XSI. See ncurses/modules for the exact + list of library modules that would be suppressed. + + --disable-hashmap + Compile without hashmap scrolling-optimization code. This algorithm is + the default. + + --disable-leaks + For testing, compile-in code that frees memory that normally would not + be freed, to simplify analysis of memory-leaks. + + --disable-macros + For testing, use functions rather than macros. The program will run + more slowly, but it is simpler to debug. This makes a header file + "nomacros.h". See also the --enable-expanded option. + + --disable-overwrite + If you are installing ncurses on a system which contains another + development version of curses, or which could be confused by the loader + for another version, we recommend that you leave out the link to + -lcurses. The ncurses library is always available as -lncurses. + Disabling overwrite also causes the ncurses header files to be + installed into a subdirectory, e.g., /usr/local/include/ncurses, + rather than the include directory. This makes it simpler to avoid + compile-time conflicts with other versions of curses.h + + --disable-root-environ + Compile with environment restriction, so certain environment variables + are not available when running as root, or via a setuid/setgid + application. These are (for example $TERMINFO) those that allow the + search path for the terminfo or termcap entry to be customized. + + --disable-scroll-hints + Compile without scroll-hints code. This option is ignored when + hashmap scrolling is configured, which is the default. + + --enable-add-ons=DIR... + This is used to check if this package is a glibc add-on. This is used + only by the glibc makefiles. + + --enable-assertions + For testing, compile-in assertion code. This is used only for a few + places where ncurses cannot easily recover by returning an error code. + + --enable-broken_linker + A few platforms have what we consider a broken linker: it cannot link + objects from an archive solely by referring to data objects in those + files, but requires a function reference. This configure option + changes several data references to functions to work around this + problem. + + 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 + problem. + + --enable-bsdpad + Recognize BSD-style prefix padding. Some ancient BSD programs (such as + nethack) call tputs("50") to implement delays. + + --enable-colorfgbg + Compile with experimental $COLORFGBG code. That environment variable + is set by some terminal emulators as a hint to applications, by + advertising the default foreground and background colors. During + initialization, ncurses sets color pair 0 to match this. + + --enable-const + The curses interface as documented in XSI is rather old, in fact + including features that precede ANSI C. The prototypes generally do + not make effective use of "const". When using stricter compilers (or + gcc with appropriate warnings), you may see warnings about the mismatch + between const and non-const data. We provide a configure option which + changes the interfaces to use const - quieting these warnings and + reflecting the actual use of the parameters more closely. The ncurses + library uses the symbol NCURSES_CONST for these instances of const, + and if you have asked for compiler warnings, will add gcc's const-qual + 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 + 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 + fewer places. + + --enable-echo + Use the option --disable-echo to make the build-log less verbose by + suppressing the display of the compile and link commands. This makes + it easier to see the compiler warnings. (You can always use "make -n" + to see the options that are used). + + --enable-expanded + For testing, generate functions for certain macros to make them visible + as such to the debugger. See also the --disable-macros option. + + --enable-getcap + Use the 4.4BSD getcap code if available, or a bundled version of it to + fetch termcap entries. Entries read in this way cannot use (make + cross-references to) the terminfo tree, but it is faster than reading + /etc/termcap. + + --enable-getcap-cache + Cache translated termcaps under the directory $HOME/.terminfo + + 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 + application, you will end up with a hidden terminfo database that + generally does not support color and will miss some function keys. + + --enable-hard-tabs + Compile-in cursor-optimization code that uses hard-tabs. We would make + this a standard feature except for the concern that the terminfo entry + may not be accurate, or that your stty settings have disabled the use + of tabs. + + --enable-no-padding + Compile-in support for the $NCURSES_NO_PADDING environment variable, + which allows you to suppress the effect of non-mandatory padding in + terminfo entries. This is the default, unless you have disabled the + extended functions. + + --enable-rpath + Use rpath option when generating shared libraries, and with some + restrictions when linking the corresponding programs. This applies + mainly to systems using the GNU linker (read the manpage). + + --enable-safe-sprintf + Compile with experimental safe-sprintf code. You may consider using + this if you are building ncurses for a system that has neither + vsnprintf() or vsprintf(). It is slow, however. + + --enable-sigwinch + Compile support for ncurses' SIGWINCH handler. If your application has + its own SIGWINCH handler, ncurses will not use its own. The ncurses + handler causes wgetch() to return KEY_RESIZE when the screen-size + changes. This option is the default, unless you have disabled the + extended functions. + + --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 + terminfo database. + + --enable-tcap-names + Compile-in support for user-definable terminal capabilities. Use the + -x option of tic and infocmp to treat unrecognized terminal + capabilities as user-defined strings. This option is the default, + unless you have disabled the extended functions. + + --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 + and --enable-getcap-cache options. + + --enable-warnings + Turn on GCC compiler warnings. There should be only a few. + + --enable-widec + Compile with experimental wide-character code. This makes a different + version of the libraries (e.g., libncursesw.so), which stores + characters as wide-characters, + + NOTE: applications compiled with this configuration are not compatible + with those built for 8-bit characters. You cannot simply make a + symbolic link to equate libncurses.so with libncursesw.so + + NOTE: the Ada95 binding may be built against either version of the the + ncurses library, but you must decide which: the binding installs the + same set of files for either version. Currently (2002/6/22) it does + not use the extended features from the wide-character code, so it is + probably better to not install the binding for that configuration. + + --enable-xmc-glitch + Compile-in support experimental xmc (magic cookie) code. + + --with-ada-compiler=CMD + Specify the Ada95 compiler command (default "gnatmake") + + --with-ada-include=DIR + Tell where to install the Ada includes (default: + PREFIX/lib/ada/adainclude) + + --with-ada-objects=DIR + Tell where to install the Ada objects (default: PREFIX/lib/ada/adalib) + + --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-cc=XXX + If cross-compiling, specify a host C compiler, which is needed to + compile a few utilties which generate source modules for ncurses. + If you do not give this option, the configure script checks if the + $BUILD_CC variable is set, and otherwise defaults to gcc or cc. + + --with-build-cflags=XXX + If cross-compiling, specify the host C compiler-flags. You might need + to do this if the target compiler has unusual flags which confuse the + host compiler. + + --with-build-cppflags=XXX + If cross-compiling, specify the host C preprocesor-flags. You might + need to do this if the target compiler has unusual flags which confuse + the host compiler. + + --with-build-ldflags=XXX + If cross-compiling, specify the host linker-flags. You might need to + do this if the target linker has unusual flags which confuse the host + compiler. + + --with-build-libs=XXX + If cross-compiling, the host libraries. You might need to do this if + the target environment requires unusual libraries. + + --with-caps=XXX + Specify an alternate terminfo capabilities file, which makes the + configure script look for "include/Caps.XXX". A few systems, e.g., + AIX 4.x use the same overall file-format as ncurses for terminfo + data, but use different alignments within the tables to support + legacy applications. For those systems, you can configure ncurses + to use a terminfo database which is compatible with the native + applications. + + --with-database=XXX + Specify the terminfo source file to install. Usually you will wish + to install ncurses' default (misc/terminfo.src). Certain systems + have special requirements, e.g, OS/2 EMX has a customized terminfo + source file. + + --with-dbmalloc + For testing, compile and link with Conor Cahill's dbmalloc library. + + --with-debug + Generate debug-libraries (default). These are named by adding "_g" + to the root, e.g., libncurses_g.a + + --with-default-terminfo-dir=XXX + Specify the default terminfo database directory. This is normally + DATADIR/terminfo, e.g., /usr/share/terminfo. + + --with-develop + Enable experimental/development options. This does not count those + that change the interface, such as --enable-widec. + + --with-dmalloc + For testing, compile and link with Gray Watson's dmalloc library. + + --with-fallbacks=XXX + Specify a list of fallback terminal descriptions which will be + compiled into the ncurses library. See CONFIGURING FALLBACK ENTRIES. + + --with-gpm + use Alessandro Rubini's GPM library to provide mouse support on the + Linux console. + + --with-install-prefix=XXX + Allows you to specify an alternate location for installing ncurses + after building it. The value you specify is prepended to the "real" + install location. This simplifies making binary packages. + + NOTE: a few systems build shared libraries with fixed pathnames; this + option probably will not work for those configurations. + + --with-libtool + Generate libraries with libtool. If this option is selected, then + it overrides all other library model specifications. + + --with-manpage-format=XXX + Tell the configure script how you would like to install man-pages. The + option value must be one of these: gzip, compress, BSDI, normal, + formatted. If you do not give this option, the configure script + attempts to determine which is the case. + + --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 + + --with-manpage-symlinks + Tell the configure script that you wish to make symbolic links in the + man-directory for aliases to the man-pages. This is the default, but + can be disabled for systems that provide this automatically. Doing + this on systems that do not support symbolic links will result in + copying the man-page for each alias. + + --with-manpage-tbl + Tell the configure script that you with to preprocess the manpages + by running them through tbl to generate tables understandable by + nroff. + + --with-ospeed=TYPE + Override type of ospeed variable, which is part of the termcap + compatibility interface. In termcap, this is a 'short', which works + for a wide range of baudrates because ospeed is not the actual speed + but the encoded value, e.g., B9600 would be a small number such as 13. + However the encoding scheme originally allowed for values "only" up to + 38400bd. A newer set of definitions past 38400bd is not encoded as + compactly, and is not guaranteed to fit into a short (see the function + cfgetospeed(), which returns a speed_t for this reason). In practice, + applications that required knowledge of the ospeed variable, i.e., + those using termcap, do not use the higher speeds. Your application + (or system, in general) may or may not. + + --with-normal + Generate normal (i.e., static) libraries (default). + + --with-profile + Generate profile-libraries These are named by adding "_p" to the root, + e.g., libncurses_p.a + + --with-rcs-ids + Compile-in RCS identifiers. Most of the C files have an identifier. + + --with-shared + Generate shared-libraries. The names given depend on the system for + 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 + environment variable, these will not be built with the -g debugging + option. + + --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 + which you are building on. We use it for testing the configure script. + + --with-system-type=XXX + For testing, override the derived host system-type which is used to + decide things such as the linker commands used to build shared + libraries. This is normally chosen automatically based on the type of + system which you are building on. We use it for testing the configure + script. + + --with-terminfo-dirs=XXX + Specify a search-list of terminfo directories which will be compiled + into the ncurses library (default: DATADIR/terminfo) + + --with-termlib + When building the ncurses library, organize this as two parts: the + curses library (libncurses) and the low-level terminfo library + (libtinfo). This is done to accommodate applications that use only + the latter. The terminfo library is about half the size of the total. + + --with-termpath=XXX + Specify a search-list of termcap files which will be compiled into the + ncurses library (default: /etc/termcap:/usr/share/misc/termcap) + + --without-ada + Suppress the configure script's check for Ada95, do not build the + Ada95 binding and related demo. + + --without-curses-h + Don't install the ncurses header with the name "curses.h". Rather, + install as "ncurses.h" and modify the installed headers and manpages + accordingly. + + --without-cxx + XSI curses declares "bool" as part of the interface. C++ also declares + "bool". Neither specifies the size and type of booleans, but both + insist on the same name. We chose to accommodate this by making the + configure script check for the size and type (e.g., unsigned or signed) + that your C++ compiler uses for booleans. If you do not wish to use + ncurses with C++, use this option to tell the configure script to not + adjust ncurses bool to match C++. + + --without-cxx-binding + Suppress the configure script's check for C++, do not build the + C++ binding and related demo. + + --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". + + +COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: +-------------------------------------------- + + Because ncurses implements the X/Open Curses Specification, its interface + is fairly stable. That does not mean the interface does not change. + Changes are made to the documented interfaces when we find differences + between ncurses and X/Open or implementations which they certify (such as + Solaris). We add extensions to those interfaces to solve problems not + addressed by the original curses design, but those must not conflict with + the X/Open documentation. + + Here are some of the major interface changes, and related problems which + you may encounter when building a system with different versions of + ncurses: + + 5.3 (pre-release) + Interface changes: + + + change type for bool used in headers to NCURSES_BOOL, which usually + is the same as the compiler's definition for 'bool'. + + + add all but two functions for X/Open curses wide-character support. + These are only available if the library is configured using the + --enable-widec option. Missing functions are + pecho_wchar() + slk_wset() + + + add environment variable $NCURSES_ASSUMED_COLORS to modify the + assume_default_colors() extension. + + Added extensions: + is_term_resized() + resize_term() + Added internal functions: + _nc_altcharset_name() debug + _nc_rootname() + _nc_trace_ttymode() debug + _nc_varargs() debug + _nc_wgetch() + Removed internal functions: + _nc_background() + Modified internal functions: + _nc_freeall() debug + + 5.2 (October 21, 2000) + Interface changes: + + + revert termcap ospeed variable to 'short' (see discussion of the + --with-ospeed configure option). + + 5.1 (July 8, 2000) + Interface changes: + + + made the extended terminal capabilities + (configure --enable-tcap-names) a standard feature. This should + be transparent to applications that do not require it. + + + removed the trace() function and related trace support from the + production library. + + + modified curses.h.in, undef'ing some symbols to avoid conflict + with C++ STL. + + Added extensions: assume_default_colors(). + + 5.0 (October 23, 1999) + Interface changes: + + + implemented the wcolor_set() and slk_color() functions. + + + move macro winch to a function, to hide details of struct ldat + + + corrected prototypes for slk_* functions, using chtype rather than + attr_t. + + + the slk_attr_{set,off,on} functions need an additional void* + parameter according to XSI. + + + modified several prototypes to correspond with 1997 version of X/Open + Curses: [w]attr_get(), [w]attr_set(), border_set() have different + parameters. Some functions were renamed or misspelled: + erase_wchar(), in_wchntr(), mvin_wchntr(). Some developers have used + attr_get(). + + Added extensions: keybound(), curses_version(). + + Terminfo database changes: + + + change translation for termcap 'rs' to terminfo 'rs2', which is + the documented equivalent, rather than 'rs1'. + + The problems are subtler in recent releases. + + a) This release provides users with the ability to define their own + terminal capability extensions, like termcap. To accomplish this, + we redesigned the TERMTYPE struct (in term.h). Very few + applications use this struct. They must be recompiled to work with + the 5.0 library. + + a) If you use the extended terminfo names (i.e., you used configure + --enable-tcap-names), the resulting terminfo database can have some + entries which are not readable by older versions of ncurses. This + is a bug in the older versions: + + + the terminfo database stores booleans, numbers and strings in + arrays. The capabilities that are listed in the arrays are + specified by X/Open. ncurses recognizes a number of obsolete and + extended names which are stored past the end of the specified + entries. + + + a change to read_entry.c in 951001 made the library do an lseek() + call incorrectly skipping data which is already read from the + string array. This happens when the number of strings in the + terminfo data file is greater than STRCOUNT, the number of + specified and obsolete or extended strings. + + + as part of alignment with the X/Open final specification, in the + 990109 patch we added two new terminfo capabilities: + set_a_attributes and set_pglen_inch). This makes the indices for + the obsolete and extended capabilities shift up by 2. + + + the last two capabilities in the obsolete/extended list are memu + and meml, which are found in most terminfo descriptions for xterm. + + When trying to read this terminfo entry, the spurious lseek() + causes the library to attempt to read the final portion of the + terminfo data (the text of the string capabilities) 4 characters + past its starting point, and reads 4 characters too few. The + library rejects the data, and applications are unable to + initialize that terminal type. + + FIX: remove memu and meml from the xterm description. They are + obsolete, not used by ncurses. (It appears that the feature was + added to xterm to make it more like hpterm). + + This is not a problem if you do not use the -x option of tic to + create a terminfo database with extended names. Note that the + user-defined terminal capabilities are not affected by this bug, + since they are stored in a table after the older terminfo data ends, + and are invisible to the older libraries. + + c) Some developers did not wish to use the C++ binding, and used the + configure --without-cxx option. This causes problems if someone + uses the ncurses library from C++ because that configure test + determines the type for C++'s bool and makes ncurses match it, since + both C++ and curses are specified to declare bool. Calling ncurses + functions with the incorrect type for bool will cause execution + errors. In 5.0 we added a configure option "--without-cxx-binding" + which controls whether the binding itself is built and installed. + + 4.2 (March 2, 1998) + Interface changes: + + + correct prototype for termattrs() as per XPG4 version 2. + + + add placeholder prototypes for color_set(), erasewchar(), + term_attrs(), wcolor_set() as per XPG4 version 2. + + + add macros getcur[xy] getbeg[xy] getpar[xy], which are defined in + SVr4 headers. + + New extensions: keyok() and define_key(). + + Terminfo database changes: + + + corrected definition in curses.h for ACS_LANTERN, which was 'I' + rather than 'i'. + + 4.1 (May 15, 1997) + + We added these extensions: use_default_colors(). Also added + configure option --enable-const, to support the use of const where + X/Open should have, but did not, specify. + + The terminfo database content changed the representation of color for + most entries that use ANSI colors. SVr4 curses treats the setaf/setab + and setf/setb capabilities differently, interchanging the red/blue + colors in the latter. + + 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 + versions were inconsistent. At that point, ncurses ABI was 3.4 and the + REL was 1.9.9g, so we made them consistent. + + 1.9.9g (December 1, 1996) + + This fixed most of the problems with 1.9.9e, and made these interface + changes: + + + remove tparam(), which had been provided for compatibility with + some termcap. tparm() is standard, and does not conflict with + application's fallback for missing tparam(). + + + turn off hardware echo in initscr(). This changes the sense of the + echo() function, which was initialized to echoing rather than + nonechoing (the latter is specified). There were several other + corrections to the terminal I/O settings which cause applications to + behave differently. + + + implemented several functions (such as attr_on()) which were + available only as macros. + + + corrected several typos in curses.h.in (i.e., the mvXXXX macros). + + + corrected prototypes for delay_output(), + has_color, immedok() and idcok(). + + + corrected misspelled getbkgd(). Some applications used the + misspelled name. + + + added _yoffset to WINDOW. The size of WINDOW does not impact + applications, since they use only pointers to WINDOW structs. + + These changes were made to the terminfo database: + + + removed boolean 'getm' which was available as an extended name. + + We added these extensions: wresize(), resizeterm(), has_key() and + mcprint(). + + 1.9.9e (March 24, 1996) + + not recommended (a last-minute/untested change left the forms and + menus libraries unusable since they do not repaint the screen). + Foreground/background colors are combined incorrectly, working properly + only on a black background. When this was released, the X/Open + specification was available only in draft form. + + Some applications (such as lxdialog) were "fixed" to work with the + incorrect color scheme. + + +IF YOU ARE A SYSTEM INTEGRATOR: +------------------------------ + + Beginning with 1.9.9, the ncurses distribution includes both a tset + utility and /usr/share/tabset directory. If you are installing ncurses, + it is no longer either necessary or desirable to install tset-jv. + + Configuration and Installation: + + Configure with --prefix=/usr to make the install productions put + libraries and headers in the correct locations (overwriting any + previous curses libraries and headers). This will put the terminfo + hierarchy under /usr/share/terminfo; you may want to override this with + --datadir=/usr/share/misc; terminfo and tabset are installed under the + data directory. + + Please configure the ncurses library in a pure-terminfo mode; that + is, with the --disable-termcap option. This will make the ncurses + library smaller and faster. The ncurses library includes a termcap + emulation that queries the terminfo database, so even applications + that use raw termcap to query terminal characteristics will win + (providing you recompile and relink them!). + + If you must configure with termcap fallback enabled, you may also + wish to use the --enable-getcap option. This option speeds up + termcap-based startups, at the expense of not allowing personal + termcap entries to reference the terminfo tree. See the code in + ncurses/tinfo/read_termcap.c for details. + + Note that if you have $TERMCAP set, ncurses will use that value + to locate termcap data. In particular, running from xterm will + set $TERMCAP to the contents of the xterm's termcap entry. + If ncurses sees that, it will not examine /etc/termcap. + + Keyboard Mapping: + + The terminfo file assumes that Shift-Tab generates \E[Z (the ECMA-48 + reverse-tabulation sequence) rather than ^I. Here are the loadkeys -d + mappings that will set this up: + + keycode 15 = Tab Tab + alt keycode 15 = Meta_Tab + shift keycode 15 = F26 + string F26 ="\033[Z" + + Naming the Console Terminal + + In various Linuxes (and possibly elsewhere) there has been a practice + of designating the system console driver type as `console'. Please + do not do this any more! It complicates peoples' lives, because it + can mean that several different terminfo entries from different + operating systems all logically want to be called `console'. + + Please pick a name unique to your console driver and set that up + in the /etc/inittab table or local equivalent. Send the entry to the + terminfo maintainer (listed in the misc/terminfo file) to be included + in the terminfo file, if it's not already there. See the + term(7) manual page included with this distribution for more on + conventions for choosing type names. + + Here are some recommended primary console names: + + linux -- Linux console driver + freebsd -- FreeBSD + netbsd -- NetBSD + bsdos -- BSD/OS + + If you are responsible for integrating ncurses for one of these + 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. + + +RECENT XTERM VERSIONS: +--------------------- + + The terminfo database file included with this distribution assumes you + are running an XFree86 xterm based on X11R6 (i.e., xterm-r6). The + earlier X11R5 entry (xterm-r5) is provided as well. + + If you are running XFree86 version 3.2 (actually 3.1.2F and up), you + should consider using the xterm-xf86-v32 (or later, the most recent + version is always named "xterm-xfree86") entry, which adds ANSI color + and the VT220 capabilities which have been added in XFree86. If you + are running a mixed network, however, where this terminal description + may be used on an older xterm, you may have problems, since + applications that assume these capabilities will produce incorrect + output on the older xterm (e.g., highlighting is not cleared). + + +CONFIGURING FALLBACK ENTRIES: +---------------------------- + + In order to support operation of ncurses programs before the terminfo + 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. + + These entries are checked by setupterm() only when the conventional + fetches from the terminfo tree and the termcap fallback (if configured) + have been tried and failed. Thus, the presence of a fallback will not + shadow modifications to the on-disk entry for the same type, when that + entry is accessible. + + By default, there are no entries on the fallback list. After you + have built the ncurses suite for the first time, you can change + the list (the process needs infocmp(1)). To do so, use the script + MKfallback.sh. A configure script option --with-fallbacks does this + (it accepts a comma-separated list of the names you wish, and does + not require a rebuild). + + If you wanted (say) to have linux, vt100, and xterm fallbacks, you + would use the commands + + cd ncurses; + MKfallback.sh linux vt100 xterm >fallback.c + + Then just rebuild and reinstall the library as you would normally. + You can restore the default empty fallback list with + + MKfallback.sh >fallback.c + + The overhead for an empty fallback list is one trivial stub function. + Any non-empty fallback list is const-ed and therefore lives in sharable + text space. You can look at the comment trailing each initializer in + the generated ncurses/fallback.c file to see the core cost of the + fallbacks. A good rule of thumb for modern vt100-like entries is that + each one will cost about 2.5K of text space. + + +BSD CONVERSION NOTES: +-------------------- + + If you need to support really ancient BSD programs, you probably + want to configure with the --enable-bsdpad option. What this does + is enable code in tputs() that recognizes a numeric prefix on a + capability as a request for that much trailing padding in milliseconds. + There are old BSD programs that do things like tputs("50"). + + (If you are distributing ncurses as a support-library component of + an application you probably want to put the remainder of this section + in the package README file.) + + The following note applies only if you have configured ncurses with + --enable-termcap. + +------------------------------- CUT HERE -------------------------------- + +If you are installing this application privately (either because you +have no root access or want to experiment with it before doing a root +installation), there are a couple of details you need to be aware of. +They have to do with the ncurses library, which uses terminfo rather +than termcap for describing terminal characteristics. + +Though the ncurses library is terminfo-based, it will interpret your +TERMCAP variable (if present), any local termcap files you reference +through it, and the system termcap file. However, in order to avoid +slowing down your application startup, it will only do this once per +terminal type! + +The first time you load a given terminal type from your termcap +database, the library initialization code will automatically write it +in terminfo format to a subdirectory under $HOME/.terminfo. After +that, the initialization code will find it there and do a (much +faster) terminfo fetch. + +Usually, all this means is that your home directory will silently grow +an invisible .terminfo subdirectory which will get filled in with +terminfo descriptions of terminal types as you invoke them. If anyone +ever installs a global terminfo tree on your system, this will quietly +stop happening and your $HOME/.terminfo will become redundant. + +The objective of all this logic is to make converting from BSD termcap +as painless as possible without slowing down your application (termcap +compilation is expensive). + +If you don't have a TERMCAP variable or custom personal termcap file, +you can skip the rest of this dissertation. + +If you *do* have a TERMCAP variable and/or a custom personal termcap file +that defines a terminal type, that definition will stop being visible +to this application after the first time you run it, because it will +instead see the terminfo entry that it wrote to $HOME/terminfo the +first time around. + +Subsequently, editing the TERMCAP variable or personal TERMCAP file +will have no effect unless you explicitly remove the terminfo entry +under $HOME/terminfo. If you do that, the entry will be recompiled +from your termcap resources the next time it is invoked. + +To avoid these complications, use infocmp(1) and tic(1) to edit the +terminfo directory directly. + +------------------------------- CUT HERE -------------------------------- + +USING NCURSES WITH AFS: + AFS treats each directory as a separate logical filesystem, you + can't hard-link across them. The --enable-symlinks option copes + with this by making tic use symbolic links. + +USING NCURSES WITH EMACS: + GNU Emacs has its own termcap support. By default, it uses a mixture + of those functions and code linked from the host system's libraries. + You need to foil this and shut out the GNU termcap library entirely. + + In order to do this, hack the Linux config file (s/linux.h) to contain + a #define TERMINFO and set the symbol LIBS_TERMCAP to "-lncurses". + + We have submitted such a change for the 19.30 release, so it may + already be applied in your sources -- check for the #define TERMINFO. + +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 + 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 (the BSD + curses) into the libgpm.so file, producing symbol conflicts with + ncurses (specifically the wgetch function). You may be able to work + around this problem by linking as follows: + + cc -o foo foo.o -lncurses -lgpm -lncurses + + but the linker may not cooperate, producing mysterious errors. + A patched version of gpm is available: + + dickey.his.com:/ncurses/gpm-1.10-970125.tar.gz + + This patch is incorporated in gpm 1.12; however some integrators + are slow to update this library. Current distributions of gpm can + be configured properly using the --without-curses option. + +BUILDING NCURSES WITH A CROSS-COMPILER + Ncurses can be built with a cross-compiler. Some parts must be built + with the host's compiler since they are used for building programs + (e.g., ncurses/make_hash and ncurses/make_keys) that generate tables + that are compiled into the ncurses library. You should set the + BUILD_CC environment variable to your host's compiler, and run the + configure script configuring for the cross-compiler. + + Note that all of the generated source-files which are part of ncurses + will be made if you use + + make sources + + This would be useful in porting to an environment which has little + support for the tools used to generate the sources, e.g., sed, awk and + Bourne-shell. + +BUGS: + Send any feedback to the ncurses mailing list at + bug-ncurses@gnu.org. To subscribe send mail to + bug-ncurses-request@gnu.org with body that reads: + subscribe ncurses + + The Hacker's Guide in the doc directory includes some guidelines + on how to report bugs in ways that will get them fixed most quickly. diff --git a/ncurses-5.3/MANIFEST b/ncurses-5.3/MANIFEST new file mode 100644 index 0000000..869e3bd --- /dev/null +++ b/ncurses-5.3/MANIFEST @@ -0,0 +1,981 @@ +./ANNOUNCE +./Ada95/Makefile.in +./Ada95/README +./Ada95/TODO +./Ada95/gen/Makefile.in +./Ada95/gen/gen.c +./Ada95/gen/html.m4 +./Ada95/gen/normal.m4 +./Ada95/gen/table.m4 +./Ada95/gen/terminal_interface-curses-aux.ads.m4 +./Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 +./Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 +./Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 +./Ada95/gen/terminal_interface-curses-forms.ads.m4 +./Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 +./Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 +./Ada95/gen/terminal_interface-curses-menus.ads.m4 +./Ada95/gen/terminal_interface-curses-mouse.ads.m4 +./Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 +./Ada95/gen/terminal_interface-curses-panels.ads.m4 +./Ada95/gen/terminal_interface-curses-trace.ads.m4 +./Ada95/gen/terminal_interface-curses.ads.m4 +./Ada95/samples/Makefile.in +./Ada95/samples/README +./Ada95/samples/explain.txt +./Ada95/samples/ncurses.adb +./Ada95/samples/ncurses2-acs_and_scroll.adb +./Ada95/samples/ncurses2-acs_and_scroll.ads +./Ada95/samples/ncurses2-acs_display.adb +./Ada95/samples/ncurses2-acs_display.ads +./Ada95/samples/ncurses2-attr_test.adb +./Ada95/samples/ncurses2-attr_test.ads +./Ada95/samples/ncurses2-color_edit.adb +./Ada95/samples/ncurses2-color_edit.ads +./Ada95/samples/ncurses2-color_test.adb +./Ada95/samples/ncurses2-color_test.ads +./Ada95/samples/ncurses2-demo_forms.adb +./Ada95/samples/ncurses2-demo_forms.ads +./Ada95/samples/ncurses2-demo_pad.adb +./Ada95/samples/ncurses2-demo_pad.ads +./Ada95/samples/ncurses2-demo_panels.adb +./Ada95/samples/ncurses2-demo_panels.ads +./Ada95/samples/ncurses2-flushinp_test.adb +./Ada95/samples/ncurses2-flushinp_test.ads +./Ada95/samples/ncurses2-genericputs.adb +./Ada95/samples/ncurses2-genericputs.ads +./Ada95/samples/ncurses2-getch.ads +./Ada95/samples/ncurses2-getch_test.adb +./Ada95/samples/ncurses2-getch_test.ads +./Ada95/samples/ncurses2-getopt.adb +./Ada95/samples/ncurses2-getopt.ads +./Ada95/samples/ncurses2-m.adb +./Ada95/samples/ncurses2-m.ads +./Ada95/samples/ncurses2-menu_test.adb +./Ada95/samples/ncurses2-menu_test.ads +./Ada95/samples/ncurses2-overlap_test.adb +./Ada95/samples/ncurses2-overlap_test.ads +./Ada95/samples/ncurses2-slk_test.adb +./Ada95/samples/ncurses2-slk_test.ads +./Ada95/samples/ncurses2-test_sgr_attributes.adb +./Ada95/samples/ncurses2-test_sgr_attributes.ads +./Ada95/samples/ncurses2-trace_set.adb +./Ada95/samples/ncurses2-trace_set.ads +./Ada95/samples/ncurses2-util.adb +./Ada95/samples/ncurses2-util.ads +./Ada95/samples/ncurses2.ads +./Ada95/samples/rain.adb +./Ada95/samples/rain.ads +./Ada95/samples/sample-curses_demo-attributes.adb +./Ada95/samples/sample-curses_demo-attributes.ads +./Ada95/samples/sample-curses_demo-mouse.adb +./Ada95/samples/sample-curses_demo-mouse.ads +./Ada95/samples/sample-curses_demo.adb +./Ada95/samples/sample-curses_demo.ads +./Ada95/samples/sample-explanation.adb +./Ada95/samples/sample-explanation.ads +./Ada95/samples/sample-form_demo-aux.adb +./Ada95/samples/sample-form_demo-aux.ads +./Ada95/samples/sample-form_demo-handler.adb +./Ada95/samples/sample-form_demo-handler.ads +./Ada95/samples/sample-form_demo.adb +./Ada95/samples/sample-form_demo.ads +./Ada95/samples/sample-function_key_setting.adb +./Ada95/samples/sample-function_key_setting.ads +./Ada95/samples/sample-header_handler.adb +./Ada95/samples/sample-header_handler.ads +./Ada95/samples/sample-helpers.adb +./Ada95/samples/sample-helpers.ads +./Ada95/samples/sample-keyboard_handler.adb +./Ada95/samples/sample-keyboard_handler.ads +./Ada95/samples/sample-manifest.ads +./Ada95/samples/sample-menu_demo-aux.adb +./Ada95/samples/sample-menu_demo-aux.ads +./Ada95/samples/sample-menu_demo-handler.adb +./Ada95/samples/sample-menu_demo-handler.ads +./Ada95/samples/sample-menu_demo.adb +./Ada95/samples/sample-menu_demo.ads +./Ada95/samples/sample-my_field_type.adb +./Ada95/samples/sample-my_field_type.ads +./Ada95/samples/sample-text_io_demo.adb +./Ada95/samples/sample-text_io_demo.ads +./Ada95/samples/sample.adb +./Ada95/samples/sample.ads +./Ada95/samples/status.adb +./Ada95/samples/status.ads +./Ada95/samples/tour.adb +./Ada95/samples/tour.ads +./Ada95/src/Makefile.in +./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 +./Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb +./Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads +./Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb +./Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads +./Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb +./Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads +./Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb +./Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads +./Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb +./Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads +./Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb +./Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads +./Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb +./Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads +./Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb +./Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads +./Ada95/src/terminal_interface-curses-forms-field_types-user.adb +./Ada95/src/terminal_interface-curses-forms-field_types-user.ads +./Ada95/src/terminal_interface-curses-forms-field_types.adb +./Ada95/src/terminal_interface-curses-forms-field_user_data.adb +./Ada95/src/terminal_interface-curses-forms-form_user_data.adb +./Ada95/src/terminal_interface-curses-forms.adb +./Ada95/src/terminal_interface-curses-menus-item_user_data.adb +./Ada95/src/terminal_interface-curses-menus-menu_user_data.adb +./Ada95/src/terminal_interface-curses-menus.adb +./Ada95/src/terminal_interface-curses-mouse.adb +./Ada95/src/terminal_interface-curses-panels-user_data.adb +./Ada95/src/terminal_interface-curses-panels.adb +./Ada95/src/terminal_interface-curses-putwin.adb +./Ada95/src/terminal_interface-curses-putwin.ads +./Ada95/src/terminal_interface-curses-termcap.adb +./Ada95/src/terminal_interface-curses-termcap.ads +./Ada95/src/terminal_interface-curses-terminfo.adb +./Ada95/src/terminal_interface-curses-terminfo.ads +./Ada95/src/terminal_interface-curses-text_io-aux.adb +./Ada95/src/terminal_interface-curses-text_io-aux.ads +./Ada95/src/terminal_interface-curses-text_io-complex_io.adb +./Ada95/src/terminal_interface-curses-text_io-complex_io.ads +./Ada95/src/terminal_interface-curses-text_io-decimal_io.adb +./Ada95/src/terminal_interface-curses-text_io-decimal_io.ads +./Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb +./Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads +./Ada95/src/terminal_interface-curses-text_io-fixed_io.adb +./Ada95/src/terminal_interface-curses-text_io-fixed_io.ads +./Ada95/src/terminal_interface-curses-text_io-float_io.adb +./Ada95/src/terminal_interface-curses-text_io-float_io.ads +./Ada95/src/terminal_interface-curses-text_io-integer_io.adb +./Ada95/src/terminal_interface-curses-text_io-integer_io.ads +./Ada95/src/terminal_interface-curses-text_io-modular_io.adb +./Ada95/src/terminal_interface-curses-text_io-modular_io.ads +./Ada95/src/terminal_interface-curses-text_io.adb +./Ada95/src/terminal_interface-curses-text_io.ads +./Ada95/src/terminal_interface-curses-trace.adb_p +./Ada95/src/terminal_interface-curses.adb +./Ada95/src/terminal_interface.ads +./INSTALL +./MANIFEST +./Makefile.glibc +./Makefile.in +./Makefile.os2 +./NEWS +./README +./README.emx +./README.glibc +./TO-DO +./aclocal.m4 +./announce.html.in +./c++/Makefile.in +./c++/NEWS +./c++/PROBLEMS +./c++/README-first +./c++/cursesapp.cc +./c++/cursesapp.h +./c++/cursesf.cc +./c++/cursesf.h +./c++/cursesm.cc +./c++/cursesm.h +./c++/cursesmain.cc +./c++/cursesp.cc +./c++/cursesp.h +./c++/cursespad.cc +./c++/cursesw.cc +./c++/cursesw.h +./c++/cursslk.cc +./c++/cursslk.h +./c++/demo.cc +./c++/edit_cfg.sh +./c++/etip.h.in +./c++/headers +./c++/internal.h +./c++/modules +./config.guess +./config.sub +./configure +./configure.in +./convert_configure.pl +./dist.mk +./doc/hackguide.doc +./doc/html/Ada95.html +./doc/html/ada/files.htm +./doc/html/ada/files/T.htm +./doc/html/ada/funcs.htm +./doc/html/ada/funcs/A.htm +./doc/html/ada/funcs/B.htm +./doc/html/ada/funcs/C.htm +./doc/html/ada/funcs/D.htm +./doc/html/ada/funcs/E.htm +./doc/html/ada/funcs/F.htm +./doc/html/ada/funcs/G.htm +./doc/html/ada/funcs/H.htm +./doc/html/ada/funcs/I.htm +./doc/html/ada/funcs/K.htm +./doc/html/ada/funcs/L.htm +./doc/html/ada/funcs/M.htm +./doc/html/ada/funcs/N.htm +./doc/html/ada/funcs/O.htm +./doc/html/ada/funcs/P.htm +./doc/html/ada/funcs/Q.htm +./doc/html/ada/funcs/R.htm +./doc/html/ada/funcs/S.htm +./doc/html/ada/funcs/T.htm +./doc/html/ada/funcs/U.htm +./doc/html/ada/funcs/V.htm +./doc/html/ada/funcs/W.htm +./doc/html/ada/index.htm +./doc/html/ada/main.htm +./doc/html/ada/table.html +./doc/html/ada/terminal_interface-curses-aux__adb.htm +./doc/html/ada/terminal_interface-curses-aux__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm +./doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm +./doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm +./doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm +./doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm +./doc/html/ada/terminal_interface-curses-forms__adb.htm +./doc/html/ada/terminal_interface-curses-forms__ads.htm +./doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm +./doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm +./doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm +./doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm +./doc/html/ada/terminal_interface-curses-menus__adb.htm +./doc/html/ada/terminal_interface-curses-menus__ads.htm +./doc/html/ada/terminal_interface-curses-mouse__adb.htm +./doc/html/ada/terminal_interface-curses-mouse__ads.htm +./doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm +./doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm +./doc/html/ada/terminal_interface-curses-panels__adb.htm +./doc/html/ada/terminal_interface-curses-panels__ads.htm +./doc/html/ada/terminal_interface-curses-putwin__adb.htm +./doc/html/ada/terminal_interface-curses-putwin__ads.htm +./doc/html/ada/terminal_interface-curses-termcap__adb.htm +./doc/html/ada/terminal_interface-curses-termcap__ads.htm +./doc/html/ada/terminal_interface-curses-terminfo__adb.htm +./doc/html/ada/terminal_interface-curses-terminfo__ads.htm +./doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm +./doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm +./doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm +./doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm +./doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm +./doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm +./doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm +./doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm +./doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm +./doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm +./doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm +./doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm +./doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm +./doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm +./doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm +./doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm +./doc/html/ada/terminal_interface-curses-text_io__adb.htm +./doc/html/ada/terminal_interface-curses-text_io__ads.htm +./doc/html/ada/terminal_interface-curses-trace__adb.htm +./doc/html/ada/terminal_interface-curses-trace__ads.htm +./doc/html/ada/terminal_interface-curses__adb.htm +./doc/html/ada/terminal_interface-curses__ads.htm +./doc/html/ada/terminal_interface__ads.htm +./doc/html/announce.html +./doc/html/hackguide.html +./doc/html/index.html +./doc/html/man/captoinfo.1m.html +./doc/html/man/clear.1.html +./doc/html/man/curs_add_wch.3x.html +./doc/html/man/curs_add_wchstr.3x.html +./doc/html/man/curs_addch.3x.html +./doc/html/man/curs_addchstr.3x.html +./doc/html/man/curs_addstr.3x.html +./doc/html/man/curs_addwstr.3x.html +./doc/html/man/curs_attr.3x.html +./doc/html/man/curs_beep.3x.html +./doc/html/man/curs_bkgd.3x.html +./doc/html/man/curs_bkgrnd.3x.html +./doc/html/man/curs_border.3x.html +./doc/html/man/curs_border_set.3x.html +./doc/html/man/curs_clear.3x.html +./doc/html/man/curs_color.3x.html +./doc/html/man/curs_delch.3x.html +./doc/html/man/curs_deleteln.3x.html +./doc/html/man/curs_extend.3x.html +./doc/html/man/curs_get_wch.3x.html +./doc/html/man/curs_get_wstr.3x.html +./doc/html/man/curs_getcchar.3x.html +./doc/html/man/curs_getch.3x.html +./doc/html/man/curs_getstr.3x.html +./doc/html/man/curs_getyx.3x.html +./doc/html/man/curs_in_wch.3x.html +./doc/html/man/curs_in_wchstr.3x.html +./doc/html/man/curs_inch.3x.html +./doc/html/man/curs_inchstr.3x.html +./doc/html/man/curs_initscr.3x.html +./doc/html/man/curs_inopts.3x.html +./doc/html/man/curs_ins_wch.3x.html +./doc/html/man/curs_ins_wstr.3x.html +./doc/html/man/curs_insch.3x.html +./doc/html/man/curs_insstr.3x.html +./doc/html/man/curs_instr.3x.html +./doc/html/man/curs_inwstr.3x.html +./doc/html/man/curs_kernel.3x.html +./doc/html/man/curs_mouse.3x.html +./doc/html/man/curs_move.3x.html +./doc/html/man/curs_outopts.3x.html +./doc/html/man/curs_overlay.3x.html +./doc/html/man/curs_pad.3x.html +./doc/html/man/curs_print.3x.html +./doc/html/man/curs_printw.3x.html +./doc/html/man/curs_refresh.3x.html +./doc/html/man/curs_scanw.3x.html +./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_termattrs.3x.html +./doc/html/man/curs_termcap.3x.html +./doc/html/man/curs_terminfo.3x.html +./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_window.3x.html +./doc/html/man/default_colors.3x.html +./doc/html/man/define_key.3x.html +./doc/html/man/form.3x.html +./doc/html/man/form_cursor.3x.html +./doc/html/man/form_data.3x.html +./doc/html/man/form_driver.3x.html +./doc/html/man/form_field.3x.html +./doc/html/man/form_field_attributes.3x.html +./doc/html/man/form_field_buffer.3x.html +./doc/html/man/form_field_info.3x.html +./doc/html/man/form_field_just.3x.html +./doc/html/man/form_field_new.3x.html +./doc/html/man/form_field_opts.3x.html +./doc/html/man/form_field_userptr.3x.html +./doc/html/man/form_field_validation.3x.html +./doc/html/man/form_fieldtype.3x.html +./doc/html/man/form_hook.3x.html +./doc/html/man/form_new.3x.html +./doc/html/man/form_new_page.3x.html +./doc/html/man/form_opts.3x.html +./doc/html/man/form_page.3x.html +./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_win.3x.html +./doc/html/man/infocmp.1m.html +./doc/html/man/infotocap.1m.html +./doc/html/man/keybound.3x.html +./doc/html/man/keyok.3x.html +./doc/html/man/menu.3x.html +./doc/html/man/menu_attributes.3x.html +./doc/html/man/menu_cursor.3x.html +./doc/html/man/menu_driver.3x.html +./doc/html/man/menu_format.3x.html +./doc/html/man/menu_hook.3x.html +./doc/html/man/menu_items.3x.html +./doc/html/man/menu_mark.3x.html +./doc/html/man/menu_new.3x.html +./doc/html/man/menu_opts.3x.html +./doc/html/man/menu_pattern.3x.html +./doc/html/man/menu_post.3x.html +./doc/html/man/menu_requestname.3x.html +./doc/html/man/menu_spacing.3x.html +./doc/html/man/menu_userptr.3x.html +./doc/html/man/menu_win.3x.html +./doc/html/man/mitem_current.3x.html +./doc/html/man/mitem_name.3x.html +./doc/html/man/mitem_new.3x.html +./doc/html/man/mitem_opts.3x.html +./doc/html/man/mitem_userptr.3x.html +./doc/html/man/mitem_value.3x.html +./doc/html/man/mitem_visible.3x.html +./doc/html/man/ncurses.3x.html +./doc/html/man/panel.3x.html +./doc/html/man/resizeterm.3x.html +./doc/html/man/term.5.html +./doc/html/man/term.7.html +./doc/html/man/terminfo.5.html +./doc/html/man/tic.1m.html +./doc/html/man/toe.1m.html +./doc/html/man/tput.1.html +./doc/html/man/tset.1.html +./doc/html/man/wresize.3x.html +./doc/html/ncurses-intro.html +./doc/ncurses-intro.doc +./form/Makefile.in +./form/READ.ME +./form/fld_arg.c +./form/fld_attr.c +./form/fld_current.c +./form/fld_def.c +./form/fld_dup.c +./form/fld_ftchoice.c +./form/fld_ftlink.c +./form/fld_info.c +./form/fld_just.c +./form/fld_link.c +./form/fld_max.c +./form/fld_move.c +./form/fld_newftyp.c +./form/fld_opts.c +./form/fld_pad.c +./form/fld_page.c +./form/fld_stat.c +./form/fld_type.c +./form/fld_user.c +./form/form.h +./form/form.priv.h +./form/frm_cursor.c +./form/frm_data.c +./form/frm_def.c +./form/frm_driver.c +./form/frm_hook.c +./form/frm_opts.c +./form/frm_page.c +./form/frm_post.c +./form/frm_req_name.c +./form/frm_scale.c +./form/frm_sub.c +./form/frm_user.c +./form/frm_win.c +./form/fty_alnum.c +./form/fty_alpha.c +./form/fty_enum.c +./form/fty_int.c +./form/fty_ipv4.c +./form/fty_num.c +./form/fty_regex.c +./form/headers +./form/llib-lform +./form/llib-lformw +./form/modules +./include/Caps +./include/Caps.aix4 +./include/Caps.hpux11 +./include/Caps.keys +./include/Caps.osf1r5 +./include/Caps.uwin +./include/MKhashsize.sh +./include/MKkey_defs.sh +./include/MKncurses_def.sh +./include/MKparametrized.sh +./include/MKterm.h.awk.in +./include/Makefile.in +./include/capdefaults.c +./include/curses.h.in +./include/curses.tail +./include/curses.wide +./include/edit_cfg.sh +./include/headers +./include/nc_alloc.h +./include/nc_panel.h +./include/ncurses_cfg.hin +./include/ncurses_defs +./include/ncurses_dll.h +./include/term_entry.h +./include/termcap.h.in +./include/tic.h +./include/unctrl.h.in +./install-sh +./man/MKterminfo.sh +./man/Makefile.in +./man/captoinfo.1m +./man/clear.1 +./man/curs_add_wch.3x +./man/curs_add_wchstr.3x +./man/curs_addch.3x +./man/curs_addchstr.3x +./man/curs_addstr.3x +./man/curs_addwstr.3x +./man/curs_attr.3x +./man/curs_beep.3x +./man/curs_bkgd.3x +./man/curs_bkgrnd.3x +./man/curs_border.3x +./man/curs_border_set.3x +./man/curs_clear.3x +./man/curs_color.3x +./man/curs_delch.3x +./man/curs_deleteln.3x +./man/curs_extend.3x +./man/curs_get_wch.3x +./man/curs_get_wstr.3x +./man/curs_getcchar.3x +./man/curs_getch.3x +./man/curs_getstr.3x +./man/curs_getyx.3x +./man/curs_in_wch.3x +./man/curs_in_wchstr.3x +./man/curs_inch.3x +./man/curs_inchstr.3x +./man/curs_initscr.3x +./man/curs_inopts.3x +./man/curs_ins_wch.3x +./man/curs_ins_wstr.3x +./man/curs_insch.3x +./man/curs_insstr.3x +./man/curs_instr.3x +./man/curs_inwstr.3x +./man/curs_kernel.3x +./man/curs_mouse.3x +./man/curs_move.3x +./man/curs_outopts.3x +./man/curs_overlay.3x +./man/curs_pad.3x +./man/curs_print.3x +./man/curs_printw.3x +./man/curs_refresh.3x +./man/curs_scanw.3x +./man/curs_scr_dump.3x +./man/curs_scroll.3x +./man/curs_slk.3x +./man/curs_termattrs.3x +./man/curs_termcap.3x +./man/curs_terminfo.3x +./man/curs_touch.3x +./man/curs_trace.3x +./man/curs_util.3x +./man/curs_window.3x +./man/default_colors.3x +./man/define_key.3x +./man/form.3x +./man/form_cursor.3x +./man/form_data.3x +./man/form_driver.3x +./man/form_field.3x +./man/form_field_attributes.3x +./man/form_field_buffer.3x +./man/form_field_info.3x +./man/form_field_just.3x +./man/form_field_new.3x +./man/form_field_opts.3x +./man/form_field_userptr.3x +./man/form_field_validation.3x +./man/form_fieldtype.3x +./man/form_hook.3x +./man/form_new.3x +./man/form_new_page.3x +./man/form_opts.3x +./man/form_page.3x +./man/form_post.3x +./man/form_requestname.3x +./man/form_userptr.3x +./man/form_win.3x +./man/infocmp.1m +./man/infotocap.1m +./man/keybound.3x +./man/keyok.3x +./man/make_sed.sh +./man/man_db.renames +./man/manlinks.sed +./man/menu.3x +./man/menu_attributes.3x +./man/menu_cursor.3x +./man/menu_driver.3x +./man/menu_format.3x +./man/menu_hook.3x +./man/menu_items.3x +./man/menu_mark.3x +./man/menu_new.3x +./man/menu_opts.3x +./man/menu_pattern.3x +./man/menu_post.3x +./man/menu_requestname.3x +./man/menu_spacing.3x +./man/menu_userptr.3x +./man/menu_win.3x +./man/mitem_current.3x +./man/mitem_name.3x +./man/mitem_new.3x +./man/mitem_opts.3x +./man/mitem_userptr.3x +./man/mitem_value.3x +./man/mitem_visible.3x +./man/ncurses.3x +./man/panel.3x +./man/resizeterm.3x +./man/term.5 +./man/term.7 +./man/terminfo.head +./man/terminfo.tail +./man/tic.1m +./man/toe.1m +./man/tput.1 +./man/tset.1 +./man/wresize.3x +./menu/Makefile.in +./menu/READ.ME +./menu/eti.h +./menu/headers +./menu/llib-lmenu +./menu/llib-lmenuw +./menu/m_attribs.c +./menu/m_cursor.c +./menu/m_driver.c +./menu/m_format.c +./menu/m_global.c +./menu/m_hook.c +./menu/m_item_cur.c +./menu/m_item_nam.c +./menu/m_item_new.c +./menu/m_item_opt.c +./menu/m_item_top.c +./menu/m_item_use.c +./menu/m_item_val.c +./menu/m_item_vis.c +./menu/m_items.c +./menu/m_new.c +./menu/m_opts.c +./menu/m_pad.c +./menu/m_pattern.c +./menu/m_post.c +./menu/m_req_name.c +./menu/m_scale.c +./menu/m_spacing.c +./menu/m_sub.c +./menu/m_userptr.c +./menu/m_win.c +./menu/menu.h +./menu/menu.priv.h +./menu/mf_common.h +./menu/modules +./misc/Makefile.in +./misc/chkdef.cmd +./misc/cleantic.cmd +./misc/cmpdef.cmd +./misc/emx.src +./misc/form.def +./misc/form.ref +./misc/indent.pro +./misc/makedef.cmd +./misc/makellib +./misc/menu.def +./misc/menu.ref +./misc/ncurses.def +./misc/ncurses.ref +./misc/panel.def +./misc/panel.ref +./misc/run_tic.in +./misc/shlib +./misc/tabset/std +./misc/tabset/stdcrt +./misc/tabset/vt100 +./misc/tabset/vt300 +./misc/tdlint +./misc/terminfo.src +./mk-0th.awk +./mk-1st.awk +./mk-2nd.awk +./mkinstalldirs +./ncurses/Makefile.in +./ncurses/README +./ncurses/README.IZ +./ncurses/SigAction.h +./ncurses/base/MKkeyname.awk +./ncurses/base/MKlib_gen.sh +./ncurses/base/MKunctrl.awk +./ncurses/base/README +./ncurses/base/define_key.c +./ncurses/base/keybound.c +./ncurses/base/keyok.c +./ncurses/base/lib_addch.c +./ncurses/base/lib_addstr.c +./ncurses/base/lib_beep.c +./ncurses/base/lib_bkgd.c +./ncurses/base/lib_box.c +./ncurses/base/lib_chgat.c +./ncurses/base/lib_clear.c +./ncurses/base/lib_clearok.c +./ncurses/base/lib_clrbot.c +./ncurses/base/lib_clreol.c +./ncurses/base/lib_color.c +./ncurses/base/lib_colorset.c +./ncurses/base/lib_delch.c +./ncurses/base/lib_delwin.c +./ncurses/base/lib_dft_fgbg.c +./ncurses/base/lib_echo.c +./ncurses/base/lib_endwin.c +./ncurses/base/lib_erase.c +./ncurses/base/lib_flash.c +./ncurses/base/lib_freeall.c +./ncurses/base/lib_getch.c +./ncurses/base/lib_getstr.c +./ncurses/base/lib_hline.c +./ncurses/base/lib_immedok.c +./ncurses/base/lib_inchstr.c +./ncurses/base/lib_initscr.c +./ncurses/base/lib_insch.c +./ncurses/base/lib_insdel.c +./ncurses/base/lib_insstr.c +./ncurses/base/lib_instr.c +./ncurses/base/lib_isendwin.c +./ncurses/base/lib_leaveok.c +./ncurses/base/lib_mouse.c +./ncurses/base/lib_move.c +./ncurses/base/lib_mvwin.c +./ncurses/base/lib_newterm.c +./ncurses/base/lib_newwin.c +./ncurses/base/lib_nl.c +./ncurses/base/lib_overlay.c +./ncurses/base/lib_pad.c +./ncurses/base/lib_printw.c +./ncurses/base/lib_redrawln.c +./ncurses/base/lib_refresh.c +./ncurses/base/lib_restart.c +./ncurses/base/lib_scanw.c +./ncurses/base/lib_screen.c +./ncurses/base/lib_scroll.c +./ncurses/base/lib_scrollok.c +./ncurses/base/lib_scrreg.c +./ncurses/base/lib_set_term.c +./ncurses/base/lib_slk.c +./ncurses/base/lib_slkatr_set.c +./ncurses/base/lib_slkatrof.c +./ncurses/base/lib_slkatron.c +./ncurses/base/lib_slkatrset.c +./ncurses/base/lib_slkattr.c +./ncurses/base/lib_slkclear.c +./ncurses/base/lib_slkcolor.c +./ncurses/base/lib_slkinit.c +./ncurses/base/lib_slklab.c +./ncurses/base/lib_slkrefr.c +./ncurses/base/lib_slkset.c +./ncurses/base/lib_slktouch.c +./ncurses/base/lib_touch.c +./ncurses/base/lib_ungetch.c +./ncurses/base/lib_vline.c +./ncurses/base/lib_wattroff.c +./ncurses/base/lib_wattron.c +./ncurses/base/lib_winch.c +./ncurses/base/lib_window.c +./ncurses/base/memmove.c +./ncurses/base/nc_panel.c +./ncurses/base/resizeterm.c +./ncurses/base/safe_sprintf.c +./ncurses/base/sigaction.c +./ncurses/base/tries.c +./ncurses/base/version.c +./ncurses/base/vsscanf.c +./ncurses/base/wresize.c +./ncurses/curses.priv.h +./ncurses/fifo_defs.h +./ncurses/llib-lncurses +./ncurses/llib-lncursesw +./ncurses/modules +./ncurses/tinfo/MKcaptab.awk +./ncurses/tinfo/MKfallback.sh +./ncurses/tinfo/MKkeys_list.sh +./ncurses/tinfo/MKnames.awk +./ncurses/tinfo/README +./ncurses/tinfo/access.c +./ncurses/tinfo/add_tries.c +./ncurses/tinfo/alloc_entry.c +./ncurses/tinfo/alloc_ttype.c +./ncurses/tinfo/captoinfo.c +./ncurses/tinfo/comp_error.c +./ncurses/tinfo/comp_expand.c +./ncurses/tinfo/comp_hash.c +./ncurses/tinfo/comp_parse.c +./ncurses/tinfo/comp_scan.c +./ncurses/tinfo/doalloc.c +./ncurses/tinfo/free_ttype.c +./ncurses/tinfo/getenv_num.c +./ncurses/tinfo/home_terminfo.c +./ncurses/tinfo/init_keytry.c +./ncurses/tinfo/lib_acs.c +./ncurses/tinfo/lib_baudrate.c +./ncurses/tinfo/lib_cur_term.c +./ncurses/tinfo/lib_data.c +./ncurses/tinfo/lib_has_cap.c +./ncurses/tinfo/lib_kernel.c +./ncurses/tinfo/lib_longname.c +./ncurses/tinfo/lib_napms.c +./ncurses/tinfo/lib_options.c +./ncurses/tinfo/lib_print.c +./ncurses/tinfo/lib_raw.c +./ncurses/tinfo/lib_setup.c +./ncurses/tinfo/lib_termcap.c +./ncurses/tinfo/lib_termname.c +./ncurses/tinfo/lib_tgoto.c +./ncurses/tinfo/lib_ti.c +./ncurses/tinfo/lib_tparm.c +./ncurses/tinfo/lib_tputs.c +./ncurses/tinfo/lib_ttyflags.c +./ncurses/tinfo/make_keys.c +./ncurses/tinfo/name_match.c +./ncurses/tinfo/parse_entry.c +./ncurses/tinfo/read_entry.c +./ncurses/tinfo/read_termcap.c +./ncurses/tinfo/setbuf.c +./ncurses/tinfo/strings.c +./ncurses/tinfo/write_entry.c +./ncurses/trace/README +./ncurses/trace/lib_trace.c +./ncurses/trace/lib_traceatr.c +./ncurses/trace/lib_tracebits.c +./ncurses/trace/lib_tracechr.c +./ncurses/trace/lib_tracedmp.c +./ncurses/trace/lib_tracemse.c +./ncurses/trace/trace_buf.c +./ncurses/trace/trace_tries.c +./ncurses/trace/trace_xnames.c +./ncurses/trace/varargs.c +./ncurses/trace/visbuf.c +./ncurses/tty/MKexpanded.sh +./ncurses/tty/hardscroll.c +./ncurses/tty/hashmap.c +./ncurses/tty/lib_mvcur.c +./ncurses/tty/lib_tstp.c +./ncurses/tty/lib_twait.c +./ncurses/tty/lib_vidattr.c +./ncurses/tty/tty_display.h +./ncurses/tty/tty_input.h +./ncurses/tty/tty_update.c +./ncurses/widechar/lib_box_set.c +./ncurses/widechar/lib_cchar.c +./ncurses/widechar/lib_erasewchar.c +./ncurses/widechar/lib_get_wch.c +./ncurses/widechar/lib_get_wstr.c +./ncurses/widechar/lib_hline_set.c +./ncurses/widechar/lib_in_wch.c +./ncurses/widechar/lib_in_wchnstr.c +./ncurses/widechar/lib_ins_nwstr.c +./ncurses/widechar/lib_ins_wch.c +./ncurses/widechar/lib_inwstr.c +./ncurses/widechar/lib_unget_wch.c +./ncurses/widechar/lib_vid_attr.c +./ncurses/widechar/lib_vline_set.c +./ncurses/widechar/lib_wacs.c +./ncurses/widechar/lib_wunctrl.c +./panel/Makefile.in +./panel/headers +./panel/llib-lpanel +./panel/llib-lpanelw +./panel/modules +./panel/p_above.c +./panel/p_below.c +./panel/p_bottom.c +./panel/p_delete.c +./panel/p_hidden.c +./panel/p_hide.c +./panel/p_move.c +./panel/p_new.c +./panel/p_replace.c +./panel/p_show.c +./panel/p_top.c +./panel/p_update.c +./panel/p_user.c +./panel/p_win.c +./panel/panel.c +./panel/panel.h +./panel/panel.priv.h +./progs/MKtermsort.sh +./progs/Makefile.in +./progs/capconvert +./progs/clear.c +./progs/clear.sh +./progs/dump_entry.c +./progs/dump_entry.h +./progs/infocmp.c +./progs/modules +./progs/progs.priv.h +./progs/tic.c +./progs/toe.c +./progs/tput.c +./progs/tset.c +./sysdeps/unix/sysv/linux/Makefile +./sysdeps/unix/sysv/linux/alpha/configure +./sysdeps/unix/sysv/linux/configure +./sysdeps/unix/sysv/linux/edit_man.sed +./sysdeps/unix/sysv/linux/edit_man.sh +./sysdeps/unix/sysv/linux/run_tic.sh +./tack/COPYING +./tack/HISTORY +./tack/Makefile.in +./tack/README +./tack/ansi.c +./tack/charset.c +./tack/color.c +./tack/control.c +./tack/crum.c +./tack/edit.c +./tack/fun.c +./tack/init.c +./tack/menu.c +./tack/modes.c +./tack/modules +./tack/output.c +./tack/pad.c +./tack/scan.c +./tack/sync.c +./tack/sysdep.c +./tack/tack.1 +./tack/tack.c +./tack/tack.h +./tar-copy.sh +./test/Makefile.in +./test/README +./test/blue.c +./test/bs.6 +./test/bs.c +./test/cardfile.c +./test/cardfile.dat +./test/configure +./test/configure.in +./test/ditto.c +./test/dots.c +./test/filter.c +./test/firework.c +./test/firstlast.c +./test/gdc.6 +./test/gdc.c +./test/hanoi.c +./test/hashtest.c +./test/keynames.c +./test/knight.c +./test/lrtest.c +./test/modules +./test/ncurses.c +./test/ncurses_tst.hin +./test/newdemo.c +./test/railroad.c +./test/rain.c +./test/tclock.c +./test/test.priv.h +./test/testaddch.c +./test/testcurs.c +./test/testscanw.c +./test/tracemunch +./test/view.c +./test/worm.c +./test/xmas.c diff --git a/ncurses-5.3/Makefile.glibc b/ncurses-5.3/Makefile.glibc new file mode 100644 index 0000000..2535e9f --- /dev/null +++ b/ncurses-5.3/Makefile.glibc @@ -0,0 +1,405 @@ +# Copyright (C) 1997,1998 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. + +# You should have received a copy of the GNU Library General Public +# License along with the GNU C Library; see the file COPYING.LIB. If not, +# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# +# Makefile for ncurses part. +# +subdir := ncurses + +ncurses-version = 4.2 +form-version = $(ncurses-version) +menu-version = $(ncurses-version) +panel-version = $(ncurses-version) + +extras := form menu ncurses panel + +extra-libs = $(extras:%=lib%) +# These libraries will be built in the `others' pass rather than +# the `lib' pass, because they depend on libc.so being built already. +extra-libs-others = $(extra-libs) + +# The sources are found in the appropriate subdir. +subdir-dirs = $(extras) progs test +vpath %.c $(subdir-dirs) +vpath %.h $(subdir-dirs) + +libform-routines = \ + fld_arg \ + fld_attr \ + fld_current \ + fld_def \ + fld_dup \ + fld_ftchoice \ + fld_ftlink \ + fld_info \ + fld_just \ + fld_link \ + fld_max \ + fld_move \ + fld_newftyp \ + fld_opts \ + fld_pad \ + fld_page \ + fld_stat \ + fld_type \ + fld_user \ + frm_cursor \ + frm_data \ + frm_def \ + frm_driver \ + frm_hook \ + frm_opts \ + frm_page \ + frm_post \ + frm_req_name \ + frm_scale \ + frm_sub \ + frm_user \ + frm_win \ + fty_alnum \ + fty_alpha \ + fty_enum \ + fty_int \ + fty_ipv4 \ + fty_num \ + fty_regex + +libncurses-routines = \ + base/define_key \ + base/keybound \ + base/keyok \ + base/lib_addch \ + base/lib_addstr \ + base/lib_beep \ + base/lib_bkgd \ + base/lib_box \ + base/lib_chgat \ + base/lib_clear \ + base/lib_clearok \ + base/lib_clrbot \ + base/lib_clreol \ + base/lib_color \ + base/lib_colorset \ + base/lib_delch \ + base/lib_delwin \ + base/lib_dft_fgbg \ + base/lib_echo \ + base/lib_endwin \ + base/lib_erase \ + base/lib_flash \ + base/lib_freeall \ + base/lib_getch \ + base/lib_getstr \ + base/lib_hline \ + base/lib_immedok \ + base/lib_inchstr \ + base/lib_initscr \ + base/lib_insch \ + base/lib_insdel \ + base/lib_insstr \ + base/lib_instr \ + base/lib_isendwin \ + base/lib_leaveok \ + base/lib_mouse \ + base/lib_move \ + base/lib_mvwin \ + base/lib_newterm \ + base/lib_newwin \ + base/lib_nl \ + base/lib_overlay \ + base/lib_pad \ + base/lib_printw \ + base/lib_redrawln \ + base/lib_refresh \ + base/lib_restart \ + base/lib_scanw \ + base/lib_screen \ + base/lib_scroll \ + base/lib_scrollok \ + base/lib_scrreg \ + base/lib_set_term \ + base/lib_slk \ + base/lib_slkatr_set \ + base/lib_slkatrof \ + base/lib_slkatron \ + base/lib_slkatrset \ + base/lib_slkattr \ + base/lib_slkclear \ + base/lib_slkcolor \ + base/lib_slkinit \ + base/lib_slklab \ + base/lib_slkrefr \ + base/lib_slkset \ + base/lib_slktouch \ + base/lib_touch \ + base/lib_ungetch \ + base/lib_vline \ + base/lib_wattroff \ + base/lib_wattron \ + base/lib_winch \ + base/lib_window \ + base/memmove \ + base/nc_panel \ + base/resizeterm \ + base/safe_sprintf \ + base/sigaction \ + base/tries \ + base/version \ + base/vsscanf \ + base/wresize \ + codes \ + comp_captab \ + expanded \ + fallback \ + lib_gen \ + lib_keyname \ + names \ + tinfo/access \ + tinfo/add_tries \ + tinfo/alloc_entry \ + tinfo/alloc_ttype \ + tinfo/captoinfo \ + tinfo/comp_error \ + tinfo/comp_expand \ + tinfo/comp_hash \ + tinfo/comp_parse \ + tinfo/comp_scan \ + tinfo/doalloc \ + tinfo/free_ttype \ + tinfo/getenv_num \ + tinfo/home_terminfo \ + tinfo/init_keytry \ + tinfo/lib_acs \ + tinfo/lib_baudrate \ + tinfo/lib_cur_term \ + tinfo/lib_data \ + tinfo/lib_has_cap \ + tinfo/lib_kernel \ + tinfo/lib_longname \ + tinfo/lib_napms \ + tinfo/lib_options \ + tinfo/lib_print \ + tinfo/lib_raw \ + tinfo/lib_setup \ + tinfo/lib_termcap \ + tinfo/lib_termname \ + tinfo/lib_tgoto \ + tinfo/lib_ti \ + tinfo/lib_tparm \ + tinfo/lib_tputs \ + tinfo/lib_ttyflags \ + tinfo/name_match \ + tinfo/parse_entry \ + tinfo/read_entry \ + tinfo/read_termcap \ + tinfo/setbuf \ + tinfo/strings \ + tinfo/write_entry \ + trace/lib_trace \ + trace/lib_traceatr \ + trace/lib_tracebits \ + trace/lib_tracechr \ + trace/lib_tracedmp \ + trace/lib_tracemse \ + trace/trace_buf \ + trace/trace_tries \ + trace/trace_xnames \ + trace/varargs \ + trace/visbuf \ + tty/hardscroll \ + tty/hashmap \ + tty/lib_mvcur \ + tty/lib_tstp \ + tty/lib_twait \ + tty/lib_vidattr \ + tty/tty_update \ + unctrl + +libmenu-routines = \ + m_attribs \ + m_cursor \ + m_driver \ + m_format \ + m_global \ + m_hook \ + m_item_cur \ + m_item_nam \ + m_item_new \ + m_item_opt \ + m_item_top \ + m_item_use \ + m_item_val \ + m_item_vis \ + m_items \ + m_new \ + m_opts \ + m_pad \ + m_pattern \ + m_post \ + m_req_name \ + m_scale \ + m_spacing \ + m_sub \ + m_userptr \ + m_win + +libpanel-routines = \ + panel \ + p_above \ + p_below \ + p_bottom \ + p_delete \ + p_hide \ + p_hidden \ + p_move \ + p_new \ + p_replace \ + p_show \ + p_top \ + p_update \ + p_user \ + p_win + +headers = curses.h eti.h form.h menu.h panel.h term.h termcap.h \ + unctrl.h +others = clear infocmp tic toe tput tset +install-bin = $(others) + +clear-objs = clear.o +infocmp-objs = infocmp.o dump_entry.o +tic-objs = tic.o dump_entry.o +toe-objs = toe.o dump_entry.o +tput-objs = tput.o +tset-objs = tset.o dump_entry.o +extra-objs = $(tic-objs) $(toe-objs) $(infocmp-objs) $(clear-objs) \ + $(tput-objs) $(tset-objs) + +test-srcs = blue bs cardfile ditto firework firstlast gdc hanoi hashtest knight \ + lrtest ncurses newdemo rain tclock testaddch testcurs \ + testscanw view worm xmas + +include ../Rules + +ifndef tabsetdir +tabsetdir = $(datadir)/tabset +endif +ifndef inst_tabsetdir +inst_tabsetdir = $(install_root)/$(tabsetdir) +endif + +ifndef terminfodir +terminfodir = $(datadir)/terminfo +endif +ifndef inst_terminfodir +inst_terminfodir = $(install_root)/$(terminfodir) +endif + +ifndef mandir +mandir = $(prefix)/man +endif + +ifndef inst_mandir +inst_mandir = $(install_root)/$(mandir) +endif + +CPPFLAGS += -DTERMINFO='"$(terminfodir)"' -Iinclude -Iform -Incurses \ + -Imenu -Ipanel -Iprogs -Itest + +ifneq ($(strip $(objpfx)),) +CPPFLAGS += -I$(objpfx) +endif + +LDLIBS-tclock = math/libm + +tests: $(test-srcs:%=$(objpfx)%) + +$(objpfx)clear: $(addprefix $(objpfx),$(clear-objs)) +$(objpfx)infocmp: $(addprefix $(objpfx),$(infocmp-objs)) +$(objpfx)tic: $(addprefix $(objpfx),$(tic-objs)) +$(objpfx)toe: $(addprefix $(objpfx),$(toe-objs)) +$(objpfx)tput: $(addprefix $(objpfx),$(tput-objs)) +$(objpfx)tset: $(addprefix $(objpfx),$(tset-objs)) + +ifeq ($(build-shared),yes) +$(others:%=$(objpfx)%): $(objpfx)libncurses.so +else +$(others:%=$(objpfx)%): $(objpfx)libncurses.a +endif + +$(test-srcs:%=$(objpfx)%): $(objpfx)libform.a $(objpfx)libmenu.a \ + $(objpfx)libpanel.a $(objpfx)libncurses.a + +# Depend on libc.so so a DT_NEEDED is generated in the shared objects. +# This ensures they will load libc.so for needed symbols if loaded by +# a statically-linked program that hasn't already loaded it. +$(extras:%=$(objpfx)lib%.so): $(common-objpfx)libc.so + +subdir_install: $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a \ + $(inst_bindir)/reset $(inst_bindir)/captoinfo + +$(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a: \ + $(inst_libdir)/libncurses.a + $(make-link) + +$(inst_bindir)/reset: $(inst_bindir)/tset + $(make-link) + +$(inst_bindir)/captoinfo: $(inst_bindir)/tic + $(make-link) + +ifeq (yes,$(build-shared)) +subdir_install: $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so + +$(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so: \ + $(inst_libdir)/libncurses.so + $(make-link) +endif + +subdir_install: $(inst_mandir)/man5/terminfo.5 + +$(inst_mandir)/man5/terminfo.5: $(objpfx)terminfo.5 $(wildcard man/*.[0-9]*) + $(make-target-directory) + sh $(edit_man-sh) $(prefix) $(inst_mandir) $(edit_man-sed) $^ + +subdir_install: $(inst_tabsetdir)/std + +$(inst_tabsetdir)/std: \ + $(filter-out misc/tabset/CVS, $(wildcard misc/tabset/*)) + $(make-target-directory) + for f in $^; do \ + echo installing $$f; \ + $(INSTALL_DATA) $$f $(inst_tabsetdir); \ + done + + +ifeq (no,$(cross-compiling)) +subdir_install: $(inst_terminfodir)/v/vt100 + +$(inst_terminfodir)/v/vt100: misc/terminfo.src $(objpfx)tic + $(make-target-directory) + sh $(run_tic-sh) $(common-objpfx) misc $(terminfodir) \ + $(install_root) +endif + +subdir_distclean subdir_realclean: + -rm -f $(addprefix $(objpfx), MKterm.h.awk codes.c \ + comp_captab.c confdefs.h config.log curses.h \ + expanded.c fallback.c hashsize.h keys.tries \ + lib_gen.c lib_keyname.c names.c ncurses_cfg.h \ + nomacros.h parametrized.h term.h termcap.h \ + terminfo.5 termsort.c unctrl.c unctrl.h) diff --git a/ncurses-5.3/Makefile.in b/ncurses-5.3/Makefile.in new file mode 100644 index 0000000..bde27bf --- /dev/null +++ b/ncurses-5.3/Makefile.in @@ -0,0 +1,93 @@ +# $Id$ +############################################################################## +# 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 1996,1997 +# +# Master Makefile for ncurses library. + +SHELL = /bin/sh + +DESTDIR=@DESTDIR@ +CF_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" + +@SET_MAKE@ + +NCURSES_MAJOR = @NCURSES_MAJOR@ +NCURSES_MINOR = @NCURSES_MINOR@ +NCURSES_PATCH = @NCURSES_PATCH@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +ticdir = @TERMINFO@ +includedir = @includedir@ +libdir = @libdir@ +mandir = @mandir@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +DIRS_TO_MAKE = @DIRS_TO_MAKE@ + +all :: $(DIRS_TO_MAKE) + +$(DIRS_TO_MAKE) : + mkdir $@ + +preinstall : + @ echo '' + @ echo '** Configuration summary for NCURSES $(NCURSES_MAJOR).$(NCURSES_MINOR) $(NCURSES_PATCH):' + @ echo '' + @ echo ' bin directory: '$(bindir) + @ echo ' lib directory: '$(libdir) + @ echo ' include directory: '$(includedir) + @ echo ' man directory: '$(mandir) +@MAKE_TERMINFO@ @ echo ' terminfo directory: '$(ticdir) + @ echo '' + @ test "$(includedir)" = "$(prefix)/include" || \ + echo '** Include-directory is not in a standard location' + @ test ! -f $(includedir)/termcap.h || \ + fgrep NCURSES_VERSION $(includedir)/termcap.h >/dev/null || \ + echo '** Will overwrite non-ncurses termcap.h' + @ test ! -f $(includedir)/curses.h || \ + fgrep NCURSES_VERSION $(includedir)/curses.h >/dev/null || \ + echo '** Will overwrite non-ncurses curses.h' + +# Put the common rules here so that we can easily construct the list of +# directories to visit. +all \ +clean \ +distclean \ +mostlyclean \ +realclean \ +depend \ +sources \ +uninstall \ +install :: diff --git a/ncurses-5.3/Makefile.os2 b/ncurses-5.3/Makefile.os2 new file mode 100644 index 0000000..ed0f68a --- /dev/null +++ b/ncurses-5.3/Makefile.os2 @@ -0,0 +1,234 @@ +################################################################################ +# Wrapper Makefile for ncurses library under OS/2. +################################################################################ +# $Id$ +# +# Author: Juan Jose Garcia Ripoll . +# Webpage: http://www.arrakis.es/~worm/ +################################################################################ +# +# Notes (from I Zakharevich) +# ~~~~~~~~~~~~~~~~~~~~~~~~~~ +# I could build the library with the following sequence of commands: +# +# touch Makefile +# make -f Makefile.os2 config +# make -f Makefile.os2 CC=gcc HOSTCC=gcc CXX=gcc +# +# Ignoring the following errors: +# Invalid configuration `os2'... +# ... ac_maketemp="make": not found +# ... syntax error: `done' unexpected +# No rule to make target `lib/ncurses4.dll' +# +# You may need to run +# +# rm make.defs +# make -f Makefile.os2 make.defs +# +# if the build of misc/panel.def fails. +# +# If you do not have perl, the configuration will fail. Use autoconf to +# generate the EMX-specific configure script (see README.emx), and run the +# configure script to generate the makefiles. Then, run +# +# make -f Makefile.os2 make.dlls +# +# Notes (from J J G Ripoll) +# ~~~~~~~~~~~~~~~~~~~~~~~~~ +# The `make.defs' rule creates the new '.def' files and outputs a diagnostic +# about symbols that disappear from one release to the other, as well as +# checks about the new '.def' consistency. If there were no problems, the +# maintainer is free to replace the `.ref' files with the newer ones using the +# `save.defs' rule. So, the only tough work is ensuring that the symbols that +# disappear are not essential. +# +# I first thought about killing '_nc_*' symbols, but it seems that some of +# them --_nc_panel_hook, _nc_ada*, etc-- are needed outside ncurses.dll. +# However, the whole size of the export table will not be larger than 1k or +# so. +# +# [installation] +# +# The way things are handled in misc/Makefile is not well suited for OS/2, +# where only emx.src is needed. Thus, I've written a few wrapper rules in +# Makefile.os2 that handle installation/deinstallation. +# +# [distribution] +# +# There's also a new rule that configures and builds a sort of binary +# distribution, much like the one I prepared for 1.9.9e. It's `os2dist'. +# +################################################################################ + +all :: config + +# This is for configuring + +# What is a useful value for this? +CONFIG_OPTS = --enable-termcap +WWWGET = lynx -source +MV_F = mv -f +DLL_LN_OPTS = -Zcrtdll -Zdll -Zomf -Zmt + +config: config.cache + +config.cache: configure.cmd configure + -$(MV_F) $@ $@.ref + configure.cmd $(CONFIG_OPTS) + +configure.cmd: configure convert_configure.pl + perl convert_configure.pl configure > $@ + +convert_configure.pl: + $(WWWGET) ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2/$@ > $@ + +install :: + echo *** + echo *** Do not use this command. Use install.os2 instead. + echo *** + exit 2 + +install.os2 : install.emxdata install.libs install.progs + +include ./Makefile + +all :: make.dlls + +# +# DLLs and that stuff +# + +LIBRARIES = ncurses form menu panel + +DLL_TAG = $(NCURSES_MAJOR) +LIB_TAG = _s + +DLL_ROOTS = $(addsuffix $(DLL_TAG), $(LIBRARIES)) +DLLS = $(addsuffix .dll, $(addprefix ./lib/, $(DLL_ROOTS))) + +LIB_ROOTS = $(addsuffix $(LIB_TAG), $(LIBRARIES)) +LIBS = $(addsuffix .lib, $(addprefix ./lib/, $(LIB_ROOTS))) + +LIBS_AOUT = $(addsuffix .a, $(addprefix ./lib/, $(LIB_ROOTS))) + +DEFS = $(addsuffix .def, $(addprefix ./misc/, $(LIBRARIES))) + +DLL_SIGNATURE = NCurses-$(NCURSES_MAJOR)-$(NCURSES_MINOR)-$(NCURSES_PATCH) + +./lib/%$(LIB_TAG).lib : ./misc/%.def + emximp -o $@ $< + +./lib/%$(LIB_TAG).a : ./misc/%.def + emximp -o $@ $< + +./lib/%$(DLL_TAG).dll : ./lib/%.a + emxomf -o ./lib/$*$(DLL_TAG).lib $< + if [ "$*" = "ncurses" ]; then \ + gcc $(LDFLAGS) $(DLL_LN_OPTS) ./lib/$*$(DLL_TAG).lib \ + ./misc/$*.def -o $@; \ + else \ + gcc $(LDFLAGS) $(DLL_LN_OPTS) ./lib/$*$(DLL_TAG).lib \ + ./lib/ncurses$(LIB_TAG).lib ./misc/$*.def -o $@; \ + fi + -rm -f ./lib/$*$(DLL_TAG).lib + +make.dlls : $(DEFS) $(LIBS) $(DLLS) $(LIBS_AOUT) + +$(DEFS) : make.defs + +LIBDIR = $(DESTDIR)$(libdir) +$(LIBDIR) : + mkdir -p $@ + +install.libs :: $(LIBS) $(DLLS) $(LIBDIR) + @for i in $(DLL_ROOTS); do \ + echo installing ./lib/$$i.dll as $(LIBDIR)/$$i.dll; \ + $(INSTALL_DATA) ./lib/$$i.dll $(LIBDIR)/$$i.dll; done + @for i in $(LIB_ROOTS); do \ + echo installing ./lib/$$i.lib as $(LIBDIR)/$$i.lib; \ + $(INSTALL_DATA) ./lib/$$i.lib $(LIBDIR)/$$i.lib; done + +uninstall.libs :: + -@for i in $(DLL_ROOTS); do \ + echo uninstalling $(LIBDIR)/$$i.dll; \ + rm -f $(LIBDIR)/$$i.dll; done + -@for i in $(LIB_ROOTS); do \ + echo uninstalling $(LIBDIR)/$$i.lib; \ + rm -f $(LIBDIR)/$$i.lib; done + +make.defs : + for i in $(LIBRARIES); do \ + echo LIBRARY $${i}$(DLL_TAG) INITINSTANCE TERMINSTANCE > ./misc/$$i.def; \ + echo DESCRIPTION \"$(DLL_SIGNATURE), module $$i\" >> ./misc/$$i.def; \ + echo CODE LOADONCALL >> ./misc/$$i.def; \ + echo DATA LOADONCALL NONSHARED MULTIPLE >> ./misc/$$i.def; \ + echo EXPORTS >> ./misc/$$i.def; \ + echo Creating $$i.def; \ + (cmd /C ".\\misc\\makedef.cmd ./lib/$$i.a ./misc/$$i.ref >> ./misc/$$i.def" \ + && cmd /C ".\\misc\\chkdef.cmd ./misc/$$i.def") \ + || exit 1; \ + done + touch make.defs + +save.defs : + for i in $(LIBRARIES); do \ + test -f ./misc/$$i.def && cp ./misc/$$i.def ./misc/$$i.ref; \ + done + +clean \ +os2clean :: + -rm -f $(DLLS) $(LIBS) + +realclean :: + -rm -f $(addprefix ./misc/, $(addsuffix .def, $(LIBRARIES))) + +# +# This is a simplified version of misc/Makefile +# + +TICDIR = $(DESTDIR)$(datadir)/terminfo +TABSETDIR = $(DESTDIR)$(datadir)/tabset + +$(TICDIR) : + mkdir -p $@ + +install \ +install.emxdata :: $(TICDIR) + -@rm -fr $(TICDIR)/* + echo Building terminfo database, please wait... + set TERMINFO=$(TICDIR); ./progs/tic ./misc/emx.src + echo Installing the terminfo cleaner and the sources... + cp ./misc/emx.src ./misc/cleantic.cmd $(TICDIR) + ./misc/cleantic.cmd $(TICDIR) + +uninstall \ +uninstall.emxdata :: + -cd $(TICDIR) && rm -rf * + -cd $(TABSETDIR) && rm -rf * + +# +# This is for preparing binary distributions +# + +OS2NAME=ncurses-$(NCURSES_MAJOR).$(NCURSES_MINOR)-emx + +# +# FIXME: this assumes that we can rerun the configure script, changing only +# the install-prefix. That means we cannot provide "interesting" options +# when building. +# +os2dist : + $(MAKE) -f Makefile.os2 os2clean + ./configure --without-debug --with-install-prefix=`pwd|sed -e 's@^.:@@'`/$(OS2NAME) + $(MAKE) -f Makefile.os2 $(CF_MFLAGS) install.os2 + -rm -f $(OS2NAME).zip + echo NCurses-$(NCURSES_MAJOR).$(NCURSES_MINOR)-$(NCURSES_PATCH) for emx > $(OS2NAME)/FILE_ID.DIZ + echo Binary release. >> $(OS2NAME)/FILE_ID.DIZ + zip -r $(OS2NAME).zip ./$(OS2NAME) + +clean \ +os2clean :: + -rm -rf $(OS2NAME) + -rm -f $(OS2NAME).zip + diff --git a/ncurses-5.3/NEWS b/ncurses-5.3/NEWS new file mode 100644 index 0000000..7908bf6 --- /dev/null +++ b/ncurses-5.3/NEWS @@ -0,0 +1,5802 @@ +-- $Id$ + +This is a log of changes that ncurses has gone through since Zeyd started +working with Pavel Curtis' original work, pcurses, in 1992. + +Changes through 1.9.9e are recorded by Zeyd M. Ben-Halim. +Changes since 1.9.9e are recorded by Thomas Dickey. + +20021012 5.3 release for upload to ftp.gnu.org + + modify ifdef's in etip.h.in to allow the etip.h header to compile + with gcc 3.2 (patch by Dimitar Zhekov ). + + add logic to setupterm() to make it like initscr() and newterm(), + by checking for $NCURSES_TRACE environment variable and enabling + the debug trace in that case. + + modify setupterm() to ensure that it initializes the baudrate, for + applications such as tput (report by Frank Henigman). + + modify definition of bits used for command-line and library debug + traces to avoid overlap, using new definition TRACE_SHIFT to relate + the two. + + document tput's interpretation of parameterized strings according to + whether parameters are given, etc. (discussion with Robert De Bath). + +20021005 pre-release + + correct winnwstr() to account for non-character cells generated when + a double-width character is added (report by Michael Bienia + ). + + modify _nc_viswbuf2n() to provide better results using wctomb(). + + correct logic in _nc_varargs() which broke tracing of parameters for + formats such as "%.*s". + + correct scale factor in linux-c and linux-c-nc terminfo entries + (report Floyd Davidson). + + change tic -A option to -t, add the same option to infocmp for + consistency. + + correct "%c" implementation in lib_tparm.c, which did not map a null + character to a 128 (cf: 980620) (patch by Frank Henigman + ). + +20020928 pre-release + + modify MKkey_defs.sh to check for POSIX sort -k option, use that if + it is found, to accommodate newer utility which dropped the + compatibility support for +number options (reported by Andrey A + Chernov). + + modify linux terminfo entry to use color palette feature from + linux-c-nc entry (comments by Tomasz Wasiak and Floyd Davidson). + + restore original color definitions in endwin() if init_color() was + used, and resume those colors on the next doupdate() or refresh() + (report by Tomasz Wasiak ). + + improve debug-traces by modifying MKlib_gen.sh to generate calls + to returnBool() and returnAttr(). + + add/use _nc_visbufn() and _nc_viswbufn() to limit the debug trace + of waddnstr() and similar functions to match the parameters as used. + + add/use _nc_retrace_bool() and _nc_retrace_unsigned(). + + correct type used by _nc_retrace_chtype(). + + add debug traces to some functions in lib_mouse.c + + modify lib_addch.c to handle non-spacing characters. + + correct parameter of RemAttr() in lib_bkgd.c, which caused the c++ + demo's boxes to lose the A_ALTCHARSET flag (broken in 20020629). + + correct width computed in _tracedump(), which did not account for + the attributes (broken in 20010602). + + modify test/tracemunch to replace addresses for windows other than + curscr, newscr and stdscr with window0, window1, etc. + +20020921 pre-release + + redid fix for edit_man.sed path. + + workaround for Cygwin bug which makes subprocess writes to stdout + result in core dump. + + documented getbegx(), etc. + + minor fixes to configure script to use '%' consistently as a sed + delimiter rather than '@'. + > Philippe Blain: + + add check in lib_overlay.c to ensure that the windows to be merged + actually overlap, and in copywin(), limit the area to be touched + to the lines given for the destination window. + +20020914 pre-release + + modified curses.h so that if the wide-character version is installed + overwriting /usr/include/curses.h, and if it relied on libutf8.h, + then applications that use that header for wide-character support + must define HAVE_LIBUTF8_H. + + modify putwin(), getwin() and dupwin() to allow them to operate on + pads (request by Philippe Blain). + + correct attribute-merging in wborder(), broken in 20020216 (report + by Tomasz Wasiak ). + > Philippe Blain: + + corrected pop-counts in tparam_internal() to '!' and '~' cases. + + use sizeof(NCURSES_CH_T) in one place that used sizeof(chtype). + + remove some unused variables from mvcur test-driver. + +20020907 pre-release + + change configure script to allow install of widec-character + (ncursesw) headers to overwrite normal (ncurses) headers, since the + latter is a compatible subset of the former. + + fix path of edit_man.sed in configure script, needed to regenerate + html manpages on Debian. + + fix mismatched enums in vsscanf.c, which caused warning on Solaris. + + update README.emx to reflect current patch used for autoconf. + + change web- and ftp-site to invisible-island.net + > Philippe Blain: + + change case for 'P' in tparam_internal() to indicate that it pops + a variable from the stack. + + correct sense of precision and width in parse_format(), to avoid + confusion. + + modify lib_tparm.c, absorb really_get_space() into get_space(). + + modify getwin() and dupwin() to copy the _notimeout, _idlok and + _idcok window fields. + + better fix for _nc_set_type(), using typeMalloc(). + +20020901 pre-release + + change minor version to 3, i.e., ncurses 5.3 + + update config.guess, config.sub + + retest build with each configure option; minor ifdef fixes. + + make keyname() return a null pointer rather than "UNKNOWN STRING" to + match XSI. + + modify handling of wide line-drawing character functions to use the + normal line-drawing characters when not in UTF-8 locale. + + add check/fix to comp_parse.c to suppress warning about missing acsc + string. This happens in configurations where raw termcap information + is processed; tic already does this and other checks. + + modify tic's check for ich/ich1 versus rmir/smir to only warn about + ich1, to match xterm patch #70 notes. + + moved information for ripped-off lines into SCREEN struct to allow + use in resizeterm(). + + add experimental wgetch_events(), ifdef'd with NCURSES_WGETCH_EVENTS + (adapted from patch by Ilya Zakharevich - see ncurses/README.IZ). + + amend check in kgetch() from 20020824 to look only for function-keys, + otherwise escape sequences are not resolved properly. + > Philippe Blain: + + removed redundant assignment to SP->_checkfd from newterm(). + + check return-value of setupterm() in restartterm(). + + use sizeof(NCURSES_CH_T) in a few places that used sizeof(chtype). + + prevent dupwin() from duplicating a pad. + + prevent putwin() from writing a pad. + + use typeRealloc() or typeMalloc() in preference to direct calls on + _nc_doalloc(). + +20020824 + + add a check in kgetch() for cooked characters in the fifo to avoid + calling fifo_push() when a KEY_RESIZE is available (report/analysis + by Sam Varshavchik ). + + fix an overlooked case for bugzilla #68199 (Philippe Blain). + + ensure clearerr() is called before using ferror() e.g., in + lib_screen.c (report by Philippe Blain). + +20020817 + + modify lib_screen.c and lib_newwin.c to maintain the SCREEN-specific + pointers for curscr/stdscr/newscr when scr_save() and scr_restore() + modify the global curscr/stdscr/newscr variables. Fixes Redhat + bugzilla #68199 dated 2002-07-07. + + add checks for null pointer in calls to tparm() and tgoto() based on + FreeBSD bug report. If ncurses were built with termcap support, and + the first call to tgoto() were a zero-length string, the result would + be a null pointer, which was not handled properly. + + correct a typo in terminfo.head, which gave the octal code for colon + rather than comma. + + remove the "tic -u" option from 20020810, since it did not account + for nested "tc=" clauses, and when that was addressed, was still + unsatisfactory. + +20020810 + + add tic -A option to suppress capabilities which are commented out + when translating to termcap. + + add tic -u option to provide older behavior of "tc=" clauses. + + modified tic to expand all but the final "tc=" clause in a termcap + entry, to accommodate termcap libraries which do not handle multiple + tc clauses. + + correct typo in curs_inopts.3x regarding CS8/CS7 usage (report by + Philippe Blain). + + remove a couple of redundant uses of A_ATTRIBUTES in expressions + using AttrOf(), which already incorporates that mask (report by + Philippe Blain). + + document TABSIZE variable. + + add NCURSES_ASSUMED_COLORS environment variable, to allow users to + override compiled-in default black-on-white assumption used in + assume_default_colors(). + + correct an off-by-one comparison against max_colors in COLORFGBG + logic. + + correct a use of uninitialized memory found by valgrind (reported by + Olaf Buddenhagen ). + + modified wresize() to ensure that a failed realloc will not corrupt + the window structure, and to make subwindows fit within the resized + window (completes Debian #87678, #101699) + +20020803 + + fix an off-by-one in lib_pad.c check for limits of pad (patch by + Philippe Blain). + + revise logic for BeOS in lib_twait.c altered in 20011013 to restore + logic used by lib_getch.c's support for GPM or EMX mouse (report by + Philippe Blain) + + remove NCURSES_CONST from several prototypes in curses.wide, to make + the --enable-const --enable-widec configure options to work together + (report by George Goffe ). + +20020727 + + finish no-leak checking in cardfile.c, using this for testing changes + to resizeterm(). + + simplify _nc_freeall() using delscreen(). + +20020720 + + check error-return from _nc_set_tty_mode() in _nc_initscr() and + reset_prog_mode() (report/patch by Philippe Blain). + + regenerate configure using patch for autoconf 2.52, to address + problem with identifying C++ bool type. + + correct/improve logic to produce an exit status for errors in tput, + which did not exit with an error when told to put a string not in the + current terminfo entry (report by David Gomez ). + + modify configure script AC_OUTPUT() call to work around defect in + autoconf 2.52 which adds an ifdef'd include to the generated + configure definitions. + + remove fstat() check from scr_init(), which also fixes a missing + include for from 20020713 (reported by David Ellement, + fix suggested by Philippe Blain). + + update curs_scanw.3x manpage to note that XSI curses differs from + SVr4 curses: return-values are incompatible. + + correct several prototypes in manpages which used const + inconsistently with the curses.h file, and removed spurious const's + in a few places from curses.h, e.g., for wbkgd() (report by Glenn + Maynard ). + + change internal type used by tparm() to long, to work with LP64 model. + + modify nc_alloc.h to allow building with g++, for testing. + +20020713 + + add resize-handling to cardfile.c test program. + + altered resizeterm() to avoid having it fail when a child window + cannot be resized because it would be larger than its parent. (More + work must be done on this, but it works well enough to integrate). + + improve a limit-check in lib_refresh.c + + remove check in lib_screen.c relating dumptime to file's modification + times, since that would not necessarily work for remotely mounted + filesystems. + + modify lrtest to simplify debugging changes to resizeterm, e.g., + t/T commands to enable/disable tracing. + + updated status of multibyte support in TO-DO. + + update contact info in source-files (patch by Juergen Pfeifer). + +20020706 + + add Caps.hpux11, as an example. + + modify version_filter(), used to implement -R option for tic and + infocmp, to use computed array offsets based on the Caps.* file which + is actually configured, rather than constants which correspond to + the Caps file. + + reorganized lib_raw.c to avoid updating SP and cur_term state if the + functions fail (reported by Philippe Blain). + + add -Wundef to gcc warnings, adjust a few ifdef's to accommodate gcc. + +20020629 + + correct parameters to setcchar() in ncurses.c (cf: 20020406). + + set locale in most test programs (view.c and ncurses.c were the + only ones). + + add configure option --with-build-cppflags (report by Maksim A + Nikulin ). + + correct a typo in wide-character logic for lib_bkgnd.c (Philippe + Blain). + + modify lib_wacs.c to not cancel the acsc, smacs, rmacs strings when + in UTF-8 locale. Wide-character functions use Unicode values, while + narrow-character functions use the terminfo data. + + fix a couple of places in Ada95/samples which did not compile with + gnat 3.14 + + modify mkinstalldirs so the DOS-pathname case is locale-independent. + + fix locale problem in MKlib_gen.sh by forcing related variables to + POSIX (C), using same approach as autoconf (set variables only if + they were set before). Update MKterminfo.sh and MKtermsort.sh to + match. + +20020622 + + add charset to generated html. + + add mvterm entry, adapted from a FreeBSD bug-report by Daniel Rudy + -TD + + add rxvt-16color, ibm+16color entries -TD + + modify check in --disable-overwrite option so that it is used by + default unless the --prefix/$prefix value is not /usr, in attempt to + work around packagers, e.g., for Sun's freeware, who do not read the + INSTALL notes. + +20020615 + + modify wgetch() to allow returning ungetch'd KEY_RESIZE as a function + key code in get_wch(). + + extended resize-handling in test/ncurses 'a' menu to the entire + stack of windows created with 'w' commands. + + improve $COLORFGBG feature by interpreting an out-of-range color + value as an SGR 39 or 49, for foreground/background respectively. + + correct a typo in configure --enable-colorfgbg option, and move it + to the experimental section (cf: 20011208). + +20020601 + + add logic to dump_entry.c to remove function-key definitions that do + not fit into the 1023-byte limit for generated termcaps. This makes + hds200 fit. + + more improvements to tic's warnings, including logic to ignore + differences between delay values in sgr strings. + + move definition of KEY_RESIZE into MKkeydefs.sh script, to + accommodate Caps.osf1r5 which introduced a conflicting definition. + +20020525 + + add simple resize-handling in test/ncurses.c 'a' menu. + + fixes in keyname() and _tracechar() to handle negative values. + + make tic's warnings about mismatches in sgr strings easier to follow. + + correct tic checks for number of parameters in smgbp and smglp. + + improve scoansi terminfo entry, and add scoansi-new entry -TD + + add pcvt25-color terminfo entry -TD + + add kf13-kf48 strings to cons25w terminfo entry (reported by Stephen + Hurd in newsgroup lucky.freebsd.bugs) -TD + + add entrypoint _nc_trace_ttymode(), use this to distinguish the + Ottyb and Nttyb members of terminal (aka cur_term), for tracing. + +20020523 + + correct and simplify logic for lib_pad.c change in 20020518 (reported + by Mike Castle). + +20020518 + + fix lib_pad.c for case of drawing a double-width character which + falls off the left margin of the pad (patch by Kriang Lerdsuwanakij + ) + + modify configure script to work around broken gcc 3.1 "--version" + option, which adds unnecessary trash to the requested information. + + adjust ifdef's in case SIGWINCH is not defined, e.g., with DJGPP + (reported by Ben Decker ). + +20020511 + + implement vid_puts(), vid_attr(), term_attrs() based on the narrow- + character versions as well. + + implement erasewchar(), killwchar() based on erasechar() and + killchar(). + + modify erasechar() and killchar() to return ERR if the value was + VDISABLE. + + correct a bug in wresize() in handling subwindows (based on patch by + Roger Gammans , report by Scott Beck + ). + + improve test/tclock.c by making the second-hand update more often + if gettimeofday() is available. + +20020429 + + workaround for Solaris sed with MKlib_gen.sh (reported by Andy + Tsouladze ). + +20020427 + + correct return-value from getcchar(), making it consistent with + Solaris and Tru64. + + reorder loops that generate makefile rules for different models vs + subsets so configure --with-termlib works again. This was broken by + logic added to avoid duplicate rules in changes to accommodate cygwin + dll's (reported by George.R.Goffe@seagate.com). + + update config.guess, config.sub + +20020421 + + modify ifdef's in write_entry.c to allow use of symbolic links on + platforms with no hard links, e.g., BeOS. + + modify a few includes to allow compile with BeOS, which has stdbool.h + with a conflicting definition for 'bool' versus its OS.h definition. + + amend MKlib_gen.sh to work with gawk, which defines 'func' as an + alias for 'function'. + +20020420 + + correct form of prototype for ripoffline(). + + modify MKlib_gen.sh to test that all functions marked as implemented + can be linked. + +20020413 + + add manpages: curs_get_wstr.3x, curs_in_wchstr.3x + + implement wgetn_wstr(). + + implement win_wchnstr(). + + remove redefinition of unget_wch() in lib_gen.c (reported by + Jungshik Shin ). + +20020406 + + modified several of the test programs to allow them to compile with + vendor curses implementations (Solaris, AIX). + +20020323 + + modified test/configure to allow configuring against ncursesw. + + change WACS_xxx definition to use address, to work like Tru64 curses. + +20020317 + + add 'e' and 'm' toggles to 'a', 'A' tests in ncurses.c to demonstrate + effect of echo/noecho and meta modes. + + add 'A' test to ncurses.c to demonstrate wget_wch() and related + functions. + + add manpage: curs_get_wch.3x + + implement unget_wch(). + + implement wget_wch(). + +20020310 + + regenerated html manpages. + + add manpages: curs_in_wch.3x, curs_ins_wch.3x, curs_ins_wstr.3x + + implement wins_wch(). + + implement win_wch(). + + implement wins_nwstr(), wins_wstr(). + +20020309 + + add manpages: curs_addwstr.3x, curs_winwstr.3x + + implement winnwstr(), winwstr(). + +20020223 + + add manpages: curs_add_wchstr.3x, curs_bkgrnd.3x + + document wunctrl, key_name. + + implement key_name(). + + remove const's in lib_box.c incorrectly leftover after splitting off + lib_box_set.c + + update llib-lncurses, llib-ncursesw, fix configure script related to these. + +20020218 + + remove quotes on "SYNOPSIS" in man/curs_box_set.3x, which resulted + in spurious symlinks on install. + +20020216 + + implement whline_set(), wvline_set(), add manpage curs_border_set. + + add subtest 'b' to 'F' and 'f' in ncurses.c to demonstrate use of + box() and box_set() functions. + + add subtest 'u' to 'F' in ncurses.c, to demonstrate use of addstr() + given UTF-8 string equivalents of WACS_xxx symbols. + + minor fixes to several manpages based on groff -ww output. + + add descriptions of external variables of termcap interface to + the manpage (report by Bruce Evans ). + > patches by Bernhard Rosenkraenzer: + + correct configure option --with-bool, which was executed as + --with-ospeed. + + add quotes for parameters of --with-bool and --with-ospeed configure + options. + > patch by Sven Verdoolaege (report by Gerhard Haering + ): + + correct typos in definitions of several wide-character macros: + waddwstr, wgetbkgrnd, mvaddwstr, mvwadd_wchnstr, mvwadd_wchnstr, + mvwaddwstr. + + pass $(CPPFLAGS) to MKlib_gen.sh, thereby fixing a missing definition + of _XOPEN_SOURCE_EXTENDED, e.g., on Solaris + +20020209 + + implement wide-acs characters for UTF-8 locales. When in UTF-8 + locale, ignore narrow version of acs. Add 'F' test to test/ncurses.c + to demonstrate. + + correct prototype in keybound manpage (noted from a Debian mailing + list item). + +20020202 + + add several cases to the wscanw() example in testcurs.c, showing the + format. + + implement a simple vsscanf() fallback function which uses the %n + conversion to help parse the input data (prompted by discussion with + Albert Chin-A-Young). + + modify mk-1st.awk and test/Makefile.in to add $(LDFLAGS) when making + shared libraries, and to use $(CFLAGS) when linking test programs + (patch by Albert Chin-A-Young). + + add a call to _nc_keypad() in keypad() to accommodate applications + such as nvi, which use curses for output but not for input (fixes + Debian #131263, cf: 20011215). + + add entrypoints to resizeterm.c which provide better control over the + process: is_term_resized() and resize_term(). The latter restores + the original design of resizeterm() before KEY_RESIZE was added in + 970906. Do this to accommodate 20010922 changes to view.c, but allow + for programs with their own sigwinch handler, such as lynx (reported + by Russell Ruby ). + +20020127 + + fix a typo in change to mk-1st.awk, which broke the shared-library + makefile rules (reported by Martin Mokrejs). + +20020126 + + update config.guess, config.sub + + finish changes needed to build dll's on cygwin. + + fix a typo in mvwchat() macro (reported by Cy ). + + add configure check for mbstate_t, needed for wide-character + configuration. On some platforms we must include to + define this (reported by Daniel Jacobowitz). + + incorporate some of the changes needed to build dll's on cygwin. + +20020112a + + workaround for awk did not work with mawk, adjusted shell script. + +20020112 + + add Caps.osf1r5, as an example. + + modify behavior of can_clear_with() so that if an application is + running in a non-bce terminals with default colors enabled, it + returns true, allowing the user to select/paste text without picking + up extraneous trailing blanks (adapted from patch by Daniel + Jacobowitz ). + + modify generated curses.h to ifdef-out prototypes for extensions if + they are disabled, and to define curses_version() as a string in that + case. This is needed to make the programs such as tic build in that + configuration. + + modified generated headers.sh to remove a gzip'd version of the + target file if it exists, in case non-gzip'd manpages are installed + into a directory where gzip'd ones exist. In that case, the latter + would be found. + + corrected a redundant initialization of signal handlers from 20010922 + changes. + + clarified bug-reporting address in terminfo.src (report by John H + DuBois III ). + > several fixes from Robert Joop: + + do not use "-v" option of awk in MKkey_defs.sh because it does not + work with SunOS nawk. + + modify definitions for libutf8 in curses.h to avoid redefinition + warnings for mblen + + quoted references to compiler in shell command in misc/Makefile, in + case it uses multiple tokens. + +20011229 + + 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 + not needed with autoconf 2.52 + + revert configure script to autoconf 2.13 patched with + autoconf-2.13-19990117.patch.gz (or later) + from + ftp://invisible-island.net/autoconf/ + because autoconf 2.52 macro AC_PROG_AWK does not work on HPUX 11.0 + (report by David Ellement ). This also fixes a + different problem configuring with Mac OS X (reported by Marc Smith + ). + +20011222 + + modify include/edit_cfg.h to eliminate BROKEN_LINKER symbol from + term.h + + move prototype for _nc_vsscanf() into curses.h.in to omit + HAVE_VSSCANF symbol from curses.h, which was dependent upon the + ncurses_cfg.h file which is not installed. + + use ACS_LEN rather than SIZEOF(acs_map) in trace code of lib_acs.c, + to work with broken linker configuration, e.g., cygwin (report by + Robert Joop ). + + make napms() call _nc_timed_wait() rather than poll() or select(), + to work around broken implementations of these on cygwin. + +20011218 + + drop configure macro CF_WIDEC_SHIFT, since that was rendered obsolete + by Sven Verdoolaege's rewrite of wide-character support. This makes + libncursesw incompatible again, but makes the header files almost the + same as in the narrow-character configuration. + + simplify definitions that combine wide/narrow versions of bkgd, etc., + to eliminate differences between the wide/narrow versions of curses.h + + correct typo in configure macro CF_FUNC_VSSCANF + + correct location of call to _nc_keypad() from 20011215 changes which + prevented keypad() from being disabled (reported by Lars Hecking). + +20011215 + + rewrote ncurses 'a' test to exercise wgetch() and keypad() functions + better, e.g., by adding a 'w' command to create new windows which + may have different keypad() settings. + + corrected logic of keypad() by adding internal screen state to track + whether the terminal's keypad-mode has been set. Use this in + wgetch() to update the keypad-mode according to whether the + associated window's keypad-mode has been set with keypad(). This + corrects a related problem restoring terminal state after handling + SIGTSTP (reported by Mike Castle). + + regenerate configure using patch for autoconf 2.52 + autoconf-2.52-patch.gz + at + ftp://invisible-island.net/autoconf/ + + update config.guess, config.sub from + http://subversions.gnu.org/cgi-bin/viewcvs/config/config/ + + minor changes to quoting in configure script to allow it to work + with autoconf 2.52 + +20011208 + + modify final checks in lib_setup.c for line and col values, making + them independent. + + modify acs_map[] if configure --broken-linker is specified, to make + it use a function rather than an array (prompted by an incorrect + implementation in cygwin package). + + correct spelling of configure option --enable-colorfgbg, which + happened to work if --with-develop was set (noted in cygwin package + for ncurses). + + modify ifdef for genericerror() to compile with SUNWspro Sun WorkShop + 6 update 1 C++ 5.2 (patch by Sullivan N Beck ). + + add configure checks to see if ncurses' fallback vsscanf() will + compile either of the special cases for FILE structs, and if not, + force it to the case which simply returns an error (report by + Sullivan N Beck indicates that Solaris 8 with + 64-bits does not allow access to FILE's fields). + + modify ifdef's for c++/cursesw.cc to use the fallback vsscanf() in + the ncurses library if no better substitute for this can be found + in the C++ runtime. + + modify the build to name dynamic libraries according to the + convention used on OS X and Darwin. Rather than something like + libncurses.dylib.5.2, Darwin would name it libncurses. 5.dylib. + There are a few additional minor fixes, such as setting the library + version and compatibility version numbers (patch by Jason Evans + ). + + use 'sh' to run mkinstalldirs, to work around problems with buggy + versions of 'make' on OS/2 (report by John Polterak ). + + correct typo in manpage description of curs_set() (Debian #121548). + + replace the configure script existence-check for mkstemp() by one + that checks if the function works, needed for older glibc and + AmigaOS. + +20011201 + + modify script that generates fallbacks.c to compile a temporary + copy of the terminfo source in case the host does not contain all of + the entries requested for fallbacks (request by Greg Roelofs). + + modify configure script to accommodate systems such as Mac OS X whose + header defines a 'bool' type inconsistent with ncurses, + which normally makes 'bool' consistent with C++. Include + from curses.h to force consistent usage, define a new type + NCURSES_BOOL and related that to the exported 'bool' as either a + typedef or definition, according to whether is present + (based on a bug report for tin 1.5.9 by Aaron Adams ). + +20011124 + + added/updated terminfo entries for M$ telnet and KDE konsole -TD + +20011117 + + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries + (Benjamin C W Sittler). + + add putty terminfo entry -TD + + if configuring for wide-curses, define _XOPEN_SOURCE_EXTENDED, since + this may not otherwise be defined to make test/view.c compile. + +20011110 + + review/correct several missing/generated items in curses.wide, sorted + the lists to make subsequent diff's easier to track. + +20011103 + + add manual pages for add_wch(), echo_wchar(), getcchar(), + mvadd_wch(), mvwadd_wch(), setcchar(), wadd_wch() and wecho_wchar(). + + implement wecho_wchar() + + modify _tracedump() to handle wide-characters by mapping them to '?' + and control-characters to '.', to make the trace file readable. Also + dynamically allocate the buffer used by _tracedump() for formatting + the results. + + modify T_CALLED/T_RETURN macros to ease balancing call/return lines + in a trace by using curly braces. + + implement _nc_viscbuf(), for tracing cchar_t arrays. + + correct trace-calls in setcchar() and getcchar() functions, which + traced the return values but not the entry to each function. + + correct usage message in test/view.c, which still mentioned -u flag. + +20011027 + + modify configure script to allow building with termcap only, or with + fallbacks only. In this case, we do not build tic and toe. + + add configure --with-termpath option, to override default TERMPATH + value of /etc/termcap:/usr/share/misc/termcap. + + cosmetic change to tack: make menu descriptions agree with menu + titles. + +20011020 + + rewrote limit-checks in wscrl() and associated _nc_scroll_window(), + to ensure that if the parameter of wscrl() is larger than the size of + the scrolling region, then the scrolling region will be cleared + (report by Ben Kohlen ). + + add trace/varargs.c, using this to trace parameters in lib_printw.c + + implement _tracecchar_t2() and _tracecchar_t(). + + split-out trace/visbuf.c + + correct typo in lib_printw.c changes from 20010922 (report by Mike + Castle). + +20011013 + + modify run_tic.sh to check if the build is a cross-compile. In that + case, do not use the build's tic to install the terminfo database + (report by Rafael Rodriguez Velilla ). + + modify mouse click resolution so that mouseinterval(-1) will disable + it, e.g., to handle touchscreens via a slow connection (request by + Byron Stanoszek ). + + correct mouseinterval() default value shown in curs_mouse.3x + + remove conflicting definition of mouse_trafo() (reported by Lars + Hecking, using gcc 2.95.3). + +20011001 + + simpler fix for signal_name(), to replace the one overlooked in + 20010929 (reported by Larry Virden). + +20010929 + + add -i option to view.c, to test ncurses' check for non-default + signal handler for SIGINT, etc. + + add cases for shared-libraries on Darwin/OS X (patch by Rob Braun + ). + + modify tset to restore original I/O modes if an error is encountered. + Also modify to use buffered stderr consistently rather than mixing + with write(). + + change signal_name() function to use if-then-else rather than case + statement, since signal-values aren't really integers (reported by + Larry Virden). + + add limit checks in wredrawln(), fixing a problem where lynx was + repainting a pad which was much larger than the screen. + +20010922 + + fix: PutRange() was counting the second part of a wide character as + part of a run, resulting in a cursor position that was one too far + (patch by Sven Verdoolaege). + + modify resizeterm() to not queue a KEY_RESIZE if there was no + SIGWINCH, thereby separating the two styles of SIGWINCH handling + in test/view.c + + simplified lib_tstp.c, modify it to use SA_RESTART flag for SIGWINCH. + + eliminate several static buffers in the terminfo compiler, using + allocated buffers. + + modify MKkeyname.awk so that keyname() does not store its result into + a static buffer that is overwritten by the next call. + + reorganize the output of infocmp -E and -e options to compile cleanly + with gcc -Wwrite-strings warnings. + + remove redefinition of chgat/wchgat/mvwchgat from curses.wide + +20010915 + + add label to test/view.c, showing the name of the last key or signal + that made the screen repaint, to make it clearer when a sigwinch + does this. + + use ExitProgram() consistently in the test-programs to make it + simpler to test leaks with dmalloc, etc. + + move hashtab static data out of hashmap.c into SCREEN struct. + + make NO_LEAK code compile with revised WINDOWLIST structs. + +20010908 + + modify tgetent() to check if exit_attribute_mode resets the alternate + character set, and if so, attempt to adjust the copy of the termcap + "me" string which it will return to eliminate that part. In + particular, 'screen' would lose track of line-drawing characters + (report by Frederic L W Meunier <0@pervalidus.net>, analysis by + Michael Schroeder). + +20010901 + + specify DOCTYPE in html manpages. + + add missing macros for several "generated" functions: attr_get(), + attr_off(), attr_on(), attr_set(), chgat(), mvchgat(), mvwchgat() and + mouse_trafo(). + + modify view.c to agree with non-experimental status of ncurses' + sigwinch handler: + + change the sense of the -r option, making it default to ncurses' + sigwinch handler. + + add a note explaining what functions are unsafe in a signal + handler. + + add a -c option, to set color display, for testing. + + unset $data variable in MKterminfo.sh script, to address potential + infinite loop if shell malfunction (report by Samuel Mikes + , for bash 2.05.0 on a Linux 2.0.36 system). + + change kbs in mach terminfo entries to ^? (Marcus Brinkmann + ). + + correct logic for COLORFGBG environment variable: if rxvt is compiled + with xpm support, the variable has three fields, making it slightly + incompatible with itself. In either case, the background color is + the last field. + +20010825 + + move calls to def_shell_mode() and def_prog_mode() before loop with + callbacks in lib_set_term.c, since the c++ demo otherwise initialized + the tty modes before saving them (patch by John David Anglin + ). + + duplicate logic used to initialize trace in newterm(), in initscr() + to avoid confusing trace of initscr(). + + simplify allocation of WINDOW and WINDOWLIST structs by making the + first a part of the second rather than storing a pointer. This saves + a call to malloc for each window (discussion with Philippe Blain). + + remove unused variable 'used_ncv' from lib_vidattr.c (Philippe + Blain). + + modify c++/Makefile.in to accommodate archive programs that are + different for C++ than for C, and add cases for vendor's C++ + compilers on Solaris and IRIX (report by Albert Chin-A-Young). + + correct manpage description of criteria for deciding if the terminal + supports xterm mouse controls. + + add several configure script options to aid with cross-compiling: + --with-build-cc, --with-build-cflags, --with-build-ldflags, and + --with-build-libs (request by Greg Roelofs). + + change criteria for deciding if configure is cross-compiling from + host/build mismatch to host/target mismatch (request by Greg Roelofs + ). + + correct logic for infocmp -e and -E options which writes the data for + the ext_Names[] array. This is needed if one constructs a fallback + table for a terminfo entry which uses extended termcap names, e.g., + AX in a color xterm. + + fix undefined NCURSES_PATHSEP when configure --disable-database + option is given. + +20010811 + + fix for VALID_BOOLEAN() macro when char is not signed. + + modify 'clean' rule for C++ binding to work with Sun compiler, which + caches additional information in a subdirectory of the objects. + + added llib-ncursesw. + +20010804 + + add Caps.keys example for experimental extended function keys + (adapted from a patch by Ilya Zakharevich). + + correct parameter types of vidputs() and vidattr() to agree with + header files (report by William P Setzer). + + fix typos in several man-pages (patch by William P Setzer). + + remove unneeded ifdef for __GNUG__ in CF_CPP_VSCAN_FUNC configure + macro, which made ncurses C++ binding fail to build with other + C++ compilers such as HPUX 11.x (report by Albert Chin-A-Young). + + workaround for bug in HPUX 11.x C compiler: add a blank after + NCURSES_EXPORT macro in form.h (report by Albert Chin-A-Young) + + ignore blank lines in Caps* files in MKkey_defs.sh script (report by + Albert Chin-A-Young). + + correct definition of key_end in Caps.aix4, which left KEY_END + undefined (report by Albert Chin-A-Young). + + remove a QNX-specific fallback prototype for vsscanf(), which is + obsolete with QNX RTP. + + review/fix some of the T() and TR() macro calls, having noticed that + there was no data for delwin() in a trace of dialog because there was + no returnVoid call for wtimeout(). Also, traces in lib_twait.c are + now selected under TRACE_IEVENT rather than TRACE_CALLS. + +20010728 + + add a _nc_access() check before opening files listed via $TERMPATH. + + using modified man2html, regenerate some of the html manpages to fix + broken HREF's where the link was hyphenated. + +20010721 + + add some limit/pointer checks to -S option of tputs. + + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries + (Benjamin C W Sittler). + + add a note in curs_termcap.3x regarding a defect in the XSI + description of tgetent (based on a discussion with Urs Jansen + regarding the HPUX 11.x implementation, whose termcap interface is + not compatible with existing termcap programs). + + modify manhtml rule in dist.mk to preserve copyright notice on the + generated files, as well as to address HTML style issues reported by + tidy and weblint. Regenerated/updated corresponding html files. + + comment out use of Protected_Character and related rarely used + attributes in ncurses Ada95 test/demo to compile with wide-character + configuration. + +20010714 + + implement a simple example in C++ demo to test scanw(). + + corrected stdio function used to implement scanw() in cursesw.cc + + correct definition of RemAttr() macro from 20010602 changes, which + caused C++ SillyDemo to not show line-drawing characters. + + modify C++ binding, adding getKey() which can be overridden by user + to substitute functions other than getch() for keyboard processing + of forms and menus (patch by Juergen Pfeifer). + +20010707 + + fix some of the trace calls which needed modification to work with + new wide-character structures. + + modify magic-cookie code in tty_update.c to compile with new + wide-character structures (report by ). + + ensure that _XOPEN_SOURCE_EXTENDED is defined in curses.priv.h if + compiling for wide-character configuration. + + make addwnstr() handle non-spacing characters (patch by Sven + Verdoolaege). + +20010630 + + add configure check to define _GNU_SOURCE, needed to prop up glibc + header files. + + split-out include/curses.wide to solve spurious redefinitions caused + by defining _GNU_SOURCE, and move includes for before + to work around misdefinition of ERR in glibc 2.1.3 header + file. + + extended ospeed change to NetBSD and OpenBSD -TD + + modify logic in lib_baudrate.c for ospeed, for FreeBSD to make it + work properly for termcap applications (patch by Andrey A Chernov). + +20010623 + + correct an overlooked CharOf/UChar instance (reports by Eugene Lee + , Sven Verdoolaege). + + correct unneeded ifdef for wunctrl() (reported by Sven Verdoolaege) + +20010618 + + change overlooked several CharOf/UChar instances. + > several patches from Sven Verdoolaege: + + correct a typo in wunctrl(), which made it appear that botwc() was + needed (no such function: use btowc()). + + reimplement wide-character demo in test/view.c, using new functions. + + implement getcchar(), setcchar(), wadd_wchnstr() and related macros. + + fix a syntax problem with do/if/while in PUTC macro (curses.priv.h). + +20010616 + + add parentheses in macros for malloc in test.priv.h, fixes an + expression in view.c (report by Wolfgang Gutjahr ). + + add Caps.uwin, as an example. + + change the way curses.h is generated, making the list of function + key definitions extracted from the Caps file. + + add #undef's before possible redefinition of ERR and OK in curses.h + + modify logic in tic, toe, tput and tset which checks for basename of + argv[0] to work properly on systems such as OS/2 which have + case-independent filenames and/or program suffixes, e.g., ".ext". + +20010609 + + add a configure check, if --enable-widec is specified, for putwc(), + which may be in libutf8. + + remove some unnecessary text from curs_extend.3x and + default_colors.3x which caused man-db to make incorrect symbolic + links (Debian bug report #99550). + + add configure check if cast for _IO_va_list is needed to compile + C++ vscan code (Debian bug report #97945). + > several patches from Sven Verdoolaege: + + correct code that used non-standard auto-initialization of a struct, + which gcc allows (report by Larry Virden). + + use putwc() in PUTC() macro. + + make addstr() work for the special case where the codeset is + non-stateful (eg. UTF-8), as well as stateful codesets. + +20010603 + + correct loop expression in NEXT_CHAR macro for lib_addstr.c changes + from 20010602 (report by Mike Castle). + +20010602 + + modify mvcur() to avoid emitting newline characters when nonl() mode + is set. Normally this is not a problem since the actual terminal + mode is set to suppress nl/crlf translations, however it is useful to + allow the caller to manipulate the terminal mode to avoid staircasing + effects after spawning a process which writes messages (for lynx + 2.8.4) -TD + > several patches from Sven Verdoolaege : + + remove redundant type-conversion in fifo_push() + + correct definition of addwstr() macro in curses.h.in + + remove _nc_utf8_outch() + + rename most existing uses of CharOf() to UChar(), e.g., where it is + used to prevent sign-extension in ctype macros. + + change some chtype's to attr_t's where the corresponding variables + are used to manipulate attributes. + + UpdateAttr() was applied to both attributes (attr_t) and characters + (chtype). Modify macro and calls to it to make these distinct. + + add CharEq() macro, use in places where wide-character configuration + implementation uses a struct for cchar_t. + + moved struct ldat into curses.priv.h, to hide implementation details. + + change CharOf() macro to use it for masking A_CHARTEXT data from + chtype's. + + add L() macro to curses.priv.h, for long-character literals. + + replace several assignments from struct ldat entries to chtype or + char values with combinations of CharOf() and AttrOf() macros. + + add/use intermediate ChAttrOf() and ChCharOf() macros where we know + we are using chtype data. + + add/use lowlevel attribute manipulation macros AddAttr(), RemAttr() + and SetAttr(). + + add/use SetChar() macro, to change a cchar_t based on a character and + attributes. + + convert most internal use of chtype to NCURSES_CH_T, to simplify use + of cchar_t for wide-character configuration. Similarly, use ARG_CH_T + where a pointer would be more useful. + + add stubs for tracing cchar_t values. + + add/use macro ISBLANK() + + add/use constructors for cchar_t's: NewChar(), NewChar2(). + + add/use macros CHREF(), CHDEREF(), AttrOfD(), CharOfD() to facilitate + passing cchar_t's by address. + + add/use PUTC_DATA, PUTC() macros. + + for wide-character configuration, move the window background data to + the end of the WINDOW struct so that whether _XOPEN_SOURCE_EXTENDED + is defined or not, the offsets in the struct will not change. + + modify addch() to work with wide-characters. + + mark several wide-character functions as generated in curses.h.in + + implement wunctrl(), wadd_wch(), wbkgrndset(), wbkgrnd(), + wborder_set() and waddnwstr(). + +20010526 + + add experimental --with-caps=XXX option to customize to similar + terminfo database formats such as AIX 4.x + + add Caps.aix4 as an example. + + modify Caps to add columns for the the KEY_xxx symbols. + + modify configure --with-widec to suppress overwrite of libcurses.so + and curses.h + + add checks to toe.c to avoid being confused by files and directories + where we would expect the reverse, e.g., source-files in the + top-level terminfo levels as is the case for AIX. + +20010519 + + add top-level 'depend' rule for the C sources, assuming that the + makedepend program is available. As a side-effect, this makes + the generated sources, as in "make sources" (prompted by a report + by Mike Castle that "make -j" fails because the resulting parallel + processes race to generate ncurses/names.c). + + modify configure script so that --disable-overwrite option's action + to add a symbolic link for libcurses applies to the static library as + well as the shared library when both are configured (report by Felix + Natter ). + + add ELKS terminfo entries (Federico Bianchi + ) + + add u6 (CSR) to Eterm (Michael Jennings). + +20010512 + + modify test/ncurses.c to work with xterm-256color, which has fewer + color pairs than colors*colors (report by David Ellement + ). + +20010505 + + corrected screen.xterm-xfree86 entry. + + update comment in Caps regarding IBM (AIX) function-key definitions. + +20010421 + + modify c++/Makefile.in to link with libncurses++w.a when configured + for wide-characters (patch by Sven Verdoolaege). + + add check in _nc_trace_buf() to refrain from freeing a null pointer. + + improve CF_PROG_INSTALL macro using CF_DIRNAME. + + update config.guess, config.sub from autoconf 2.49e (alpha). + +20010414 + + add secondary check in tic.c, similar_sgr() to see if the reason + for mismatch was that the individual capabilities used a time-delay + while sgr did not. Used this to cleanup mismatches, e.g., in vt100, + and remove time-delay from Apple_Terminal entries. + + add Apple_Terminal terminfo entries (Benjamin C W Sittler + ). + + correct definitions of shifted editing keys for xterm-xfree86 -TD + + fix a bug in test/bs.c from 20010407 (patch by Erik Sigra). + + prevent relative_move() from doing an overwrite if it detects 8-bit + characters when configured for UTF-8 (reported by Sven Verdoolaege + ). + +20010407 + + add configure checks for strstream.h vscan function, and similar + stdio-based function which may be used in C++ binding for gcc 3.0 + (reports by George Goffe, Lars Hecking, Mike Castle). + + rewrite parts of configure.in which used changequote(). That feature + is broken in the latest autoconf alphas (e.g., 2.49d). + + add a missing pathname for ncurses_dll.h, needed when building in + a directory outside the source tree (patch by Sven Verdoolaege + ). + > fix 2 bugs in test/bs.c (patch by Erik Sigra ): + + no ships were ever placed in the last row or in the last column. + This made the game very easy to win, because you never had to waste + any shots there, but the computer did. + + the squares around a sunken ship that belonged to the player were not + displayed as already hit by the computer, like it does for the + player. + +20010331 + + add some examples of customizing screen's terminfo: + screen.xterm-xfree86, screen.xterm-r6, screen.teraterm -TD + + modify screen's terminfo entry to match the khome/kend in screen + 3.09.08 (Debian bug report #92215). + + correct a memory leak in forms library (report by Stefan Vogtner + , patch by Juergen Pfeifer). + +20010324 + + change symbols used to guard against repeated includes to begin + consistently with "NCURSES_" rather than a leading underscore. There + are other symbols defined in the header files which begin with a + leading underscore, but they are part of the legacy interface. + + reorder includes in c++ binding so that rcs identifiers can be + compiled-in. + + add .cc.ii rule to c++ makefile, to get preprocessor output for + debugging. + + correct configure script handling of @keyword@ substitutions when the + --with-manpage-renames option is given (cf: 20000715, fixes Debian + bug #89939). + + report stack underflow/overflow in tparm() when tic -cv option is + given. + + remove spurious "%|" operator from xterm-xfree86 terminfo entry, + (reported by Adam Costello , Debian bug #89222). + +20010310 + + cleanup of newdemo.c, fixing some ambiguous expressions noted by gcc + 2.95.2, and correcting some conflicting color pair initializations. + + add missing copyright notice for cursesw.h + + review, make minor fixes for use of '::' for referring to C-language + interface from C++ binding. + + modify configure check for g++ library slightly to accommodate + nonstandard version number, e.g., -2.7 (report by Ronald Ho + ). + + add configure check for c++ header, replace hardcoded + ifdef. + + workaround for pre-release of gcc 3.0 libstdc++, which has dropped + vscan from strstreambuf to follow standard, use wrapper for C vscanf + instead (report by George Goffe and Matt Taggart + , fixes Debian . + +20010303 + + modify interface of _nc_get_token() to pass 'silent' parameter to it, + to make quieter loading of /etc/termcap (patch by Todd C Miller). + + correct a few typos in curs_slk.3x and curs_outopts.3x manpages + (patch by Todd C Miller). + +20010224 + + compiler-warning fixes (reported by Nelson Beebe). + +20010210 + + modify screen terminfo entry to use new 3.9.8 feature allowing xterm + mouse controls -TD + +20010203 + + broaden patterns used to match OS/2 EMX in configure script to cover + variant used in newer config.guess/config.sub + + remove changequote() calls from configure script, since this feature + is broken in the autoconf 2.49c alpha, maintainers decline to fix. + + remove macro callPutChar() from tty_update.c, since this is no longer + needed (reported by Philippe Blain). + + add a null-pointer check in tic.c to handle the case when the input + file is really empty. Modify the next_char() function in comp_scan.c + to allow arbitrarily long lines, and incidentally supply a newline to + files that do not end in a newline. These changes improve tic's + recovery from attempts to read binary files, e.g., its output from + the terminfo database (reported by Bernhard Rosenkraenzer). + +20010127 + + revert change to c++/demo.cc from 20001209, which changed definition + of main() apparently to accommodate cygwin linker, but broke the demo + program. + + workaround for broken egcs 2.91.66 which calls member functions + (i.e., lines() and colors() of NCursesWindow before calling its + constructor. Add calls to initialize() in a few constructors which + did not do this already. + + use the GNAT preprocessor to make the necessary switch between TRACE + and NO_TRACE configurations (patch by Juergen Pfeifer). + > patches by Bernhard Rosenkraenzer: + + modify kterm terminfo entry to use SCS sequence to support alternate + character set (it does not work with SI/SO). + + --with-ospeed=something didn't work. configure.in checked for a + $enableval where it should check for $withval. Also, + ncurses/llib-lncurses still had a hardcoded short. + +20010114 + + correction to my merge of Tom Riddle's patch that broke tic in some + conditions (reported by Enoch Wexler ) -TD + +20010113 + + modify view.c to test halfdelay(). Like other tests, this recognizes + the 's' and space commands for stopping/starting polled input, shows + a freerunning clock in the header. If given a parameter to 's', that + makes view.c use halfdelay() with that parameter rather than + nodelay(). + + fix to allow compile with the experimental configure option + --disable-hashmap. + + modify postprocess_termcap() to avoid overwriting key_backspace, + key_left, key_down when processing a non-base entry (report/patch by + Tom Riddle). + + modify _nc_wrap_entry(), adding option to reallocate the string + table, needed in _nc_merge_entry() when merging termcap entries. + (adapted from report/patch by Tom Riddle ). + + modify a few configure script macros to keep $CFLAGS used only for + compiler options, preprocessor options in $CPPFLAGS. + +20001230 + + correct marker positions in lrtest.c after receiving a sigwinch. + + fix ifdef's in ncurses.c to build against pre-5.2 for testing. + + fixes to tclock for resizing behavior, redundant computation (report + and patch by A M Kuchling ). + +20001216 + + improved scoansi terminfo entry -TD + + modify configure script and makefile in Ada95/src to compile a stub + for the trace functions when ncurses does not provide those. + +20001209 + + add ncurses_dll.h and related definitions to support generating DLL's + with cygwin (adapted from a patch by Charles Wilson + , changed NCURSES_EXPORT macro to make it + work with 'indent'). + +20001202 + + correct prototypes for some functions in curs_termcap.3x, matching + termcap.h, which matches X/Open. + > patch by Juergen Pfeifer: + + a revised version of the Ada enhancements sent in by "H. + Nanosecond", aka Eugene V Melaragno . This + patch includes + - small fixes to the existing ncurses binding + - addition of some more low-level functions to the binding, including + termcap and terminfo functions + - An Ada implementation of the "ncurses" test application originally + written in C. + +20001125 + + modify logic in lib_setup.c to allow either lines or columns value + from terminfo to be used if the screen size cannot be determined + dynamically rather than requiring both (patch by Ehud Karni + ). + + add check in lib_tgoto.c's is_termcap() function to reject null or + empty strings (reported by Valentin Nechayev to + freebsd-bugs). + + add definition from configure script that denotes the path-separator, + which is normally a colon. The path-separator is a semicolon on + OS/2 EMX and similar systems which may use a colon within pathnames. + + alter logic to set default for --disable-overwrite option to set it + to 'yes' if the --prefix/$prefix value is not /usr/local, thereby + accommodating the most common cause of problems: gcc's nonstandard + search rules. Other locations such as /usr/local/ncurses will + default to overwriting (report by Lars Hecking ). + +20001118 + + modify default for --disable-overwrite configure option to disable + if the --prefix or $prefix value is not /usr. + + add cygwin to systems for which ncurses is installed by default into + /usr rather than /usr/local. + +20001111 + + minor optimization in comp_error.c and lib_termname.c, using + strncat() to replace strncpy() (patch by Solar Designer). + + add a use_terminfo_vars() check for $HOME/.termcap, and check for + geteuid() to use_terminfo_vars() (patch by Solar Designer + ). + + improved cygwin terminfo entry, based on patch by + . + + modify _nc_write_entry() to allow for the possibility that linking + aliases on a filesystem that ignores case would not succeed because + the source and destination differ only by case, e.g., NCR260VT300WPP0 + on cygwin (report by Neil Zanella). + + fix a typo in the curs_deleteln.3x man page (patch by Bernhard + Rosenkraenzer ). + +20001104 + + add configure option --with-ospeed to assist packagers in transition + to 5.3 change to ospeed type. + + add/use CharOf() macro to suppress sign-extension of char type on + platforms where this is a problem in ctype macros, e.g., Solaris. + + change trace output to binary format. + + correct a missing quote adjustment in CF_PATH_SYNTAX autoconf + macro, for OS/2 EMX configuration. + + rearrange a few configure macros, moving preprocessor options to + $CPPFLAGS (a now-obsolete version of autoconf did not consistently + use $CPPFLAGS in both the compile and preprocessor checks). + + add a check in relative_move() to guard against buffer overflow in + the overwrite logic. + +20001028 + + add message to configure script showing g++ version. + + resync config.guess, config.sub + + modify lib_delwin.c, making it return ERR if the window did not exist + (suggested by Neil Zanella). + + add cases for FreeBSD 3.1 to tdlint and makellib scripts, used this + to test/review ncurses library. (Would use lclint, but it doesn't + work). + + reorganized knight.c to avoid forward references. Correct screen + updates when backtracking, especially to the first cell. Add F/B/a + commands. + +20001021 5.2 release for upload to ftp.gnu.org + + update generated html files from manpages. + + modify dist.mk to use edit_man.sh to substitute autoconf'd variables + in html manpages. + + fix an uninitialized pointer in read_termcap.c (report by Todd C + Miller, from report/patch by Philip Guenther ). + + correct help-message and array limit in knight.c (patch by Brian + Raiter ). + > patch by Juergen Pfeifer: + + fix to avoid warning by GNAT-3.13p about use of inconsistent casing + for some identifiers defined in the standard package. + + cosmetic change to forms/fty_enum.c + +20001014 + + correct an off-by-one position in test/railroad.c which could cause + wrapping at the right margin. + + test/repair some issues with libtool configuration. Make + --disable-echo force libtool --silent. (Libtool does not work for + OS/2 EMX, works partly for SCO - libtool is still very specific to + gcc). + + change default of --with-manpage-tbl to "no", since for most of the + platforms which do have tbl installed, the system "man" program + understands how to run tbl automatically. + + minor improvement to force_bar() in comp_parse.c (Bernhard + Rosenkraenzer ). + + modify lib_tparm.c to use get_space() before writing terminating + null character, both for consistency as well as to ensure that if + save_char() was called immediately before, that the allocated memory + is enough (patch by Sergei Ivanov). + + add note about termcap ML capability which is duplicated between two + different capabilities: smgl and smglr (reported by Sergei Ivanov + ). + + correct parameter counts in include/Caps for dclk as well as some + printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp. + > patch by Johnny C Lam : + + add support for building with libtool (apparently version 1.3.5, + since old versions do not handle -L../lib), using new configure + option --with-libtool. + + add configure option --with-manpage-tbl, which causes the manpages to + be preprocessed by tbl(1) prior to installation, + + add configure option --without-curses-h, which causes the + installation process to install curses.h as ncurses.h and make + appropriate changes to headers and manpages. + +20001009 + + correct order of options/parameters in run_tic.in invocation of tic, + which did not work with standard getopt() (reported by Ethan + Butterfield ). + + correct logic for 'reverse' variable in lib_vidattr.c, which was + setting it true without checking if newmode had A_REVERSE set, e.g., + using $TERM=ansi on OS/2 EMX (see 20000917). + > patch by Todd Miller: + + add a few missing use_terminfo_vars() and fixes up _nc_tgetent(). + Previously, _nc_cgetset() would still get called on cp so the + simplest thing is to set cp to NULL if !use_terminfo_vars(). + + added checks for an empty $HOME environment variable. + > patches by Ilya Zakharevich for OS/2 EMX: + + modify convert_configure.pl to support INSTALL. Change compiler + options in that script to use multithreading, needed for the mouse. + + modify OS/2 mouse support, retrying as a 2-button mouse if code fails + to set up a 3-button mouse. + + improve code for OS/2 mouse support, using _nc_timed_wait() to + replace select() call. + +20001007 + + change type of ospeed variable back to short to match its use in + legacy applications (reported by Andrey A Chernov). + + add case to configure script for --enable-rpath on IRIX (patch by + Albert Chin-A-Young). + + minor fix to position_check() function, to ensure it gets the whole + cursor report before decoding. + + add configure option --disable-assumed-color, to allow pre-5.1 + convention of default colors used for color-pair 0 to be configured + (see assume_default_colors()). + + rename configure option --enable-hashmap --disable-hashmap, and + reorder the configure options, splitting the experimental and + development + + add configure option --disable-root-environ, which tells ncurses to + disregard $TERMINFO and similar environment variables if the current + user is root, or running setuid/setgid (based on discussion with + several people). + + modified misc/run_tic.in to use tic -o, to eliminate dependency on + $TERMINFO variable for installs. + + add table entry for plab_norm to tput, so it passes in strings + for that capability. + + modify parse_format() in lib_tparm.c to ignore precision if it is + longer than 10000 (report by Jouko Pynnonen). + + rewrote limit checks in lib_mvcur.c using new functions + _nc_safe_strcat(), etc. Made other related changes to check lengths + used for strcat/strcpy (report by Jouko Pynnonen + ). + +20000930 + + modify several descriptions, including those for setaf, setab, in + include/Caps to indicate that the entries are parameterized. This + information is used to tell which strings are translated when + converting to termcap. Fixes a problem where the generated termcap + would contain a spurious "%p1" for the terminfo "%p1%d". + + modify ld -rpath options (e.g., Linux, and Solaris) to use an + absolute pathname for the build tree's lib directory (prompted by + discussion with Albert Chin-A-Young). + + modify "make install.man" and "make uninstall.man" to include tack's + man-page. + + various fixes for install scripts used to support configure --srcdir + and --with-install-prefix (reported by Matthew Clarke + ). + + make configure script checks on variables $GCC and $GXX consistently + compare against 'yes' rather than test if they are nonnull, since + either may be set to the corresponding name of the C or C++ compiler + (report/patch by Albert Chin-A-Young). + +20000923 + + modify rs2 capability in xterm-r6 and similar where cursor + save/restore bracketed the sequence for resetting video attributes. + The cursor restore would undo that (from a NetBSD bug report by John + Hawkinson ). + + using parameter check added to tic, corrected 27 typos in + terminfo.src -TD + + modify tic to verify that its inputs are really files, in case + someone tries to read a directory (or /dev/zero). + + add a check for empty buffers returned by fgets() in comp_scan.c + next_char() function, in case tic is run on a non-text file (fixes + a core dump reported by Aaron Campbell ). + + add to railroad.c some code exercising tgoto(), providing an + alternate form of display if the terminal supports cursor addressing. + + split-out tgoto() again, this time into new file lib_tgoto.c, and + implement a conventional BSD-style tgoto() which is used if the + capability string does not contain terminfo-style padding or + parameters (requested by Andrey A Chernov). + + add check to tic which reports capabilities that do not reference + the expected number of parameters. + + add error checking to infocmp's -v and -m options to ensure that + the option value is indeed a number. + + some cleanup of logic in _nc_signal_handler() to verify if SIGWINCH + handler is setup. Separated the old/new sigaction data for SIGTSTP + from the other signals. + +20000917 + + add S0, E0 extensions to screen's terminfo entry, which is another + way to solve the misconfiguration issue -TD + + completed special case for tgoto from 20000916 + +20000916 + + update xterm terminfo entries to match XFree86 xterm patch #146 -TD + + add Matrix Orbital terminfo entries (from Eric Z Ayers + ). + + add special case to lib_tparm.c to allow 'screen' program to use a + termcap-style parameter "%." to tgoto() for switching character sets. + + use LN_S substitution in run_tic.in, to work on OS/2 EMX which has + no symbolic links. + + updated notes in README.emx regarding autoconf patches. + + replace a lookup table in lib_vidattr.c used to decode no_color_video + with a logic expression (suggested by Philippe Blain). + + add a/A toggle to ncurses.c 'b' test, which clears/sets alternate + character set attribute from the displayed text. + + correct inequality in parameter analysis of rewritten lib_tparm.c + which had the effect of ignoring p9 in set_attributes (sgr), breaking + alternate character set (reported by Piotr Majka ). + + correct ifdef'ing for GCC_PRINTF, GCC_SCANF which would not compile + with Sun WorkShop compilers since these tokens were empty (cf: + 20000902, reported by Albert Chin-A-Young). + +20000909 + + correct an uninitialized parameter to open_tempfile() in tic.c which + made "tic -I" give an ambiguous error message about tmpnam. + + add special case in lib_vidattr.c to reset underline and standout for + devices that have no sgr0 defined (patch by Don Lewis + ). Note that this will not work for bold + mode, since there is no exit-bold-mode capability. + + improved patch for Make_Enum_Type (patch by Juergen Pfeifer). + + modify tparm to disallow arithmetic on strings, analyze the varargs + list to read strings as strings and numbers as numbers. + + modify tparm's internal function spop() to treat a null pointer as + an empty string. + + modify tput program so it can be renamed or invoked via a link as + 'reset' or 'init', producing the same effect as 'tput reset' or 'tput + init'. + + add private entrypoint _nc_basename(), use to consolidate related + code in progs, as well as accommodating OS/2 EMX pathnames. + + remove NCURSES_CONST line from edit_cfg.sh to compensate for its + removal (except via AC_SUBST) from configure.in, making + --enable-const work again (reported by Juergen Pfeifer). + + regen'd configure to pick up "hpux*" change from 20000902. + +20000902 + + modify tset.c to check for transformed "reset" program name, if any. + + add a check for null pointer in Make_Enum_Type() (reported by Steven + W Orr ). + + change functions _nc_parse_entry() and postprocess_termcap() to avoid + using strtok(), because it is non-reentrant (reported by Andrey A + Chernov ). + + remove "hpux10.*" case from CF_SHARED_OPTS configure script macro. + This differed from the "hpux*" case by using reversed symbolic + links, which made the 5.1 version not match the configuration of + 5.0 shared libraries (reported by Albert Chin-A-Young). + + correct a dependency in Ada95/src/Makefile.in which prevented + building with configure --srcdir (patch by H Nanosecond + ). + + modify ifdef's in curses.h.in to avoid warning if GCC_PRINTF or + GCC_SCANF was not previously defined (reported by Pavel Roskin + ). + + add MKncurses_def.sh to generate fallback definitions for + ncurses_cfg.h, to quiet gcc -Wundef warnings, modified ifdef's in + code to consistently use "#if" rather than "#ifdef". + +20000826 + + add QNX qansi entries to terminfo -TD + + add os2 entry to misc/emx.src (). + + add configure option --with-database to allow specifying a different + terminfo source-file to install. On OS/2 EMX, this defaults to + misc/emx.src + + change misc/run_tic.sh to derive it from misc/run_tic.in, to simplify + setting .exe extension on OS/2 EMX. + + add .exe extension in Ada95/gen/Makefile.in, + Ada95/samples/Makefile.in, for OS/2 EMX (reported by + ). + + add configure check for filesystems (such as OS/2 EMX) which do not + distinguish between upper/lowercase filenames, use this to fix tags + rules in makefiles. + + initialize fds[] array to 0's in _nc_timed_wait(); apparently poll() + only sets the revents members of that array when there is activity + corresponding to the related file (report by Glenn Cooper + , using Purify on Solaris 5.6). + + change configure script to use AC_CANONICAL_SYSTEM rather than + AC_CANONICAL_HOST, which means that configure --target will set + a default program-prefix. + + add note on cross-compiling to INSTALL (which does not rely on the + AC_CANONICAL_* macros). + +20000819 + + add cases for EMX OS/2 to config.guess, config.sub + + new version of config.guess, config.sub from lynx 2.8.4dev.7 + + add definitions via transform.h to allow tic and tput to check for + the transformed aliases rather than the original infotocap, etc. + + simplify transform-expressions in progs/Makefile.in, make the + uninstall rule work for transformed program names. + + change symbol used by --install-prefix configure option from + INSTALL_PREFIX to DESTDIR (the latter has become common usage + although the name is misleading). + + modify programs to use curses_version() string to report the version + of ncurses with which they are compiled rather than the + NCURSES_VERSION string. The function returns the patch level in + addition to the major and minor version numbers. + +20000812 + + modify CF_MAN_PAGES configure macro to make transformed program names + a parameter to that macro rather than embedding them in the macro. + + newer config.guess, config.sub (reference version used in lynx + 2.8.4dev.7). + + add configure option --with-default-terminfo-dir=DIR to allow + specifying the default terminfo database directory (request by Albert + Chin-A-Young). + + minor updates for terminfo.src from FreeBSD termcap change-history. + + correct notes in README and INSTALL regarding documentation files + that were moved from misc directory to doc (report by Rich Kulawiec + ). + + change most remaining unquoted parameters of 'test' in configure + script to use quotes, for instance fixing a problem in the + --disable-database option (reported by Christian Mondrup + ). + + minor adjustments to work around some of the incompatibilities/bugs + in autoconf 2.29a alpha. + + add -I/usr/local/include when --with-ncurses option is used in + test/configure script. + + correct logic in adjust_cancels(), which did not check both + alternatives when reclassifying an extended name between boolean, + number and string, causing an infinite loop in tic. + +20000730 + + correct a missing backslash in curses.priv.h + +20000729 + + change handling of non_dest_scroll_region in tty_update.c to clear + text after it is shifted in rather than before shifting out. Also + correct row computation (reported by Ruediger Kuhlmann + ). + + add/use new trace function to display chtype values from winch() and + getbkgd(). + + add trace mask TRACE_ATTRS, alter several existing _tracef calls that + trace attribute changes under TRACE_CALLS to use this. + + modify MKlib_gen.sh so that functions returning chtype will call + returnChar(). + + add returnChar() trace, for functions returning chtype. + + change indent.pro to line up parenthesis. + +20000722 + + fix a heap problem with the c++ binding (report by + , patch by Juergen Pfeifer). + + minor adjustment to ClrToEOL() to handle an out-of-bounds parameter. + + modify the check for big-core to force a couple of memory accesses, + which may work as needed for older/less-capable machines (if not, + there's still the explicit configure option). + > fixes based on diff's for Amiga and BeOS found at + http://www.mathematik.uni-karlsruhe.de/~kuhlmann/cross/ncurses/ + + alter definition of NCURSES_CONST to make it non-empty. + + add amiga-vnc terminfo entry. + + redefine 'TEXT' in menu.h for AMIGA, since it is reported to have + an (unspecified) symbol conflict. + + replaced case-statement in _nc_tracebits() for CSIZE with a table to + simplify working around implementations that define random + combinations of the related macros to zero. + + modify configure test for tcgetattr() to allow for old + implementations, e.g., on BeOS, which only defined it as a macro. + > patches by Bruno Haible: + + when checking LC_ALL/LC_CTYPE/LANG environment variables for UTF-8 + locale, ignore those which are set to an empty value, as per SUSV2. + + encode 0xFFFD in UTF-8 with 3 bytes, not 2. + + modify _nc_utf8_outch() to avoid sign-extension when checking for + out-of-range value. + +20000715 + + correct manlinks.sed script to avoid using ERE "\+", which is not + understood by older versions of sed (patch by Albert Chin-A-Young). + + implement configure script options that transform installed program + names, e.g., --program-prefix, including the manpage names and cross + references (patch by Albert Chin-A-Young ). + + correct several mismatches between manpage filename and ".TH" + directives, renaming dft_fgbg.3x to default_colors.3x and + menu_attribs.3x to menu_attributes.3x (report by Todd C Miller). + + correct missing includes for in several places, including + the C++ binding. This is not noted by gcc unless we use the + -fno-builtin option (reported by Igor Schein ). + + modified progs/tset.c and tack/sysdep.c to build with sgttyb + interface if neither termio or termios is available. Tested this + with FreeBSD 2.1.5 (which does have termios - but the sgttyb does + work). + +20000708 5.1 release for upload to ftp.gnu.org + + document configure options in INSTALL. + + add man-page for ncurses trace functions. + + correct return value shown in curs_touch.3x for is_linetouched() and + is_wintouched(), in curs_initscr.3x for isendwin(), and in + curs_termattr.3x for has_ic() and has_il(). + + add prototypes for touchline() and touchwin(), adding them to the + list of generated functions. + + modify fifo_push() to put ERR into the fifo just like other values to + return from wgetch(). It was returning without doing that, making + end-of-file condition incorrectly return a 0 (reported by Todd C + Miller). + + uncomment CC_SHARED_OPTS for progs and tack (see 971115), since they + are needed for SCO OpenServer. + + move _nc_disable_period from free_ttype.c to comp_scan.c to appease + dynamic loaders on SCO and IRIX64. + + add "-a" option to test/ncurses.c to invoke assume_default_colors() + for testing. + + correct assignment in assume_default_colors() which tells ncurses + whether to use default colors, or the assumed ones (reported by Gary + Funck ). + + review/correct logic in mk-1st.awk for making symbolic links for + shared libraries, in particular for FreeBSD, etc. + + regenerate misc/*.def files for OS/2 EMX dll's. + + correct quoting of values for CC_SHARED_OPTS in aclocal.m4 for + cases openbsd2*, openbsd*, freebsd* and netbsd* (patch by Peter + Wemm) (err in 20000610). + + minor updates to release notes, as well as adding/updating URLs for + examples cited in announce.html + > several fixes from Philippe Blain : + + correct placement of ifdef for NCURSES_XNAMES in function + _nc_free_termtype(), fixes a memory leak. + + add a call to _nc_synchook() to the end of function whline() like + that in wvline() (difference was in 1.9.4). + + make ClearScreen() a little faster by moving two instances of + UpdateAttr() out of for-loops. + + simplify ClrBottom() by eliminating the tstLine data, using for-loops + (cf: 960428). + +20000701 pre-release + + change minor version to 1, i.e., ncurses 5.1 + + add experimental configure option --enable-colorfgbg to check for + $COLORTERM variable as set by rxvt/aterm/Eterm. + + add Eterm terminfo entry (Michael Jennings ). + + modify manlinks.sed to pick aliases from the SYNOPSIS section, and + several manpages so manlinks.sed can find aliases for creating + symbolic links. + + add explanation to run_tic.sh regarding extended terminal + capabilities. + + change message format for edit_cfg.sh, since some people interpret + it as a warning. + + correct unescaped '$' in sysv5uw7*|unix_sv* rule for CF_SHARED_OPTS + configure macro (report by Thanh Ma ). + + correct logic in lib_twait.c as used by lib_mouse.c for GPM mouse + support when poll() is used rather than select() (prompted by + discussion with David Allen ). + +20000624 pre-release + + modify TransformLine() to check for cells with different color pairs + that happen to render the same display colors. + + apply $NCURSES_NO_PADDING to cost-computation in mvcur(). + + improve cost computation in PutRange() by accounting for the use + of parm_right_cursor in mvcur(). + + correct cost computation in EmitRange(), which was not using the + normalized value for cursor_address. + + newer config.guess, config.sub (reference version used in TIN 1.5.6). + +20000617 + + update config.guess, config.sub (reference version used in PCRE 3.2). + + resync changes to gnathtml against version 1.22, regenerated html + files under doc/html/ada using this (1.22.1.1). + + regenerated html files under doc/html/man after correcting top and + bottom margin options for man2html in dist.mk + + minor fixes to test programs ncurses 'i' and testcurs program to make + the subwindow's background color cover the subwindow. + + modify configure script so AC_MSG_ERROR is temporarily defined to a + warning in AC_PROG_CXX to make it recover from a missing C++ compiler + without requiring user to add --without-cxx option (from comment by + Akim Demaille to autoconf mailing list). + + modify headers.sh to avoid creating temporary files in the build + directory when installing headers (reported by Sergei Pokrovsky + ) + +20000610 + + regenerated the html files under doc/html/ada/files and + doc/html/ada/funcs with a slightly-improved gnathtml. + + add kmous capability to linux terminfo entry to allow it to use + xterm-style events provided by gpm patch by Joerg Schoen. + + make the configure macro CF_SHARED_OPTS a little smarter by testing + if -fPIC is supported by gcc rather than -fpic. The former option + allows larger symbol tables. + + update config.guess and config.sub (patches by + Kevin Buettner for elf64_ia64 + Bernd Kuemmerlen and MacOS X). + + add warning for 'tic -cv' about use of '^?' in terminfo source, which + is an extension. + +20000527 + + modify echo() behavior of getch() to match Solaris curses for + carriage return and backspace (reported by Neil Zanella). + + change _nc_flush() to a function. + + modify delscreen() to check if the output stream has been closed, and + if so, free the buffer allocated for setbuf (this provides an + ncurses-specific way to avoid a memory leak when repeatedly calling + newterm reported by Chipp C ). + + correct typo in curs_getch.3x manpage regarding noecho (reported by + David Malone ). + + add a "make libs" rule. + + make the Ada95 interface build with configure --enable-widec. + + if the configure --enable-widec option is given, append 'w' to names + of the generated libraries (e.g., libncursesw.so) to avoid conflict + with existing ncurses libraries. + +20000520 + + modify view.c to make a rudimentary viewer of UTF-8 text if ncurses + is configured with the experimental wide-character support. + + add a simple UTF-8 output driver to the experimental wide-character + support. If any of the environment variables LC_ALL, LC_CTYPE or + LANG contain the string "UTF-8", this driver will be used to + translate the output to UTF-8. This works with XFree86 xterm. + + modify configure script to allow building shared libraries on BeOS + (from a patch by by Valeriy E Ushakov). + + modify lib_addch.c to allow repeated update to the lower-right + corner, rather than displaying only the first character written until + the cursor is moved. Recent versions of SVr4 curses can update the + lower-right corner, and behave this way (reported by Neil Zanella). + + add a limit-check in _nc_do_color(), to avoid using invalid color + pair value (from bug report by Brendan O'Dea ). + +20000513 + + the tack program knows how to use smcup and rmcup but the "show caps + that can be tested" feature did not reflect this knowledge. Correct + the display in the menu tack/test/edit/c (patch by Daniel Weaver). + + xterm-16color does allow bold+colors, removed ncv#32 from that + terminfo entry. + +20000506 + + correct assignment to SP->_has_sgr_39_49 in lib_dft_fgbg.c, which + broke check for screen's AX capability (reported by Valeriy E Ushakov + ). + + change man2html rule in dist.mk to workaround bug in some + man-programs that ignores locale when rendering hyphenation. + + change web- and ftp-site to dickey.his.com + +20000429 + + move _nc_curr_token from parse_entry.c to comp_scan.c, to work around + problem linking tack on MacOS X DP3. + + include in lib_napms.c to compile on MacOS X DP3 + (reported by Gerben Wierda ). + + modify lib_vidattr.c to check for ncv fixes when pair-0 is not + default colors. + + add -d option to ncurses.c, to turn on default-colors for testing. + + add a check to _nc_makenew() to ensure that newwin() and newpad() + calls do not silently fail by passing too-large limits. + + add symbol NCURSES_SIZE_T to use rather than explicit 'short' for + internal window and pad sizes. Note that since this is visible in + the WINDOW struct, it would be an ABI change to make this an 'int' + (prompted by a question by Bastian Trompetter + , who attempted to create a 96000-line pad). + +20000422 + + add mgterm terminfo entry from NetBSD, minor adjustments to sun-ss5, + aixterm entries -TD + + modify tack/ansi.c to make it more tolerant of bad ANSI replies. An + example of an illegal ANSI resonse can be found using Microsoft's + Telnet client. A correct display can be found using a VT-4xx + terminal or XFree86 xterm with: + XTerm*VT100*decTerminalID: 450 + (patch by Daniel Weaver). + + modify gdc.c to recognize 'q' for quit, 's' for single-step and ' ' + for resume. Add '-n' option to force gdc's standard input to + /dev/null, to both illustrate the use of newterm() for specifying + alternate inputs as well as for testing signal handling. + + minor fix for configure option --with-manpage-symlinks, for target + directories that contain a period ('.') (reported by Larry Virden). + +20000415 + + minor additions to beterm entry (feedback from Rico Tudor) -TD + + corrections/updates for some IBM terminfo entries -TD + + modify _nc_screen_wrap() so that when exiting curses mode with + non-default colors, the last line on the screen will be cleared to + the screen's default colors (request by Alexander Lukyanov). + + modify ncurses.c 'r' example to set nonl(), allowing control/M to be + read for demonstrating the REQ_NEW_LINE operation (prompted by a + question by Tony L Keith" ). + + modify ncurses.c 'r' example of field_info() to work on Solaris 2.7, + documented extension of ncurses which allows a zero pointer. + + modify fmt_complex() to avoid buffer overflow in case of excess + recursion, and to recognize "%e%?" as a synonym for else-if, which + means that it will not recur for that special case. + + add logic to support $TERMCAP variable in case the USE_GETCAP symbol + is defined (patch by Todd C Miller). + + modify one of the m4 files used to generate the Ada95 sources, + to avoid using the token "symbols" (patch by Juergen Pfeifer). + +20000408 + + add terminfo entries bsdos-pc-m, bsdos-pc-mono (Jeffrey C Honig) + + correct spelling error in terminfo entry name: bq300-rv was given as + bg300-rv in esr's version. + + modify redrawwin() macro so its parameter is fully parenthesized + (fixes Debian bug report #61088). + + correct formatting error in dump_entry() which set incorrect column + value when no newline trimming was needed at the end of an entry, + before appending "use=" clauses (cf: 960406). + +20000401 + + add configure option --with-manpage-symlinks + + change unctrl() to render C1 characters (128-159) as ~@, ~A, etc. + + change makefiles so trace() function is provided only if TRACE is + defined, e.g., in the debug library. Modify related calls to + _tracechar() to use unctrl() instead. + +20000325 + + add screen's AX capability (for ECMA SGR 39 and 49) to applicable + terminfo entries, use presence of this as a check for a small + improvement in setting default colors. + + improve logic in _nc_do_color() implementing assume_default_colors() + by passing in previous color pair info to eliminate redundant call to + set_original_colors(). (Part of this is from a patch by Alexander + Lukyanov). + + modify warning in _nc_trans_string() about a possibly too-long string + to do this once only rather than for each character past the + threshold (600). Change interface of _nc_trans_string() to allow + check for buffer overflow. + + correct use of memset in _nc_read_entry_source() to initialize ENTRY + struct each time before reading new data into it, rather than once + per loop (cf: 990301). This affects multi-entry in-core operations + such as "infocmp -Fa". + +20000319 + + remove a spurious pointer increment in _nc_infotocap() changes from + 20000311. Add check for '.' in format of number, since that also + is not permitted in termcap. + + correct typo in rxvt-basic terminfo from temporary change made while + integrating 20000318. + +20000318 + + revert part of the vt220 change (request by Todd C Miller). + + add ansi-* terminfo entries from Eric's version. + + add -a option to tic and infocmp, which retains commented-out + capabilities during source translation/comparison, e.g., captoinfo + and infotocap. + + modify cardfile.c to display an empty card if no input data file is + found, fixes a core dump in that case (reported by Bruno Haible). + + correct bracketing in CF_MATH_LIB configure macro, which gave wrong + result for OS/2 EMX. + + supply required parameter for _nc_resolve_uses() call in + read_termcap.c, overlooked in 20000311 (reported by Todd C Miller). + > patches by Bruno Haible : + + fix a compiler warning in fty_enum.c + + correct LIB_PREFIX expression for DEPS_CURSES in progs, tack + makefiles, which resulted in redundant linking (cf: 20000122). + +20000311 + + make ifdef's for BROKEN_LINKER consistent (patch by Todd C Miller). + + improved tack/README (patch by Daniel Weaver). + + modify tput.c to ensure that unspecified parameters are passed to + tparm() as 0's. + + add a few checks in infocmp to guard against buffer overflow when + displaying string capabilities. + + add check for zero-uses in infocmp's file_comparison() function + before calling _nc_align_termtype(). Otherwise one parameter is + indexed past the end of the uses-array. + + add an option -q to infocmp to specify the less verbose output, + keeping the existing format as the default, though not retaining the + previous behavior that made the -F option compare each entry to + itself. + + adapted patch by Eric Raymond to make infocmp -F less verbose + (the submitted patch was unusable because it did not compile + properly): + + modify write_entry.c to ensure that absent or cancelled booleans + are written as FALSE, for consistency with infocmp which now + assumes this. Note that for the small-core configuration, tic + may not produce the same result as before. + + change some private library interfaces used by infocmp, e.g., + _nc_resolve_uses(). + + add a check in _nc_infotocap() to ensure that cm-style capabilities + accept only %d codes when converting the format from terminfo to + termcap. + + modify ENTRY struct to separate the data in 'parent' into the name + and link values (the original idea to merge both into 'parent' was + not good). + + discard repair_acsc(tterm); + > patch by Juergen Pfeifer: + + drop support for gnat 3.10 + + move generated documentation and html files under ./doc directory, + adding makefile rules for this to dist.mk + +20000304 + + correct conflicting use of tparm() in 20000226 change to tic, which + made it check only one entry at a time. + + fix errors in ncurses-intro.html and hackguide.html shown by Dave + Raggett's tidy. + + make the example in ncurses-intro.html do something plausible, and + corrected misleading comment (reported by Neil Zanella). + + modify pnoutrefresh() to set newscr->_leaveok as wnoutrefresh() does, + to fix a case where the cursor position was not updated as in + Solaris (patch by David Mosberger ). + + add a limit-check for wresize() to ensure that a subwindow does not + address out of bounds. + + correct offsets used for subwindows in wresize() (patch by Michael + Andres ). + + regenerate html'ized manual pages with man2html 3.0.1 (patch by + Juergen Pfeifer). This generated a file with a space in its name, + which I removed. + + fix a few spelling errors in tack. + + modify tack/Makefile.in to match linker options of progs/Makefile.in; + otherwise it does not build properly for older HPUX shared library + configurations. + + add several terminfo entries from esr's "11.0". + +20000226 + + make 'tput flash' work properly for xterm by flushing output in + delay_output() when using napms(), and modifying xterm's terminfo to + specify no padding character. Otherwise, xterm's reported baud rate + can mislead ncurses into producing too few padding characters + (Debian #58530). + + add a check to tic for consistency between sgr and the separate + capabilities such as smso, use this to check/correct several + terminfo entries (Debian #58530). + + add a check to tic if cvvis is the same as cnorm, adjusted several + terminfo entries to remove the conflict (Debian #58530). + + correct prototype shown in attr_set()/wattr_set() manpages (fixes + Debian #53962). + + minor clarification for curs_set() and leaveok() manpages. + + use mkstemp() for creating temporary file for tic's processing of + $TERMCAP contents (fixes Debian #56465). + + correct two errors from integrating Alexander's changes: did not + handle the non-bce case properly in can_erase_with() (noted by + Alexander), and left fg/bg uninitialized in the pair-zero case of + _nc_do_color() (reported by Dr Werner Fink and + Ismael Cordeiro ). + +20000219 + + store default-color code consistently as C_MASK, even if given as + -1 for convenience (adapted from patches by Alexander Lukyanov). + > patches by Alexander Lukyanov: + + change can_clear_with() macro to accommodate logic for + assume_default_colors(), making most of the FILL_BCE logic + unnecessary. Made can_clear_with() an inline function to make it + simpler to read. + +20000212 + + corrected form of recent copyright dates. + + minor corrections to xterm-xf86-v333 terminfo entry -TD + > patches by Alexander Lukyanov: + + reworded dft_fgbg.3x to avoid assuming that the terminal's default + colors are white on black. + + fix initialization of tstLine so that it is filled with current blank + character in any case. Previously it was possible to have it filled + with old blank. The wrong over-optimization was introduced in 991002 + patch. (it is not very critical as the only bad effect is not using + clr_eos for clearing if blank has changed). + +20000205 + + minor corrections/updates to several terminfo entries: rxvt-basic, + vt520, vt525, ibm5151, xterm-xf86-v40 -TD + + modify ifdef's for poll() to allow it to use , thereby + allowing poll() to be used on Linux. + + add CF_FUNC_POLL macro to check if poll() is able to select from + standard input. If not we will not use it, preferring select() + (adapted from patch by Michael Pakovic ). + + update CF_SHARED_OPTS macro for SCO Unixware 7.1 to allow building + shared libraries (reported/tested by Thanh ). + + override $LANGUAGE in build to avoid incorrect ordering of keynames. + + correct CF_MATH_LIB parameter, must be sin(x), not sqrt(x). + +20000122 + + resync CF_CHECK_ERRNO and CF_LIB_PREFIX macros from tin and xterm. + + modify CF_MATH_LIB configure macro to parameterize the test function + used, for reuse in dialog and similar packages. + + correct tests for file-descriptors in OS/2 EMX mouse support. A + negative value could be used by FD_SET, causing the select() call + to wait indefinitely. + +20000115 + + additional fixes for non-bce terminals (handling of delete_character) + to work when assume_default_colors() is not specified. + + modify warning message from _nc_parse_entry() regarding extended + capability names to print only if tic/infocmp/toe have the -v flag + set, and not at all in ordinary user applications. Otherwise, this + warning would be shown for screen's extended capabilities in programs + that use the termcap interface (reported by Todd C Miller). + + modify use of _nc_tracing from programs such as tic so their debug + level is not in the same range as values set by trace() function. + + small panel header cleanup (patch by Juergen Pfeifer). + + add 'railroad' demo for termcap interface. + + modify 'tic' to write its usage message to stderr (patch by Todd C + Miller). + +20000108 + + add prototype for erase() to curses.h.in, needed to make test + programs build with c++/g++. + + add .c.i and .c.h suffix rules to generated makefiles, for debugging. + + correct install rule for tack.1; it assumed that file was in the + current directory (reported by Mike Castle ). + + modify terminfo/termcap translation to suppress acsc before trying + sgr if the entry would be too large (patch by Todd C Miller). + + document a special case of incompatiblity between ncurses 4.2 and + 5.0, add a section for this in INSTALL. + + add TRACE_DATABASE flag for trace(). + +20000101 + + update mach, add mach-color terminfo entries based on Debian diffs + for ncurses 5.0 -TD + + add entries for xterm-hp, xterm-vt220, xterm-vt52 and xterm-noapp + terminfo entries -TD + + change OTrs capabilities to rs2 in terminfo.src -TD + + add obsolete and extended capabilities to 'screen' terminfo -TD + + corrected conversion from terminfo rs2 to termcap rs (cf: 980704) + + make conversion to termcap ug (underline glitch) more consistently + applied. + + fix out-of-scope use of 'personal[]' buffer in 'toe' (this error + was in the original pre-1.9.7 version, when $HOME/.terminfo was + introduced). + + modify 'toe' to ignore terminfo directories to which it has no + permissions. + + modify read_termtype(), fixing 'toe', which could dump core when it + found an incomplete entry such as "dumb" because it did not + initialize its buffer for _nc_read_file_entry(). + + use -fPIC rather than -fpic for shared libraries on Linux, not + needed for i386 but some ports (from Debian diffs for 5.0). + + use explicit VALID_NUMERIC() checks in a few places that had been + overlooked, and add a check to ensure that init_tabs is nonzero, + to avoid divide-by-zero (reported by Todd C Miller). + + minor fix for CF_ANSI_CC_CHECK configure macro, for HPUX 10.x (from + tin). + +19991218 + + reorder tests during mouse initialization to allow for gpm to run in + xterm, or for xterm to be used under OS/2 EMX. Also drop test for + $DISPLAY in favor of kmous=\E[M or $TERM containing "xterm" (report + by Christian Weisgerber ). + + modify raw() and noraw() to clear/restore IEXTEN flag which affects + stty lnext on systems such as FreeBSD (report by Bruce Evans + , via Jason Evans ). + + fix a potential (but unlikely) buffer overflow in failed() function + of tset.c (reported by Todd C Miller). + + add manual-page for ncurses extensions, documented curses_version(), + use_extended_names(). + +19991211 + + treat as untranslatable to termcap those terminfo strings which + contain non-decimal formatting, e.g., hexadecimal or octal. + + correct commented-out capabilities that cannot be translated to + termcap, which did not check if a colon must be escaped. + + correct termcap translation for "%>" and "%+", which did not check + if a colon must be escaped, for instance. + + use save_string/save_char for _nc_captoinfo() to eliminate fixed + buffer (originally for _nc_infotocap() in 960301 -TD). + + correct expression used for terminfo equivalent of termcap %B, + adjust regent100 entry which uses this. + + some cleanup and commenting of ad hoc cases in _nc_infotocap(). + + eliminate a fixed-buffer in tic, used for translating comments. + + add manpage for infotocap + +19991204 + + add kvt and gnome terminfo entries -TD + + correct translation of "%%" by infotocap, which was emitted as "%". + + add "obsolete" termcap strings to terminfo.src + + modify infocmp to default to showing obsolete capabilities rather + than terminfo only. + + modify write_entry.c so that if extended names (i.e., configure + --enable-tcap-names) are active, then tic will also write "obsolete" + capabilities that are present in the terminfo source. + + modify tic so that when running as captoinfo or infotocap, it + initializes the output format as in -C and -I options, respectively. + + improve infocmp and tic -f option by splitting long strings that do + not have if-then-else construct, but do have parameters, e.g., the + initc for xterm-88color. + + refine MKtermsort.sh slightly by using bool for the *_from_termcap + arrays. + +19991127 + + additional fixes for non-bce terminals (handling of clear_screen, + clr_eol, clr_eos, scrolling) to work when assume_default_colors() is + not specified. + + several small changes to xterm terminfo entries -TD. + + move logic for _nc_windows in lib_freeall.c inside check for nonnull + SP, since it is part of that struct. + + remove obsolete shlib-versions, which was unintentionally re-added + in 970927. + + modify infocmp -e, -E options to ensure that generated fallback.c + type for Booleans agrees with term.h (reported by Eric Norum + ). + + correct configure script's use of $LIB_PREFIX, which did not work + for installing the c++ directory if $libdir did not end with "/lib" + (reported by Huy Le ). + + modify infocmp so -L and -f options work together. + + modify the initialization of SP->_color_table[] in start_color() so + that color_content() will return usable values for COLORS greater + than 8. + + modify ncurses 'd' test in case COLORS is greater than 16, e.g., for + xterm-88color, to limit the displayed/computed colors to 16. + > patch by Juergen Pfeifer: + + simplify coding of the panel library according to suggestions by + Philippe Blain. + + improve macro coding for a few macros in curses.priv.h + +19991113 + + modify treatment of color pair 0 so that if ncurses is configured + to support default colors, and they are not active, then ncurses + will set that explicitly, not relying on orig_colors or orig_pair. + + add new extension, assume_default_colors() to provide better control + over the use of default colors. + + modify test programs to use more-specific ifdef's for existence of + wresize(), resizeterm() and use_default_colors(). + + modify configure script to add specific ifdef's for some functions + that are included when --enable-ext-funcs is in effect, so their + existence can be ifdef'd in the test programs. + + reorder some configure options, moving those extensions that have + evolved from experimental status into a new section. + + change configure --enable-tcap-names to enable this by default. + +19991106 + + install tack's manpage (reported by Robert Weiner + ) + + correct worm.c's handling of KEY_RESIZE (patch by Frank Heckenbach). + + modify curses.h.in, undef'ing some symbols to avoid conflict with C++ + STL (reported by Matt Gerassimoff ) + +19991030 + + modify linux terminfo entry to indicate that dim does not mix with + color (reported by Klaus Weide ). + + correct several typos in terminfo entries related to missing '[' + in CSI's -TD + + fix several compiler warnings in c++ binding (reported by Tim + Mooney for alphaev56-dec-osf4.0f + + rename parameter of _nc_free_entries() to accommodate lint. + + correct lint rule for tack, used incorrect list of source files. + + add case to config.guess, config.sub for Rhapsody. + + improve configure tests for libg++ and libstdc++ by omitting the + math library (which is missing on Rhapsody), and improved test for + the math library itself (adapted from path by Nelson H. F. Beebe). + + explicitly initialize to zero several data items which were + implicitly initialized, e.g., cur_term. If not explicitly + initialized, their storage type is C (common), and causes problems + linking on Rhapsody 5.5 using gcc 2.7.2.1 (reported by Nelson H. F. + Beebe). + + modify Ada95 binding to not include the linker option for Ada + bindings in the Ada headers, but in the Makefiles instead (patch by + Juergen Pfeifer). + +19991023 5.0 release for upload to ftp.gnu.org + + effective with release of 5.0, change NCURSES_VERSION_PATCH to + 4-digit year. + + add function curses_version(), to return ncurses library version + (request by Bob van der Poel). + + remove rmam, smam from cygwin terminfo entry. + + modify FreeBSD cons25 terminfo entry to add cnorm and cvvis, as well + as update ncv to indicate that 'dim' conflicts with colors. + + modify configure script to use symbolic links for FreeBSD shared + libraries by default. + + correct ranf() function in rain and worm programs to ensure it does + not return 1.0 + + hide the cursor in hanoi.c if it is running automatically. + + amend lrtest.c to account for optimizations that exploit margin + wrapping. + + add a simple terminfo demo, dots.c + + modify SIGINT/SIGQUIT handler to set a flag used in _nc_outch() to + tell it to use write() rather than putc(), since the latter is not + safe in a signal handler according to POSIX. + + add/use internal macros _nc_flush() and NC_OUTPUT to hide details + of output-file pointer in ncurses library. + + uncomment CC_SHARED_OPTS (see 971115), since they are needed for SCO + OpenServer. + + correct CC_SHARED_OPTS for building shared libraries for SCO + OpenServer. + + remove usleep() from alternatives in napms(), since it may interact + with alarm(), causing a process to be interrupted by SIGALRM (with + advice from Bela Lubkin). + + modify terminal_interface-curses-forms.ads.m4 to build/work with + GNAT 3.10 (patch by Juergen Pfeifer). + + remove part of CF_GPP_LIBRARY configure-script macro, which did not + work with gcc 2.7.2.3 + + minor fix to test/tclock.c to avoid beeping more than once per second + + add 's' and ' ' decoding to test/rain.c + +991016 pre-release + + corrected BeOS code for lib_twait.c, making nodelay() function work. + +991009 pre-release + + correct ncurses' value for cursor-column in PutCharLR(), which was + off-by-one in one case (patch by Ilya Zakharevich). + + fix some minor errors in position_check() debugging code, found while + using this to validate the PutCharLR() patch. + + modify firework, lrtest, worm examples to be resizable, and to + recognize 'q' for quit, 's' for single-step and ' ' for resume. + + restore reverted change to terminal_interface-curses-forms.ads.m4, + add a note on building with gnat 3.10p to Ada95/TODO. + + add a copy of the standalone configure script for the test-directory + to simplify testing on SCO and Solaris. + +991002 pre-release + + minor fixes for _nc_msec_cost(), color_content(), pair_content(), + _nc_freewin(), ClrBottom() and onscreen_mvcur() (analysis by Philippe + Blain, comments by Alexander Lukyanov). + + simplify definition of PANEL and eliminate internal functions + _nc_calculate_obscure(), _nc_free_obscure() and _nc_override(), + (patch by Juergen Pfeifer, based on analysis by Philippe Blain + )). + + change renaming of dft_fgbg.3x to use_default_colors.3ncurses in + man_db.renames, since Debian is not concerned with 14-character + filename limitation (from Debian bug report by Josip Rodin + ). + + corrected scoansi terminfo entry by testing with scoterm and console. + + revert change from 990614 to terminal_interface-curses-forms.ads.m4, + since this does not work for gnat 3.10p + + modify tclock example to be resizable (if ncurses' sigwinch handler + is used), and in color. + + use $(CC) rather than 'gcc' in MK_SHARED_LIB symbols, used for Linux + shared library rules. + +990925 pre-release + + add newer NetBSD console terminfo entries + + add amiga-8bit terminfo entry (from Henning 'Faroul' Peters + ) + + remove -lcurses -ltermcap from configure script's check for the gpm + library, since they are not really necessary (a properly configured + gpm library has no dependency on any curses library), and if the + curses library is not installed, this would cause the test to fail. + + modify tic's -C option so that terminfo "use=" clauses are translated + to "tc=" clauses even when running it as captoinfo. + + modify CF_STDCPP_LIBRARY configure macro to perform its check only + for GNU C++, since that library conflicts with SGI's libC on IRIX-6.2 + + modify CF_SHARED_OPTS configure macro to support build on NetBSD with + ELF libraries (patch by Bernd Ernesti ). + + correct a problem in libpanel, where the _nc_top_panel variable was + not set properly when bottom_panel() is called to hide a panel which + is the only one on the stack (report/analysis by Michael Andres + , patch by Juergen Pfeifer). + +990918 pre-release + + add acsc string to HP 70092 terminfo entry (patch by Joerg Wunsch + ). + + add top-level uninstall.data and uninstall.man makefile rules. + + correct logic of CF_LINK_FUNCS configure script, from BeOS changes so + that hard-links work on Unix again. + + change default value of cf_cv_builtin_bool to 1 as suggested by + Jeremy Buhler, making it less likely that a conflicting declaration + of bool will be seen when compiling with C++. + +990911 pre-release + + improved configure checks for builtin.h + + minor changes to C++ binding (remove static initializations, and make + configure-test for parameter initializations) for features not + allowed by vendor's C++ compilers (reported by Martin Mokrejs, this + applies to SGI, though I found SCO has the same characteristics). + + corrected quoting of ETIP_xxx definitions which support old versions + of g++, e.g., those using -lg++ + + remove 'L' code from safe_sprintf.c, since 'long double' is not + widely portable. safe_sprintf.c is experimental, however, and + exists mainly as a fallback for systems without snprintf (reported + by Martin Mokrejs , for IRIX 6.2) + + modify definition of _nc_tinfo_fkeys in broken-linker configuration + so that it is not unnecessarily made extern (Jeffrey C Honig). + +990904 pre-release + + move definition for builtin.h in configure tests to specific check + for libg++, since qt uses the same filename incompatibly. + + correct logic of lib_termcap.c tgetstr function, which did not copy + the result to the buffer parameter. Testing shows Solaris does + update this, though of course tgetent's buffer is untouched (from + mpc.lists.freebsd.current newsgroup item by Peter Edwards + ). + + corrected beterm terminfo entry, which lists some capabilities which + are not actually provided by the BeOS Terminal. + + add special logic to replace select() calls on BeOS, whose select() + function works only for sockets. + + correct missing escape in mkterm.h.awk.in, which caused part + of the copyright noticed to be omitted (reported by Peter + Wemm ). + > several small changes to make the c++ binding and demo work on OS/2 + EMX (related to a clean reinstall of EMX): + + correct library-prefix for c++ binding; none is needed. + + add $x suffix to make_hash and make_keys so 'make distclean' works. + + correct missing $x suffix for tack, c++ demo executables. + + split CF_CXX_LIBRARY into CF_GPP_LIBRARY (for -lg++) and + CF_STDCPP_LIBRARY (for -lstdc++) + +990828 pre-release + + add cygwin terminfo entry -TD + + modify CF_PROG_EXT configure macro to set .exe extension for cygwin. + + add configure option --without-cxx-binding, modifying the existing + --without-cxx option to check only for the C++ compiler + characteristics. Whether or not the C++ binding is needed, the + configure script checks for the size/type of bool, to make ncurses + match. Otherwise C++ applications cannot use ncurses. + +990821 pre-release + + updated configure macros CF_MAKEFLAGS, CF_CHECK_ERRNO + + minor corrections to beterm terminfo entry. + + modify lib_setup.c to reject values of $TERM which have a '/' in + them. + + add ifdef's to guard against CS5, CS6, CS7, CS8 being zero, as more + than one is on BeOS. That would break a switch statement. + + add configure macro CF_LINK_FUNCS to detect and work around BeOS's + nonfunctional link(). + + improved configure macros CF_BOOL_DECL and CF_BOOL_SIZE to detect + BeOS's bool, which is declared as an unsigned char. + +990814 pre-release + + add ms-vt100 terminfo entry -TD + + minor fixes for misc/emx.src, based on testing with tack. + + minor fix for test/ncurses.c, test 'a', in case ncv is not set. + +990731 pre-release + + minor correction for 'screen' terminfo entry. + + clarify description of errret values for setupterm in manpage. + + modify tput to allow it to emit capabilities for hardcopy terminals + (patch by Goran Uddeborg ). + + modify the 'o' (panel) test in ncurses.c to show the panels in color + or at least in bold, to test Juergen's change to wrefresh(). + > patches by Juergen Pfeifer: + + Fixes a problem using wbkgdset() with panels. It has actually + nothing to with panels but is a problem in the implementation of + wrefresh(). Whenever a window changes its background attribute to + something different than newscr's background attribute, the whole + window is touched to force a copy to newscr. This is an unwanted + side-effect of wrefresh() and it is actually not necessary. A + changed background attribute affects only further outputs of + background it doesn't mean anything to the current content of the + window. So there is no need to force a copy. (reported by Frank + Heckenbach ). + + an upward compatible enhancement of the NCursesPad class in the C++ + binding. It allows one to add a "viewport" window to a pad and then + to use panning to view the pad through the viewport window. + +990724 pre-release + + suppress a call to def_prog_mode() in the SIGTSTP handler if the + signal was received while not in curses mode, e.g., endwin() was + called in preparation for spawning a shell command (reported by Frank + Heckenbach ) + + corrected/enhanced xterm-r5, xterm+sl, xterm+sl-twm terminfo entries. + + change test for xterm mouse capability: it now checks only if the + user's $DISPLAY variable is set in conjunction with the kmous + capability being present in the terminfo. Before, it checked if any + of "xterm", "rxvt" or "kterm" were substrings of the terminal name. + However, some emulators which are incompatible with xterm in other + ways do support the xterm mouse capability. + + reviewed and made minor changes in ncurses to quiet g++ warnings + about shadowed or uninitialized variables. g++ incorrectly warns + about uninitialized variables because it does not take into account + short-circuit expression evaluation. + + change ncurses 'b' test to start in color pair 0 and to show in the + right margin those attributes which are suppressed by no_color_video, + i.e., "(NCV)". + + modify ifdef's in curses.h so that __attribute__ is not redefined + when compiling with g++, but instead disabled the macros derived for + __attribute__ since g++ does not consistently recognize the same + keywords as gcc (reported by Stephan K Zitz ). + + update dependencies for term.h in ncurses/modules (reported by + Ilya Zakharevich). + +990710 pre-release + + modify the form demo in ncurses.c to illustrate how to manipulate the + field appearance, e.g, for highlighting or translating the field + contents. + + correct logic in write_entry from split-out of home_terminfo in + 980919, which prevented update of $HOME/.terminfo (reported by Philip + Spencer ). + +990703 pre-release + + modify linux terminfo description to make use of kernel 2.2.x mods + that support cursor style, e.g., to implement cvvis (patch by Frank + Heckenbach ) + + add special-case in setupterm to retain previously-saved terminal + settings in cur_term, which happens when curses and termcap calls are + mixed (from report by Bjorn Helgaas ). + + suppress initialization of key-tries in _nc_keypad() if we are only + disabling keypad mode, e.g., in endwin() called when keypad() was + not. + + modify the Ada95 makefile to ensure that always the Ada files from + the development tree are used for building and not the eventually + installed ones (patch by Juergen Pfeifer). + +990626 pre-release + + use TTY definition in tack/sysdep.c rather than struct termios + (reported by Philippe De Muyter). + + add a fallback for strstr, used in lib_mvcur.c and tack/edit.c, + not present on sysV68 (reported by Philippe De Muyter). + + correct definition in comp_hash.c to build with configure + --with-rcs-ids option. + +990619 pre-release + + modified ifdef's for sigaction and sigvec to ensure we do not try to + handle SIGTSTP if neither is available (from report by Philippe De + Muyter). + > patch by Philippe De Muyter: + + in tic.c, use `unlink' if `remove' is not available. + + use only `unsigned' as fallback value for `speed_t'. Some files used + `short' instead. + +990616 pre-release + + fix some compiler warnings in tack. + + add a check for predefined bool type in CC, based on report that + BeOS predefines a bool type. + + correct logic for infocmp -e option (i.e., the configure + --with-fallbacks option), which I'd not updated when implementing + extended names (cf: 990301). The new implementation adds a -E + option to infocmp. + > patch by Juergen Pfeifer: + + introduce the private type Curses_Bool in the Ada95 binding + implementation. This is to clearly represent the use of "bool" also + in the binding. It should have no effect on the generated code. + + improve the man page for field_buffer() to tell the people, that the + whole buffer including leading/trailing spaces is returned. This is + a common source of confusion, so it's better to document it clearly. + +990614 pre-release + > patch by Juergen Pfeifer: + + use pragma PreElaborate in several places. + + change a few System.Address uses to more specific types. + + change interface version-number to 1.0 + + regenerate Ada95 HTML files. + +990612 pre-release + + modify lib_endwin.c to avoid calling reset_shell_mode(), return ERR + if it appears that curses was never initialized, e.g., by initscr(). + For instance, this guards against setting the terminal modes to + strange values if endwin() is called after setupterm(). In the same + context, Solaris curses will dump core. + + modify logic that avoids a conflict in lib_vidattr.c between sgr0 and + equivalent values in rmso or rmul by ensuring we do not modify the + data which would be returned by the terminfo or termcap interfaces + (reported by Brad Pepers , cf: 960706). + + add a null-pointer check for SP in lib_vidattr.c to logic that checks + for magic cookies. + + improve fallback declaration of 'bool' when the --without-cxx option + is given, by using a 'char' on i386 and related hosts (from + discussion with Alexander Lukyanov). + +990605 pre-release + + include time.h in lib_napms.c if nanosleep is used (patch by + R Lindsay Todd ). + + add an "#undef bool" to curses.h, in case someone tries to define it, + e.g., perl. + + add check to tparm to guard against divide by zero (reported by Aaron + Campbell ). + +990516 pre-release + + minor fix to build tack on CLIX (mismatched const). + > patch by Juergen Pfeifer: + + change Juergen's old email address with new one in the files where it + is referenced. The Ada95 HTML pages are regenerated. + + update MANIFEST to list the tack files. + +990509 pre-release + + minor fixes to make 'tack' build/link on NeXT (reported by Francisco + A. Tomei Torres). + +990417 pre-release + + add 'tack' program (which is GPL'd), updating it to work with the + modified TERMTYPE struct and making a fix to support setaf/setab + capabilities. Note that the tack program is not part of the + ncurses libraries, but an application which can be distributed with + ncurses. The configure script will ignore the directory if it is + omitted, however. + + modify gpm mouse support so that buttons 2 and 3 are used for + select/paste only when shift key is pressed, making them available + for use by an application (patch by Klaus Weide). + + add complete list of function keys to scoansi terminfo entry - TD + +990410 pre-release + + add a simple test program cardfile.c to illustrate how to read form + fields, and showing forms within panels. + + change shared-library versioning for the Hurd to be like Linux rather + than *BSD (patch by Mark Kettenis ). + + add linux-lat terminfo entry. + + back-out _nc_access check in read_termcap.c (both incorrect and + unnecessary, except to guard against a small window where the file's + ownership may change). + +990403 pre-release + + remove conflicting _nc_free_termtype() function from test module + lib_freeall.c + + use _nc_access check in read_termcap.c for termpaths[] array (noted + by Jeremy Buhler, indicating that Alan Cox made a similar patch). + > patch by Juergen Pfeifer: + + modify menu creation to not inherit status flag from the default menu + which says that the associated marker string has been allocated and + should be freed (bug reported by Marek Paliwoda" + ) + +990327 pre-release (alpha.gnu.org:/gnu/ncurses-5.0-beta1.tar.gz) + + minor fixes to xterm-xfree86 terminfo entry - TD. + + split up an expression in configure script check for ldconfig to + workaround limitation of BSD/OS sh (reported by Jeff Haas + ). + + correct a typo in man/form_hook.3x (Todd C Miller). + +990318 pre-release + + parenthesize and undef 'index' symbol in c++ binding and demo, to + accommodate its definition on NeXT (reported by Francisco A. Tomei + Torres). + + add sigismember() to base/sigaction.c compatibility to link on NeXT + (reported by Francisco A. Tomei Torres). + + further refinements to inequality in hashmap.c to cover a case with + ^U in nvi (patch by Alexander Lukyanov). + +990316 pre-release + + add fallback definition for getcwd, to link on NeXT. + + add a copy of cur_term to tic.c to make it link properly on NeXT + (reported by Francisco A. Tomei Torres). + + change inequality in hashmap.c which checks the distance traveled by + a chunk so that ^D command in nvi (scrolls 1/2 screen) will use + scrolling logic (patch by Alexander Lukyanov, reported by Jeffrey + C Honig). + +990314 pre-release + + modify lib_color.c to handle a special case where the curscr + attributes have been made obsolete (patch by Alexander Lukyanov). + + update BSD/OS console terminfo entries to use klone+sgr and + klone+color (patch by Jeffrey C Honig). + + update glibc addon configure script for extended capabilities. + + correct a couple of warnings in the --enable-const configuration. + + make comp_hash build properly with _nc_strdup(), on NeXT (reported by + Francisco A. Tomei Torres ). + +990313 pre-release + + correct typos in linux-c initc string - TD + + add 'crt' terminfo entry, update xterm-xfree86 entry - TD + + remove a spurious argument to tparm() in lib_sklrefr.c (patch by + Alexander Lukyanov). + +990307 pre-release + + back-out change to wgetch because it causes a problem with ^Z + handling in lynx (reported by Kim DeVaughn). + +990306 pre-release + + add -G option to tic and infocmp, to reverse the -g option. + + recode functions in name_match.c to avoid use of strncpy, which + caused a 4-fold slowdown in tic (cf: 980530). + + correct a few warnings about sign-extension in recent changes. + > patch by Juergen Pfeifer: + + fixes suggested by Jeff Bradbury : + + improved parameter checking in new_fieldtype(). + + fixed a typo in wgetch() timeout handling. + + allow slk_init() to be called per newterm call. The internal SLK + state is stored in the SCREEN struct after every newterm() and then + reset for the next newterm. + + fix the problem that a slk_refresh() refreshes stdscr if the + terminal has true SLKs. + + update HTML documentation for Ada binding. + +990301 pre-release + + remove 'bool' casts from definitions of TRUE/FALSE so that statements + such as "#if TRUE" work. This was originally done to allow for a C++ + compiler which would warn of implicit conversions between enum and + int, but is not needed for g++ (reported by Kim DeVaughn). + + add use_extended_names() function to allow applications to suppress + read of the extended capabilities. + + add configure option --enable-tcap-names to support logic which + allows ncurses' tic to define new (i.e., extended) terminal + capabilities. This is activated by the tic -x switch. The infocmp + program automatically shows or compares extended capabilities. + Note: This changes the Strings and similar arrays in the TERMTYPE + struct so that applications which manipulate it must be recompiled. + + use macros typeMalloc, typeCalloc and typeRealloc consistently + throughout ncurses library. + + add _nc_strdup() to doalloc.c. + + modify define_key() to allow multiple strings to be bound to the + same keycode. + + correct logic error in _nc_remove_string, from 990220. + > patch by Juergen Pfeifer, for Ada95 binding: + + regenerate some of the html documentation + + minor cleanup in terminal_interface-curses.adb + +990220 pre-release + + resolve ambiguity of kend/kll/kslt and khome/kfnd/kich1 strings in + xterm and ncsa terminfo entries by removing the unneeded ones. Note + that some entries will return kend & khome versus kslt and kfnd, for + PC-style keyboards versus strict vt220 compatiblity - TD + + add function keybound(), which returns the definition associated with + a given keycode. + + modify define_key() to undefine the given string when no keycode is + given. + + modify keyok() so it works properly if there is more than one string + defined for a keycode. + + add check to tic to warn about terminfo descriptions that contain + more than one key assigned to the same string. This is shown only if + the verbose (-v) option is given. Moved related logic (tic -v) from + comp_parse.c into the tic program. + + add/use _nc_trace_tries() to show the function keys that will be + recognized. + + rename init_acs to _nc_init_acs (request by Alexander Lukyanov). + > patch by Juergen Pfeifer, for Ada95 binding: + + remove all the *_adabind.c from ncurses, menu and form projects. + Those little helper routines have all been implemented in Ada and are + no longer required. + + The option handling routines in menu and form have been made more + save. They now make sure that the unused bits in options are always + zero. + + modify configuration scripts to + + use gnatmake as default compiler name. This is a safer choice than + gcc, because some GNAT implementations use other names for the + compilerdriver to avoid conflicts. + + use new default installation locations for the Ada files according + to the proposed GNU Ada filesystem standard (for Linux). + + simplify the Makefiles for the Ada binding + + rename ada_include directory to src. + +990213 + + enable sigwinch handler by default. + + disable logic that allows setbuf to be turned off/on, because some + implementations will overrun the buffer after it has been disabled + once. + +990206 + + suppress sc/rc capabilities from terminal description if they appear + in smcup/rmcup. This affects only scrolling optimization, to fix a + problem reported by several people with xterm's alternate screen, + though the problem is more general. + > patch by Juergen Pfeifer, for Ada95 binding: + + removed all pragma Preelaborate() stuff, because the just released + gnat-3.11p complains on some constructs. + + fixed some upper/lower case notations because gnat-3.11p found + inconsistent use. + + used a new method to generate the HTML documentation of the Ada95 + binding. This invalidates nearly the whole ./Ada95/html subtree. + Nearly all current files in this subtree are removed + +990130 + + cache last result from _nc_baudrate, for performance (suggested by + Alexander Lukyanov). + + modify ClrUpdate() function to workaround a problem in nvi, which + uses redrawwin in SIGTSTP handling. Jeffrey C Honig reported that + ncurses repainted the screen with nulls before resuming normal + operation (patch by Alexander Lukyanov). + + generalize is_xterm() function a little by letting xterm/rxvt/kterm + be any substring rather than the prefix. + + modify lib_data.c to initialize SP. Some linkers, e.g., IBM's, will + not link a module if the only symbols exported from the module are + uninitialized ones (patch by Ilya Zakharevich, who says that he has + seen messages claiming this behaviour conforms to the standard.) + + move call on _nc_signal_handler past _nc_initscr, to avoid a small + window where Nttyb hasn't yet been filled (reported by Klaus Weide). + + modify lib_tstp.c to block SIGTTOU when handling SIGTSTP, fixes a + problem where ncurses applications which were run via a shell script + would hang when given a ^Z. Also, check if the terminal's process + group is consistent, i.e., a shell has not taken ownership of it, + before deciding to save the current terminal settings in the SIGTSTP + handler (patch by Klaus Weide). + + correct spelling of ACS_ names in curs_border.3x (reported by Bob van + der Poel ). + + correct a couple of typos in the macros supporting the configure + --with-shlib-version option. + +990123 + + modify fty_regex.c to compile on HAVE_REGEXPR_H_FUNCS machine (patch + by Kimio Ishii ). + + rename BSDI console terminfo entries: bsdos to bsdos-pc-nobold, and + bsdos-bold to bsdos-pc (patch by Jeffrey C Honig). + + modify tput to accept termcap names as an alternative to terminfo + names (patch by Jeffrey C Honig). + + correct a typo in term.7 (Todd C Miller). + + add configure --with-shlib-version option to allow installing shared + libraries named according to release or ABI versions. This + parameterizes some existing logic in the configure script, and is + intended for compatiblity upgrades on Digital Unix, which used + versioned libraries in ncurses 4.2, but no longer does (cf: 980425). + + resync configure script against autoconf 2.13 + patches + + minor improvements for teraterm terminfo entry based on the program's + source distribution. + +990116 + + change default for configure --enable-big-core to assume machines do + have enough memory to resolve terminfo.src in-memory. + + correct name of ncurses library in TEST_ARGS when configuring with + debug library. + + minor fixes to compile ncurses library with broken-linker with g++. + + add --enable-broken-linker configure option, default to environment + variable $BROKEN_LINKER (request by Jeffrey C Honig). + + change key_names[] array to static since it is not part of the curses + interface (reported by Jeffrey C Honig ). + +990110 + + add Tera Term terminfo entry - TD + +990109 + + reviewed/corrected macros in curses.h as per XSI document. + + provide support for termcap PC variable by copying it from terminfo + data and using it as the padding character in tputs (reported by + Alexander Lukyanov). + + corrected iris-ansi and iris-ansi-ap terminfo entries for kent and + kf9-kf12 capabilities, as well as adding kcbt. + + document the mouse handling mechanism in menu_driver and make a small + change in menu_driver's return codes to provide more consistency + (patch by Juergen Pfeifer). + + add fallback definition for NCURSES_CONST to termcap.h.in (reported + by Uchiyama Yasushi ). + + move lib_restart.c to ncurses/base, since it uses curses functions + directly, and therefore cannot be used in libtinfo.so + + rename micro_char_size to micro_col_size, adding #define to retain + old name. + + add set_a_attributes and set_pglen_inch to terminfo structure, as per + XSI and Solaris 2.5. + + minor makefile files to build ncurses test_progs + + update html files in misc directory to reflect changes since 4.2 + +990102 + + disable scroll hints when hashmap is enabled (patch by Alexander + Lukyanov). + + move logic for tic's verify of -e option versus -I and -C so that the + terminfo data is not processed if we cannot handle -e (reported by + Steven Schwartz . + + add test-driver traces to terminfo and termcap functions. + + provide support for termcap ospeed variable by copying it from the + internal cur_term member, and using ospeed as the baudrate reference + for the delay_output and tputs functions. If an application does not + set ospeed, the library behaves as before, except that _nc_timed_wait + is no longer used, or needed, since ospeed always has a value. But + the application can modify ospeed to adjust the output of padding + characters (from a bug report for screen 3.7.6 and email from Michael + Schroeder ). + + removed some unused ifdef's as part of Alexander's restructuring. + + reviewed/updated curses.h, term.h against X/Open Curses Issue 4 + Version 2. This includes making some parameters NCURSES_CONST + rather than const, e.g., in termcap.h. + + change linux terminfo entry to use ncv#2, since underline does not + work with color + +981226 + + miscellaneous corrections for curses.h to match XSI. + + change --enable-no-padding configure option to be normally enabled. + + add section to ncurses manpage for environment variables. + + investigated Debian bug report that pertains to screen 3.7.4/3.7.6 + changes, found no sign of problems on Linux (or on SunOS, Solaris) + running screen built with ncurses. + + check if tmp_fp is opened in tic.c before closing it (patch by Pavel + Roskin ). + + correct several font specification typos in man-pages. + +981220 + + correct default value for BUILD_CC (reported by Larry Virden). + +981219 + + modify _nc_set_writedir() to set a flag in _nc_tic_dir() to prevent + it from changing the terminfo directory after chdir'ing to it. + Otherwise, a relative path in $TERMINFO would confuse tic (from a + Debian bug report). + + correct/update ncsa terminfo entry (report by Larry Virden). + + update xterm-xfree86 terminfo to current (patch 90), smcur/rmcur + changes + + add Mathew Vernon's mach console entries to terminfo.src + + more changes, moving functions, as part of Alexander's restructuring. + + modify configure script for GNU/Hurd share-library support, introduce + BUILD_CC variable for cross compiling (patch by Uchiyama Yasushi + ) + +981212 + + add environment variable NCURSES_NO_SETBUF to allow disabling the + setbuf feature, for testing purposes. + + correct ifdef's for termcap.h versus term.h that suppress redundant + declarations of prototypes (reported by H.J.Lu). + + modify Makefile.os2 to add linker flags which allow multiple copies + of an application to coexist (reported by Ilya Zakharevich). + + update Makefile.glibc and associated configure script so that ncurses + builds as a glibc add-on with the new directory configuration + (reported by H.J.Lu). + +981205 + + modify gen_reps() function in gen.c to work properly on SunOS + (sparc), which is a left-to-right architecture. + + modify relative_move and tputs to avoid an interaction with the + BSD-style padding. The relative_move function could produce a string + to replace on the screen which began with a numeric character, which + was then interpreted by tputs as padding. Now relative_move will not + generate a string with a leading digit in that case (overwrite). + Also, tputs will only interpret padding if the string begins with a + digit; as coded it permitted a string to begin with a decimal point + or asterisk (reported by Larry Virden). + > patches by Juergen Pfeifer: + + fix a typo in m_driver.c mouse handling and improves the error + handling. + + fix broken mouse handling in the Ada95 binding + + make the Ada95 sample application menus work with the new menu mouse + support + + improve the mouse handling introduced by Ilya; it now handles menus + with spacing. + + repair a minor bug in the menu_driver code discovered during this + rework. + + add new function wmouse_trafo() to hide implementation details of + _yoffset member of WINDOW struct needed for mouse coordinate + transformation. + +981128 + + modify Ada95/gen/gen.c to avoid using return-value of sprintf, since + some older implementations (e.g., SunOS 4.x) return the buffer + address rather than its length. + > patch by Rick Ohnemus: + + modify demo.cc to get it to compile with newer versions of egcs. + + trim a space that appears at the end of the table preprocessor lines + ('\" t). This space prevents some versions of man from displaying + the pages - changed to remove all trailing whitespace (TD) + + finally, 'make clean' does not remove panel objects. + > patches by Ilya Zakharevich: + + allow remapping of OS/2 mouse buttons using environment variable + MOUSE_BUTTONS_123 with the default value 132. + + add mouse support to ncurses menus. + +981121 + + modify misc/makedef.cmd to report old-style .def file symbols, and to + generate the .def files sorted by increasing names rather than the + reverse. + + add misc/*.ref which are J.J.G.Ripoll's dll definition files (renamed + from misc/*.old), and updated based on the entrypoint coding he used + for an older version of ncurses. + + add README.emx, to document how to build on OS/2 EMX. + + updates for config.guess, config.sub from Lynx + > patches by Ilya Zakharevich: + + minor fixes for mouse handling mode: + a) Do not initialize mouse if the request is to have no mouse; + b) Allow switching of OS/2 VIO mouse on and off. + + modify Makefile.os2 to support alternative means of generating + configure script, by translating Unix script with Perl. + > patches by Juergen Pfeifer: + + Updates MANIFEST to reflect changes in source structure + + Eliminates a problem introduced with my last patch for the C++ + binding in the panels code. It removes the update() call done in the + panel destructor. + + Changes in the Ada95 binding to better support systems where + sizeof(chtype)!=sizeof(int) (e.g. DEC Alpha). + +981114 + + modify install-script for manpages to skip over .orig and .rej files + (request by Larry Virden). + > patches/discussion by Alexander Lukyanov: + + move base-library sources into ncurses/base and tty (serial terminal) + sources into ncurses/tty, as part of Alexander Lukyanov's proposed + changes to ncurses library. + + copy _tracemouse() into ncurses.c so that lib_tracemse.c need not + be linked into the normal ncurses library. + + move macro winch to a function, to hide details of struct ldat + > patches by Juergen Pfeifer: + + fix a potential compile problem in cursesw.cc + + some Ada95 cosmetics + + fix a gen.c problem when compiling on 64-Bit machines + + fix Ada95/gen/Makefile.in "-L" linker switch + + modify Ada95 makefiles to use the INSTALL_PREFIX setting. + +981107 + + ifdef'd out lib_freeall.c when not configured. + + rename _tracebits() to _nc_tracebits(). + + move terminfo-library sources into ncurses/tinfo, and trace-support + functions into ncurses/trace as part of Alexander Lukyanov's proposed + changes to ncurses library. + + modify generated term.h to always specify its own definitions for + HAVE_TERMIOS_H, etc., to guard against inclusion by programs with + broken configure scripts. + +981031 + + modify terminfo parsing to accept octal and hexadecimal constants, + like Solaris. + + remove an autoconf 2.10 artifact from the configure script's check + for "-g" compiler options. (Though harmless, this confused someone + at Debian, who recently issued a patch that results in the opposite + effect). + + add configure option --with-ada-compiler to accommodate installations + that do not use gcc as the driver for GNAT (patch by Juergen + Pfeifer). + +981017 + + ensure ./man exists in configure script, needed when configuring + with --srcdir option. + + modify infocmp "-r" option to remove limit on formatted termcap + output, which makes it more like Solaris' version. + + modify captoinfo to treat no-argument case more like Solaris' + version, which uses the contents of $TERMCAP as the entry to format. + + modify mk-2nd.awk to handle subdirectories, e.g., ncurses/tty + (patch by Alexander V Lukyanov). + +981010 + + modify --with-terminfo-dirs option so that the default value is the + ${datadir} value, unless $TERMINFO_DIRS is already set. This gets + rid of a hardcoded list of candidate directories in the configure + script. + + add some error-checking to _nc_read_file_entry() to ensure that + strings are properly terminated (Todd C Miller). + + rename manpage file curs_scr_dmp.3x to curs_scr_dump.3x, to + correspond with contents (reported by Neil Zanella + ). + + remove redundant configure check for C++ which did not work when $CXX + was specified with a full pathname (reported by Andreas Jaeger). + + corrected bcopy/memmove check; the macro was not standalone. + +981003 + + remove unnecessary portion of OS/2 EMX mouse change from + check_pending() (reported by Alexander V Lukyanov). + +980926 + + implement mouse support for OS/2 EMX (adapted from patch against + 4.2(?) by Ilya Zakharevich). + + add configure-check for bcopy/memmove, for 980919 changes to hashmap. + + merge Data General terminfo from Hasufin - TD + + merge AIX 3.2.5 terminfo descriptions for IBM terminals, replaces + some older entries - TD + + modify tic to compile into %'char' form in preference to %{number}, + since that is a little more efficient. + + minor correction to infocmp to avoid displaying "difference" between + two capabilities that are rendered in equivalent forms. + + add -g option to tic/infocmp to force character constants to be + displayed in quoted form. Otherwise their decimal values are shown. + + modify setupterm so that cancelled strings are treated the same as + absent strings, cancelled and absent booleans false (does not affect + tic, infocmp). + + modify tic, infocmp to discard redundant i3, r3 strings when output + to termcap format. + > patch by Alexander V Lukyanov: + + improve performance of tparm, now it takes 19% instead of 25% when + profiling worm. + + rename maxlen/minlen to prec/width for better readability. + + use format string for printing strings. + + use len argument correctly in save_text, and pass it to save_number. + +980919 + + make test_progs compile (but hashmap does not function). + + correct NC_BUFFERED macro, used in lib_mvcur test-driver, modify + associated logic to avoid freeing the SP->_setbuf data. + + add modules home_terminfo and getenv_num to libtinfo. + + move write_entry to libtinfo, to work with termcap caching. + + minor fixes to blue.c to build with atac. + + remove softscroll.c module; no longer needed for testing. + > patches by Todd C Miller: + + use strtol(3) instead of atoi(3) when parsing env variables so we can + detect a bogus (non-numeric) value. + + check for terminal names > MAX_NAME_SIZE in a few more places when + dealing with env variables again. + + fix a MAX_NAME_SIZE that should be MAX_NAME_SIZE+1 + + use sizeof instead of strlen(3) on PRIVATE_INFO since it is a fixed + string #define (compile time vs runtime). + + when setting errno to ENOMEM, set it right before the return, not + before code that could, possibly, set errno to a different value. + > patches by Alexander V Lukyanov: + + use default background in update_cost_from_blank() + + disable scroll-hints when hashmap is configured. + + improve integration of hashmap scrolling code, by adding oldhash and + newhash data to SP struct. + + invoke del_curterm from delscreen. + + modify del_curterm to set cur_term to null if it matches the + function's parameter which is deleted. + + modify lib_doupdate to prefer parm_ich to the enter_insert_mode and + exit_insert_mode combination, adjusting InsCharCost to check + enter_insert_mode, exit_insert_mode and insert_padding. Add + insert_padding in insert mode after each char. This adds new costs + to the SP struct. + +980912 + + modify test-driver in lib_mvcur.s to use _nc_setbuffer, for + consistent treatment. + + modify ncurses to restore output to unbuffered on endwin, and resume + buffering in refresh (see lib_set_term.c and NC_BUFFERED macro). + + corrected HTML version numbers (according to the W3C validator, they + never were HTML 2.0-compliant, but are acceptable 3.0). + +980905 + + modify MKterminfo.sh to generate terminfo.5 with tables sorted by + capability name, as in SVr4. + + modified term.h, termcap.h headers to avoid redundant declarations. + + change 'u_int' type in tset.c to unsigned, making this compile on + Sequent PRX 4.1 (reported by Michael Sterrett ). + +980829 + + corrections to mailing addresses, and moving the magic line that + causes the man program to invoke tbl to the first line of each + manpage (patch by Rick Ohnemus ). + + add Makefile.os2 and supporting scripts to generate dll's on OS/2 EMX + (from J.J.G.Ripoll, with further integration by TD). + + correct a typo in icl6404 terminfo entry. + + add xtermm and xtermc terminfo entries. + > from esr's terminfo version: + + Added Francesco Potorti's tuned Wyse 99 entries. + + dtterm enacs correction from Alexander V Lukyanov. + + Add ncsa-ns, ncsa-m-ns and ncsa-m entries from esr version. + +980822 + + document AT&T acs characters in terminfo.5 manpage. + + use EMX _scrsize() function if terminfo and environment do not + declare the screen size (reported by Ilya Zakharevich + ). + + remove spurious '\' characters from eterm and osborne terminfo + entries (prompted by an old Debian bug report). + + correct reversed malloc/realloc calls in _nc_doalloc (reported by + Hans-Joachim Widmaier ). + + correct misplaced parenthesis which caused file-descriptor from + opening termcap to be lost, from 980725 changes (reported by Andreas + Jaeger). + +980815 + + modify lib_setup.c to eliminate unneeded include of + when termios is not used (patch by Todd C Miller). + + add function _nc_doalloc, to ensure that failed realloc calls do not + leak memory (reported by Todd C Miller). + + improved ncsa-telnet terminfo entry. + +980809 + + correct missing braces around a trace statement in read_entry.c, + from 980808 (reported by Kim DeVaughn and Liviu + Daia). + +980808 + + fix missing include in ditto.c (reported by Bernhard + Rosenkraenzer ) + + add NCSA telnet terminfo entries from Francesco Potorti + , from Debian bug reports. + + make handling of $LINES and $COLUMNS variables more compatible with + Solaris by allowing them to individually override the window size + as obtained via ioctl. + +980801 + + modify lib_vidattr.c to allow for terminal types (e.g., xterm-color) + which may reset all attributes in the 'op' capability, so that colors + are set before turning on bold and other attributes, but still after + turning attributes off. + + add 'ditto.c' to test directory to illustrate use of newterm for + initializing multiple screens. + + modify _nc_write_entry() to recover from failed attempt to link alias + for a terminfo on a filesystem which does not preserve character case + (reported by Peter L Jordan ). + +980725 + + updated versions of config.guess and config.sub based on automake 1.3 + + change name-comparisons in lib_termcap to compare no more than 2 + characters (gleaned from Debian distribution of 1.9.9g-8.8, verified + with Solaris curses). + + fix typo in curs_insstr.3x (patch by Todd C Miller) + + use 'access()' to check if ncurses library should be permitted to + open or modify files with fopen/open/link/unlink/remove calls, in + case the calling application is running in setuid mode (request by + Cristian Gafton , responding to Duncan Simpson + ). + + arm100 terminfo entries from Dave Millen ). + + qnxt2 and minitel terminfo entries from esr's version. + +980718 + + use -R option with ldconfig on FreeBSD because otherwise it resets + the search path to /usr/lib (reported by Dan Nelson). + + add -soname option when building shared libraries on OpenBSD 2.x + (request by QingLong). + + add configure options --with-manpage-format and + --with-manpage-renames (request by QingLong). + + correct conversion of CANCELLED_NUMERIC in write_object(), which was + omitting the high-order byte, producing a 254 in the compiled + terminfo. + + modify return-values of tgetflag, tgetnum, tgetstr, tigetflag, + tigetnum and tigetstr to be compatible with Solaris (gleaned from + Debian distribution of 1.9.9g-8.8). + + modify _nc_syserr_abort to abort only when compiled for debugging, + otherwise simply exit with an error. + +980711 + + modify Ada95 'gen' program to use appropriate library suffix (e.g., + "_g" for a debug build). + + update Ada95 'make clean' rule to include generics .ali files + + add a configure test to ensure that if GNAT is found, that it can + compile/link working Ada95 program. + + flush output in beep and flash functions, fixing a problem with + getstr (patch by Alexander V Lukyanov) + + fix egcs 1.0.2 warning for etip.h (patch by Chris Johns). + + correct ifdef/brace nesting in lib_sprintf.c (patch by Bernhard + Rosenkraenzer ). + + correct typo in wattr_get macro from 980509 fixes (patch by Dan + Nelson). + +980704 + + merge changes from current XFree86 xterm terminfo descriptions. + + add configure option '--without-ada'. + + add a smart-default for termcap 'ac' to terminfo 'acs_chars' which + corresponds to vt100. + + change translation for termcap 'rs' to terminfo 'rs2', which is + the documented equivalent, rather than 'rs1'. + +980627 + + slow 'worm' down a little, for very fast machines. + + corrected firstchar/lastchar computation in lib_hline.c + + simplify some expressions with CHANGED_CELL, CHANGED_RANGE and + CHANGED_TO_EOL macros. + + modify init_pair so that if a color-pair is reinitialized, we will + repaint the areas of the screen whose color changes, like SVr4 curses + (reported by Christian Maurer ). + + modify getsyx/setsyx macros to comply with SVr4 man-page which + says that leaveok() affects their behavior (report by Darryl Miles, + patch by Alexander V Lukyanov). + +980620 + + review terminfo.5 against Solaris 2.6 curses version, corrected + several minor errors/omissions. + + implement tparm %l format. + + implement tparm printf-style width and precision for %s, %d, %x, %o + as per XSI. + + implement tparm dynamic variables (reported by Xiaodan Tang). + +980613 + + update man-page for for wattr_set, wattr_get (cf: 980509) + + correct limits in hashtest, which would cause nonprinting characters + to be written to large screens. + + correct configure script, when --without-cxx was specified: the + wrong variable was used for cf_cv_type_of_bool. Compilers up to gcc + 2.8 tolerated the missing 'int'. + + remove the hardcoded name "gcc" for the GNU Ada compiler. The + compiler's name might be something like "egcs" (patch by Juergen + Pfeifer). + + correct curs_addch.3x, which implied that echochar could directly + display control characters (patch by Alexander V Lukyanov). + + fix typos in ncurses-intro.html (patch by Sidik Isani + ) + +980606 + + add configure test for conflicting use of exception in math.h and + other headers. + + minor optimization to 'hash()' function in hashmap.c, reduces its + time by 10%. + + correct form of LD_SHARED_OPTS for HP-UX 10.x (patch by Tim Mooney). + + fix missing quotes for 'print' in MKunctrl.awk script (reported by + Mihai Budiu ). + > patch by Alexander V Lukyanov: + + correct problem on Solaris (with poll() function) where getch could + hang indefinitely even if timeout(x) was called. This turned out to + be because milliseconds was not updated before 'goto retry' in + _nc_timed_wait. + + simplified the function _nc_timed_wait and fixed another bug, which + was the assumption of !GOOD_SELECT && HAVE_GETTIMEOFDAY in *timeleft + assignment. + + removed the cycle on EINTR, as it seems to be useless. + +980530 + + add makefile-rule for test/keynames + + modify run_tic.sh and shlib to ensure that user's .profile does not + override the $PATH used to run tic (patch by Tim Mooney). + + restore LD_SHARED_OPTS to $(LD_SHARED_FLAGS) when linking programs, + needed for HP-UX shared-library path (recommended by Tim Mooney). + + remove special case of HP-UX -L options, use +b options to embed + $(libdir) in the shared libraries (recommended by Tim Mooney). + + add checks for some possible buffer overflows and unchecked + malloc/realloc/calloc/strdup return values (patch by Todd C Miller + ) + +980523 + + correct maxx/maxy expression for num_columns/num_lines in derwin + (patch by Alexander V Lukyanov). + + add /usr/share/lib/terminfo and /usr/lib/terminfo as compatibilty + fallbacks to _nc_read_entry(), along with --with-terminfo-dirs + configure option (suggested by Mike Hopkirk). + + modify config.guess to recognize Unixware 2.1 and 7 (patch by Mike + Hopkirk ). + + suppress definition of CC_SHARED_OPTS in LDFLAGS_SHARED in c++ + Makefile.in, since this conflicts when g++ is used with HP-UX + compiler (reported by Tim Mooney). + + parenthesize 'strcpy' calls in c++ binding to workaround redefinition + in some C++ implementations (reported by several people running + egcs with glibc 2.0.93, analysis by Andreas Jaeger. + +980516 + + modify write_entry.c so that it will not attempt to link aliases + with embedded '/', but give only a warning. + + put -L$(libdir) first when linking programs, except for HP-UX. + + modify comp_scan.c to handle SVr4 terminfo description for att477, + which contains a colon in the description field. + + modify configure script to support SCO osr5.0.5 shared libraries + (from comp.unix.sco.programmer newsgroup item by Mike Hopkirk + ). + + eliminate extra GoTo call in lib_doupdate.c (patch by Alexander V. + Lukyanov). + + minor adjustments of const/NCURSES_CONST from IRIX compile. + + add updates based on esr's 980509 version of terminfo.src. + +980509 + + correct macros for wattr_set, wattr_get, separate wattrset macro from + these to preserve behavior that allows attributes to be combined with + color pair numbers. + + add configure option --enable-no-padding, to allow environment + variable $NCURSES_NO_PADDING to eliminate non-mandatory padding, + thereby making terminal emulators (e.g., for vt100) a little more + efficient (request by Daniel Eisenbud ). + + modify configure script to embed ABI in shared libraries for HP-UX + 10.x (detailed request by Tim Mooney). + + add test/example of the 'filter()' function. + + add nxterm and xterm-color terminfo description (request by Cristian + Gafton ). + + modify rxvt terminfo description to clear alternate screen before + switching back to normal screen, for compatibility with applications + which use xterm (reported by Manoj Kasichainula ). + + modify linux terminfo description to reset color palette (reported + by Telford Tendys ). + + correction to doupdate, for case where terminal does not support + insert/delete character. The logic did not check that there was a + difference in alignment of changes to old/new screens before + repainting the whole non-blank portion of the line. Modified to fall + through into logic that reduces by the portion which does not differ + (reported by Daniel Eisenbud ). + + minor performance improvement to wnoutrefresh by moving some + comparisons out of inner loop. + +980425 + + modify configure script to substitute NCURSES_CONST in curses.h + + updated terminfo entries for xterm-xf86-v40, xterm-16color, + xterm-8bit to correspond to XFree86 3.9Ag. + + remove restriction that forces ncurses to use setaf/setab if the + number of colors is greater than 8. (see 970524 for xterm-16color). + + change order of -L options (so that $(libdir) is searched first) when + linking tic and other programs, to workaround HP's linker. + Otherwise, the -L../lib is embedded when linking against shared + libraries and the installed program does not run (reported by Ralf + Hildebrandt). + + modify configuration of shared libraries on Digital Unix so that + versioning is embedded in the library, rather than implied by + links (patch by Tim Mooney). + +980418 + + modify etip.h to avoid conflict with math.h on HP-UX 9.03 with gcc + 2.8.1 which redefines 'exception' (reported by Ralf Hildebrandt + ). + + correct configure tests in CF_SHARED_OPTS which used $CC value to + check for gcc, rather than autoconf's $GCC value. This did not + work properly if the full pathname of the compiler were given + (reported by Michael Yount ). + + revise check for compiler options to force ANSI mode since repeating + an option such as -Aa causes HP's compiler to fail on its own headers + (reported by Clint Olsen ). + +980411 + + ifdef'd has_key() and mcprint() as extended functions. + + modified several prototypes to correspond with 1997 version of + X/Open Curses (affects ABI since developers have used attr_get). + + remove spurious trailing blanks in glibc addon-scripts (patch by + H.J.Lu). + + insert a few braces at locations where gcc-2.8.x asks to use them to + avoid ambigous else's, use -fpic rather than -fPIC for Linux (patch + by Juergen Pfeifer). + +980404 + + split SHLIB_LIST into SHLIB_DIRS/SHLIB_LIST to keep -L options + before -l to accommodate Solaris' linker (reported by Larry Virden). + +980328 + + modify lib_color.c to eliminate dependency on orig_colors and + orig_pair, since SVr4 curses does not require these either, but + uses them when they are available. + + add detailed usage-message to infocmp. + + correct a typo in att6386 entry (a "%?" which was "?"). + + add -f option to infocmp and tic, which formats the terminfo + if/then/else/endif so that they are readable (with newlines and + tabs). + + fixes for glibc addon scripts (patch by H.J.Lu). + +980321 + + revise configure macro CF_SPEED_TYPE so that termcap.h has speed_t + declared (from Adam J. Richter ) + + remove spurious curs_set() call from leaveok() (J.T.Conklin). + + corrected handling leaveok() in doupdate() (patch by Alexander V. + Lukyanov). + + improved version of wredrawln (patch by Alexander V. Lukyanov). + + correct c++/Makefile.in so install target do not have embedded ../lib + to confuse it (patch by Thomas Graf ). + + add warning to preinstall rule which checks if the installer would + overwrite a curses.h or termcap.h that is not derived from ncurses. + (The recommended configuration for developers who need both is to + use --disable-overwrite). + + modify preinstall rule in top-level Makefile to avoid implicit + use of 'sh', to accommodate Ultrix 4.4 (reported by Joao Palhoto + Matos , patch by Thomas Esser + ) + + refine ifdef's for TRACE so that libncurses has fewer dependencies + on libtinfo when TRACE is disabled. + + modify configure script so that if the --with-termlib option is used + to generate a separate terminfo library, we chain it to the ncurses + library with a "-l" option (reported by Darryl Miles and Ian T. + Zimmerman). + +980314 + + correct limits and window in wredrawln function (reported/analysis by + Alexander V. Lukyanov). + + correct sed expression in configure script for --with-fallback + option (patch by Jesse Thilo). + + correct some places in configure script where $enableval was used + rather than $withval (patch by Darryl Miles ). + + modify some man-pages so no '.' or '..' falls between TH and SH + macros, to accommodate man_db program (reported by Ian T. Zimmerman + ). + + terminfo.src 10.2.1 from Eric's webpage. + > several changes by Juergen Pfeifer: + + add copyright notices (and rcs id's) on remaining man-pages. + + corrected prototypes for slk_* functions, using chtype rather than + attr_t. + + implemented the wcolor_set() and slk_color() functions + + the slk_attr_{set,off,on} functions need an additional void* + parameter according to XSI. + + fix the C++ and Ada95 binding as well as the man pages to + reflect above enhancements. + +980307 + + use 'stat()' rather than 'access()' in toe.c to check for the + existence of $HOME/.terminfo, since it may be a file. + + suppress configure CF_CXX_LIBRARY check if we are not using g++ + 2.7.x, since this is not needed with g++ 2.8 or egcs (patch by + Juergen Pfeifer). + + turn on hashmap scrolling code by default, intend to remedy defects + by 4.3 release. + + minor corrections to terminfo.src changelog. + +980302 4.2 release for upload to prep.ai.mit.edu + + correct Florian's email address in ncurses-intro.html + + terminfo.src 10.2.0 from Eric. + +980228 pre-release + + add linux-koi8r replace linux-koi8, which is not KOI8 (patch by + QingLong ). + + minor documentation fixes (patch by Juergen Pfeifer). + + add setlocale() call to ncurses.c (reported by Claes G. Lindblad + ). + + correct sign-extension in lib_insstr.c (reported by Sotiris + Vassilopoulos ) + +980221 pre-release + + regenerated some documentation overlooked in 980214 patch + (ncurses-intro.doc, curs_outopts.3x.html) + + minor ifdef change to C++ binding to work with gcc 2.8.0 (patch by + Juergen Pfeifer). + + change maintainer's mailing address to florian@gnu.org, change + tentative mailing list address to bug-ncurses-request@gnu.org (patch + by Florian La Roche). + + add definition of $(REL_VERSION) to c++/Makefile.in (reported by Gran + Hasse ). + + restore version numbers to Ada95 binding, accidentally deleted by + copyright patch (patch by Juergen Pfeifer). + +980214 pre-release + + remove ncurses.lsm from MANIFEST so that it won't be used in FSF + distributions, though it is retained in development. + + correct scaling of milliseconds to nanoseconds in lib_napms.c (patch + by Jeremy Buhler). + + update mailing-list information (bug-ncurses@gnu.org). + + update announcement for upcoming 4.2 release. + + modify -lm test to check for 'sin()' rather than 'floor()' + + remove spurious commas from terminfo.src descriptions. + + change copyright notices to Free Software Foundation + +980207 + + minor fixes for autoconf macros CF_ERRNO, CF_HELP_MESSAGE and + CF_SIZECHANGE + + modify Makefile.glibc so that $(objpfx) is defined (H.J.Lu). + + ifdef-out true-return from _nc_mouse_inline() which depends on + merge of QNX patch (pending 4.2 release). + > patch by J.T.Conklin, to split off seldom-used modules in ncurses + (reduces size by up to 2.6kb): + + move functionality of _nc_usleep into napms, add configuration case + for nanosleep(). + + moved wchgat() from lib_addch.c to lib_chgat.c + + moved clearok(), immedok(), leaveok(), and scrollok() from + lib_options.c to lib_clearok.c, lib_immedok.c, lib_leaveok.c and + lib_scrollok.c. + + moved napms() from lib_kernel.c to lib_napms.c + + moved echo() and noecho() from lib_raw.c to lib_echo.c + + moved nl() and nonl() from lib_raw.c to lib_nl.c + +980131 + + corrected conversion in tclock.c (cf: 971018). + + updates to Makefile.glibc and associated Linux configure script + (patch by H.J.Lu). + + workaround a quoting problem on SunOS with tar-copy.sh + + correct init_pair() calls in worm.c to work when use_default_colors() + is not available. + + include in CF_SYS_TIME_SELECT to work with FreeBSD + 2.1.5 + + add ncv capability to FreeBSD console (cons25w), making reverse + work with color. + + correct sense of configure-test for sys/time.h inclusion with + sys/select.h + + fixes for Ada95/ada_include/Makefile.in to work with --srcdir option. + + remove unused/obsolete test-program rules from progs/Makefile.in + (the rules in ncurses/Makefile.in work). + + remove shared-library loader flags from test/Makefile.in, etc. + + simplify test/configure.in using new version of autoconf to create + test/ncurses_cfg.h + + suppress suffix rules in test/Makefile.in, provide explicit + dependency to work with --srcdir option and less capable 'make' + programs. + > adapted from patch for QNX by Xiaodan Tang: + + initialize %P and %g variables set/used in tparm, and also ensure + that empty strings don't return a null result from tparam_internal + + add QNX-specific prototype for vsscanf() + + move initialization of SP->_keytry from init_keytry() to newterm() to + avoid resetting it via a keyok() call by mouse_activate(). + + reorganized some functions in lib_mouse() to use case-statements. + + remove sgr string from qnx terminfo entry since it is reported to + turn off attributes inconsistently. + +980124 + + add f/F/b/B commands to ncurses 'b' test to toggle colors, providing + test for no_color_video. + + adjusted emx.src to use no_color_video, now works with ncurses 'b' + and 'k' tests. + + implement no_color_video attribute, and as a special case, reverse + colors when the reverse attribute cannot be combined with color. + + check for empty string in $TERM variable (reported by Brett Michaels + ). + > from reports by Fred Fish: + + add configure-test for isascii + + add configure-test for -lm library. + + modify CF_BOOL_SIZE to check if C++ bool types are unsigned. + > patches by J.J.G.Ripoll + + add configure/makefile variables to support .exe extension on + OS/2 EMX (requires additional autoconf patches). + + explicitly initialize variables in lib_data.c to appease OS/2 linker + > patches by Fred Fish + + misc/Makefile.in (install.data): Avoid trying to install the CVS + directory. + + aclocal.m4 (install.includes): Remove files in the include directory + where we are going to install new ones, not the original source + files. + + misc/terminfo.src: Add entry for "beterm", derived from termcap + distributed with BeOS PR2 using captoinfo. + + aclocal.m4: Wrap $cf_cv_type_of_bool with quotes (contains space) + + aclocal.m4: Assume bool types are unsigned. + + progs/infocmp.c: workaround mwcc 32k function data limit + +980117 + + correct initialization of color-pair (from 970524) in xmas.c, which + was using only one color-pair for all colors (reported by + J.J.G.Ripoll). + + add multithread options for objects build on EMX, for compatibility + with XFree86. + + split up an expression in MKlib_gen.sh to work around a problem on + OS/2 EMX, with 'ash' (patch by J.J.G.Ripoll). + + change terminfo entries xterm (xterm-xf86-v40), xterm-8bit rs1 to use + hard reset. + + rename terminfo entry xterm-xf86-v39t to xterm-xf86-v40 + + remove bold/underline from sun console entries since they're not + implemented. + + correct _tracef calls in _tracedump(), which did not separate format + from parameters. + + correct getopt string for tic "-o" option, and add it to man-page + synopsis (reported by Darren Hiebert ). + + correct typo in panel/Makefile.in, reversed if-statement in scrolling + optimization (Alexander V. Lukyanov). + + test for 'remove()', use 'unlink() if not found (patch by Philippe De + Muyter ). + > patches by Juergen Pfeifer: + + Improve a feature of the forms driver. For invisible fields + (O_VISIBLE off) only the contents but not the attributes are cleared. + We now clear both. (Reported by Javier Kohan + ) + + The man page form_field_opts.3x makes now clear, that invisible + fields are also always inactive. + + adjust ifdef's to compile the C++ binding with the just released + gcc-2.8.0 c++ and the corresponding new C++ libraries. + +980110 + + correct "?" command in ncurses.c; it was performing non-screen writes + while the program was in screen mode. (It "worked" in 1.9.9e because + that version sets OPOST and OCRNL incorrectly). + + return error from functions in lib_kernel, lib_raw and lib_ti if + cur_term is null, or if underlying I/O fails. + + amend change to tputs() so that it does not return an error if + cur_term is null, since some applications depend on being able to use + tputs without initializing the terminal (reported by Christian J. + Robinson ). + +980103 + + add a copy of emx.src from J.J.G.Ripoll's OS/2 EMX version of ncurses + 1.9.9e, together with fixes/additions for the "ansi" terminal type. + + add tic check for save/restore cursor if change_scroll_region is + defined (from O'Reilly book). + + modify read_termcap.c to handle EMX-style pathnames (reported by + J.J.G.Ripoll). + + modify lib_raw.c to use EMX's setmode (from J.J.G.Ripoll, who says + EMX's curses does this). + + modify _nc_tic_expand() to generate \0 rather than \200. + + move/revise 'expand()' from dump_entry.c to ncurses library as + _nc_tic_expand(), for use by tack. + + decode \a as \007 for terminfo, as per XSI. + + correct translation of terminfo "^@", to \200, like \0. + + modify next_char() to treat the same as , for + cross-platform compatibility. + + use new version of autoconf (971230) to work around limited + environment on CLIX, due to the way autoconf builds --help message. + > patch by Juergen Pfeifer: + + check that the Ada95 binding runs against the correct version of + ncurses. + + insert constants about the library version into the main spec-file of + the Ada95 binding. + +971227 + + modify open/fopen calls to use binary mode, needed for EMX. + + modify configure script to work with autoconf 2.10 mods for OS/2 + EMX from J.J.G.Ripoll. + + generated ncurses_cfg.h with patch (971222) to autoconf 2.12 which + bypasses limited sed buffer length. + > several changes from Juan Jose Garcia Ripoll + (J.J.G.Ripoll) to support OS/2 EMX: + + add a _scrolling flag to SP, to set when we encounter a terminal + that simply cannot scroll. + + corrected logic in _nc_add_to_try(), by ensuring that strings with + embedded \200 characters are matched. + + don't assume the host has 'link()' function, for linking terminfo + entries. + +971220 + + if there's no ioctl's to support sigwinch handler, disable it. + + add configure option --disable-ext-funcs to remove the extended + functions from the build. + + add configure option --with-termlib to generate the terminfo + functions as a separate library. + + add 'sources' rule to facilitate cross-compiling. + + review/fix order of mostlyclean/clean/distclean rules. + + modify install-rule for headers to first remove old header, in + case there was a symbolic link that confuses the install script. + + corrected substitution for NCURSES_CONST in term.h (cf: 971108) + + add null pointer checks in wnoutrefresh(), overlap() (patch by + Xiaodan Tang ) + + correct tputs(), which could dereference a null cur_term if invoked + before terminal is initialized (patch by Christopher Seawood + ) + > patch by Juergen Pfeifer: + + makes better use of "pragma Inline" in the Ada95 binding + + resynchronizes the generated html manpages + +971213 + + additional fixes for man-pages section-references + + add (for debugging) a check for ich/ich1 conflict with smir/rmir + to tic, etc. + + remove hpa/vpa from rxvt terminal description because they are not + implemented correctly, added sgr0. + + change ncurses 's' to use raw mode, so ^Q works (reported by Rudolf + Leitgeb ) + +971206 + + modify protection when installing libraries to (normally) not + executable. HP-UX shared libraries are an exception. + + add configure check for 'tack'. + + implement script for renaming section-references in man-page install, + for Debian configuration. + + add validity-check for SP in trace code in baudrate() (reported by + Daniel Weaver). + > patch by Alexander V. Lukyanov (fixes to match sol25 curses) + + modify 'overlay()' so that copy applies target window background to + characters. + + correct 'mvwin()' so that it does not clear the previous locations. + + correct lib_acs.c so that 8-bit character is not sign expanded in + case of wide characters in chtype. + + correct control-char test in lib_addch.c for use with wide chars + + use attribute in the chtype when adding a control character in + lib_addch.c control char was added with current attribute + +971129 + + save/restore errno in _tracef() function + + change treatment of initialize_color to use a range of 0..1000 + (recommended by Daniel Weaver). + + set umask in mkinstalldirs, fixing problems reported by users who + have set root's umask to 077. + + correct bug in tic that caused capabilities to be reprinted at the + end of output when they had embedded comments. + + rewrote wredrawln to correspond to XSI, and split-out since it is + not often used (from report by Alexander V. Lukyanov, 970825) + + rewrote Dan Nelson's change to make it portable, as well as to + correct logic for handling backslashes. + + add code to _nc_tgetent() to make it work more like a real tgetent(). + It removes all empty fields, and removes all but the first in a group + of duplicate caps. The code was pulled from the BSD libtermcap code + in termcap.c (patch by Dan Nelson + + don't include --enable-widec in the --with-develop configure option, + since it is not binary-compatible with 4.1 (noted by Alexander V. + Lukyanov) + > patch by Juergen Pfeifer: + + further improvements of the usage of elaboration pragmas in the Ada95 + binding + + enhanced Ada95 sample to use the user_data mechanism for panels. + + a fix for the configuration script to make gnat-3.10 the required + version. + + resync of the html version of the manpages + +971122 + > fixes/updates for terminfo.src: + + add vt220-js, pilot, rbcomm, datapoint entries from esr's 27-jun-97 + version. + + add hds200 description (Walter Skorski) + + add EMX 0.9b descriptions + + correct rmso/smso capabilities in wy30-mc and wy50-mc (Daniel Weaver) + + rename xhpterm back to hpterm. + > patch by Juergen Pfeifer: + + Improves the usage of elaboration pragmas for the Ada95 binding. + + Adds a translation of the test/rain.c into Ada95 to the samples. + This has been contributed to the project by Laurent Pautet + (pautet@gnat.com) + +971115 + + increase MAX_NAME_SIZE to 512 to handle extremely long alias list + in HP-UX terminfo. + + correction & simplification of delay computation in tputs, based on + comments from Daniel Weaver. + + replace test for SCO with more precise header tests. + + add configure test for unsigned literals, use in NCURSES_BITS macro. + + comment-out the -PIC, etc., flags from c++, progs and test makefiles + since they probably are not needed, and are less efficient (noted by. + Ju"rgen Fluk) + + add -L$(libdir) to loader options, after -L../lib so that loaders + that record this information will tend to do the right thing if + the programs are moved around after installing them (suggested by. + Ju"rgen Fluk). + + add -R option to loader options for programs for Solaris if the + --enable-rpath option is specified for the libraries. + +971112 + + correct installed filename for shared libraries on *BSD (reported by + Ju"rgen Fluk). + +971108 + + cleanup logic for deciding when tputs() should call delay_output(), + based on comments from Daniel Weaver. + + modified tputs() to avoid use of float. + + correct use of trailpad in tputs(), which used the wrong variable + in call to delay_output(). + + correct inverted expression for null-count in delay_output() + (analysis by Daniel Weaver). + + apply --enable-rpath option to Solaris (requested by Larry Virden). + + correct substitution of EXTRA_CFLAGS for gcc 2.6.3 + + correct check for error-return by _nc_tgetent(), which returns 0 + for success. + + add configure test for BSD 4.4 cgetent() function, modify + read_termcap.c to use the host's version of that if found, using the + terminal database on FreeBSD (reported by Peter Wemm). + + add u8, u9 strings to sun-il description for Daniel Weaver. + + use NCURSES_CONST in panel's user-pointer. + + modify edit_cfg.sh and MKterm.h.awk.in to substitute NCURSES_CONST + so that will work on NeXT. + + use _nc_set_screen() rather than assignments to SP to fix port to + NeXT (reported by Francisco A. Tomei Torres). + +971101 + + force mandatory padding in bell and flash_screen, as specified in + XSI. + + don't allow padding_baud_rate to override mandatory delays (reported + by Daniel Weaver). + + modify delay_output() to use _nc_timed_wait() if no baudrate has been + defined, or if the cur_term pointer is not initialized. XSI treats + this as unspecified. (requested by Daniel Weaver). + + change getcap-cache ifdef's to eliminate unnecessary chdir/mkdir + when that feature is not configured. + + remove _nc_err_abort() calls when write_entry.c finds a directory but + cannot write to it, e.g., when translating part/all of /etc/termcap + (reported by Andreas Jaeger ). + (this dates back to 951102, in 1.9.7a). + + minor ifdef fixes to compile with atac and glibc 2.0.5c + + add check for -lgen when configuring regexpr.h + + modify Solaris shared-library option "-d y" to "-dy" to workaround + incompatibility of gcc 2.7.2 vs vendor's tools. + +971026 + + correct ifdef's for struct winsize vs struct ttysize in lib_setup.c + to compile on SCO. + + remove dangling backslash in panel/Makefile.in + + modify MKkeyname.awk to work with SCO's nawk, which dumps core in the + length() function. + + correct length of allocation in _nc_add_to_try(), to allow for + trailing null. + + correct logic in _nc_remove_key(), which was discarding too many + nodes (patch by Alexander V. Lukyanov) + +971025 + + add definition for $(REL_VERSION) to test/Makefile.in, so *BSD + shared libraries link properly (see 970524). + + modify Linux shared-library generation to include library + dependencies (e.g., -lncurses and -lgpm) in the forms, menu and + panel libraries (suggested by Juergen Pfeifer). + + modify configure script to use config.guess and config.sub rather + than uname, which is unreliable on some systems. + + updated Makefile.glibc, test-built with glibc 2.0.5c + + modify keyname() to return values consistent with SVr4 curses (patch + by Ju"rgen Fluk). + > changes requested by Daniel Weaver: + + modify delay_output() so that it uses the same output function as + tputs() if called from that function. + + move _baudrate from SCREEN to TERMINAL so that low-level use of + tputs works when SP is not set. + > patch by Juergen Pfeifer: + + factor lib_menu and lib_form into smaller modules + + clean up the interface between panel and SCREEN + + minor changes to the Ada95 mouse support implemenation + + minor bugfix in C++ binding to ripoff windows + + fix a few Ada95 html documentation pages + +971018 + + split-out lib_ungetch.c, make runtime link to resizeterm() to + decouple those modules from lib_restart.c + + add xterm-xf86-v39t description to terminfo.src + + reset SP->_endwin in lib_tstp.c cleanup() function after calling + endwin() to avoid unnecessary repainting if the application has + established an atexit function, etc. Encountered this problem in + the c++ demo, whose destructors repaint the screen. + + combine _nc_get_screensize() and resizeterm() calls as new function + _nc_update_screensize(). + + minor fixes to allow compile with g++ (suggested by Nelson H. F. + Beebe). + + implement install-rules for Ada95 makefiles. + + use screen_lines or MAXLINES as needed where LINES was coded, + as well as screen_columns for COLS, in the ncurses library. + > patch by Alexander V. Lukyanov: + + modify logic for ripped-off lines to handle several SCREENs. + > patch by Juergen Pfeifer: + + factors lib_slk.c into some smaller modules + + factors panel.c into some smaller modules + + puts the static information about the current panel stack into the + SCREEN structure to allow different panel stacks on different + screens. + + preliminary fix for an error adjusting LINES to account for + ripped-off lines. + +971011 + + move _nc_max_click_interval and other mouse interface items to SCREEN + struct so that they are associated with a single terminal, and also + save memory when the application does not need a mouse (roughly 3k vs + 0.5k on Linux). + + modify mouseinterval() so that a negative parameter queries the + click-interval without modifying it. + + modify ncurses 'i' test to work with ncurses' apparent extension from + SVr4, i.e., allows nocbreak+noecho (analysis by Alexander V. + Lukyanov). + + add configure options --with-ada-includes and --with-ada-objects, + to drive Ada95 binding install (not yet implemented). + + install C++ binding as -lncurses++ and associated headers with the + other ncurses headers. + + fix header uninstall if configure --srcdir is used. + > minor interface changes (request by Daniel Weaver , + to support 'tack' program): + + export functions _nc_trans_string() and _nc_msec_cost(). + + add variable _nc_nulls_sent, to record the number of padding + characters output in delay_output(). + + move tests for generic_type and hard_copy terminals in setupterm() + to the end of that function so that the library will still be + initialized, though not generally useful for curses programs. + > patches by Alexander V. Lukyanov: + + modify ClrBottom() to avoid using clr_eos if there is only one line + to erase. + + typo in configure --help. + > patch by J.T.Conklin (with minor resync against Juergen's changes) + + split-out lib_flash.c from lib_beep.c + + split-out lib_hline.c and lib_vline.c from lib_box.c + + split-out lib_wattron.c, lib_wattroff.c from lib_addch.c + +971005 + > patch by Juergen Pfeifer: + + correct source/target of c++/edit_cfg.sh + +971004 + + add color, mouse support to kterm terminfo entry. + + modify lib_mouse.c to recognize rxvt, kterm, color_xterm also as + providing "xterm"-style mouse. + + updated rxvt's terminfo description to correspond to 2.21b, with + fixes for the acsc (the box1 capability is incorrect, ech1 does not + work). + + fix logic in parse_entry.c that discarded acsc when 'synthesizing' + an entry from equivalents in XENIX or AIX. This lets ncurses handle + the distribution copy of rxvt's terminfo. + + modify acsc capability for linux and linux-koi8 terminfo descriptions + (from Pavel Roskin ). + + corrected definition in curses.h for ACS_LANTERN, which was 'I' + rather than 'i' (see 970802). + + updated terminfo.src with reformatted acsc entries, and repaired the + trashed entries with spurious '\' characters that this exposed. + + add logic to dump_entry.c to reformat acsc entries into canonical + form (sorted, unique mapping). + + add configure script to generate c++/etip.h + + add configure --with-develop option, to enable by default most of the + experimental options (requested by Alexander V. Lukyanov). + + rename 'deinstall' to 'uninstall', following GNU convention + (suggested by Alexander V. Lukyanov). + > patches by Alexander V. Lukyanov: + + modify tactics 2 and 5 in onscreen_mvcur(), to allow them on the last + line of the screen, since carriage return will not cause a newline. + + remove clause from PutCharLR() that would try to use + eat_newline_glitch since that apparently does not work on some + terminals (e.g., M$ telnet). + + correct a limit check in scroll_csr_backward() + > patches by Juergen Pfeifer: + + adds dummy implementations of methods above() and below() to the + NCursesPanel class. + + fixes missing returncode in NCursesWindow::ripoffline() + + fixes missing returncode in TestApplication::run() in demo.cc + + We should at least give a comment in etip.h why it is currently a + problem to install the C++ binding somewhere + + makes the WINDOW* argument of wenclose() a const. + + modifies several of the routines in lib_adabind.c to use a const + WINDOW* argument. + +970927 + + add 'deinstall' rules. + + use explicit assignments in configure --without-progs option to + work around autoconf bug which doesn't always set $withval. + + check for ldconfig, don't try to run it if not found. + + implement simple/unoptimized case in lib_doupdate.c to handle + display with magic cookie glitch, tested with ncurses.c program. + + correct missing _tracef in getmouse(), to balance the returnCode + macro. + + simplify show_attr() in ncurses.c using termattrs(). + > patches by Juergen Pfeifer: + + provides missing inlines for mvw[hv]line in cursesw.h of the C++ + binding + + fixes a typo in a comment of frm_driver.c + + Enhances Ada95 Makefiles to fulfill the requirement of GNAT-3.10 that + generics should be compiled. Proper fixes to the configuration + scripts are also provided. + +970920 + + several modifications to the configure script (requested by Ward + Horner): + + add configure options --without-progs, to suppress the build of the + utility programs, e.g., for cross-compiling. + + add $(HOSTCCFLAGS) and $(HOSTLDFLAGS) symbols to ncurses + Makefile.in, to simplify setup for cross compiling. + + add logic in configure script to recognize "--target=vxworks", and + generate load/install actions for VxWorks objects. + + move typedef for sigaction_t into SigAction.h to work around problem + generating lint library. + + modify fty_regex.c to reflect renaming of ifdef's for regular + expressions. + + simplify ifdef in lib_setup.c for TIOCGWINSZ since that symbol may + reside in . + + merge testcurs.c with version from PDCurses 2.3, clarifying some of + the more obscure tests, which rely upon color. + + use macros getbegyx() and getmaxyx() in newdemo.c and testcurs.c + + modify ncurses.c to use getbegyx() and getmaxyx() macros to cover up + implementation difference wrt SVr4 curses, allow 's' test to work. + + add missing endwin() to testscanw.c program (reported by Fausto + Saporito ). + + fixes/updates for Makefile.glibc and related files under sysdeps + (patch by H.J.Lu). + > patches by Juergen Pfeifer: + + add checks for null pointers, especially WINDOW's throughout the + ncurses library. + + solve a problem with wrong calculation of panel overlapping (reported + by Ward Horner): + + make sure that a panel's window isn't a pad. + + do more error checking in module lib_touch.c + + missing files for Ada95 binding from the last patch + + synch. of generated html pages (RCS-Id's were wrong in html files) + + support for Key_Resize in Ada binding + + changed documentation style in ./c++/cursesm.h + > patches by Alexander V. Lukyanov: + + undo attempt to do recursive inlining for PutChar(), noting that it + did not improve timing measurably, but inflated the size of + lib_doupdate.o + +970913 + + modify rain.c to use color. + + correct scroll_csr_backward() to match scroll_csr_forward(). + + minor adjustment to llib-lncurses, to work with Solaris 2.5.1 + + minor fixes to sysdeps/unix/sysv/linux/configure to reflect renaming + of configure cache variables in 970906. + + correct logic involving changes to O_VISIBLE option in + Synchronize_Options function in frm_driver.c (Tony Hoffmann + ) + + add $(HOSTCC) symbol to ncurses Makefile.in, to simplify setup for + cross compiling (suggested by Chris Johns). + + modify ifdef in lib_setup.c to only include if we can + use it to support screen-size calculation (reported by Chris Johns). + + #undef unctrl to avoid symbol conflict in port to RTEMS (reported by + Chris Johns ) + > patches by Juergen Pfeifer: + + simplified, made minor corrections to Ada95 binding to form + fieldtype. + + The C++ binding has been enhanced: + + 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 menu's fieldlist. + + Change of return type for current_item() and operator[] for menus. + + Enhanced demo. + + Fixed a bug in form/fld_def.c: take into account that copyarg and + freearg for a fieldtype may be NULL, makearg must not be NULL + + Fixed a bug in form/fld_type.c: in set_fieldtype_arg() makearg must + not be NULL, copyarg and freearg may be NULL. + + Fixed a bug in form/frm_def.c: Allow Disconnect_Fields() if it is + already disconnected. + + Enhance form/frm_driver.c: Allow growth of dynamic fields also on + navigation requests. + + Fixed a bug in form/fty_enum.c: wrong position of postincrement in + case-insensitiva comparision routine. + + Enhanced form/lib_adabind.c with function _nc_get_field() to get a + forms field by index. + + Enhanced menu/m_adabind.c with function _nc_get_item() to get a menus + item by index. + + Fixed in curses.h.in: make chtype argument for pechochar() constant. + Mark wbkgdset() as implemented, remove wbkgdset macro, because it was + broken (didn't handle colors correctly). + + Enhanced lib_mouse.c: added _nc_has_mouse() function + + Added _nc_has_mouse() prototype to curses.priv.h + + Modified lib_bkgd.c: hopefully correct implementation of wbkgdset(); + streamlined implementation of wbkgd() + + Modified lib_mvwin.c: Disable move of a pad. Implement (costly) + move of subwindows. Fixed update behaviour of movements of regular + windows. + + Fixed lib_pad.c: make chtype argument of pechochar() const. + + Fixed lib_window.c: dupwin() is not(!) in every bit a really clone + of the original. Subwindows become regular windows by doing a + dupwin(). + + Improved manpage form_fieldtype.3x + > patches by Alexander V. Lukyanov: + + simplify the PutChar() handling of exit_am_mode, because we already + know that auto_right_margin is true. + + add a check in PutChar() for ability to insert to the case of + shifting character to LR corner. + + in terminal initialization by _nc_screen_resume(), make sure that + terminal right margin mode is known. + + move logic that invokes touchline(), or does the equivalent, into + _nc_scroll_window(). + + modify scrolling logic use of insert/delete line capability, assuming + that they affect the screen contents only within the current + scrolling region. + + modify rain.c to demonstrate SIGWINCH handler. + + remove logic from getch() that would return an ERR if the application + called getch() when the cursor was at the lower-right corner of the + physical screen, and the terminal does not have insert-character + ability. + + change view.c so that it breaks out of getch() loop if a KEY_RESIZE + is read, and modify logic in getch() so this fix will yield the + desired behavior, i.e., the screen is repainted automatically when + the terminal window is resized. + +970906 + + add configure option --enable-sigwinch + + modify view.c to test KEY_RESIZE logic, with "-r" option. + + modify testcurs.c to eliminate misleading display wrt cursor type + by testing if the terminal supports cnorm, civis, cvvis. + + several fixes for m68k/NeXT 4.0, to bring cur_term, _nc_curr_line and + _nc_curr_col variables into linked programs: move these variables, + making new modules lib_cur_term and trace_buf (reported by Francisco + Alberto Tomei Torres ). + > patches by Alexander V. Lukyanov: + + add pseudo-functionkey KEY_RESIZE which is returned by getch() when + the SIGWINCH handler has been called since the last call to + doupdate(). + + modify lib_twait.c to hide EINTR only if HIDE_EINTR is defined. + + add SIGWINCH handler to ncurses library which is used if there is no + application SIGWINCH handler in effect when the screen is + initialized. + + make linked list of all SCREEN structures. + + move curses.h include before definition of SCREEN to use types in + that structure. + + correction to ensure that wgetstr uses only a newline to force a + scroll (970831). + +970831 + + add experimental configure option --enable-safe-sprintf; the normal + mode now allocates a buffer as large as the screen for the + lib_printw.c functions. + + modify wgetch to refresh screen when reading ungetch'd characters, + since the application may require this - SVr4 does this. + + refine treatment of newline in wgetstr to echo only when this would + force the screen to scroll. + +970830 + + remove override in wgetstr() that forces keypad(), since SVr4 does + not do this. + + correct y-reference for erasure in wgetstr() when a wrap forces a + scroll. + + correct x-position in waddch() after a wrap forces a scroll. + + echo newline in wgetstr(), making testscanw.c scroll properly when + scanw is done. + + modify vwscanw() to avoid potential buffer overflow. + + rewrote lib_printw.c to eliminate fixed-buffer limits. + > patches by Alexander V. Lukyanov: + + correct an error in handling cooked mode in wgetch(); processing + was in the wrong order. + + simplified logic in wgetch() that handles backspace, etc., by using + wechochar(). + + correct wechochar() so that it interprets the output character as + in waddch(). + + modify pechochar() to use prefresh() rather than doupdate(), since + the latter does not guarantee immediate refresh of the pad. + + modify pechochar() so that if called with a non-pad WINDOW, will + invoke wechochar() instead. + + modify fifo indices to allow fifo to be longer than 127 bytes. + +970823 + + add xterm-8bit to terminfo.src + + moved logic for SP->_fifohold inside check_pending() to make it + work properly when we add calls to that function. + + ensure that bool functions return only TRUE or FALSE, and TRUE/FALSE + are assigned to bool values (patch by H.J.Lu). + > patches by Alexander V. Lukyanov: + + several fixes to getch: + 1. Separate cooked and raw keys in fifo + 2. Fix the case of ungetch'ed KEY_MOUSE + 3. wrap the code for hiding EINTR with ifdef HIDE_EINTR + 4. correctly handle input errors (i.e., EINTR) without loss of raw + keys + 5. recognize ESC KEY_LEFT and similar + 6. correctly handle the case of receiption of KEY_MOUSE from gpm + + correct off-by-one indexing error in _nc_mouse_parse(), that caused + single mouse events (press/release) to be ignored in favor of + composed events (click). Improves on a fix from integrating gpm + support in 961229. + + add another call to check_pending, before scrolling, for + line-breakout optimization + + improve hashmap.c by + 1. fixed loop condition in grow_hunks() + 2. not marking lines with offset 0 + 3. fixed condition of 'too far' criteria, thus one-line hunks are + ignored and two lines interchanged won't pass. + + rewrote/simplified _nc_scroll_optimize() by separating into two + passes, forward/backward, looking for chunks moving only in the given + direction. + + move logic that emits sgr0 when initializing the screen to + _nc_screen_init(), now invoked from newterm. + + move cursor-movement cleanup from endwin() into _nc_mvcur_wrap() + function and screen cleanup (i.e., color) into _nc_screen_wrap() + function. + + add new functions _nc_screen_init(), _nc_screen_resume() and + _nc_screen_wrap(). + + rename _nc_mvcur_scrolln() to _nc_scrolln(). + + add a copy of acs_map[] to the SCREEN structure, where it can be + stored/retrieved via set_term(). + + move variables _nc_idcok, _nc_idlok, _nc_windows into the SCREEN + structure. + +970816 + + implement experimental _nc_perform_scroll(). + + modify newterm (actually _nc_setupscreen()) to emit an sgr0 when + initializing the screen, as does SVr4 (reported by Alexander V. + Lukyanov). + + added test_progs rule to ncurses/Makefile. + + modify test/configure.in to check if initscr is already in $LIBS + before looking for (n)curses library. + + correct version-number in configure script for OSF1 shared-library + options (patch by Tim Mooney). + + add -DNDEBUG to CPPFLAGS for --enable-assertions (as Juergen + originally patched) since the c++ demo files do not necessarily + include ncurses_cfg.h + + supply default value for --enable-assertions option in configure + script (reported by Kriang Lerdsuwanakij ). + > patches by Alexander V. Lukyanov: + + correct/simplify logic of werase(), wclrtoeol() and wclrbot(). See + example firstlast.c + + optimize waddch_literal() and waddch_nosync() by factoring out + common subexpressions. + + correct sense of NDEBUG ifdef for CHECK_POSITION macro. + + corrections to render_char(), to make handling of colored blanks + match SVr4 curses, as well as to correct a bug that xor'd space + against the background character. + + replaced hash function with a faster one (timed it) + + rewrote the hashmap algorithm to be one-pass, this avoids multiple + cost_effective() calls on the same lines. + + modified cost_effective() so it is now slightly more precise. + > patches by H.J.Lu for glibc integration: + + add modules define_key, keyok, name_match, tries + + add makefile rules for some of the unit tests in ncurses (mvcur, + captoinfo, hardscroll, hashmap). + + update Linux configure-script for wide-character definitions. + +970809 + + modify _tracebits() to show the character size (e.g., CS8). + + modify tparm() to emit '\200' where the generated string would have a + null (reported by From: Ian Dall for + terminal type ncr7900). + + modify install process so that ldconfig is not invoked if the + package is built with an install-prefix. + + correct test program for chtype size (reported by Tim Mooney). + + add configure option --disable-scroll-hints, using this to ifdef the + logic that computes indices for _nc_scroll_optimize(). + + add module ncurses/softscroll.c, to perform single-stage computation + of scroll indices used in _nc_scroll_optimize(). This is faster than + the existing scrolling algorithm, but tends to make too-small hunks. + + eliminate fixed buffer size in _nc_linedump(). + + minor fixes to lib_doupdate.c to add tradeoff between clr_eol (el) + and clr_bol (el1), refine logic in ClrUpdate() and ClrBottom() (patch + by Alexander V. Lukyanov). + + add test/testaddch.c, from a pending patch by Alexander V. Lukyanov. + + correct processing of "configure --enable-assertions" option (patch + by Juergen Pfeifer). + +970802 + + add '-s' (single-step) option too test/hashtest.c, correct an error + in loop limit for '-f' (footer option), toggle scrollok() when + writing footer to avoid wrap at lower-right corner. + + correct behavior of clrtoeol() immediately after wrapping cursor, + which was not clearing the line at the cursor position (reported by + Liviu Daia ). + + corrected mapping for ACS_LANTERN, which was 'I' rather than 'i' + (reported by Klaus Weide ). + + many corrections to make progs/capconvert work, as well as make it + reasonably portable and integrated with ncurses 4.1 (reported by Dave + Furstenau ). + +970726 + + add flag SP->_fifohold, corresponding logic to modify the behavior of + the line breakout logic so that if the application does not read + input, refreshes will not be stopped, but only slowed. + + generate slk_attr_off(), slk_attr_on(), slk_attr_set(), vid_attr(), + ifdef'd for wide-character support, since ncurses' WA_xxx attribute + masks are identical with the A_xxx masks. + + modify MKlib_gen.sh to generate ifdef'd functions to support optional + configuration of wide-characters. + + modify tset to behave more like SVr4's tset, which does not modify + the settings of intr, quit or erase unless they are given as command + options (reported by Nelson H. F. Beebe ). + + modify tset to look in /etc/ttys or /etc/ttytype if the configuration + does not have getttynam(). + + extend baudrate table in tset.c to match baudrate() function. + + add table entries for 230400 and 460800 bd to baudrate() function. + + improve breakout logic by allowing it before the first line updated, + which is what SVr4 curses does (patch by Alexander V. Lukyanov). + + correct initialization of vcost in relative_move(), for cursor-down + case (patch by Alexander V. Lukyanov). + > nits gleaned from Debian distribution of 1.9.9g-3: + + install symbolic link for intotocap. + + reference libc directly when making shared libraries. + + correct renaming of curs_scr_dmp.3x in man_db.renames. + + guard tgetflag() and other termcap functions against null cur_term + pointer. + +970719 + + corrected initial state of software echo (error in 970405, reported + by Alexander V. Lukyanov). + + reviewed/added messages to configure script, so that all non-test + options should be accompanied by a message. + + add configure check for long filenames, using this to determine if + it is safe to allow long aliases for terminal descriptions as does + SVr4. + + add configure options for widec (wide character), hashmap (both + experimental). + > patch by Alexander V. Lukyanov: + + hashmap.c - improved by heuristic, so that scroll test works much + better when csr is not available. + + hardscroll.c - patched so that it continues to scroll other chunks + after failure to scroll one. + + lib_doupdate.c - _nc_mvcur_scrolln extended to handle more cases; csr + is avoided as it is relative costly. Fixed wrong coordinates in one + case and wrong string in TRACE. + > patch by Juergen Pfeifer: + + modify C++ binding to compile on AIX 4.x with the IBM C-SET++ + compiler. + +970712 + + remove alternate character set from kterm terminfo entry; it uses the + shift-out control for a purpose incompatible with curses, i.e., font + switching. + + disentangle 'xterm' terminfo entry from some derived entries that + should be based on xterm-r6 instead. + + add cbt to xterm-xf86-xv32 terminfo entry; I added the emulation for + XFree86 3.1.2F, but overlooked its use in terminfo then - T.Dickey. + + correct logic in lib_mvcur.c that uses back_tab. + +970706 + + correct change from 970628 to ClrUpdate() in lib_doupdate.c so that + contents of curscr are saved in newscr before clearing the screen. + This is needed to make repainting work with the present logic of + TransformLine(). + + use napms() rather than sleep() in tset.c to avoid interrupting I/O. + +970705 + + add limit checks to _nc_read_file_entry() to guard against overflow + of buffer when reading incompatible terminfo format, e.g, from OSF/1. + + correct some loop-variable errors in xmc support in lib_doupdate.c + + modify ncurses 'b' test to add gaps, specified by user, to allow + investigation of interaction with xmc (magic cookie) code. + + correct typo in 970524 mods to xmas.c, had omitted empty parameter + list from has_colors(), which gcc ignores, but SVr4 does not + (reported by Larry Virden). + + correct rmso capability in wy50-mc description. + + add configure option "--enable-hard-tabs", renamed TABS_OK ifdef to + USE_HARD_TABS. + > patch by Juergen Pfeifer: + + Add bindings for keyok() and define_key() to the Ada95 packages. + + Improve man pages menu_post.3x and menu_format.3x + + Fix the HTML pages in the Ada95/html directory to reflect the above + changes. + +970628 + + modify change from 970101 to ClrUpdate() in lib_doupdate.c so that + pending changes to both curscr and newscr are flushed properly. + This fixes a case where the first scrolling operation in nvi would + cause the screen to be cleared unnecessarily and repainted before + doing the indexing, i.e., by repeatedly pressing 'j' (reported by + Juergen Pfeifer). + + correct error in trans_string() which added embedded newlines in a + terminfo description to the stored strings. + + remove spurious newlines from sgr in wyse50 (and several other) + terminfo descriptions. + + add configure option for experimental xmc (magic cookie) code, + "--enable-xmc-glitch". When disabled (the default), attributes that + would store a magic cookie are suppressed in vidputs(). The magic + cookie code is far from workable at this stage; the configuration + option is a stopgap. + + move _nc_initscr() from lib_initscr.c to lib_newterm.c + + correct path for invoking make_keys (a missing "./"). + +970621 + + correct sign-extension problem with "infocmp -e", which corrupted + acsc values computed for linux fallback data. + + correct dependency on ncurses/names.c (a missing "./"). + + modify configure script to use '&&' even for cd'ing to existing + directories to work around broken shell interpreters. + + correct a loop-limit in _nc_hash_map() (patch by Alexander V. + Lukyanov). + +970615 + + restore logic in _nc_scroll_optimize() which marks as touched the + lines in curscr that are shifted. + + add new utility 'make_keys' to compute keys.tries as a table rather + than a series of function calls. + + correct include-dependency for tic.h used by name_match + + removed buffer-allocation for name and description from m_item_new.c, + since this might result in incompatibilities with SVr4. Also fixed + the corresponding Ada95 binding module (patch by Juergen Pfeifer, + from report by Avery Pennarun ) + + removed the mechanism to timestamp the generated Ada95 sources. This + resulted always in generating patches for the HTML doc, even when + nothing really changed (patch by Juergen Pfeifer). + + improve man page mitem_new.3x (patch by Juergen Pfeifer). + +970614 + + remove ech capability from rxvt description because it does not work. + + add missing case logic for infocmp -I option (reported by Lorenzo M. + Catucci ) + + correct old bug in pnoutrefresh() unmasked by fix in 970531; this + caused glitches in the ncurses 'p' test since the area outside the + pad was not compared when setting up indices for _nc_scroll_optimize. + + rewrote tracebits() to workaround misdefinition of TOSTOP on Ultrix + 4.4, as well as to eliminate fixed-size buffer (reported by Chris + Tanner ) + + correct prototype for termattrs() as per XPG4 version 2. + + add placeholder prototypes for color_set(), erasewchar(), + term_attrs(), wcolor_set() as per XPG4 version 2. + + correct attribution for progs/progs.priv.h and lib_twait.c + + improve line-breakout logic by checking based on changed lines rather + than total lines (patch by Alexander V. Lukyanov). + + correct loop limits for table-lookup of enumerated value in form + (patch by Juergen Pfeifer). + + improve threshhold computation for determining when to call ClrToEOL + (patch by Alexander V. Lukyanov). + +970531 + + add configure option --disable-database to force the library to + use only the fallback data. + + add configure option --with-fallbacks, to specify list of fallback + terminal descriptions. + + add a symbolic link for ncurses.h during install; too many programs + still assume there's an ncurses.h + + add new terminfo.src entry for xterm-xf86-v33. + + restore terminfo.src entry for emu to using setf/setb, since it is + not, after all, generating ANSI sequences. Corrected missing comma + that caused setf/setb entries to merge. + + modify mousemask() to use keyok() to enable/disable KEY_MOUSE, so + that applications can disable ncurses' mouse and supply their own + handler. + + add extensions keyok() and define_key(). These are designed to allow + the user's application better control over the use of function keys, + e.g., disabling the ncurses KEY_MOUSE. (The define_key idea was from + a mailing-list thread started by kjahds@kjahds.com Nov'1995). + + restore original behavior in ncurses 'g' test, i.e., explicitly + set the keypad mode rather than use the default, since it confuses + people. + + rewrote the newdemo banner so it's readable (reported by Hugh + Daniel). + + tidy up exit from hashtest (reported by Hugh Daniel). + + restore check for ^Q in ncurses 'g' test broken in 970510 (reported + by Hugh Daniel) + + correct tput program, checking return-value of setupterm (patch by + Florian La Roche). + + correct logic in pnoutrefresh() and pechochar() functions (reported + by Kriang Lerdsuwanakij ). The computation + of 'wide' date to eric's #283 (1.9.9), and the pechochar bug to the + original implementation (1.9.6). + + correct typo in vt102-w terminfo.src entry (patch by Robert Wuest + ) + + move calls of _nc_background() out of various loops, as its return + value will be the same for the whole window being operated on (patch + by J.T.Conklin). + + add macros getcur[xy] getbeg[xy] getpar[xy], which are defined in + SVr4 headers (patch by J.T.Conklin ) + + modify glibc addon-configure scripts (patch by H.J.Lu). + + correct a bug in hashmap.c: the size used for clearing the hashmap + table was incorrect, causing stack corruption for large values of + LINES, e.g., >MAXLINES/2 (patch by Alexander V. Lukyanov). + + eric's terminfo 9.13.23 & 9.13.24 changes: replaced minitel-2 entry, + added MGR, ansi-nt (note: the changes described for 9.13.24 have not + been applied). + > several changes by Juergen Pfeifer: + + correct a missing error-return in form_driver.c when wrapping of a + field is not possible. + + correct logic in form_driver.c for configurations that do not have + memccpy() (reported by Sidik Isani ) + + change several c++ binding functions to inline. + + modify c++ menu binding to inherit from panels, for proper + initialization. + + correct freeing of menu items in c++ binding. + + modify c++ binding to reflect removal of const from user data pointer + in forms/menus libraries. + +970524 + + add description of xterm-16color. + + modify name of shared-library on *BSD to end with $(REL_VERSION) + rather than $(ABI_VERSION) to match actual convention on FreeBSD + (cf: 960713). + + add OpenBSD to shared-library case, same as NetBSD and FreeBSD + (reported by Hugh Daniel ). + + corrected include-dependency in menu/Makefile so that "make install" + works properly w/o first doing "make". + + add fallback definition for isascii, used in infocmp. + + modify xmas to use color, and to exit right away when a key is + pressed. + + modify gdc so that the scrolled digits function as described (there + was no time delay between the stages, and the digits overwrote the + bounding box without tidying up). + + modify lib_color.c to use setaf/setab only for the ANSI color codes + 0 through 7. Using 16 colors requires setf/setb. + + modify ncurses 'c' test to work with 16 colors, as well as the normal + 8 colors. + + remove const qualifier from user data pointer in forms and menus + libraries (patch by Juergen Pfeifer). + + rewrote 'waddchnstr()' to avoid using the _nc_waddch_nosync() + function, thereby not interpreting tabs, etc., as per spec (patch by + Alexander V. Lukyanov). + +970517 + + suppress check for pre-existing ncurses header if the --prefix + option is specified. + + add configure options "--with-system-type" and + "--with-system-release" to assist in checking the generated + makefiles. + + add configure option "--enable-rpath" to allow installers to specify + that programs linked against shared libraries will have their library + path embedded, allowing installs into nonstandard locations. + + add flags to OSF1 shared-library options to specify version and + symbol file (patch by Tim Mooney ) + + add missing definition for ABI_VERSION to c++/Makefile.in (reported + by Satoshi Adachi ). + + modify link flags to accommodate HP-UX linker which embeds absolute + pathnames in executables linked against shared libraries (reported by + Jason Evans , solved by Alan Shutko + ). + + drop unnecessary check for attribute-change in onscreen_mvcur() since + mvcur() is the only caller within the library, and that check in turn + is exercised only from lib_doupdate.c (patch by Alexander V. + Lukyanov). + + add 'blank' parameter to _nc_scroll_window() so _nc_mvcur_scrolln() + can use the background of stdscr as a parameter to that function + (patch by Alexander V. Lukyanov). + + moved _nc_mvcur_scrolln() from lib_mvcur.c to lib_doupdate.c, to use + the latter's internal functions, as well as to eliminate unnecessary + cursor save/restore operations (patch by Alexander V. Lukyanov). + + omit parameter of ClrUpdate(), since it is called only for newscr, + further optimized/reduced by using ClearScreen() and TransformLine() + to get rid of duplicate code (patch by Alexander V. Lukyanov). + + modify scrolling algorithm in _nc_scroll_optimize() to reject hunks + that are smaller than the distance to be moved (patch by Alexander V. + Lukyanov). + + correct a place where the panel library was not ifdef'd in ncurses.c + (Juergen Pfeifer) + + documentation fixes (Juergen Pfeifer) + +970515 4.1 release for upload to prep.ai.mit.edu + + re-tag changes since 970505 as 4.1 release. + +970510 + + modify ncurses 'g' test to allow mouse input + + modify default xterm description to include mouse. + + modify configure script to add -Wwrite-strings if gcc warnings are + enabled while configuring --enable-const (and fixed related + warnings). + + add toggle, status display for keypad mode to ncurses 'g' test to + verify that keypad and scrollok are not inherited from parent window + during a call to newwin. + + correction to MKexpanded.sh to make it work when configure --srcdir + is used (reported by H.J.Lu). + + revise test for bool-type, ensuring that it checks if builtin.h is + available before including it, adding test for sizeof(bool) equal + to sizeof(short), and warning user if the size cannot be determined + (reported by Alexander V. Lukyanov). + + add files to support configuration of ncurses as an add-on library + for GNU libc (patch by H.J.Lu ) + +970506 + + correct buffer overrun in lib_traceatr.c + + modify change to lib_vidattr.c to avoid redundant orig_pair. + + turn on 'echo()' in hanoi.c, since it is initially off. + + rename local 'errno' variable in etip.h to avoid conflict with global + (H.J.Lu). + + modify configure script to cache LD, AR, AR_OPTS (patch by H.J.Lu + ) + +970505 4.1 pre-release + + regenerate the misc directory html dumps without the link list, which + is not useful. + + correct dependency in form directory makefile which caused + unnecessary recompiles. + + correct substitution for ABI_VERSION in test-makefile + + modify install rules for shared-library targets to remove the target + before installing, since some install programs do not properly handle + overwrite of symbolic links. + + change order of top-level targets so that 'include' immediate + precedes the 'ncurses' directory, reducing the time between new + headers and new libraries (requested by Larry Virden). + + modify lib_vidattr.c so that colors are turned off only before + modifying other attributes, turned on after others. This makes the + hanoi.c program display correctly on FreeBSD console. + + modify debug code in panel library to print user-data addresses + rather than the strings which they (may) point to. + + add check to ensure that C++ binding and demo are not built with g++ + versions below 2.7, since the binding uses templates. + + modify c++ binding and demo to build and run with SGI's c++ compiler. + (It also compiles with the Sun SparcWorks compiler, but the demo does + not link, due to a vtbl problem). + + corrections to demo.cc, to fix out-of-scope variables (Juergen + Pfeifer). + +970503 + + correct memory leak in _nc_trace_buf(). + + add configure test for regexpr.h, for Unixware 1.x. + + correct missing "./" prefixing names of generated files in ncurses + directory. + + use single-quotes in configure scripts assignments for MK_SHARED_LIB + to workaround shell bug on FreeBSD 2.1.5 + + remove tabs from intermediate #define's for GCC_PRINTF, GCC_SCANF + that caused incorrect result in ncurses_cfg.h + + correct initialization in lib_trace.c, which omitted version info. + + remove ech, el1 attributes from cons25w description; they appear to + malfunction in FreeBSD 2.1.5 + + correct color attributes in terminfo.src and lib_color.c to match + SVr4 behavior by interchanging codes 1,4, 3,6 in the setf/setb + capabilities. + + use curs_set() rather than checks via tigetstr() for test programs + that hide the cursor: firework, rain, worm. + + ensure that if the terminal lacks change_scroll_region, parm_index + and parm_rindex are used only to scroll the whole screen (patch by + Peter Wemm). + + correct curs_set() logic, which did not return ERR if the requested + attributes did not exist, nor did it assume an unknown initial state + for the cursor (patch by Alexander V. Lukyanov). + + combine IDcTransformLine and NoIDcTransformLine to new TransformLine + function in lib_doupdate.c (patch by Alexander V. Lukyanov). + + correct hashmap.c, which did not update index information (patch by + Alexander V. Lukyanov). + + patch by Juergen Pfeifer for C++ binding and demo (see c++/NEWS) + + correct index in lib_instr.c (Juergen Pfeifer). + + correct typo in 970426 patch from Tom's cleanup of lib_overlay.c + (Juergen Pfeifer). + +970426 + + corrected cost computation in PutRange(), which was using + milliseconds compared to characters by adding two new members to the + SCREEN struct, _hpa_ch_cost and _cup_ch_cost. + + drop ncurses/lib_unctrl.c, add ncurses/MKunctrl.awk to generate a + const array of strings (suggested by Alexander V. Lukyanov, though + with a perl script 970118). + + rewrote ncurses 'b' test to better exercise magic-cookie (xmc), as + well as noting the attributes that are not supported by a terminal. + + trace the computation of cost values in lib_mvcur.c + + modify _nc_visbuf() to use octal rather than hex, corrected sign + extension bug in that function that caused buffer overflow. + + modify trace in lib_acs.c to use _nc_visbuf(). + + suppress trace within _traceattr2(). + + correct logic of _tracechtype2(), which did not account for repeats + or redefinition within an acsc string. + + modify debug-library version baudrate() to use environment variable + $BAUDRATE to override speed computation. This is needed for + regression testing. + + correct problems shown by "weblint -pedantic". + + update mailing-list information (now ncurses@bsdi.com). + +970419 + + Improve form_field_validation.3x manpage to better describe the + precision parameter for TYPE_NUMERIC and TYPE_INTEGER. Provide more + precise information how the range checking can be avoided. (patch by + Juergen Pfeifer, reported by Bryan Henderson) + + change type of min/max value of form types TYPE_INTEGER to long to + match SVr4 documentation. + + set the form window to stdscr in set_form_win() so that form_win() + won't return null (patch by Juergen Pfeifer, reported by Bryan + Henderson ). + +970412 + + corrected ifdef'ing of inline (from 970321) for TRACE vs C++. + + corrected toggle_attr_off() macro (patch by Andries.Brouwer). + + modify treatment of empty token in $MANPATH to /usr/man (reported by + ) + + modify traces that record functions-called so that chtype and attr_t + values are expressed symbolically, to simplify reuse of generated + test-scripts on SVr4 regression testing. + + add new trace functions _traceattr2() and _tracechtype2() + +970405 + + add configure option --enable-const, to support the use of 'const' + where XSI should have, but did not, specify. This defines + NCURSES_CONST, which is an empty token otherwise, for strict + compatibility. + + make processing of configure options more verbose by echoing the + --enable/--with values. + + add configure option --enable-big-core + + set initial state of software echo off as per XSI. + + check for C++ builtin.h header + + correct computation of absolute-path for $INSTALL that dropped "-c" + parameter from the expression. + + rename config.h to ncurses_cfg.h to avoid naming-conflict when + ncurses is integrated into larger systems (from diffs by H.J.Lu for + libc). + + correct inequality in lib_doupdate.c that caused a single-char to not + be updated when the char on the right-margin was not blank, idcok() + was true (patch by Alexander V. Lukyanov 970124, also reported by + Kriang Lerdsuwanakij 970329). + + modify 'clean' rule in include/Makefile so that files created by + configure script are removed in 'distclean' rule instead. + +970328 + + correct array limit in tparam_internal(), add case to interpret "%x" + (patch by Andreas Schwab) + + rewrote number-parsing in ncurses.c 'd' test; it did not reset the + value properly when non-numeric characters were given (reported by + Andreas Schwab ) + +970321 + + move definition of __INTERNAL_CAPS_VISIBLE before include for + progs.priv.h (patch by David MacKenzie). + + add configuration summary, reordered check for default include + directory to better accommodate a case where installer is configuring + a second copy of ncurses (reported by Klaus Weide + ) + + moved the #define for 'inline' as an empty token from the + $(CFLAGS_DEBUG) symbol into config.h, to avoid redefinition warning + (reported by Ward Horner). + + modify test for bool builtin type to use 'unsigned' rather than + 'unknown' when cross-compiling (reported by Ward Horner). + +970315 + + add header dependencies so that "make install.libs" will succeed + even if "make all" is not done first. + + moved some macros from lib_doupdate.c to curses.priv.h to use in + expanded functions with ATAC. + + correct implementation of lib_instr.c; both XSI and SVr4 agree that + the winnstr functions can return more characters than will fit on one + line. + +970308 + + modify script that generates lib_gen.c to support traces of called & + return. + + add new configure option "--disable-macros", for testing calls within + lib_gen.c + + corrected logic that screens level-checking of called/return traces. + +970301 + + use new configure macro NC_SUBST to replace AC_PATH_PROG, better + addressing request by Ward Horner. + + check for cross-compiling before trying to invoke the autoconf + AC_FUNC_SETVBUF_REVERSED macro (reported by Ward Horner) + + correct/simplify loop in _nc_visbuf(), 970201 changes omitted + a pointer-increment. + + eliminate obsolete symbol SHARED_ABI from dist.mk (noted by + Florian La Roche). + +970215 + + add configure option --enable-expanded, together with code that + implements an expanded form of certain complex macros, for testing + with ATAC. + + disable CHECK_POSITION unless --with-assertions is configured + (Alexander Lukyanov pointed out that this is redundant). + + use keyname() to show traced chtype values where applicable rather + than _tracechar(), which truncates the value to 8-bits. + + minor fixes to TRACE_ICALLS, added T_CREATE, TRACE_CCALLS macros. + + modify makefiles in progs and test directories to avoid using C + preprocessor options on link commands (reported by Ward Horner) + + correct ifdef/include-order for nc_alloc.h vs lib_freeall.c (reported + by Ward Horner) + + modify ifdef's to use configure-defined symbols consistently + (reported by Ward Horner) + + add/use new makefile symbols AR, AR_OPTS and LD to assist in non-UNIX + ports (reported by Ward Horner ) + + rename struct try to struct tries, to avoid name conflict with C++ + (reported by Gary Johnson). + + modify worm.c to hide cursor while running. + + add -Wcast-qual to gcc warnings, fix accordingly. + + use PutChar rather than PutAttrChar in ClrToEOL to properly handle + wrapping (Alexander Lukyanov). + + correct spurious echoing of input in hanoi.c from eric's #291 & #292 + patches (reported by Vernon C. Hoxie ). + + extend IRIX configuration to IRIX64 + + supply missing install.libs rule needed after restructuring + test/Makefile.in + +970208 + + modify "make mostlyclean" to leave automatically-generated source + in the ncurses directory, for use in cross-compiles. + + autogenerated object-dependencies for test directory + + add configure option --with-rcs-ids + + modify configuration scripts to generate major/minor/patch versions + (suggested by Alexander Lukyanov). + + supply missing va_end's in lib_scanw.c + + use stream I/O for trace-output, to eliminate fixed-size buffer + + add TRACE_ICALLS definition/support to lib_trace.c + + modify Ada95 binding to work with GNAT 3.09 (Juergen Pfeifer). + +970201 + + add/modify traces for called/return values to simplify extraction + for test scripts. + + changed _nc_visbuf to quote its result, and to dynamically allocate + the returned buffer. + + invoke ldconfig after installing shared library + + modify install so that overwrite applies to shared library -lcurses + in preference to static library (reported by Zeyd 960928). + + correct missing ';' in 961221 mod to overwrite option use of $(LN_S). + + fixes to allow "make install" to work without first doing a "make + all" (suggested by Larry Virden). + +970125 + + correct order of #ifdef for TABS_OK. + + instrumented toe.c to test memory-leaks. + + correct memory-deallocation in toe.c (patch by Jesse Thilo). + + include in configuration test for regex.h (patch by + Andreas Schwab) + + make infocmp recognize -I option, for SVr4 compatibility (reported by + Andreas Schwab ) + +970118 + + add extension 'use_default_colors()', modified test applications that + use default background (firework, gdc, hanoi, knight, worm) to + demonstrate. + + correct some limit checks in lib_doupdate.c exposed while running + worm. + + use typeCalloc macro for readability. + + add/use definition for CONST to accommodate testing with Solaris + (SVr4) curses, which doesn't use 'const' in its prototypes. + + modify ifdef's in test/hashtest.c and test/view.c to compile with + Solaris curses. + + modify _tracedump() to pad pad colors & attrs lines to match change + in 970101 showing first/last changes. + + corrected location of terminating null on dynamically allocated forms + fields (patch by Per Foreby). + +970111 + + added headers to make view.c compile on SCO with the resizeterm() + code (i.e., struct winsize) - though this compiles, I don't have a + suitable test configuration since SIGWINCH doesn't pass my network to + that machine - T.Dickey. + + update test/configure.in to supply some default substitutions. + + modify configure script to add -lncurses after -lgpm to fix problem + linking against static libraries. + + add a missing noraw() to test/ncurses.c (places noted by Jeremy + Buhler) + + add a missing wclear() to test/testcurs.c (patch by Jeremy Buhler + ) + + modify headers to accommodate compilers that don't allow duplicate + "#define" lines for NCURSES_VERSION (reported by Larry W. Virden + ) + + fix formatting glitch in curs_getch.3x (patch by Jesse Thilo). + + modify lib_doupdate to make el, el1 and ed optimization use the + can_clear_with macro, and change EmitRange to allow leaving cursor at + the middle of interval, rather than always at the end (patch by + Alexander Lukyanov originally 960929, resync 970106). + +970104 + + workaround defect in autoconf 2.12 (which terminates configuration + if no C++ compiler is found) by adding an option --without-cxx. + + modify several man-pages to use tbl, where .nf/.fi was used (reported + by Jesse Thilo). + + correct font-codes in some man-pages (patch by Jesse Thilo + ) + + use configure script's knowledge of existence of g++ library for the + c++ Makefile (reported by Paul Jackson). + + correct misleading description of --datadir configuration option + (reported by Paul Jackson ) + +970101 + + several corrections to _nc_mvcur_scrolln(), prompted by a bug report + from Peter Wemm: + > the logic for non_dest_scroll_region was interchanged between the + forward & reverse scrolling cases. + > multiple returns from the function allowed certain conditions to do + part of an operation before discovering that it couldn't be + completed, returning an error without restoring the cursor. + > some returns were ERR, where the function had completed the + operation, because the insert/delete line logic was improperly + tested (this was probably the case Peter saw). + > contrary to comments, some scrolling cases were tested after the + insert/delete line method. + + modify _tracedump() to show first/last changes. + + modify param of ClrUpdate() in lib_doupdate.c to 'newscr', fixes + refresh problem (reported by Peter Wemm) that caused nvi to not show + result of ":r !ls" until a ^L was typed. + +961229 (internal alpha) + + correct some of the writable-strings warnings (reported by Gary + Johnson ). Note that most of the remaining ones + are part of the XSI specification, and can't be "fixed". + + improve include-dependencies in form, menu, panel directories. + + correct logic of delay_output(), which would return early if + there is data on stdin. + + modify interface & logic of _nc_timed_wait() to support 2 file + descriptors, needed for GPM. + + integrate patch by Andrew Kuchling for GPM (mouse) + support, correcting logic in wgetch() and _nc_mouse_parse() which + prevented patch from working properly. + + improve performance of panel algorithm (Juergen Pfeifer 961203). + + strip RCS id's from generated .html files in Ada95 subtree. + + resync with generated .html files (Juergen Pfeifer 961223). + + terminfo.src 10.1.0 from Eric. + +961224 4.0 release + + release as 4.0 to accommodate Linux ld.so.1.8.5 + + correct syntax/spelling, regenerated .doc files from .html using + lynx 2.5 + + refined forms/menus makefiles (Juergen Pfeifer 961223). + +961221 - snapshot + + remove logic in read_entry.c that attempts to refine errno by using + 'access()' for the directory (from patch by Florian La Roche). + + correct configure test/substitution that inhibits generating + include-path to /usr/include if gcc is used (reported by Florian La + Roche). + + modify setupterm() to allocate new TERMINAL for each call, just as + solaris' curses does (Alexander Lukyanov 960829). + + corrected memory leaks in read_entry.c + + add configure options --with-dbmalloc, --with-dmalloc, and + --disable-leaks, tested by instrumenting infocmp, ncurses programs. + + move #include's for stdlib.h and string.h to *.priv.h to accommodate + use of dbmalloc. + + modify use of $(LN_S) to follow recommendation in autoconf 2.12, + i.e., set current directory before linking. + + split-out panel.priv.h, improve dependencies for forms, menus + (Juergen Pfeifer 961204). + + modify _nc_freewin() to reset globals curscr/newscr/stdscr when + freeing the corresponding WINDOW (Purify). + + modify delwin() to return ERR if the window to be deleted has + subwindows, needed as a side-effect of resizeterm() (Purify). Tested + and found that SVr4 curses behaves this way. + + implement logic for _nc_freeall(), bringing stub up to date. + +961215 + + modify wbkgd() so that it doesn't set nulls in the rendered text, + even if its argument doesn't specify a character (fixes test case by + Juergen Pfeifer for bug-report). + + set window-attributes in wbkgd(), to simplify comparison against + Solaris curses, which does this. + +961214 - snapshot + + replace most constants in ncurses 'o' test by expressions, making it + work with wider range of screen sizes. + + add options to ncurses.c to specify 'e' test softkey format, and the + number of header/footer lines to rip-off. + + add ^R (repaint after resize), ^L (refresh) commands to ncurses 'p' + test. + + add shell-out (!) command to ncurses 'p' test to allow test of + resize between endwin/refresh. + + correct line-wrap case in mvcur() by emitting carriage return, + overlooked in 960928, but needed due to SVr4 compatibility changes to + terminal modes in 960907. + + correct logic in wresize that causes new lines to be allocated, + broken for the special case of increasing rows only in 960907's fix + for subwindows. + + modify configure script to generate $(LDFLAGS) with -L and -l options + in preference to explicit library filenames. (NOTE: this may + require further amending, since I vaguely recall a dynamic loader + that did not work properly without the full names, but it should be + handled as an exception to the rule, since some linkers do bulk + inclusion of libraries when given the full name - T.Dickey). + + modify configure script to allow user-supplied $CFLAGS to set the + debug-option in all libraries (requested by lots of people). + + use return consistently from main(), rather than exit (reported by + Florian La Roche). + + add --enable-getcap-cache option to configure, normally disabled + (requested by Florian La Roche). + + make configure test for gettimeofday() and possibly -lbsd more + efficient (requested by Florian La Roche florian@knorke.saar.de) + + minor adjustments to Ada95 binding (patches by Juergen Pfeifer) + + correct attributes after emitting orig_pair in lib_vidattr.c (patch + by lav@yars.free.net). + +961208 + + corrected README wrt Ada95 (Juergen Pfeifer) + +961207 - snapshot + + integrate resizeterm() into doupdate(), so that if screen size + changes between endwin/refresh, ncurses will resize windows to fit + (this needs additional testing with pads and softkeys). + + add, for memory-leak testing, _nc_freeall() entrypoint to free all + data used in ncurses library. + + initialize _nc_idcok, _nc_idlok statically to resolve discrepancy + between initscr() and newwin() initialization (reported by + lav@yars.free.net). + + test built VERSION=4.0, SHARED_ABI=4 with Linux ld.so.1.8.5 + (set beta versions to those values -- NOTE that subsequent pre-4.0 + beta may not be interchangeable). + + modify configure script to work with autoconf 2.12 + +961130 1.9.9g release + + add copyright notices to configuration scripts (written by Thomas + Dickey). + +961127 + > patch by Juergen Pfeifer (mostly for panel): + + cosmetic improvement for a few routines in the ncurses core library + to avoid warning messages. + + the panel overlap detection was broken + + the panel_window() function was not fool-proof. + + Some inlining... + + Cosmetic changes (also to avoid warning messages when compiling with + -DTRACE). + +961126 + > patch by Juergen Pfeifer: + + eliminates warning messages for the compile of libform. + + inserts Per Foreby's new field type TYPE_IPV4 into libform. + + Updates man page and the Ada95 binding to reflect this. + + Improves inlining in libmenu and libform. + +961120 + + improve the use of the "const" qualifier in the + panel library (Juergen Pfeifer) + + change set_panel_userptr() and panel_userptr() to use void* + (Juergen Pfeifer) + +961119 + + change ABI to 3.4 + + package with 961119 version of Ada95 binding (fixes for gnat-3.07). + (Juergen Pfeifer) + + correct initialization of the stdscr pseudo panel in panel library + (Juergen Pfeifer) + + use MODULE_ID (rcs keywords) in forms and menus libraries (Juergen + Pfeifer). + > patch #324 by Eric. + + typo in curs_termcap man page (reported by Hendrik Reichel + <106065.2344@compuserve.com>) + + change default xterm entry to xterm-r6. + + add entry for color_xterm + +961116 - snapshot + + lint found several functions that had only #define implementations + (e.g., attr_off), modified curses.h.in to generate them as per XSI + Curses requirement that every macro be available as a function. + + add check in infocmp.c to guard against string compare of + CANCELLED_STRING values. + + modify firework.c, rain.c to hide cursor while running. + + correct missing va_end in lib_tparm.c + + modify hanoi.c to work on non-color terminals, and to use timing + delays when in autoplay mode. + + correct 'echochar()' to refresh immediately (reported by Adrian + Garside 94ajg2@eng.cam.ac.uk) + > patch #322 by eric: + + reorganize terminfo.src entries for xterm. + +961109 - snapshot + + corrected error in line-breakout logic (lib_doupdate.c) + + modified newdemo to use wgetch(win) rather than getch() to eliminate + a spurious clear-screen. + + corrected ifdef's for 'poll()' configuration. + + added modules to ncurses, form, menu for Ada95 binding (Juergen + Pfeifer). + + modify set_field_buffer() to allow assignment of string longer than + the initial buffer length, and to return the complete string rather + than only the initial size (Juergen Pfeifer and Per Foreby + ). + +961102 - snapshot + + configure for 'poll()' in preference to 'select()', since older + systems are more likely to have a broken 'select()'. + + modified render_char() to avoid OR'ing colors. + + minor fixes to testcurs.c, newdemo.c test programs: ifdef'd out the + resize test, use wbkgd and corrected box() parameters. + + make flushinp() test work in ncurses.c by using napms() instead of + sleep(). + + undo Eric's changes to xterm-x11r6 (it no longer matched the X11R6.1 + distribution, as stated) + + terminfo 9.13.18 (resync by Eric) + + check for getenv("HOME") returning null (Eric). + + change buffer used to decode xterm-mouse commands to unsigned to + handle displays wider than 128 chars (Juergen Pfeifer). + + correct typo curs_outopts.3x (Juergen Pfeifer). + + correct limit-checking in wenclose() (Juergen Pfeifer). + + correction to Peter Wemm's newwin change (Thomas Fehr + ). + + corrections to logic that combines colors and attributes; they must + not be OR'd (Juergen Pfeifer, extending from report/patch by Rick + Marshall). + +961026 - snapshot + + reset flags in 'getwin()' that might cause refresh to attempt to + manipulate the non-existent parent of a window that is read from a + file (lib_screen.c). + + restructure _nc_timed_wait() to log more information, and to try to + recover from badly-behaved 'select()' calls (still testing this). + + move define for GOOD_SELECT into configure script. + + corrected extra '\' character inserted before ',' in comp_scan.c + + corrected expansion of %-format characters in dump_entry.c; some were + rendered as octal constants. + + modify dump_entry.c to make terminfo output more readable and like + SVr4, by using "\s" for spaces (leading/trailing only), "\," for + comma, "\^" and "\:" as well. + + corrected some memory leaks in ncurses.c, and a minor logic error + in the top-level command-parser. + + correction for label format 4 (PC style with info line), a + slk_clear(), slk_restore() sequence didn't redraw the info line + (Juergen Pfeifer). + + modified the slk window (if simulated) to inherit the background and + default character attributes from stdscr (Juergen Pfeifer). + + corrected limit-check in set_top_row (Juergen Pfeifer). + +961019 - snapshot + + correct loop-limit in wnoutrefresh(), bug exposed during pipe-testing + had '.lastchar' entry one beyond '._maxx'. + + modify ncurses test-program to work with data piped to it. + + corrected pathname computation in run_tic.sh, removing extra "../" + (reported by Tim Mooney). + + modified configure script to use previous install's location for + curses.h + + added NetBSD and FreeBSD to platforms that use --prefix=/usr as + a default. + +961013 + + revised xterm terminfo descriptions to reflect the several versions + that are available. + + corrected a pointer reference in dump_entry.c that didn't test if + the pointer was -1. + +961005 - snapshot + + correct _nc_mvcur_scrolln for terminals w/o scrolling region. + + add -x option to hashtest to control whether it allows writes to the + lower-right corner. + + ifdef'd (NCURSES_TEST) the logic for _nc_optimize_enable to make it + simpler to construct tests (for double-check of _nc_hash_map tests). + + correct ifdef's for c++ in curses.h + + change default xterm type to xterm-x11r6. + + correct quoting in configure that made man-pages installed with + $datadir instead of actual terminfo path. + + correct whitespace in include/Caps, which caused kf11, clr_eol and + clr_end to be omitted from terminfo.5 + + fix memory leaks in delscreen() (adapted from Alexander Lukyanov). + + improve appearance of marker in multi-selection menu (Juergen + Pfeifer) + + fix behaviour for forms with all fields inactive (Juergen + Pfeifer) + + document 'field_index()' (Juergen Pfeifer) + > patch #321 by eric: + + add some more XENIX keycap translations to include/Caps. + + modify newwin to set initial state of each line to 'touched' + (from patch by Peter Wemm ) + + in SET_TTY, replace TCSANOW with TCSADRAIN (Alexander Lukyanov). + +960928 - snapshot + + ifdef'd out _nc_hash_map (still slower) + + add graphic characters to vt52 description. + + use PutAttrChar in ClrToEOL to ensure proper background, position. + + simplify/correct logic in 'mvcur()' that does wrapping; it was + updating the position w/o actually moving the cursor, which broke + relative moves. + + ensure that 'doupdate()' sets the .oldindex values back to a sane + state; this was causing a spurious refresh in ncurses 'r'. + + add logic to configure (from vile) to guard against builders who + don't remove config.cache & config.status when doing new builds. + + corrected logic for 'repeat_char' in EmitRange (from #317), which + did not follow the 2-parameter scheme specified in XSI. + + corrected logic of wrefresh, wnoutrefresh broken in #319, making + clearok work properly (from report by Michael Elkins). + + corrected problem with endwin introduced by #314 (removing the + scrolling-region reset) that broke ncurses.c tests. + + corrected order of args in AC_CHECK_LIB (from report by Ami Fischman + ). + + corrected formatting of terminfo.5 tables (Juergen Ehling) + > patch 320 by eric: + + change ABI to 3.3 + + emit a carriage-return in 'endwin()' to workaround a kernel bug in + BSDI. (requested by Mike Karels ) + + reverse the default o configure --enable-termcap (consensus). + > patch 319 by eric: + + modified logic for clearok and related functions (from report by + Michael Elkins) - untested + > patch 318 by eric: + + correction to #317. + > patch 317 by eric: + + re-add _nc_hash_map + + modify EmitRange to maintain position as per original design. + + add hashtest.c, program to time the hashmap optimization. + > patch 316 by eric: + + add logic to deal with magic-cookie (how was this tested?) + (lib_doupdate.c). + + add ncurses.c driver for magic-cookie, some fixes to ncurses.c + > patch 315 by eric: + + merged A. Lukyanov's patch to use ech and rep - untested + (lib_doupdate.c). + + modified handling of interrupted system calls - untested + (lib_getch.c, lib_twait.c). + + new function _nc_mvcur_resume() + + fix return value for 'overlay()', 'overwrite()' + +960914 - snapshot + + implement subwindow-logic in wresize, minor fixes to ncurses 'g' + test. + + corrected bracketing of fallback.c (reported/suggested fix by Juergen + Ehling ). + + update xterm-color to reflect XFree86 3.1.3G release. + + correct broken dtterm description from #314 patch (e.g., spurious + newline. The 'pairs' change might work, but no one's tested it + either ;-) + + clarify the documentation for the builtin form fieldtypes (Juergen + Pfeifer) + > patch 314 by eric: + + Enhancement suggested by A. Lukyanov -- reset scroll region on + startup rather than at wrapup time. + + Fix suggested by A. Lukyanov, make storage of palette tables + and their size counts per-screen for multi-terminal applications. + + Improved error reporting for infotocap translation errors. + + Update terminfo.src to 9.13.14. + +960907 - snapshot + + rewrote wgetstr to make it erase control chars and also fix bogus use + of _nc_outstr which caused the display to not wrap properly (display + problem reported by John M. Flinchbaugh ) + + modify ncurses 'f' test to accommodate terminal responses to C1 codes + (and split up this screen to accommodate non-ANSI terminals). + + test enter_insert_mode and exit_insert_mode in has_ic(). + + removed bogus logic in mvcur that assumes nl/nonl set output modes + (XSI says they are input modes; SVr4 implements this). + + added macros SET_TTY, GET_TTY to term.h + + correct getstr() logic that altered terminal modes w/o restoring. + + disable ICRNL, etc., during initialization to match SVr4, removing + the corresponding logic from raw, cbreak, etc. + + disable ONLCR during initialization, to match SVr4 (this is needed + for cursor optimization when the cursor-down is a newline). + + replaced Eric's imitation of wresize with my original (his didn't + work). + +960831 - snapshot + + memory leaks (Alexander V. Lukyanov). + + modified pnoutrefresh() to be more tolerant of too-large screen + size (reported by Michael Elkins). + + correct handling of terminfo files with no strings (Philippe De + Muyter) + + correct "tic -s" to take into account -I, -C options. + + modify ncurses 'f' test to not print codes 80 through 9F, since they + are considered control codes by ANSI terminals. + +960824 - snapshot + + correct speed variable-type in 'tgetent()' (reported by Peter Wemm) + + make "--enable-getcap" configuration-option work (reported by + Peter Wemm ) + +960820 + + correct err in 960817 that changed return-value of tigetflag() + (reported by Alexander V. Lukyanov). + + modify infocmp to use library default search-path for terminfo + directory (Alexander V. Lukyanov). + +960817 - snapshot + + corrected an err in mvcur that broke resizing-behavior. + + correct fall-thru behavior of _nc_read_entry(), which was not finding + descriptions that existed in directories past the first one searched + (reported by Alexander V. Lukyanov) + + corrected typo in dtterm description. + > patch 313 by eric: + + add dtterm description + + clarify ncurses 'i' test (drop vscanf subtest) + +960810 - snapshot + + correct nl()/nonl() to work as per SVr4 & XSI. + + minor fixes to ncurses.c (use 'noraw()', mvscanw return-code) + + refine configure-test for -g option (Tim Mooney). + + correct interaction between O_BLANK and NEW_LINE request in form + library (Juergen Pfeifer) + +960804 + + revised fix to tparm; previous fix reversed parameter order. + > patch 312 by eric: + correct terminfo.src corrupted by #310 + > patch 311 by eric: + + fix idlok() and idcok() and the default of the idlok switch. + +960803 - snapshot + + corrected tparm to handle capability strings without explicit pop + (reported by William P Setzer) + + add fallback def for GCC_NORETURN, GCC_UNUSED for termcap users + (reported by Tim Mooney). + > patch 310 by eric: + + documentation and prototyping errors for has_color, immedok and idcok + (reported by William P Setzer ) + + updated qnx terminfo entry (by Michael Hunter) + +960730 + + eliminate quoted includes in ncurses subdirectory, ensure config.h + is included first. + + newterm initializes terminal settings the same as initscr (reported + by Tim Mooney). + +960727 - snapshot + + call cbreak() in initscr(), as per XSI & SVr4. + + turn off hardware echo in initscr() as per XSI & SVr4 + > patch 309 by eric: + + terminfo changes (9.3.10), from BRL + + add more checks to terminfo parser. + + add more symbols to infocmp. + +960720 - snapshot + + save previous-attribute in lib_vidattr.c if SP is null (reported by + Ju"rgen Fluk ) + + corrected calls on _nc_render so that background character is set + as per XSI. + + corrected wbkgdset macro (XSI allows background character to be + null), and tests that use it. + + more corrections to terminfo (xterm & rxvt) + + undid change to mcprint prototype (cannot use size_t in curses.h + because not all systems declare it in the headers that we can safely + include therein). + + move the ifdefs for errno into curses.priv.h + > patch 308 by eric: + + terminfo changes (9.3.8) + + modified logic of error-reporting in terminfo parser + +960713 - snapshot + + always check for since ISC needs it to declare + fd_set (Juergen Pfeifer) + + install shared-libraries on NetBSD/FreeBSD with ABI-version (reported + by several people: Juergen Pfeifer, Mike Long) + + add LOCAL_LDFLAGS2 symbol (Juergen Pfeifer) + + corrected prototype for delay_output() -- bump ABI to 3.2 + + terminfo patches #306/307 from Eric. + + moved logic that filters out rmul and rmso from setupterm to newterm + where it is less likely to interfere with termcap applications. + +960707 + + rollback Eric's #305 change to terminfo.src (it breaks existing + applications, e.g., 'less 290'). + + correct path of edit_man.sh, and fix typo that made all man-pages + preformatted. + + restore man/menu_requestname.3x omitted in Zeyd's resync (oops). + + auto-configure the GCC_PRINTFLIKE/GCC_SCANFLIKE macros (reported by + Philippe De Muyter). + +960706 - snapshot + + make lib_vidattr.c more readable using macros. + + filter out rmul, rmso that conflict with sgr0 when reading terminal + descriptions. + + added sanity-checking of various paired string attributes (Eric). + + work around autoconf bug, force $INSTALL to absolute path. + (reported by Zeyd). + + modify man-page install for BSDI to install preformatted .0 files + (reported by David MacKenzie). + + add/use gcc __attribute__ for printf and scanf in curses.h + + added SGR attributes test-case to ncurses + + revised ncurses 't' logic to show trace-disable effect in the menu. + + use getopt in ncurses program to process -s and -t options. + + make ncurses 'p' legend toggle with '?' + + disable scrollok during the ncurses 'p' test; if it is enabled the + stdscr will scroll when putting the box-corners in the lower-right + of the screen. + +960629 - snapshot + + check return code of _nc_mvcur_scrolln() in _nc_scroll_optimize() for + terminals with no scrolling-support (reported by Nikolay Shadrin + ) + + added ^S scrollok-toggle to ncurses 'g' test. + + added ^T trace-toggle to ncurses tests. + + modified ncurses test program to use ^Q or ESC consistently for + terminating tests (rather than ^D), and to use control keys rather + than function keys in 'g' test. + + corrected misplaced wclrtoeol calls in addch to accommodate wrapping + (reported by Philippe De Muyter). + + modify lib_doupdate.c to use effective costs to tradeoff between + delete-character/insert-character vs normal updating (reported by + David MacKenzie). + + compute effective costs for screen update operations (e.g., clr_eos, + delete_character). + + corrected error in knight.c exposed by wrap fixes in 960622; the + msgwin needed scrollok set. + + corrected last change to IDcTransformLine logic to avoid conflict + between PutRange and InsStr + + modified run_tic.sh to not use /usr/tmp (reported by David + MacKenzie), and further revised it and aclocal.m4 to use $TMPDIR if + set. + + corrected off-by-one in RoomFor call in read_entry.c + +960622 - snapshot + + modified logic that wraps cursor in addch to follow the XSI spec, + (implemented in SVr4) which states that the cursor position is + updated when wrapping. Renamed _NEED_WRAP to _WRAPPED to reflect the + actual semantics. + + added -s option to tic, to provide better diagnostics in run_tic.sh + + improved error-recovery for tabset install. + + change ABI to 3.1 (dropped tparam, corrected getbkgd(), added + _yoffset to WINDOW). + + modified initialization of SP->_ofp so that init_acs() is called with + the "right" file pointer (reported by Rick Marshall + + documentation fixes (Juergen Pfeifer). + + corrected, using new SCREEN and WINDOW members, the behavior of + ncurses if one uses ripoffline() to remove a line from the top of the + screen (Juergen Pfeifer). + + modified autoconf scripts to prepare for Ada95 (GNAT) binding to + ncurses (Juergen Pfeifer). + + incorrect buffer-size in _nc_read_entry, reported by Eric Raymond. + +960617 + + corrected two logic errors in read_entry.c, write_entry.c (called by + tic, the write/read of terminfo entries used inconsistent rules for + locating the entries; the $TERMINFO_DIRS code would find only the + first entry in a list). + + refined pathname computation in run_tic.sh and shlib. + + corrected initialization of $IP in misc/run_tic.sh + +960615 - snapshot + + ifdef'd out _nc_hash_map() call because it does not improve speed. + + display version of gcc if configure script identifies it. + + modify configure script to use /usr as Linux's default prefix. + + modify run_tic.sh to use shlib script, fixes some problems installing + with a shared-library configuration. + + adjusted configure script so that it doesn't run tests with the + warnings turned on, which makes config.log hard to read. + + added 'lint' rule to top-level Makefile. + + added configure option '--with-install-prefix' for use by system + builders to install into staging locations (from request by + charles@comm.polymtl.ca) + + corrected autoconfigure for Debian man program; it's not installed + as "man_db". + + set noecho in 'worm'; it was ifdef'd for debug only + + updated test/configure.in for timing-display in ncurses 'p' test + + corrected misspelled 'getbkgd()'. + + corrected wbkgdset to work like observed syvr4 (sets A_CHARTEXT part + to blank if no character given, copies attributes to window's + attributes). + + modified lib_doupdate.c to use lower-level SP's current_attr state + instead of curscr's state, since it is redundant. + + correction to IDcTransformLine logic which controls where InsStr is + invoked (refined by lav@yars.free.net). + > patches 303 by eric + + conditionally include Chris Torek's hash function _nc_hash_map(). + + better fix for nvi refresh-bug (Rick Marshall) + + fix for bug in handling of interrupted keystroke waits, + (Werner Fleck). + +960601 - snapshot + + auto-configure man-page compression-format and renames for Debian. + + corrected several typos in curses.h.in (i.e., the mvXXXX macros). + + re-order curses.priv.h for lint. + + added rules for lintlib, lint + + corrected ifdef for BROKEN_LINKER in MKnames.awk.in + + corrected missing INSTALL_DATA in misc/Makefile.in + + flush output when changing cursor-visibility (Rick Marshall) + + fix a minor bug in the _nc_ripoff() routine and improve error + checking when creating the label window (Juergen Pfeifer). + + enhancement to the control over the new PC-style soft key format. + allow caller now to select whether or not one wants to have + the index-line; see curs_slk.3x for documentation (Juergen Pfeifer). + + typos, don't use inline with -g (Philippe De Muyter) + + fixes for menus & wattr-, slk-functions (Juergen Pfeifer) + +960526 - snapshot + + removed --with-ticdir option altogether, maintain compatibility with + existing applications via symbolic link in run_tic.sh + + patch for termio.h, signal (Philippe De Muyter) + + auto-configure gcc warning options rather than infer from version. + + auto-configure __attribute__ for different gcc versions. + + corrected special use of clearok() in hardscroll.c by resetting flag + in wrefresh(). + + include stdlib.h before defs for EXIT_SUCCESS, for OSF/1. + + include sys/types.h in case stdlib.h does not declare size_t. + + fixes for makefile (Tim Mooney) + + fixes for menus & forms (Juergen.Pfeifer@T-Online.de) + +960518 - snapshot + + revised ncurses.c panner test, let pad abut all 4 sides of screen. + + refined case in lib_doupdate.c for ClrToEOL(). + + corrected prior change for PutRange (Alexander V. Lukyanov: + lav@yars.free.net). + + autoconf mods (Tim Mooney: mooney@dogbert.cc.ndsu.NoDak.edu). + + locale fix for forms (Philippe De Muyter: phdemuyt@ulb.ac.be) + + renamed "--with-datadir" option to "--with-ticdir" to avoid + confusion, and made this check for the /usr/lib/terminfo pre-existing + directory. + > patches 299-301 by eric: + + added hashmap.c + + mods to tracing, especially for ACS chars. + + corrected off-by-one in IDCtransform. + + corrected intermittent mouse bug by using return-value from read(). + + mods to parse_entry.c, for smarter defaults. + +960512 + + use getopt in 'tic'; added -L option and modified -e option to allow + list from a file. + +960511 + + don't use fixed buffer-size in tparm(). + + modified tic to create terminfo directory if it doesn't exist. + + added -T options to tic and infocmp (for testing/analysis) + + refined the length criteria for termcap and terminfo + + optimize lib_doupdate with memcpy, PutRange + > patches 297, 298 by eric + + implement TERMINFO_DIRS, and -o option of tic + + added TRACE_IEVENT + + removed boolean version of 'getm' + + added lib_print.c (for Rick Marshall) + + added has_key() + + added 't' to ncurses.c test. + + moved delay_output() to lib_tputs.c + + removed tparam(). + + misc cursor & optimization fixes. + +960504 - snapshot + + modified ncurses 'p' test to allow full-screen range for panner size. + + fixes for locale (phdm@labauto1.ulb.ac.be) + + don't use fixed buffer-size in fmt_entry(). + + added usage-message to 'infocmp'. + + modified install.includes rules to prepend subdirectory-name to + "#include" if needed. + +960430 + + protect wrefresh, wnoutrefresh from invocation with pad argument. + + corrected default CCFLAGS in test/Makefile. + +960428 - snapshot + + implemented logic to support terminals with background color erase + (e.g., rxvt and the newer color xterm). + + improved screen update logic (off-by-one logic error; use clr_eos if + possible) + +960426 - snapshot + + change ncurses 'a' test to run in raw mode. + + make TIOCGWINSZ configure test less stringent, in case user + configures via terminal that cannot get screen size. + > patches 295, 296 by eric: + + new "-e" option of tic. + + fix for "infocmp -e". + + restore working-directory in read_termcap.c + + split lib_kernel.c, lib_setup.c and names.c in order to reduce + overhead for programs that use only termcap features. + +960418 - snapshot + + use autoconf 2.9 + + fix for AIX 3.2.5 (must define _POSIX_SOURCE to get termios struct + definitions via , modified macros in lib_raw.c to avoid + K&R-style substitution) + > patches 293, 294 by eric: + + mods to wgetch() in cooked mode + + corrected askuser() logic in tset + + correct interaction of endwin() with mouse processing + + added trace support for TTY flags + +960406 + + fixes for NeXT, ISC and HPUX auto-configure + + autogenerate development header-dependencies (config.h, *.priv.h) + + corrected single-column formatting of "use=" (e.g., in tic) + + modify tic to read full terminfo-names + + corrected divide-by-zero that caused hang (or worse) when redirecting + output + + modify tic to generate directories only as-needed (and corrected + instance of use of data from function that had already returned). + +### ncurses-1.9.8a -> 1.9.9e + +* fixed broken wsyncup()/wysncdown(), as a result wnoutrefresh() now has + copy-changed-lines behavior. +* added and documented wresize() function. +* more fixes to LOWER-RIGHT corner handling. +* changed the line-breakout optimization code to allow some lines to be + emitted before the first check. +* added option for tic to use symbolic instead of hard links (for AFS) +* fix to restore auto-wrap mode. +* trace level can be controlled by environment variable. +* better handling of NULs in terminal descriptions. +* improved compatibility with observed SVR4 behavior. +* the refresh behavior of over-lapping windows is now more efficient and + behaves like SVR4. +* use autoconf 2.7, which results in a working setup for SCO 5.0. +* support for ESCDELAY. +* small fixes for menu/form code. +* the test directory has its own configure. +* fixes to pads when optimizing scrolling. +* fixed several off-by-one bugs. +* fixes for termcap->terminfo translation; less restrictions more correct + behavior. + +### ncurses-1.9.7 -> 1.9.8a + +* teach infocmp -i to recognize ECMA highlight sequences +* infocmp now dumps all SVr4 termcaps (not just the SVr4 ones) on -C +* support infocmp -RBSD. +* satisfy XSI Curses requirement that every macro be available as a function. +* This represents the last big change to the public interface of ncurses. The + ABI_VERSION has now been set at 3.0 and should stay there barring any great + catastrophies or acts of God. +* The C++ has been cleaned up in reaction to the changes to satisfy XSI's + requirements. +* libncurses now gets linked to libcurses to help seamless emulation + (replacement) of a vendor's curses. --disable-overwrite turns this behavior + off. + +### ncurses-1.9.6 -> 1.9.7 + +* corrected return values of setupterm() +* Fixed some bugs in tput (it does padding now) +* fixed a bug in tic that made it do the wrong thing on entries with more than + one `use' capability. +* corrected the screen-size calculation at startup time to alter the + numeric capabilities as per SVr4, not just LINES and COLS. +* toe(1) introduced; does what infocmp -T used to. +* tic(1) can now translate AIX box1 and font[0123] capabilities. +* tic uses much less core, the dotic.sh kluge can go away now. +* fix read_entry() and write_entry() to pass through cancelled capabilities OK. +* Add $HOME/.terminfo as source/target directory for terminfo entries. +* termcap compilation now automatically dumps an entry to $HOME/.terminfo. +* added -h option to toe(1). +* added -R option to tic(1) and infocmp(1). +* added fallback-entry-list feature. +* added -i option to infocmp(1). +* do a better job at detecting if we're on SCO. + +### ncurses-1.9.5 -> 1.9.6 + +* handling of TERMCAP environment variables now works correctly. +* various changes to shorten termcap translations to less that 1024 chars. +* tset(1) added +* mouse support for xterm. +* most data tables are now const and accordingly live in shareable text space. +* Obey the XPG4/SVr4 practice that echo() is initally off. +* tic is much better at translating XENIX and AIX termcap entries now. +* tic can interpret ko capabilities now. +* integrated Juergen Pfeifer's forms library. +* taught write_entry() how not to write more than it needs to; this change + reduces the size of the terminfo tree by a full 26%! +* infocmp -T option added. +* better warnings about historical tic quirks from tic. + +### ncurses 1.9.4 -> 1.9.5 + +* menus library is now included with documentation. +* lib_mvcur has been carefully profiled and tuned. +* Fixed a ^Z-handling bug that was tanking lynx(1). +* HJ Lu's patches for ELF shared libraries under Linux +* terminfo.src 9.8.2 +* tweaks for compiling in seperate directories. +* Thomas Dickey's patches to support NeXT's brain-dead linker +* Eric Raymond's patches to fix problems with long termcap entries. +* more support for shared libraries under SunOS and IRIX. + +### ncurses 1.9.3 -> 1.9.4 + +* fixed an undefined-order-of-evaluation bug in lib_acs.c +* systematically gave non-API public functions and data an _nc_ prefix. +* integrated Juergen Pfeifer's menu code into the distribution. +* totally rewrote the knight test game's interface + +### ncurses 1.9.2c -> 1.9.3 + +* fixed the TERMCAP_FILE Support. +* fixed off-by-one errors in scrolling code +* added tracemunch to the test tools +* took steps to cut the running time of make install.data + +### ncurses 1.9.2c -> 1.9.2d + +* revised 'configure' script to produce libraries for normal, debug, + profile and shared object models. + +### ncurses 1.9.1 -> 1.9.2 + +* use 'autoconf' to implement 'configure' script. +* panels support added +* tic now checks for excessively long termcap entries when doing translation +* first cut at eliminating namespace pollution. + +### ncurses 1.8.9 -> 1.9 + +* cleanup gcc warnings for the following: use size_t where 'int' is not + appropriate, fixed some shadowed variables, change attr_t to compatible with + chtype, use attr_t in some places where it was confused with 'int'. +* use chtype/attr_t casts as appropriate to ensure portability of masking + operations. +* added-back waddchnstr() to lib_addstr.c (it had been deleted). +* supplied missing prototypes in curses.h +* include in lib_termcap.c to ensure that the prototypes + are consistent (they weren't). +* corrected prototype of tputs in +* rewrote varargs parsing in lib_tparm.c (to avoid referencing memory + that may be out of bounds on the stack) -- Purify found this. +* ensure that TRACE is defined in lib_trace.c (to solve prototype + warnings from gcc). +* corrected scrolling-region size in 'mvcur_wrap()' +* more spelling fixes +* use 'calloc()' to allocate WINDOW struct in lib_newwin.c (Purify). +* set default value for SP->_ofp in lib_set_term.c (otherwise SunOS dumps + core in init_acs()). +* include in write_entry.c (most "braindead" includes declare errno + in that file). + +### ncurses 1.8.8 -> 1.8.9 + +* compile (mostly) clean with gcc 2.5.8 -Wall -Wstrict-prototypes + -Wmissing-prototypes -Wconversion and using __attribute__ to flush out + non-portable use of "%x" for pointers, or for chtype data (which is declared + as a long). +* modified doupdate to ensure that typahead was turned on before attempting + select-call (otherwise, some implementations hang). +* added trace mask TRACE_FIFO, use this in lib_getch.c to allow finer + resolution of traces. +* improved bounds checking on several critical functions. +* the data directory has been replaced by the new master terminfo file. +* -F file-comparison option added to infocmp. +* compatibility with XSI Curses is now documented in the man bages. +* wsyncup/wsyncdown functions are reliable now; subwindow code in general + is much less flaky. +* capabilities ~msgr, tilde_glitch, insert_padding, generic_type, no_pad_char, + memory_above, memory_below, and hard_copy are now used properly. +* cursor-movement optimization has been completely rewritten. +* vertical-movement optimization now uses hardware scrolling, il, dl. + +### ncurses 1.8.7 -> 1.8.8 +* untic no longer exists, infocmp replaces it. +* tic can understand termcap now, especially if it is called captoinfo. +* The Linux Standard Console terminfo entry is called linux insead of console. + It also uses the kernel's new method of changing charsets. +* initscr() will EXIT upon error (as the docs say) This wil mostly happen if + you try to run on an undefined terminal. +* I can get things running on AIX but tic can't compile terminfo. I have to + compile entries on another machine. Volunteers to hunt this bug are welcome. +* wbkgd() and wbkgdset() can be used to set a windows background to color. + wclear()/werase() DO NOT use the current attribute to clear the screen. + This is the way SVR4 curses works. PDCurses 2.1 is broken in this respect, + though PDCurses 2.2 has been fixed. +* cleaned up the test/ directory. +* test/worm will segfault after quite a while. +* many spelling corrections courtesy of Thomas E. Dickey + +### ncurses 1.8.6 -> 1.8.7 +* cleaned up programs in test/ directory. +* fixed wbkgdset() macro. +* modified getstr() to stop it from advancing cursor in noecho mode. +* modified linux terminfo entry to work with the latest kernel to get + the correct alternate character set. +* also added a linux-mono entry for those running on monochrome screens. +* changed initscr() so that it behaves like the man page says it does. + this fixes the problem with programs in test/ crashing with SIGSEV if + a terminal is undefined. +* modified addch() to avoid using any term.h #define's +* removed duplicate tgoto() in lib_tparm.c +* modified dump_entry.c so that infocmp deals correctly with ',' in acsc +* modified delwin() to correctly handle deleting subwindows. +* fixed Makefile.dist to stop installing an empty curses.h +* fixed a couple of out-of-date notes in man pages. + +### ncurses 1.8.5 -> 1.8.6 +* Implemented wbkgd(), bkgd(), bkgdset(), and wbkgdset(). +* The handling of attributes has been improved and now does not turn off color + if other attributes are turned off. +* scrolling code is improved. Scrolling in subwindows is still broken. +* Fixes to several bugs that manifest them on platforms other than Linux. +* The default to meta now depends on the status of the terminal when ncurses + is started. +* The interface to the tracing facility has changed. Instead of the pair of + functions traceon() and traceoff(), there is just one function trace() which + takes a trace mask argument. The trace masks, defined in curses.h, are + as follows: + + #define TRACE_DISABLE 0x00 /* turn off tracing */ + #define TRACE_ORDINARY 0x01 /* ordinary trace mode */ + #define TRACE_CHARPUT 0x02 /* also trace all character outputs */ + #define TRACE_MAXIMUM 0x0f /* maximum trace level */ + + More trace masks may be added, or these may be changed, in future releases. +* The pad code has been improved and the pad test code in test/ncurses.c has + been improved. +* The prototype ansi entry has been changed to work with a wider variety + of emulators. +* Fix to the prototype ansi entry that enables it to work with PC emulators + that treat trailing ";m" in a highlight sequence as ";0m"; this doesn't + break operation with any emulators. +* There are now working infocmp, captoinfo, tput, and tclear utilities. +* tic can now compile entries in termcap syntax. +* Core-dump bug in pnoutrefresh fixed. +* We now recognize and compile all the nonstandard capabilities in Ross + Ridge's mytinfo package (rendering it obsolete). +* General cleanup and documentation improvements. +* Fixes and additions to the installation-documentation files. +* Take cursor to normal mode on endwin. + +### ncurses 1.8.4 -> 1.8.5 +* serious bugs in updating screen which caused erratic non-display, + fixed. +* fixed initialization for getch() related variable which cause + unpredictable results. +* fixed another doupdate bug which only appeared if you have + parm_char. +* implemented redrawln() and redrawwin(). +* implemented winsnstr() and related functions. +* cleaned up insertln() and deleteln() and implemented (w)insdeln(). +* changed Makefile.dist so that installation of man pages will + take note of the terminfo directory. +* fixed Configure (removed the mysterious 'X'). +* Eric S. Raymond fixed the script.* files so that they work with + stock awk. + +#### ncurses 1.8.3 -> 1.8.4 #### #### +* fixed bug in refreshing the screen after return from shell_mode. + There are still problems but they don't manifest themselves on + my machine (Linux 0.99.14f). +* added wgetnstr() and modified things accordingly. +* fixed the script.src script.test to work with awk not just gawk. +* Configure can now take an argument of the target system. +* added test/ncurses.c which replaces several other programs and + performs more testing. +[Thanks to Eric S Raymond for the last 4] +* more fixes to lib_overlay.c and added test/over.c to illustrate + how it works. +* fixed ungetch() to take int instead of ch. +* fixes to cure wgetch() if flushinp() is called. + +One note I forgot to mention in 1.8.3 is that tracing is off by +default starting in the version. If you want tracing output, put +traceon(); in your code and link with -ldcurses. + +#### ncurses 1.8.2 -> ncurses 1.8.3 #### #### +MAJOR CHANGES: +1) The order of capabilities has been changed in order to achieve +binary compatibility with SVR4 terminfo database. This has the +unfortunate effect of breaking application currently linked with +ncurses. To ensure correct behavior, recompile all such programs. +Most programs using color or newer capabilities will break, others +will probably continue to work ok. + +2) Pavel Curtis has renounced his copyright to the public domain. +This means that his original sources (posted to comp.sources.unix, +volume 1) are now in the public domain. The current sources are +NOT in the public domain, they are copyrighted by me. I'm +entertaining ideas on what the new terms ncurses is released under. + +3) Eric S. Raymond has supplied a complete set of man pages for +ncurses in ?roff format. They will eventually replace most of the +current docs. Both sets are included in this release. + +Other changes and notes from 1.8.2 include: +* SIGSEGV during scrolling no longer occurs. +* Other problems with scrolling and use of idl have been corrected. +* lib_getch.c has been re-written and should perform flawlessly. + please use test/getch.c and any other programs to test this. +* ripoffline() is implemented (Thanks to Eric) and slk_ functions + changed accordingly. +* I've added support for terminals that scroll if you write in the + bottom-right corner. +* fixed more bugs in pads code. If anybody has a program that uses + pads I'd love a copy. +* correct handling for terminal with back_color_erase capability + (such as Linux console, and most PC terminals) +* ^Z handling apparently didn't work (I should never trust code + sent me to me without extensive testing). It now seems to be + fixed. Let me know if you have problems. +* I've added support for Apollo and NeXT, but it may still be + incomplete, especially when dealing with the lack of POSIX + features. +* scrolling should be more efficient on terminals with idl + capabilities. Please see src/lib_scroll.c for more notes. +* The line drawing routines were offset by 1 at both ends. This + is now fixed. +* added a few missing prototypes and macros (e.g. setterm()) +* fixed code in src/lib_overlay.c which used to crash. +* added a few more programs in test/ The ones from the PDCurses + package are useful, especially if you have SVR4 proper. I'm + interested in the results you get on such a systems (Eric? ;-). + They already exposed certain bugs in ncurses. +* See src/README for porting notes. +* The C++ code should really replace ncurses.h instead of working + around it. It should avoid name-space clashes with nterm.h (use + rows instead of lines, etc.) +* The C++ should compile ok. I've added explicit rules to the + Makefile because no C++ defaults are documented on the suns. +* The docs say that echo() and nocbreak() are mutually exclusive. + At the moment ncurses will switch to cbreak() if the case above + occurs. Should it continue to do so? How about echo() and noraw()? +* PDCurses seem to assume that wclear() will use current attribute + when clearing the screen. According to Eric this is not the case + with SVR4. +* I have discovered, to my chagrin, SunOS 4.x (and probably other systems) + * doesn't have vsscanf and God knows what else! I've will do a vsscanf(). +* I've also found out that the src/script.* rely on gawk and will not + work with stock awk or even with nawk. Any changes are welcome. +* Linux is more tolerant of NULL dereferences than most systems. This + fact was exposed by hanoi. +* ncurses still seems inefficient in drawing the screen on a serial + link between Linux and suns. The padding may be the culprit. +* There seems to be one lingering problem with doupdate() after shelling + out. Despite the fact the it is sending out the correct information + to the terminal, nothing takes effect until you press ^L or another + refresh takes place. And yes, output does get flushed. + +#### ncurses 1.8.1 -> ncurses 1.8.2 #### Nov 28, 1993 #### + +* added support for SVR4 and BSDI's BSD/386. +* major update and fix to scrolling routine. +* MORE fixes to stuff in lib_getch.c. +* cleaned-up configuration options and can now generate + Config.* files through an awk script. +* changed setupterm() so it can be called more than once, + add added set_curterm(), del_curterm(). +* a few minor cleanups. +* added more prototypes in curses.h + +#### ncurses 1.8 -> ncurses 1.8.1 #### Nov 4, 1993 #### + +* added support for NeXTStep 3.0 +* added termcap emulation (not well tested). +* more complete C++ interface to ncurses. +* fixed overlay(), overwrite(), and added copywin(). +* a couple of bug fixes. +* a few code cleanups. + +#### ncurses 0.7.2/0.7.3 -> ncurses 1.8 #### Aug 31, 1993 #### + +* The annoying message "can't open file." was due to missing + terminfo entry for the used terminal. It has now been + replaced by a hopefully more helpful message. +* Problems with running on serial lines are now fixed. +* Added configuration files for SunOS, Linux, HP/UX, Ultrix, + 386bsd/BSDI (if you have others send'em to me) +* Cleaner Makefile. +* The documentation in manual.doc is now more uptodate. +* update optimization and support for hp terminals, and 386bsd + console driver(s). +* mvcur optimization for terminals without cursor addressing + (doesn't work on Linux) +* if cursor moved since last update, getch() will refresh the + screen before working. +* getch() & alarm() can now live together. in 0.7.3 a signal + interrupted getch() (bug or feature?) now the getch is + restarted. +* scanw() et all were sick, now fixed. +* support for 8-bit input (use meta()). +* added default screen size to all terminfos. +* added c++ Ncursesw class. +* several minor bug fixes. + +#### ncurses 0.7.2 -> ncurses 0.7.3 #### May 27, 1993 #### + +* Config file to cope with different platforms (386BSD, BSDI, Ultrix, SunOS) +* more fixes to lib_getch.c +* changes related to Config + +#### ncurses 0.7 -> ncurses 0.7.2 #### May 22, 1993 #### + +* docs updated slightly (color usage is now documented). +* yet another fix for getch(), this one fixes problems with ESC being swallowed + if another character is typed before the 1 second timeout. +* Hopefully, addstr() and addch() are 8-bit clean. +* fixed lib_tparm.c to use stdarg.h (should run on suns now) +* order of capabilities changed to reflect that specified in SYSV + this will allow for binary-compatibility with existing terminfo dbs. +* added halfdelay() +* fixed problems with asc_init() +* added A_PROTECT and A_INVIS +* cleaned up vidputs() +* general cleanup of the code +* more attention to portability to other systems +* added terminfos for hp70092 (wont work until changes to lib_update.c are + made) and 386BSD pcvt drivers. + +Thanks to Hellmuth Michaelis for his help. +optimization code is slated for the next major release, stay tuned! + +#### ncurses 0.6/0.61 -> ncurses 0.7 #### April 1, 1993 +Please note that the next release will be called 1.8. If you want to know about +the rationale drop me a line. + +Included are several test programs in test/. +I've split up the panels library, reversi, tetris, sokoban. They are now +available separately from netcom.com:pub/zmbenhal/ + +* color and ACS support is now fully compatible with SYSV at the terminfo + level. +* Capabilities now includes as many SYSV caps I could find. +* tigetflag,tigetnum,tigetstr functions added. +* boolnames, boolfnames, boolcodes numnames, numfnames, numcodes, + strnames, strfnames, strcodes arrays are now added. +* keyname() is added. +* All function keys can be defined in terminfo entries. +* fixed lin_tparm.c to behave properly. +* terminfo entries for vt* and xterm are included (improvements are welcome) +* more automation in handling caps and keys. +* included fixes from 0.6.1 +* added a few more missing functions. +* fixed a couple of minor bugs. +* updated docs JUST a little (still miles behind in documenting the newer + features). + +#### ncurses 0.6 -> ncurses 0.61 #### + +1) Included the missing data/console. + +2) allow attributes when drawing boxes. + +3) corrected usage of win->_delay value. + +4) fixed a bug in lib_getch.c. if it didn't recognize a sequence it would + simply return the last character in the sequence. The correct + behavior is to return the entire sequence one character at a time. + +#### ncurses0.5 -> ncurses0.6 #### March 1, 1993 #### +* removed _numchngd from struct _win_st and made appropriate changes. +* rewritten kgetch() to remove problems with interaction between alarm and + read(). It caused SIGSEGV every now and then. +* fixed a bug that miscounted the numbers of columns when updating. + (in lib_doupdate.c(ClrUpdate() -- iterate to columns not columns-1) +* fixed a bug that cause the lower-right corner to be incorrect. + (in lib_doupdate.c(putChar() -- check against columns not columns-1) +* made resize() and cleanup() static to lib_newterm.c +* added notimeout(). +* added timeout() define in curses.h +* added more function prototypes and fixed napms. +* added use_env(). +* moved screen size detection to lib_setup.c. +* fixed newterm() to confirm to prototype. +* removed SIGWINCH support as SYSV does not define its semantics. +* cleaned-up lib_touch.c +* added waddnstr() and relatives. +* added slk_* support. +* fixed a bug in wdeleteln(). +* added PANEL library. +* modified Makefile for smoother installation. +* terminfo.h is really term.h + +#### ncurses 0.4 -> ncurses 0.5 #### Feb 14, 1993 #### +* changed _win_st structure to allow support for missing functionality. +* Addition of terminfo support for all KEY_*. +* Support for nodelay(), timeout(), notimeout(). +* fixed a bug with the keypad char reading that did not return ESC until + another key is pressed. +* nl mapping no longer occur on output (as should be) + fixed bug '\n' no causing a LF. +* fixed bug that reset terminal colors regardless of whether we use color + or not. +* Better support for ACS (not quite complete). +* fixed bug in wvline(). +* added curs_set(). +* changed from signal() to sigaction(). +* re-included the contents of important.patch into source. + +#### ncurses 0.3 -> ncurses 0.4 #### Feb 3, 1993 #### +* Addition of more KEY_* definitions. +* Addition of function prototypes. +* Addition of several missing functions. +* No more crashes if screen size is undefined (use SIGWINCH handler). +* added a handler to cleanup after SIGSEGV (hopefully never needed). +* changed SRCDIR from /etc/term to /usr/lib/terminfo. +* renamed compile/dump to tic/untic. +* New scrolling code. +* fixed bug that reversed the sense of nl() and nonl(). + +#### ncurses 0.2 -> ncurses 0.3 #### Jan 20, 1993 #### +* more support for color and graphics see test/ for examples. +* fixed various files to allow correct update after shelling out. +* more fixes for updates. +* no more core dumps if you don't have a terminfo entry. +* support for LINES and COLUMNS environment variables. +* support for SIGWINCH signal. +* added a handler for SIGINT for clean exits. + +#### ncurses 0.1 -> ncurses 0.2 #### Aug 14, 1992 #### +* support for color. +* support for PC graphic characters. +* lib_trace.c updated to use stdarg.h and vprintf routines. +* added gdc.c (Great Digital Clock) as an example of using color. + +#### ncurses -> ncurses 0.1 #### Jul 31, 1992 #### +* replacing sgtty stuff by termios stuff. +* ANSIfication of some functions. +* Disabling cost analysis 'cause it's incorrect. +* A quick hack for a terminfo entry. diff --git a/ncurses-5.3/README b/ncurses-5.3/README new file mode 100644 index 0000000..52aa79d --- /dev/null +++ b/ncurses-5.3/README @@ -0,0 +1,175 @@ +-- $Id$ +------------------------------------------------------------------------------- + README file for the ncurses package + +See the file ANNOUNCE for a summary of ncurses features and ports. +See the file INSTALL for instructions on how to build and install ncurses. +See the file NEWS for a release history and bug-fix notes. +See the file TO-DO for things that still need doing, including known bugs. + +Browse the file misc/ncurses-intro.html for narrative descriptions of how +to use ncurses and the panel, menu, and form libraries. + +Browse the file doc/html/hackguide.html for a tour of the package internals. + +ROADMAP AND PACKAGE OVERVIEW: + +You should be reading this file in a directory called: ncurses-d.d, where d.d +is the current version number (see the dist.mk file in this directory for +that). There should be a number of subdirectories, including `c++', `form', +`man', `menu', `misc', `ncurses', `panel', `progs', `test', 'tack' and `Ada95'. +(The 'tack' program may be distributed separately). + +A full build/install of this package typically installs several libraries, a +handful of utilities, and a database hierarchy. Here is an inventory of the +pieces: + +The libraries are: + + libncurses.a (normal) + libncurses.so (shared) + libncurses_g.a (debug and trace code enabled) + libncurses_p.a (profiling enabled) + + libpanel.a (normal) + libpanel.so (shared) + libpanel_g.a (debug and trace code enabled) + + libmenu.a (normal) + libmenu.so (shared) + libmenu_g.a (debug enabled) + + libform.a (normal) + libform.so (shared) + libform_g.a (debug enabled) + +The ncurses libraries implement the curses API. The panel, menu and forms +libraries implement clones of the SVr4 panel, menu and forms APIs. The source +code for these lives in the `ncurses', `panel', `menu', and `form' directories +respectively. + +In the `c++' directory, you'll find code that defines an interface to the +curses, forms, menus and panels library packaged as C++ classes, and a demo program in C++ +to test it. These class definition modules are not installed by the 'make +install.libs' rule as libncurses++. + +In the `Ada95' directory, you'll find code and documentation for an +Ada95 binding of the curses API, to be used with the GNAT compiler. +This binding is built by a normal top-level `make' if configure detects +an usable version of GNAT (3.10 or above). It is not installed automatically. +See the Ada95 directory for more build and installation instructions and +for documentation of the binding. + +To do its job, the ncurses code needs your terminal type to be set in the +environment variable TERM (normally set by your OS; under UNIX, getty(1) +typically does this, but you can override it in your .profile); and, it needs a +database of terminal descriptions in which to look up your terminal type's +capabilities. + +In older (V7/BSD) versions of curses, the database was a flat text file, +/etc/termcap; in newer (USG/USL) versions, the database is a hierarchy of +fast-loading binary description blocks under /usr/lib/terminfo. These binary +blocks are compiled from an improved editable text representation called +`terminfo' format (documented in man/terminfo.5). The ncurses library can use +either /etc/termcap or the compiled binary terminfo blocks, but prefers the +second form. + +In the `misc' directory, there is a text file terminfo.src, in editable +terminfo format, which can be used to generate the terminfo binaries (that's +what make install.data does). If the package was built with the +--enable-termcap option enabled, and the ncurses library cannot find a terminfo +description for your terminal, it will fall back to the termcap file supplied +with your system (which the ncurses package installation leaves strictly +alone). + +The utilities are as follows: + + tic -- terminfo source to binary compiler + infocmp -- terminfo binary to source decompiler/comparator + clear -- emits clear-screen for current terminal + tput -- shell-script access to terminal capabilities. + toe -- table of entries utility + tset -- terminal-initialization utility + +The first two (tic and infocmp) are used for manipulating terminfo +descriptions; the next two (clear and tput) are for use in shell scripts. The +last (tset) is provided for 4.4BSD compatibility. The source code for all of +these lives in the `progs' directory. + +Detailed documentation for all libraries and utilities can be found in the +`man' and `doc' directories. An HTML introduction to ncurses, panels, and +menus programming lives in the `doc/html' directory. Manpages in HTML format +are under `doc/html/man'. + +The `test' directory contains programs that can be used to verify or +demonstrate the functions of the ncurses libraries. See test/README for +descriptions of these programs. Notably, the `ncurses' utility is designed to +help you systematically exercise the library functions. + +AUTHORS: + +Pavel Curtis: + wrote the original ncurses + +Zeyd M. Ben-Halim: + port of original to Linux and many enhancements. + +Thomas Dickey (maintainer for 1.9.9g through 4.1, resuming with FSF's 5.0): + configuration scripts, porting, mods to adhere to XSI Curses in the + areas of background color, terminal modes. Also memory leak testing, + the wresize, default colors and key definition extensions and numerous + bug fixes (more than half of those enumerated in NEWS beginning with + the internal release 1.8.9). + +Florian La Roche (official maintainer for FSF's ncurses 4.2) + Beginning with release 4.2, ncurses is distributed under an MIT-style + license. + +Eric S. Raymond: + the man pages, infocmp(1), tput(1), clear(1), captoinfo(1), tset(1), + toe(1), most of tic(1), trace levels, the HTML intro, wgetnstr() and + many other entry points, the cursor-movement optimization, the + scroll-pack optimizer for vertical motions, the mouse interface and + xterm mouse support, and the ncurses test program. + +Juergen Pfeifer + The menu and form libraries, C++ bindings for ncurses, menus, forms and + panels, as well as the Ada95 binding. Ongoing support for panel. + +CONTRIBUTORS: + +Alexander V. Lukyanov + for numerous fixes and improvements to the optimization logic. + +David MacKenzie + for first-class bug-chasing and methodical testing. + +Ross Ridge + for the code that hacks termcap parameterized strings into terminfo. + +Warren Tucker and Gerhard Fuernkranz, + for writing and sending the panel library. + +Hellmuth Michaelis, + for many patches and testing the optimization code. + +Eric Newton, Ulrich Drepper, and Anatoly Ivasyuk: + the C++ code. + +Jonathan Ross, + for lessons in using sed. + +Keith Bostic (maintainer of 4.4BSD curses) + for help, criticism, comments, bug-finding, and being willing to + deep-six BSD curses for this one when it grew up. + +Richard Stallman, + for his commitment to making ncurses free software. + +Countless other people have contributed by reporting bugs, sending fixes, +suggesting improvements, and generally whining about ncurses :-) + +BUGS: + See the INSTALL file for bug and developer-list addresses. + The Hacker's Guide in the doc directory includes some guidelines + on how to report bugs in ways that will get them fixed most quickly. diff --git a/ncurses-5.3/README.emx b/ncurses-5.3/README.emx new file mode 100644 index 0000000..e8ba0b9 --- /dev/null +++ b/ncurses-5.3/README.emx @@ -0,0 +1,45 @@ +-- $Id$ +-- Author: Thomas Dickey +------------------------------------------------------------------------------- + +You can build ncurses on OS/2 in the EMX environment. But you must build and +acquire tools. Not all of the tools distributed with EMX work properly, and +some additional ones are required. + +First, the configure script distributed with ncurses will not run as-is in EMX. +You can generate a new one if you have autoconf built for EMX. You will need +the EMX development tools, of course. Get these programs to start: + + GNU m4 program (version 1.4) + GNU autoconf (version 2.13). + GNU patch (version 2.5) + +Apply the autoconf patches from + + http://invisible-island.net/autoconf + ftp://invisible-island.net/autoconf + +These are ordered by date: + + autoconf-2.13-20020210.patch.gz + autoconf-2.13-20020210-emx.patch.gz + +I built my development environment for ncurses using EMX 0.9c at the end of +1997. Much of the EMX patch for autoconf was done originally by J.J.G.Ripoll, +using a similar environment (he prefers using the 'ash' shell). Newer versions +may fix these problems: + + + The pdksh program distributed at Hobbes and Leo (with a 1996 date) is + defective. It does not process "here documents" correctly (which + renders it useless for running the autoconf script). I built my own + copy of pdksh 5.2.13, which does have the bug corrected (documented + in the change log for pdksh). + + + I also built from sources (because the distributed binaries did not + work) the cmp, diff programs. + + Other required utilities such as ar, cat, chmod, cp, gawk, grep, mv, + ls, rm, mkdir, sed, sort and tr worked. + +Once you have autoconf patched and installed, run 'autoconf' from the top-level +directory of ncurses to generate the EMX-specific configure script. diff --git a/ncurses-5.3/README.glibc b/ncurses-5.3/README.glibc new file mode 100644 index 0000000..7d52269 --- /dev/null +++ b/ncurses-5.3/README.glibc @@ -0,0 +1,5 @@ +To compile this as an add-on for glibc, unpack it in the glibc source +tree and put ncurses on the add-on list when you do configure. + +hjl@gnu.ai.mit.edu +03/21/1997 diff --git a/ncurses-5.3/TO-DO b/ncurses-5.3/TO-DO new file mode 100644 index 0000000..4db47ff --- /dev/null +++ b/ncurses-5.3/TO-DO @@ -0,0 +1,191 @@ +-- $Id$ + +SHORT-TERM TO-DO ITEMS: + +Known Problems: + +* GNAT does not put libraries in the correct order, so a build only links + properly if you use shared libraries since -lncurses is first. + +* The screen optimization has been tested only in an ad hoc manner. We should + develop a good set of regression tests to cover lib_doupdate.c and + lib_mvcur.c. + +* Magic cookie support does not work, since the logic does not take into account + refresh. Also, the initial optimize does not adjust the current location + when a cookie is emitted. + +* 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. + For example, they are initially displayed (before the ncurses 'e' test + activates them), and a touchwin can apparently also force them to be + displayed. + ++ The code departs from perfect 8-bit cleanness in one respect; you cannot + specify a character \200 as part of a capability string, because the terminfo + library interprets \200 as a request to embed NUL (\000) at that point. This + is a legacy terminfo property we can't mess with. + +* The window classes defined in the c++ subdirectory need documentation. + Some C++ programmer could earn a lot of good karma by doing this... + +* The resizeterm() function does not handle ripped-off lines such as that + done for the slk_XXX functions. + +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/lib_tstp.c. + +* In theory, vwprintw and vwscanf are supposed to use the older varargs.h + interface for handling variadic argument lists. 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 uses 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 implementation to ncurses/vsscanf.c. + +* The demo build for the c++ library craps out with many link errors under gcc + 2.6.3. We're told the C++ support in 2.6.3 is broken and that the right + fix is to upgrade to 2.7.0. This demo is also known to not build with + the Sun SPARCworks 4.1 C++ compiler, due to a problem resolving templates. + +* Under Ultrix, configure craps out (Ultrix sh is lame). Run it under ksh. + +* We've not tested the configure script with cross-compilers. The autoconf + tests are supposed to be able to support this (please report bugs). You will + have to configure and build in two steps. The first step must create the + automatically-generated sources (e.g., comp_captab.c) on your host machine. + Then, run "make mostlyclean", remove config.* from the top-level directory + and configure for the cross-compiler. + ++ terminfo.5 does not format with the SunOS (and most other platform's) tbl + utility because it relies on a diversion for each table entry. Get the groff + package. + +Untested features: + +* The code for the HP color model using set_color_pair is untested. + +* The code for handling soft labels on a terminal type with built-in support + for them (num_labels > 0, label_height, label_width, label_format, label_off, + label_on, plab_norm, lab_f*) has not been tested. The label_format and + lab_f* capabilities aren't presently used. + +* The wide-character input functions need testing. + +LONGER-TERM TO-DO ITEMS: + +1. Extended COSE conformance + +There is an XPG4 standard recently released which describes a superset +of the SVr4 API. The library is BASE conformant with this standard. +We would like to make ncurses fully conformant at the EXTENDED level +supporting internationalization. + +Current status: + pecho_wchar() not implemented. + slk_wset not implemented. + +2. DOS port + +Only 16 of the 55 files in the library depend on the terminfo format. +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. + +3. X port + +It would be nice if ncurses could recognize when it was running under X and +maintain its own window. With this feature, all ncurses programs would +automatically become X programs. The challenge is to handle resize events +properly. + +4. Unused capabilities + +The currently unused capabilities fall naturally into several groups: + +A. Status-line capabilities: + + Booleans: has_status_line, status_line_esc_ok. + Numerics: width_status_line. + Strings: dis_status_line, from_status_line, to_status_line. + +System V Release 1 curses made no use of these at all. SVr4's use, if +any, is unknown. From the AT&T termcap file it looks like curses, in general, +shouldn't use them; terminal variants with status lines have their line count +decremented by 1, suggesting that curses is supposed to leave the status line +alone. + +B. Printer capabilities: + + Boolean: col_addr_glitch, cr_cancels_micro_mode, has_print_wheel, + row_addr_glitch, semi_auto_right_margin, cpi_changes_res, + lpi_changes_res. + Numeric: buffer_capacity, dot_horz_spacing, dot_vert_spacing, + max_micro_address, max_micro_jump, micro_col_size, + micro_line_size, number_of_pins, output_res_char, + output_res_line, output_res_horz_inch, print_rate, + wide_char_size, bit_image_entwining, bit_image_type. + String: down_half_line, form_feed, up_half_line, set_left_margin, + set_right_margin, clear_margins, change_char_pitch + ... set_page_length (all the SVr4 printer caps), + +Curses doesn't use these. + +C. Printer-control capabilities: + + Boolean: prtr_silent. + Strings: print_screen, prtr_on, prtr_off, prtr_non. + +Curses doesn't use these. + +D. Dialer strings: + + Strings: hangup, dial_phone, quick_dial, tone, pulse, flash_hook, + fixed_pause, wait_tone. + +Curses doesn't use these. + +E. Window and virtual-terminal capabilities: + + Numerics: maximum_windows, virtual_terminal. + Strings: req_for_input, create_window, goto_window, set_window. + +These seem to be fossils from some AT&T experiments on character-based +window systems that never escaped the lab. The virtual_terminal cap had +something to do with building terminal emulations into tty line disciplines. + +F. Unused VDT capabilities: + + Booleans: erase_overstrike, has_meta_key, insert_null_glitch, + 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, + display_clock, remove_clock, user[0-5], display_pc_char, + enter_scancode_mode, exit_scancode_mode, pc_term_options, + scancode_escape, alt_scancode_esc. + +These are the potentially important ones for ncurses. Notes: + + i) ncurses doesn't need move_insert; it never uses cup/hpa/vpa while + insert_mode is on. + + ii) We probably don't care about dest_tabs_magic_smso; only + Telerays used it and they're all long obsolete. + + diff --git a/ncurses-5.3/aclocal.m4 b/ncurses-5.3/aclocal.m4 new file mode 100644 index 0000000..3c216c5 --- /dev/null +++ b/ncurses-5.3/aclocal.m4 @@ -0,0 +1,2932 @@ +dnl*************************************************************************** +dnl Copyright (c) 1998-2000,2001,2002 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,1997,1998,1999,2000,2001 +dnl +dnl $Id$ +dnl Macros used in NCURSES auto-configuration script. +dnl +dnl See http://invisible-island.net/autoconf/ for additional information. +dnl +dnl --------------------------------------------------------------------------- +dnl --------------------------------------------------------------------------- +dnl Construct the list of include-options for the C programs in the Ada95 +dnl binding. +AC_DEFUN([CF_ADA_INCLUDE_DIRS], +[ +ACPPFLAGS="$ACPPFLAGS -I. -I../../include" +if test "$srcdir" != "."; then + ACPPFLAGS="$ACPPFLAGS -I\$(srcdir)/../../include" +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 Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS +dnl The second parameter if given makes this macro verbose. +AC_DEFUN([CF_ADD_CFLAGS], +[ +cf_new_cflags= +cf_new_cppflags= +for cf_add_cflags in $1 +do + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + 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 + +])dnl +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 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_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 Test if 'bool' is a builtin type in the configured C++ compiler. Some +dnl older compilers (e.g., gcc 2.5.8) don't support 'bool' directly; gcc +dnl 2.6.3 does, in anticipation of the ANSI C++ standard. +dnl +dnl Treat the configuration-variable specially here, since we're directly +dnl substituting its value (i.e., 1/0). +AC_DEFUN([CF_BOOL_DECL], +[ +AC_CHECK_HEADER(stdbool.h, + cf_cv_header_stdbool_h=1, + cf_cv_header_stdbool_h=0) +AC_MSG_CHECKING([for builtin bool type]) +AC_CACHE_VAL(ifelse($1,,cf_cv_builtin_bool,[$1]),[ + AC_TRY_COMPILE([ +#include +#include +],[bool x = false], + [ifelse($1,,cf_cv_builtin_bool,[$1])=1], + [ifelse($1,,cf_cv_builtin_bool,[$1])=0]) + ]) +if test "$ifelse($1,,cf_cv_builtin_bool,[$1])" = 1 +then AC_MSG_RESULT(yes) +else AC_MSG_RESULT(no) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type). +dnl Don't bother looking for bool.h, since it's been deprecated. +dnl +dnl If the current compiler is C rather than C++, we get the bool definition +dnl from . +AC_DEFUN([CF_BOOL_SIZE], +[ +AC_MSG_CHECKING([for size of bool]) +AC_CACHE_VAL(cf_cv_type_of_bool,[ + rm -f cf_test.out + AC_TRY_RUN([ +#include +#include + +#if defined(__cplusplus) + +#ifdef HAVE_GXX_BUILTIN_H +#include +#elif HAVE_GPP_BUILTIN_H +#include +#elif HAVE_BUILTIN_H +#include +#endif + +#else + +#if $cf_cv_header_stdbool_h +#include +#endif + +#endif + +main() +{ + FILE *fp = fopen("cf_test.out", "w"); + if (fp != 0) { + bool x = true; + if ((bool)(-x) >= 0) + fputs("unsigned ", fp); + if (sizeof(x) == sizeof(int)) fputs("int", fp); + else if (sizeof(x) == sizeof(char)) fputs("char", fp); + else if (sizeof(x) == sizeof(short))fputs("short",fp); + else if (sizeof(x) == sizeof(long)) fputs("long", fp); + fclose(fp); + } + exit(0); +} + ], + [cf_cv_type_of_bool=`cat cf_test.out` + if test -z "$cf_cv_type_of_bool"; then + cf_cv_type_of_bool=unknown + fi], + [cf_cv_type_of_bool=unknown], + [cf_cv_type_of_bool=unknown]) + ]) + rm -f cf_test.out +AC_MSG_RESULT($cf_cv_type_of_bool) +if test "$cf_cv_type_of_bool" = unknown ; then + case .$NCURSES_BOOL in #(vi + .auto|.) NCURSES_BOOL=unsigned;; + esac + AC_MSG_WARN(Assuming $NCURSES_BOOL for type of bool) + cf_cv_type_of_bool=$NCURSES_BOOL +fi +])dnl +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*|netbsd*|freebsd*|linux*|cygwin*) + 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 Check if the terminal-capability database functions are available. If not, +dnl ncurses has a much-reduced version. +AC_DEFUN([CF_CGETENT],[ +AC_MSG_CHECKING(for terminal-capability database functions) +AC_CACHE_VAL(cf_cv_cgetent,[ +AC_TRY_LINK([ +#include ],[ + char temp[128]; + char *buf = temp; + char *db_array = temp; + cgetent(&buf, /* int *, */ &db_array, "vt100"); + cgetcap(buf, "tc", '='); + cgetmatch(buf, "tc"); + ], + [cf_cv_cgetent=yes], + [cf_cv_cgetent=no]) +]) +AC_MSG_RESULT($cf_cv_cgetent) +test "$cf_cv_cgetent" = yes && AC_DEFINE(HAVE_BSD_CGETENT) +])dnl +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. +AC_DEFUN([CF_CHECK_CACHE], +[ +if test -f $srcdir/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_ERROR("Please remove config.cache and try again.") +fi +])dnl +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 +dnl ourselves. +dnl +dnl $1 = the name to check +AC_DEFUN([CF_CHECK_ERRNO], +[ +AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ + AC_TRY_COMPILE([ +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#include +#include ], + [long x = (long) $1], + [cf_cv_dcl_$1=yes], + [cf_cv_dcl_$1=no]) +]) + +if test "$cf_cv_dcl_$1" = no ; then + CF_UPPER(cf_result,decl_$1) + AC_DEFINE_UNQUOTED($cf_result) +fi + +# It's possible (for near-UNIX clones) that the data doesn't exist +CF_CHECK_EXTERN_DATA($1,int) +])dnl +dnl --------------------------------------------------------------------------- +dnl Check for existence of external data in the current set of libraries. If +dnl we can modify it, it's real enough. +dnl $1 = the name to check +dnl $2 = its type +AC_DEFUN([CF_CHECK_EXTERN_DATA], +[ +AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[ + AC_TRY_LINK([ +#undef $1 +extern $2 $1; +], + [$1 = 2], + [cf_cv_have_$1=yes], + [cf_cv_have_$1=no]) +]) + +if test "$cf_cv_have_$1" = yes ; then + CF_UPPER(cf_result,have_$1) + AC_DEFINE_UNQUOTED($cf_result) +fi + +])dnl +dnl --------------------------------------------------------------------------- +dnl Check if the C++ compiler accepts duplicate parameter initialization. This +dnl is a late feature for the standard and is not in some recent compilers +dnl (1999/9/11). +AC_DEFUN([CF_CPP_PARAM_INIT], +[ +if test -n "$CXX"; then +AC_CACHE_CHECK(if $CXX accepts parameter initialization,cf_cv_cpp_param_init,[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_RUN([ +class TEST { +private: + int value; +public: + TEST(int x = 1); + ~TEST(); +}; + +TEST::TEST(int x = 1) // some compilers do not like second initializer +{ + value = x; +} +void main() { } +], + [cf_cv_cpp_param_init=yes], + [cf_cv_cpp_param_init=no], + [cf_cv_cpp_param_init=unknown]) + AC_LANG_RESTORE +]) +fi +test "$cf_cv_cpp_param_init" = yes && AC_DEFINE(CPP_HAS_PARAM_INIT) +])dnl +dnl --------------------------------------------------------------------------- +dnl Check if the g++ compiler supports vscan function (not a standard feature). +AC_DEFUN([CF_CPP_VSCAN_FUNC], +[ +if test -n "$CXX"; then + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_CHECK_HEADERS(strstream.h) + +AC_CACHE_CHECK(if $CXX supports vscan function,cf_cv_cpp_vscan_func,[ + for cf_vscan_func in strstream strstream_cast stdio + do + case $cf_vscan_func in #(vi + stdio) cf_vscan_defs=USE_STDIO_VSCAN ;; #(vi + strstream) cf_vscan_defs=USE_STRSTREAM_VSCAN ;; + strstream_cast) cf_vscan_defs=USE_STRSTREAM_VSCAN_CAST ;; + esac + AC_TRY_LINK([ +#include +#include +#define $cf_vscan_defs 1 +#if defined(USE_STDIO_VSCAN) +#elif defined(HAVE_STRSTREAM_H) && defined(USE_STRSTREAM_VSCAN) +#include +#endif + +int scanw(const char* fmt, ...) +{ + int result = -1; + char buf[BUFSIZ]; + + va_list args; + va_start(args, fmt); +#if defined(USE_STDIO_VSCAN) + if (::vsscanf(buf, fmt, args) != -1) + result = 0; +#elif defined(USE_STRSTREAM_VSCAN) + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) + result = 0; +#elif defined(USE_STRSTREAM_VSCAN_CAST) + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, (_IO_va_list)args) != -1) + result = 0; +#else +#error case $cf_vscan_func failed +#endif + va_end(args); + return result; +} +],[int tmp, foo = scanw("%d", &tmp)], + [cf_cv_cpp_vscan_func=$cf_vscan_func; break], + [cf_cv_cpp_vscan_func=no]) + test "$cf_cv_cpp_vscan_func" != no && break + done +]) + +AC_LANG_RESTORE +fi + +case $cf_cv_cpp_vscan_func in #(vi +stdio) #(vi + AC_DEFINE(CPP_HAS_VSCAN_FUNC) + AC_DEFINE(USE_STDIO_VSCAN) + ;; +strstream) + AC_DEFINE(CPP_HAS_VSCAN_FUNC) + AC_DEFINE(USE_STRSTREAM_VSCAN) + ;; +strstream_cast) + AC_DEFINE(CPP_HAS_VSCAN_FUNC) + AC_DEFINE(USE_STRSTREAM_VSCAN_CAST) + ;; +esac +])dnl +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 --------------------------------------------------------------------------- +AC_DEFUN([CF_DIRS_TO_MAKE], +[ +DIRS_TO_MAKE="lib" +for cf_item in $cf_list_models +do + CF_OBJ_SUBDIR($cf_item,cf_subdir) + for cf_item2 in $DIRS_TO_MAKE + do + test $cf_item2 = $cf_subdir && break + done + test ".$cf_item2" != ".$cf_subdir" && DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" +done +for cf_dir in $DIRS_TO_MAKE +do + test ! -d $cf_dir && mkdir $cf_dir +done +AC_SUBST(DIRS_TO_MAKE) +])dnl +dnl --------------------------------------------------------------------------- +dnl Check if 'errno' is declared in +AC_DEFUN([CF_ERRNO], +[ +CF_CHECK_ERRNO(errno) +])dnl +dnl --------------------------------------------------------------------------- +dnl Test for conflicting definitions of exception in gcc 2.8.0, etc., between +dnl math.h and builtin.h, only for ncurses +AC_DEFUN([CF_ETIP_DEFINES], +[ +AC_MSG_CHECKING(for special defines needed for etip.h) +cf_save_CXXFLAGS="$CXXFLAGS" +cf_result="none" +for cf_math in "" MATH_H +do +for cf_excp in "" MATH_EXCEPTION +do + CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu" + test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}" + test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}" +AC_TRY_COMPILE([ +#include +],[],[ + test -n "$cf_math" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_math}) + test -n "$cf_excp" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_excp}) + cf_result="$cf_math $cf_excp" + break +],[]) +done +done +AC_MSG_RESULT($cf_result) +CXXFLAGS="$cf_save_CXXFLAGS" +]) +dnl --------------------------------------------------------------------------- +dnl Check for memmove, or a bcopy that can handle overlapping copy. If neither +dnl is found, add our own version of memmove to the list of objects. +AC_DEFUN([CF_FUNC_MEMMOVE], +[ +AC_CHECK_FUNC(memmove,,[ +AC_CHECK_FUNC(bcopy,[ + AC_CACHE_CHECK(if bcopy does overlapping moves,cf_cv_good_bcopy,[ + AC_TRY_RUN([ +int main() { + static char data[] = "abcdefghijklmnopqrstuwwxyz"; + char temp[40]; + bcopy(data, temp, sizeof(data)); + bcopy(temp+10, temp, 15); + bcopy(temp+5, temp+15, 10); + exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz")); +} + ], + [cf_cv_good_bcopy=yes], + [cf_cv_good_bcopy=no], + [cf_cv_good_bcopy=unknown]) + ]) + ],[cf_cv_good_bcopy=no]) + if test "$cf_cv_good_bcopy" = yes ; then + AC_DEFINE(USE_OK_BCOPY) + else + AC_DEFINE(USE_MY_MEMMOVE) + fi +])])dnl +dnl --------------------------------------------------------------------------- +dnl See if the poll function really works. Some platforms have poll(), but +dnl it does not work for terminals or files. +AC_DEFUN([CF_FUNC_POLL],[ +AC_CACHE_CHECK(if poll really works,cf_cv_working_poll,[ +AC_TRY_RUN([ +#include +#ifdef HAVE_POLL_H +#include +#else +#include +#endif +int main() { + struct pollfd myfds; + int ret; + + myfds.fd = 0; + myfds.events = POLLIN; + + ret = poll(&myfds, 1, 100); + exit(ret != 0); +}], + [cf_cv_working_poll=yes], + [cf_cv_working_poll=no], + [cf_cv_working_poll=unknown])]) +test "$cf_cv_working_poll" = "yes" && AC_DEFINE(HAVE_WORKING_POLL) +])dnl +dnl --------------------------------------------------------------------------- +dnl Some old/broken variations define tcgetattr() only as a macro in +dnl termio(s).h +AC_DEFUN([CF_FUNC_TERMIOS],[ +AC_REQUIRE([CF_STRUCT_TERMIOS]) +AC_CACHE_CHECK(for tcgetattr, cf_cv_have_tcgetattr,[ +AC_TRY_LINK([ +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_TERMIOS_H +#include +#define TTY struct termios +#else +#ifdef HAVE_TERMIO_H +#include +#define TTY struct termio +#endif +#endif +],[ +TTY foo; +tcgetattr(1, &foo);], +[cf_cv_have_tcgetattr=yes], +[cf_cv_have_tcgetattr=no])]) +test "$cf_cv_have_tcgetattr" = yes && AC_DEFINE(HAVE_TCGETATTR) +])dnl +dnl --------------------------------------------------------------------------- +dnl Check for vsscanf() function, which is in c9x but generally not in earlier +dnl versions of C. It is in the GNU C library, and can often be simulated by +dnl other functions. +AC_DEFUN([CF_FUNC_VSSCANF], +[ +AC_CACHE_CHECK(for vsscanf function or workaround,cf_cv_func_vsscanf,[ +AC_TRY_LINK([ +#include +#include ],[ + va_list ap; + vsscanf("from", "%d", ap)],[cf_cv_func_vsscanf=vsscanf],[ +AC_TRY_LINK([ +#include +#include ],[ + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (vfscanf(&strbuf, "%d", ap))],[cf_cv_func_vsscanf=vfscanf],[ +AC_TRY_LINK([ +#include +#include ],[ + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (_doscan(&strbuf, "%d", ap))],[cf_cv_func_vsscanf=_doscan],[ +cf_cv_func_vsscanf=no])])])]) + +case $cf_cv_func_vsscanf in #(vi +vsscanf) AC_DEFINE(HAVE_VSSCANF);; #(vi +vfscanf) AC_DEFINE(HAVE_VFSCANF);; #(vi +_doscan) AC_DEFINE(HAVE__DOSCAN);; +esac + +])dnl +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 + scanf|printf) + cat >conftest.h <conftest.h <>confdefs.h +# else +# sed -e 's/__attr.*/\/*nothing*\//' conftest.h >>confdefs.h + fi + done +else + fgrep define conftest.i >>confdefs.h +fi +rm -rf conftest* +fi +])dnl +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) +dnl -pedantic +dnl +AC_DEFUN([CF_GCC_WARNINGS], +[ +if test "$GCC" = yes +then + cat > conftest.$ac_ext <>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 -f conftest* +])dnl +dnl --------------------------------------------------------------------------- +dnl Verify Version of GNAT. +AC_DEFUN([CF_GNAT_VERSION], +[ +cf_cv_gnat_version=`$cf_ada_make -v 2>&1 | grep '[[0-9]].[[0-9]][[0-9]]*' |\ + sed -e 's/[[^0-9 \.]]//g' | $AWK '{print $[1];}'` +case $cf_cv_gnat_version in + 3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) + cf_cv_prog_gnat_correct=yes + ;; + *) echo Unsupported GNAT version $cf_cv_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. + cf_cv_prog_gnat_correct=no + ;; +esac +case $cf_cv_gnat_version in + 3.1*|[[4-9]].*) + cf_compile_generics=generics + cf_generic_objects="\$(GENOBJS)" + ;; + *) cf_compile_generics= + cf_generic_objects= + ;; +esac +]) +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 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 +dnl configure, but won't be able to build the c++ demo program. +AC_DEFUN([CF_GPP_LIBRARY], +[ +cf_cxx_library=unknown +case $cf_cv_system_name in #(vi +os2*) #(vi + cf_gpp_libname=gpp + ;; +*) + cf_gpp_libname=g++ + ;; +esac +if test "$ac_cv_prog_gxx" = yes; then + AC_MSG_CHECKING([for lib$cf_gpp_libname]) + cf_save="$LIBS" + 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 + CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + if test "$cf_gpp_libname" = cpp ; then + AC_DEFINE(HAVE_GPP_BUILTIN_H) + else + AC_DEFINE(HAVE_GXX_BUILTIN_H) + fi], + [AC_TRY_LINK([ +#include + ], + [two_arg_error_handler_t foo2 = lib_error_handler], + [cf_cxx_library=yes + CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + AC_DEFINE(HAVE_BUILTIN_H)], + [cf_cxx_library=no])]) + LIBS="$cf_save" + AC_MSG_RESULT($cf_cxx_library) +fi +])dnl +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 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 Check if we have either a function or macro for 'isascii()'. +AC_DEFUN([CF_ISASCII], +[ +AC_MSG_CHECKING(for isascii) +AC_CACHE_VAL(cf_cv_have_isascii,[ + AC_TRY_LINK([#include ],[int x = isascii(' ')], + [cf_cv_have_isascii=yes], + [cf_cv_have_isascii=no]) +])dnl +AC_MSG_RESULT($cf_cv_have_isascii) +test "$cf_cv_have_isascii" = yes && AC_DEFINE(HAVE_ISASCII) +])dnl +dnl --------------------------------------------------------------------------- +dnl Check for libutf8 +AC_DEFUN([CF_LIBUTF8], +[ +AC_CACHE_CHECK(for putwc in libutf8,cf_cv_libutf8,[ + cf_save_LIBS="$LIBS" + LIBS="-lutf8 $LIBS" +AC_TRY_LINK([ +#include ],[putwc(0,0);], + [cf_cv_libutf8=yes], + [cf_cv_libutf8=no]) + LIBS="$cf_save_LIBS" +]) + +if test "$cf_cv_libutf8" = yes ; then + AC_DEFINE(HAVE_LIBUTF8_H) + LIBS="-lutf8 $LIBS" +fi +])dnl +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 + OS/2*) LIB_PREFIX='' ;; + os2*) LIB_PREFIX='' ;; + *) LIB_PREFIX='lib' ;; + esac +ifelse($1,,,[$1=$LIB_PREFIX]) + AC_SUBST(LIB_PREFIX) +])dnl +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 +dnl subdirectory is a library-source directory, modify the LIBRARIES list in +dnl the corresponding makefile to list the models that we'll generate. +dnl +dnl For shared libraries, make a list of symbolic links to construct when +dnl generating each library. The convention used for Linux is the simplest +dnl one: +dnl lib.so -> +dnl lib.so. -> +dnl lib.so.. +AC_DEFUN([CF_LIB_RULES], +[ +CF_LIB_PREFIX(cf_prefix) +AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) +for cf_dir in $SRC_SUBDIRS +do + if test -f $srcdir/$cf_dir/modules; then + + IMPORT_LIB= + SHARED_LIB= + LIBS_TO_MAKE= + for cf_item in $CF_LIST_MODELS + do + CF_LIB_SUFFIX($cf_item,cf_suffix) + if test $cf_item = shared ; then + if test "$cf_cv_do_symlinks" = yes ; then + case "$cf_cv_shlib_version" in #(vi + rel) #(vi + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(REL_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; + esac + ;; + abi) + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(ABI_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;; + esac + ;; + esac + fi + # cygwin needs import library, and has unique naming convention + if test $cf_cv_shlib_version = cygdll ; then + SHARED_LIB="../lib/${cf_prefix}${cf_dir}\$(ABI_VERSION).dll" + IMPORT_LIB="../lib/${cf_prefix}${cf_dir}.dll.a" + LIBS_TO_MAKE="$LIBS_TO_MAKE \$(SHARED_LIB) \$(IMPORT_LIB)" + continue + fi + fi + LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/${cf_prefix}${cf_dir}${cf_suffix}" + done + + if test $cf_dir = ncurses ; then + cf_subsets="$LIB_SUBSETS" + case "$LIB_SUBSETS" in #(vi + termlib+*) #(vi + ;; + *) #(vi + cf_item=`echo $LIBS_TO_MAKE |sed -e s/$LIB_NAME/$TINFO_NAME/g` + LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE" + ;; + esac + else + cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib //'` + fi + + sed -e "s%@LIBS_TO_MAKE@%$LIBS_TO_MAKE%" \ + -e "s%@IMPORT_LIB@%$IMPORT_LIB%" \ + -e "s%@SHARED_LIB@%$SHARED_LIB%" \ + $cf_dir/Makefile >$cf_dir/Makefile.out + mv $cf_dir/Makefile.out $cf_dir/Makefile + + $AWK -f $srcdir/mk-0th.awk \ + libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" \ + $srcdir/$cf_dir/modules >>$cf_dir/Makefile + + for cf_subset in $cf_subsets + do + cf_subdirs= + for cf_item in $CF_LIST_MODELS + do + echo "Appending rules for ${cf_item} model (${cf_dir}: ${cf_subset})" + CF_UPPER(CF_ITEM,$cf_item) + CF_LIB_SUFFIX($cf_item,cf_suffix) + CF_OBJ_SUBDIR($cf_item,cf_subdir) + + # These dependencies really are for development, not + # builds, but they are useful in porting, too. + cf_depend="../include/ncurses_cfg.h" + if test "$srcdir" = "."; then + cf_reldir="." + else + cf_reldir="\$(srcdir)" + fi + + if test -f $srcdir/$cf_dir/$cf_dir.priv.h; then + cf_depend="$cf_depend $cf_reldir/$cf_dir.priv.h" + elif test -f $srcdir/$cf_dir/curses.priv.h; then + cf_depend="$cf_depend $cf_reldir/curses.priv.h" + fi + + $AWK -f $srcdir/mk-1st.awk \ + name=$cf_dir \ + traces=$LIB_TRACING \ + MODEL=$CF_ITEM \ + model=$cf_subdir \ + prefix=$cf_prefix \ + suffix=$cf_suffix \ + subset=$cf_subset \ + ShlibVer=$cf_cv_shlib_version \ + ShlibVerInfix=$cf_cv_shlib_version_infix \ + DoLinks=$cf_cv_do_symlinks \ + rmSoLocs=$cf_cv_rm_so_locs \ + ldconfig="$LDCONFIG" \ + overwrite=$WITH_OVERWRITE \ + depend="$cf_depend" \ + target="$target" \ + $srcdir/$cf_dir/modules >>$cf_dir/Makefile + for cf_subdir2 in $cf_subdirs lib + do + test $cf_subdir = $cf_subdir2 && break + done + test "${cf_subset}.${cf_subdir2}" != "${cf_subset}.${cf_subdir}" && \ + $AWK -f $srcdir/mk-2nd.awk \ + name=$cf_dir \ + traces=$LIB_TRACING \ + MODEL=$CF_ITEM \ + model=$cf_subdir \ + subset=$cf_subset \ + srcdir=$srcdir \ + echo=$WITH_ECHO \ + $srcdir/$cf_dir/modules >>$cf_dir/Makefile + cf_subdirs="$cf_subdirs $cf_subdir" + done + done + fi + + echo ' cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) [$]@' >>Makefile +done + +for cf_dir in $SRC_SUBDIRS +do + if test -f $cf_dir/Makefile ; then + case "$cf_dir" in + Ada95) #(vi + echo 'libs \' >> Makefile + echo 'install.libs \' >> Makefile + echo 'uninstall.libs ::' >> Makefile + echo ' cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) [$]@' >> Makefile + ;; + esac + fi + + if test -f $srcdir/$cf_dir/modules; then + echo >> Makefile + if test -f $srcdir/$cf_dir/headers; then +cat >> Makefile <> Makefile +fi +cat >> Makefile <> Makefile <> Makefile <> Makefile <headers.sh <>headers.sh </<\$END\/\$NAME>/" >> \$TMPSED + done + ;; +*) + echo "" >> \$TMPSED + ;; +esac +CF_EOF +else + cat >>headers.sh <//" >> \$TMPSED + NAME=ncurses.h + fi + echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED + done + ;; +*) + echo "s///" >> \$TMPSED + ;; +esac +CF_EOF +fi +cat >>headers.sh < \$TMPSRC +NAME=\`basename \$SRC\` +CF_EOF +if test $WITH_CURSES_H != yes; then + cat >>headers.sh <>headers.sh <>$cf_dir/Makefile <>$cf_dir/Makefile + j=$i + done + echo " $j" >>$cf_dir/Makefile + for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"` + do + echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(DESTDIR)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile + test $i = curses.h && test $WITH_CURSES_H = yes && echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile + done + + cat >>$cf_dir/Makefile <>$cf_dir/Makefile + test $i = curses.h && echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile + done + fi + + if test -f $srcdir/$cf_dir/modules; then + if test "$cf_dir" != "c++" ; then + cat >>$cf_dir/Makefile <<"CF_EOF" +depend : $(AUTO_SRC) + makedepend -- $(CPPFLAGS) -- $(C_SRC) + +# DO NOT DELETE THIS LINE -- make depend depends on it. +CF_EOF + fi + fi +done + +])dnl +dnl --------------------------------------------------------------------------- +dnl Compute the library file-suffix 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_SUFFIX], +[ + AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) + case $1 in + libtool) $2='.la' ;; + normal) $2='.a' ;; + debug) $2='_g.a' ;; + profile) $2='_p.a' ;; + shared) + case $cf_cv_system_name in + cygwin*) $2='.dll' ;; + darwin*) $2='.dylib' ;; + hpux*) $2='.sl' ;; + *) $2='.so' ;; + esac + esac + test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" +])dnl +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 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 <&5 1>/dev/null + fi + rm -f conftest.$ac_ext data.o + cat >conftest.$ac_ext <&5 1>/dev/null + fi + rm -f conftest.$ac_ext func.o + ( eval $ac_cv_prog_RANLIB conftest.a ) 2>&5 >/dev/null + cf_saveLIBS="$LIBS" + LIBS="conftest.a $LIBS" + AC_TRY_RUN([ + int main() + { + extern int testfunc(); + exit (!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 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 "$ac_cv_prog_cc_cross" = 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 + exit (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 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` + 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 no match "$cf_result" + ;; + esac + done + rm -f cf_makeflags.tmp +]) + +AC_SUBST(cf_cv_makeflags) +])dnl +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) + +if test "$cf_cv_mixedcase" = yes ; then + AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no) +else + MAKE_UPPER_TAGS=no +fi + +if test "$MAKE_UPPER_TAGS" = yes ; then + MAKE_UPPER_TAGS= +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(MAKE_LOWER_TAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl Option to allow user to override automatic configuration of manpage format. +dnl There are several special cases. +AC_DEFUN([CF_MANPAGE_FORMAT], +[ +AC_REQUIRE([CF_PATHSEP]) +AC_MSG_CHECKING(format of man-pages) + +AC_ARG_WITH(manpage-format, + [ --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and + optionally formatted, e.g., gzip,formatted], + [MANPAGE_FORMAT=$withval], + [MANPAGE_FORMAT=unknown]) + +case ".$MANPAGE_FORMAT" in +.gzip|.compress|.BSDI|.normal|.formatted) # (vi + ;; +.unknown|.) # (vi + if test -z "$MANPATH" ; then + MANPATH="/usr/man:/usr/share/man" + fi + # look for the 'date' man-page (it's most likely to be installed!) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" + MANPAGE_FORMAT=unknown + for cf_dir in $MANPATH; do + test -z "$cf_dir" && cf_dir=/usr/man + for cf_name in $cf_dir/*/date.[[01]]* $cf_dir/*/date + do + cf_test=`echo $cf_name | sed -e 's/*//'` + if test "x$cf_test" = "x$cf_name" ; then + case "$cf_name" in + *.gz) MANPAGE_FORMAT=gzip;; + *.Z) MANPAGE_FORMAT=compress;; + *.0) MANPAGE_FORMAT=BSDI,formatted;; + *) MANPAGE_FORMAT=normal;; + esac + break + fi + done + if test "$MANPAGE_FORMAT" != "unknown" ; then + break + fi + done + IFS="$ac_save_ifs" + ;; +.*) # (vi + AC_MSG_WARN(Unexpected manpage-format) + ;; +esac + +AC_MSG_RESULT($MANPAGE_FORMAT) +])dnl +dnl --------------------------------------------------------------------------- +dnl The Debian people have their own naming convention for manpages. This +dnl option lets us override the name of the file containing renaming, or +dnl disable it altogether. +AC_DEFUN([CF_MANPAGE_RENAMES], +[ +AC_MSG_CHECKING(for manpage renaming) + +AC_ARG_WITH(manpage-renames, + [ --with-manpage-renames specify manpage-renaming], + [MANPAGE_RENAMES=$withval], + [MANPAGE_RENAMES=yes]) + +case ".$MANPAGE_RENAMES" in #(vi +.no) #(vi + ;; +.|.yes) + # Debian 'man' program? + if test -f /etc/debian_version ; then + MANPAGE_RENAMES=`cd $srcdir && pwd`/man/man_db.renames + else + MANPAGE_RENAMES=no + fi + ;; +esac + +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 + AC_MSG_ERROR(not a filename: $MANPAGE_RENAMES) + fi + + test ! -d man && mkdir man + + # Construct a sed-script to perform renaming within man-pages + if test -n "$MANPAGE_RENAMES" ; then + test ! -d man && mkdir man + sh $srcdir/man/make_sed.sh $MANPAGE_RENAMES >man/edit_man.sed + fi +fi + +AC_MSG_RESULT($MANPAGE_RENAMES) +AC_SUBST(MANPAGE_RENAMES) +])dnl +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 +dnl of 'man', and is optional. +AC_DEFUN([CF_MANPAGE_SYMLINKS], +[ +AC_MSG_CHECKING(for manpage symlinks) + +AC_ARG_WITH(manpage-symlinks, + [ --with-manpage-symlinks specify manpage-symlinks], + [MANPAGE_SYMLINKS=$withval], + [MANPAGE_SYMLINKS=yes]) + +AC_MSG_RESULT($MANPAGE_SYMLINKS) +])dnl +dnl --------------------------------------------------------------------------- +dnl This option causes manpages to be run through tbl(1) to generate tables +dnl correctly. +AC_DEFUN([CF_MANPAGE_TBL], +[ +AC_MSG_CHECKING(for manpage tbl) + +AC_ARG_WITH(manpage-tbl, + [ --with-manpage-tbl specify manpage processing with tbl], + [MANPAGE_TBL=$withval], + [MANPAGE_TBL=no]) + +AC_MSG_RESULT($MANPAGE_TBL) +])dnl +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 +dnl will install man-pages. +AC_DEFUN([CF_MAN_PAGES], +[ +CF_HELP_MESSAGE(Options to Specify How Manpages are Installed:) +CF_MANPAGE_FORMAT +CF_MANPAGE_RENAMES +CF_MANPAGE_SYMLINKS +CF_MANPAGE_TBL + + if test "$prefix" = "NONE" ; then + cf_prefix="$ac_default_prefix" + else + cf_prefix="$prefix" + fi + + case "$MANPAGE_FORMAT" in # (vi + *formatted*) # (vi + cf_subdir='$mandir/cat' + cf_format=yes + ;; + *) + cf_subdir='$mandir/man' + cf_format=no + ;; + esac + +test ! -d man && mkdir man +cat >man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <\$TMP +CF_EOF +else +cat >>man/edit_man.sh <\$TMP +CF_EOF +fi +if test $MANPAGE_TBL = yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi +if test $with_curses_h != yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi +if test $cf_format = yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi +case "$MANPAGE_FORMAT" in #(vi +*compress*) #(vi +cat >>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh < + #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,,[ + LIBS="$LIBS -lm" +],[$1=-lm]) +fi +]) +dnl --------------------------------------------------------------------------- +dnl Check if mbstate_t is declared, and if so, which header file. +AC_DEFUN([CF_MBSTATE_T], +[ +# This is needed on Tru64 5.0 to declare mbstate_t +AC_CACHE_CHECK(if we must include wchar.h to declare mbstate_t,cf_cv_mbstate_t,[ +AC_TRY_COMPILE([ +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif], + [mbstate_t state], + [cf_cv_mbstate_t=no], + [AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif], + [mbstate_t value], + [cf_cv_mbstate_t=yes], + [cf_cv_mbstate_t=unknown])])]) + +if test "$cf_cv_mbstate_t" = yes ; then + AC_DEFINE(NEED_WCHAR_H) +fi + +if test "$cf_cv_mbstate_t" != unknown ; then + AC_DEFINE(HAVE_MBSTATE_T) +fi +])dnl +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,[ + 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 +]) +test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) +])dnl +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* +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; + exit(result); +} +],[cf_cv_func_mkstemp=yes +],[cf_cv_func_mkstemp=no +],[AC_CHECK_FUNC(mkstemp) +]) +]) +if test "$cf_cv_func_mkstemp" = yes ; then + AC_DEFINE(HAVE_MKSTEMP) +fi +])dnl +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 Provide a value for the $PATH and similar separator +AC_DEFUN([CF_PATHSEP], +[ + case $cf_cv_system_name in + os2*) PATHSEP=';' ;; + *) PATHSEP=':' ;; + esac +ifelse($1,,,[$1=$PATHSEP]) + AC_SUBST(PATHSEP) +])dnl +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],[ +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%$ac_default_prefix%` + ;; + esac + ;; #(vi +.NONE/*) + $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%` + ;; +*) + ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2) + ;; +esac +])dnl +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]) +PROG_EXT= +case $cf_cv_system_name in +os2*) + # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@ + CFLAGS="$CFLAGS -Zmt" + CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" + CXXFLAGS="$CXXFLAGS -Zmt" + LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"` + PROG_EXT=".exe" + ;; +cygwin*) + PROG_EXT=".exe" + ;; +esac +AC_SUBST(PROG_EXT) +test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") +])dnl +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 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"])])]) +]) +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 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]) + LOCAL_LDFLAGS= + LOCAL_LDFLAGS2= + LD_SHARED_OPTS= + INSTALL_LIB="-m 644" + + cf_cv_do_symlinks=no + + 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_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 + beos*) + MK_SHARED_LIB='$(CC) -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0' + ;; + cygwin*) + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared -Wl,--out-implib=$(IMPORT_LIB) -Wl,--export-all-symbols -o $(SHARED_LIB)' + cf_cv_shlib_version=cygdll + cf_cv_shlib_version_infix=cygdll + ;; + darwin*) + EXTRA_CFLAGS="-no-cpp-precomp" + CC_SHARED_OPTS="-dynamic" + MK_SHARED_LIB='$(CC) -dynamiclib -install_name $(DESTDIR)$(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 + ;; + hpux*) + # (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*) + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" + fi + # tested with IRIX 5.2 and 'cc'. + if test "$GCC" != yes; then + CC_SHARED_OPTS='-KPIC' + fi + MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $[@]` -o $[@]' + cf_cv_rm_so_locs=yes + ;; + linux*|gnu*) + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" + fi + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION),-stats,-lc -o $[@]' + ;; + openbsd2*) + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + MK_SHARED_LIB='$(LD) -Bshareable -soname,`basename $[@].$(ABI_VERSION)` -o $[@]' + ;; + openbsd*|freebsd*) + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + MK_SHARED_LIB='$(LD) -Bshareable -o $[@]' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + ;; + netbsd*) + 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,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" + MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]' + if test "$cf_cv_shlib_version" = auto; then + if test ! -f /usr/libexec/ld.elf_so; then + cf_cv_shlib_version=rel + fi + fi + else + MK_SHARED_LIB='$(LD) -Bshareable -o $[@]' + fi + ;; + 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 + 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,`pwd`/lib" + 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 + # tested with osr5.0.5 + if test "$ac_cv_prog_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 + # 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*) + # tested with SunOS 4.1.1 and gcc 2.7.0 + if test "$ac_cv_prog_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*) + # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 + if test "$ac_cv_prog_gcc" != yes; then + CC_SHARED_OPTS='-KPIC' + fi + MK_SHARED_LIB='$(LD) -dy -G -h `basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]' + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-R `pwd`/lib:\$(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" + fi + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + ;; + sysv5uw7*|unix_sv*) + # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) + if test "$ac_cv_prog_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 $[@]') + 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 + 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_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 Check for definitions & structures needed for window size-changing +dnl FIXME: check that this works with "snake" (HP-UX 10.x) +AC_DEFUN([CF_SIZECHANGE], +[ +AC_REQUIRE([CF_STRUCT_TERMIOS]) +AC_CACHE_CHECK(declaration of size-change, cf_cv_sizechange,[ + cf_cv_sizechange=unknown + cf_save_CPPFLAGS="$CPPFLAGS" + +for cf_opts in "" "NEED_PTEM_H" +do + + CPPFLAGS="$cf_save_CPPFLAGS" + test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts" + AC_TRY_COMPILE([#include +#ifdef HAVE_TERMIOS_H +#include +#else +#ifdef HAVE_TERMIO_H +#include +#endif +#endif +#ifdef NEED_PTEM_H +/* This is a workaround for SCO: they neglected to define struct winsize in + * termios.h -- it's only in termio.h and ptem.h + */ +#include +#include +#endif +#if !defined(sun) || !defined(HAVE_TERMIOS_H) +#include +#endif +],[ +#ifdef TIOCGSIZE + struct ttysize win; /* FIXME: what system is this? */ + int y = win.ts_lines; + int x = win.ts_cols; +#else +#ifdef TIOCGWINSZ + struct winsize win; + int y = win.ws_row; + int x = win.ws_col; +#else + no TIOCGSIZE or TIOCGWINSZ +#endif /* TIOCGWINSZ */ +#endif /* TIOCGSIZE */ + ], + [cf_cv_sizechange=yes], + [cf_cv_sizechange=no]) + + CPPFLAGS="$cf_save_CPPFLAGS" + if test "$cf_cv_sizechange" = yes ; then + echo "size-change succeeded ($cf_opts)" >&AC_FD_CC + test -n "$cf_opts" && cf_cv_sizechange="$cf_opts" + break + fi +done +]) +if test "$cf_cv_sizechange" != no ; then + AC_DEFINE(HAVE_SIZECHANGE) + case $cf_cv_sizechange in #(vi + NEED*) + AC_DEFINE_UNQUOTED($cf_cv_sizechange ) + ;; + esac +fi +])dnl +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 +dnl use in CF_LIB_RULES. +dnl +dnl This uses the configured value to make the lists SRC_SUBDIRS and +dnl SUB_MAKEFILES which are used in the makefile-generation scheme. +AC_DEFUN([CF_SRC_MODULES], +[ +AC_MSG_CHECKING(for src modules) + +# dependencies and linker-arguments for test-programs +TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX} $TEST_DEPS" +if test "$DFT_LWR_MODEL" = "libtool"; then + TEST_ARGS="${TEST_DEPS}" +else + TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS" +fi + +# dependencies and linker-arguments for utility-programs +PROG_ARGS="$TEST_ARGS" + +cf_cv_src_modules= +for cf_dir in $1 +do + if test -f $srcdir/$cf_dir/modules; then + + # We may/may not have tack in the distribution, though the + # makefile is. + if test $cf_dir = tack ; then + if test ! -f $srcdir/${cf_dir}/${cf_dir}.h; then + continue + fi + fi + + if test -z "$cf_cv_src_modules"; then + cf_cv_src_modules=$cf_dir + else + cf_cv_src_modules="$cf_cv_src_modules $cf_dir" + fi + + # Make the ncurses_cfg.h file record the library interface files as + # well. These are header files that are the same name as their + # directory. Ncurses is the only library that does not follow + # that pattern. + if test $cf_dir = tack ; then + continue + elif test -f $srcdir/${cf_dir}/${cf_dir}.h; then + CF_UPPER(cf_have_include,$cf_dir) + AC_DEFINE_UNQUOTED(HAVE_${cf_have_include}_H) + AC_DEFINE_UNQUOTED(HAVE_LIB${cf_have_include}) + TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${cf_dir}${DFT_DEP_SUFFIX} $TEST_DEPS" + if test "$DFT_LWR_MODEL" = "libtool"; then + TEST_ARGS="${TEST_DEPS}" + else + TEST_ARGS="-l${cf_dir}${DFT_ARG_SUFFIX} $TEST_ARGS" + fi + fi + fi +done +AC_MSG_RESULT($cf_cv_src_modules) +TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" +AC_SUBST(TEST_DEPS) +AC_SUBST(TEST_ARGS) + +PROG_ARGS="-L${LIB_DIR} $PROG_ARGS" +AC_SUBST(PROG_ARGS) + +SRC_SUBDIRS="man include" +for cf_dir in $cf_cv_src_modules +do + SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" +done +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 samples" +fi + +SUB_MAKEFILES= +for cf_dir in $SRC_SUBDIRS +do + SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile" +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) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl Check for -lstdc++, which is GNU's standard C++ library. +AC_DEFUN([CF_STDCPP_LIBRARY], +[ +if test -n "$GXX" ; then +case $cf_cv_system_name in #(vi +os2*) #(vi + cf_stdcpp_libname=stdcpp + ;; +*) + cf_stdcpp_libname=stdc++ + ;; +esac +AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[ + cf_save="$LIBS" + LIBS="$LIBS -l$cf_stdcpp_libname" +AC_TRY_LINK([ +#include ],[ +char buf[80]; +strstreambuf foo(buf, sizeof(buf)) +], + [cf_cv_libstdcpp=yes], + [cf_cv_libstdcpp=no]) + LIBS="$cf_save" +]) +test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +fi +])dnl +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 Check if we need _POSIX_SOURCE defined to use struct sigaction. We'll only +dnl do this if we've found the sigaction function. +dnl +dnl If needed, define SVR4_ACTION. +AC_DEFUN([CF_STRUCT_SIGACTION],[ +if test "$ac_cv_func_sigaction" = yes; then +AC_MSG_CHECKING(whether sigaction needs _POSIX_SOURCE) +AC_TRY_COMPILE([ +#include +#include ], + [struct sigaction act], + [sigact_bad=no], + [ +AC_TRY_COMPILE([ +#define _POSIX_SOURCE +#include +#include ], + [struct sigaction act], + [sigact_bad=yes + AC_DEFINE(SVR4_ACTION)], + [sigact_bad=unknown])]) +AC_MSG_RESULT($sigact_bad) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl Some machines require _POSIX_SOURCE to completely define struct termios. +dnl If so, define SVR4_TERMIO +AC_DEFUN([CF_STRUCT_TERMIOS],[ +AC_CHECK_HEADERS( \ +termio.h \ +termios.h \ +unistd.h \ +) +if test "$ISC" = yes ; then + AC_CHECK_HEADERS( sys/termio.h ) +fi +if test "$ac_cv_header_termios_h" = yes ; then + case "$CFLAGS $CPPFLAGS" in + *-D_POSIX_SOURCE*) + termios_bad=dunno ;; + *) termios_bad=maybe ;; + esac + if test "$termios_bad" = maybe ; then + AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE) + AC_TRY_COMPILE([#include ], + [struct termios foo; int x = foo.c_iflag], + termios_bad=no, [ + AC_TRY_COMPILE([ +#define _POSIX_SOURCE +#include ], + [struct termios foo; int x = foo.c_iflag], + termios_bad=unknown, + termios_bad=yes AC_DEFINE(SVR4_TERMIO)) + ]) + AC_MSG_RESULT($termios_bad) + fi +fi +])dnl +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)) +test -z "[$]$2" && $2=$3 +AC_MSG_RESULT([$]$2) +AC_SUBST($2) +cf_cv_subst_$2=[$]$2]) +$2=${cf_cv_subst_$2} +])dnl +dnl --------------------------------------------------------------------------- +dnl Get the version-number for use in shared-library naming, etc. +AC_DEFUN([CF_SUBST_NCURSES_VERSION], +[ +NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0-9]]*//'`" +NCURSES_MINOR="`egrep '^NCURSES_MINOR[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0-9]]*//'`" +NCURSES_PATCH="`egrep '^NCURSES_PATCH[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0-9]]*//'`" +cf_cv_abi_version=${NCURSES_MAJOR} +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) +AC_SUBST(cf_cv_cc_bool_type) +AC_SUBST(cf_cv_builtin_bool) +AC_SUBST(cf_cv_header_stdbool_h) +AC_SUBST(cf_cv_type_of_bool)dnl +])dnl +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 Determine the type we should use for chtype (and attr_t, which is treated +dnl as the same thing). We want around 32 bits, so on most machines want a +dnl long, but on newer 64-bit machines, probably want an int. If we're using +dnl wide characters, we have to have a type compatible with that, as well. +AC_DEFUN([CF_TYPEOF_CHTYPE], +[ +AC_REQUIRE([CF_UNSIGNED_LITERALS]) +AC_MSG_CHECKING([for type of chtype]) +AC_CACHE_VAL(cf_cv_typeof_chtype,[ + AC_TRY_RUN([ +#ifdef USE_WIDEC_SUPPORT +#include /* we want wchar_t */ +#define WANT_BITS 39 +#else +#define WANT_BITS 31 +#endif +#include +int main() +{ + FILE *fp = fopen("cf_test.out", "w"); + if (fp != 0) { + char *result = "long"; +#ifdef USE_WIDEC_SUPPORT + /* + * If wchar_t is smaller than a long, it must be an int or a + * short. We prefer not to use a short anyway. + */ + if (sizeof(unsigned long) > sizeof(wchar_t)) + result = "int"; +#endif + if (sizeof(unsigned long) > sizeof(unsigned int)) { + int n; + unsigned int x; + for (n = 0; n < WANT_BITS; n++) { + unsigned int y = (x >> n); + if (y != 1 || x == 0) { + x = 0; + break; + } + } + /* + * If x is nonzero, an int is big enough for the bits + * that we want. + */ + result = (x != 0) ? "int" : "long"; + } + fputs(result, fp); + fclose(fp); + } + exit(0); +} + ], + [cf_cv_typeof_chtype=`cat cf_test.out`], + [cf_cv_typeof_chtype=long], + [cf_cv_typeof_chtype=long]) + rm -f cf_test.out + ]) +AC_MSG_RESULT($cf_cv_typeof_chtype) + +AC_SUBST(cf_cv_typeof_chtype) +AC_DEFINE_UNQUOTED(TYPEOF_CHTYPE,$cf_cv_typeof_chtype) + +cf_cv_1UL="1" +test "$cf_cv_unsigned_literals" = yes && cf_cv_1UL="${cf_cv_1UL}U" +test "$cf_cv_typeof_chtype" = long && cf_cv_1UL="${cf_cv_1UL}L" +AC_SUBST(cf_cv_1UL) + +])dnl +dnl --------------------------------------------------------------------------- +dnl +AC_DEFUN([CF_TYPE_SIGACTION], +[ +AC_MSG_CHECKING([for type sigaction_t]) +AC_CACHE_VAL(cf_cv_type_sigaction,[ + AC_TRY_COMPILE([ +#include ], + [sigaction_t x], + [cf_cv_type_sigaction=yes], + [cf_cv_type_sigaction=no])]) +AC_MSG_RESULT($cf_cv_type_sigaction) +test "$cf_cv_type_sigaction" = yes && AC_DEFINE(HAVE_TYPE_SIGACTION) +])dnl +dnl --------------------------------------------------------------------------- +dnl Test if the compiler supports 'U' and 'L' suffixes. Only old compilers +dnl won't, but they're still there. +AC_DEFUN([CF_UNSIGNED_LITERALS], +[ +AC_MSG_CHECKING([if unsigned literals are legal]) +AC_CACHE_VAL(cf_cv_unsigned_literals,[ + AC_TRY_COMPILE([],[long x = 1L + 1UL + 1U + 1], + [cf_cv_unsigned_literals=yes], + [cf_cv_unsigned_literals=no]) + ]) +AC_MSG_RESULT($cf_cv_unsigned_literals) +])dnl +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 Use AC_VERBOSE w/o the warnings +AC_DEFUN([CF_VERBOSE], +[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG +])dnl +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 +CF_PATH_SYNTAX(withval) +eval $3="$withval" +AC_SUBST($3)dnl +])dnl +dnl --------------------------------------------------------------------------- +dnl Process an option specifying a list of colon-separated paths. +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 $6 = flag to tell if we want to define or substitute +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 + +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +cf_dst_path= +for cf_src_path in $withval +do + CF_PATH_SYNTAX(cf_src_path) + test -n "$cf_dst_path" && cf_dst_path="${cf_dst_path}:" + cf_dst_path="${cf_dst_path}${cf_src_path}" +done +IFS="$ac_save_ifs" + +ifelse($6,define,[ +# Strip single quotes from the value, e.g., when it was supplied as a literal +# for $4 or $5. +case $cf_dst_path in #(vi +\'*) + cf_dst_path=`echo $cf_dst_path |sed -e s/\'// -e s/\'\$//` + ;; +esac +cf_dst_path=`echo "$cf_dst_path" | sed -e 's/\\\\/\\\\\\\\/g'` +]) + +eval '$3="$cf_dst_path"' +AC_SUBST($3)dnl + +])dnl diff --git a/ncurses-5.3/announce.html.in b/ncurses-5.3/announce.html.in new file mode 100644 index 0000000..4813cee --- /dev/null +++ b/ncurses-5.3/announce.html.in @@ -0,0 +1,436 @@ + + + + +Announcing ncurses @VERSION@ Pre-Release + + + + +

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 is encouraging 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/pub/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 and 5.2; +very few applications will require recompilation, depending on the platform. +These are the highlights from the change-log since ncurses 5.2 release. +

+Interface changes: +

    +
  • change type for bool used in headers to NCURSES_BOOL, + which usually is the same as the compiler's definition for + bool. + +
  • add all but two functions for X/Open curses wide-character support. + These are only available if the library is configured using the + --enable-widec option. Missing functions are +
      +
    • pecho_wchar() +
    • slk_wset() +
    + +
  • add environment variable $NCURSES_ASSUMED_COLORS to + modify the assume_default_colors() extension. + +
+New features and improvements: +
    +
  • Improved support for termcap applications: +
      +
    • add logic to dump_entry.c to remove function-key definitions that do + not fit into the 1023-byte limit for generated termcaps. This makes + hds200 fit. + +
    • modify tgetent() to check if exit_attribute_mode resets the alternate + character set, and if so, attempt to adjust the copy of the termcap + "me" string which it will return to eliminate that part. In + particular, 'screen' would lose track of line-drawing characters. + +
    • add check/fix to comp_parse.c to suppress warning about missing acsc + string. This happens in configurations where raw termcap information + is processed; tic already does this and other checks. + +
    • add tic -A option to suppress capabilities which are commented out + when translating to termcap. + +
    • modify logic in lib_baudrate.c for ospeed, for FreeBSD to make it + work properly for termcap applications (patch by Andrey A Chernov). + +
    + +
  • add a call to _nc_keypad() in keypad() to accommodate applications + such as nvi, which use curses for output but not for input (fixes + Debian #131263, cf: 20011215). + +
  • correct logic for COLORFGBG environment variable: if rxvt is compiled + with xpm support, the variable has three fields, making it slightly + incompatible with itself. In either case, the background color is + the last field. +
+Major bug fixes: +
    +
  • rewrote limit-checks in wscrl() and associated _nc_scroll_window(), + to ensure that if the parameter of wscrl() is larger than the size of + the scrolling region, then the scrolling region will be cleared. + +
  • modify tset to restore original I/O modes if an error is encountered. + Also modify to use buffered stderr consistently rather than mixing + with write(). + +
  • move calls to def_shell_mode() and def_prog_mode() before loop with + callbacks in lib_set_term.c, since the c++ demo otherwise initialized + the tty modes before saving them. + +
  • modified wresize() to ensure that a failed realloc will not corrupt + the window structure, and to make subwindows fit within the resized + window. + +
  • altered resizeterm() to avoid having it fail when a child window + cannot be resized because it would be larger than its parent. + +
  • correct/improve logic to produce an exit status for errors in tput, + which did not exit with an error when told to put a string not in the + current terminfo entry. + +
  • modify behavior of can_clear_with() so that if an application is + running in a non-bce terminals with default colors enabled, it + returns true, allowing the user to select/paste text without picking + up extraneous trailing blanks. + +
  • add a check in relative_move() to guard against buffer overflow in + the overwrite logic. + +
  • add some limit/pointer checks to -S option of tputs. + +
  • modify mvcur() to avoid emitting newline characters when nonl() mode + is set. Normally this is not a problem since the actual terminal + mode is set to suppress nl/crlf translations, however it is useful to + allow the caller to manipulate the terminal mode to avoid staircasing + effects after spawning a process which writes messages (for lynx + 2.8.4). +
+ +Portability: +
    +
  • configure script: +
      +
    • modify check in --disable-overwrite option so that it is used by + default unless the --prefix/$prefix value is not /usr, in attempt to + work around packagers who do not read the INSTALL notes. + +
    • correct a typo in configure --enable-colorfgbg option, and move it + to the experimental section (cf: 20011208). + +
    • modify configure script to allow building with termcap only, or with + fallbacks only. In this case, we do not build tic and toe. + +
    • modify run_tic.sh to check if the build is a cross-compile. In that + case, do not use the build's tic to install the terminfo database. + +
    • modify c++/Makefile.in to accommodate archive programs that are + different for C++ than for C, and add cases for vendor's C++ + compilers on Solaris and IRIX. + +
    • add several configure script options to aid with cross-compiling: + --with-build-cc, --with-build-cflags, --with-build-ldflags, and + --with-build-libs. + +
    • add experimental --with-caps=XXX option to customize to similar + terminfo database formats such as AIX 4.x + +
    • add configure option --with-ospeed to assist packagers in transition + to 5.3 change to ospeed type. +
    + +
  • library: +
      +
    • implement a simple vsscanf() fallback function which uses the %n + conversion to help parse the input data. + +
    • various fixes to build/work with different implementations of + vsscanf(). + +
    • add/use macro to suppress sign-extension of char type on + platforms where this is a problem in ctype macros, e.g., Solaris. + +
    • finish changes needed to build dll's on cygwin. + +
    • add #undef's before possible redefinition of ERR and OK in curses.h +
    + +
  • programs: +
      +
    • modify ifdef's in write_entry.c to allow use of symbolic links on + platforms with no hard links, e.g., BeOS. + +
    • modify _nc_write_entry() to allow for the possibility that linking + aliases on a filesystem that ignores case would not succeed because + the source and destination differ only by case, e.g., NCR260VT300WPP0 + on cygwin. + +
    • modify logic in tic, toe, tput and tset which checks for basename of + argv[0] to work properly on systems such as OS/2 which have + case-independent filenames and/or program suffixes, e.g., ".ext". +
    +
+ +

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, +but not all EXTENDED features). Most EXTENDED-level features not directly +concerned with wide-character support are implemented, including 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 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 16-color terminals, such as aixterm and XFree86 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/CDK.html +
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 +
+www.gnome.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/. +
tin +
newsreader, supporting color, MIME +
+http://www.tin.org. +
taper +
tape archive utility +
+http://members.iinet.net.au/~yusuf/taper/. +
vh-1.6 +
Volks-Hypertext browser for the Jargon File +
+http://www.bg.debian.org/Packages/unstable/text/vh.html. +
+as well as some that use ncurses for the terminfo support alone: +
+
minicom +
terminal emulator +
+http://www.pp.clinet.fi/~walker/minicom.html. +
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

+ +The original developers of ncurses are Zeyd Ben-Halim and +Eric S. Raymond. +Ongoing work is being done by +Thomas Dickey +and +Jürgen Pfeifer. +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.

+ +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. + +

Other Related Resources

+ +The distribution includes and uses a version of the terminfo-format +terminal description file maintained by Eric Raymond. +http://earthspace.net/~esr/terminfo.

+ +You can find lots of information on terminal-related topics +not covered in the terminfo file at +Richard Shuford's +archive. + + + diff --git a/ncurses-5.3/c++/Makefile.in b/ncurses-5.3/c++/Makefile.in new file mode 100644 index 0000000..a6c8577 --- /dev/null +++ b/ncurses-5.3/c++/Makefile.in @@ -0,0 +1,220 @@ +# $Id$ +############################################################################## +# Copyright (c) 1998,1999,2000,2001,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 "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders 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,1997 +# +# Simple makefile for c++ window class demo + +# turn off _all_ suffix rules; we'll generate our own +.SUFFIXES: + +SHELL = /bin/sh + +CF_MFLAGS = @cf_cv_makeflags@ +@SET_MAKE@ +x = @PROG_EXT@ + +MODEL = ../@DFT_OBJ_SUBDIR@ +DESTDIR = @DESTDIR@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ + +LIBTOOL = @LIBTOOL@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +AR = @AR@ +AR_OPTS = @AR_OPTS@ + +CXX_AR = @CXX_AR@ +CXX_AR_OPTS = @CXX_AR_OPTS@ +RANLIB = @RANLIB@ + +CXX = @CXX@ +CPP = @CPP@ +CXXFLAGS = @CXXFLAGS@ +CXXLIBS = @CXXLIBS@ + +INCDIR = ../include +CPPFLAGS = -I../c++ -I$(INCDIR) -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ + +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@ + +LINK = @LINK_PROGS@ $(LIBTOOL) $(CXX) @CXXLDFLAGS@ + +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@ + +LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@LIB_SUFFIX@ + +LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib ../lib/$(LIBNAME) +LINK_NORMAL = $(LINK_FLAGS) +LINK_DEBUG = $(LINK_FLAGS) +LINK_PROFILE = $(LINK_FLAGS) +LINK_SHARED = $(LINK_FLAGS) + +LDFLAGS = @TEST_ARGS@ @LDFLAGS@ \ + @LD_MODEL@ @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ $(CXXLIBS) + +LDFLAGS_LIBTOOL = $(LDFLAGS) +LDFLAGS_NORMAL = $(LDFLAGS) +LDFLAGS_DEBUG = $(LDFLAGS) @CC_G_OPT@ +LDFLAGS_PROFILE = $(LDFLAGS) -pg +LDFLAGS_SHARED = $(LDFLAGS) @LD_SHARED_OPTS@ + +LDFLAGS_DEFAULT = $(LINK_@DFT_UPR_MODEL@) $(LDFLAGS_@DFT_UPR_MODEL@) + +AUTO_SRC = \ + etip.h + +all \ +libs :: $(AUTO_SRC) ../lib/$(LIBNAME) + +all :: demo$x + +sources : $(AUTO_SRC) + +depend : + +# 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_AR_OPTS) $@ $? + $(RANLIB) $@ + +../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS) + cd ../lib && $(LIBTOOL) $(CXX) -o $(LIBNAME) $(LIB_OBJS:.o=.lo) \ + -rpath $(INSTALL_PREFIX)$(libdir) \ + -version-info $(NCURSES_MAJOR):$(NCURSES_MINOR) + +OBJS_DEMO = $(MODEL)/demo.o + +$(MODEL)/demo.o : $(srcdir)/demo.cc \ + $(cursesf_h) $(cursesm_h) $(cursesapp_h) + +demo$x: $(OBJS_DEMO) \ + ../lib/$(LIBNAME) \ + @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) : + sh $(srcdir)/../mkinstalldirs $@ + +install \ +install.libs:: ../lib/$(LIBNAME) $(DESTDIR)$(libdir) + $(LIBTOOL) $(INSTALL) ../lib/$(LIBNAME) $(DESTDIR)$(libdir)/$(LIBNAME) + +uninstall \ +uninstall.libs:: + -$(LIBTOOL) rm -f $(DESTDIR)$(libdir)/$(LIBNAME) + +mostlyclean :: + -rm -f core tags TAGS *~ *.bak *.i *.ii *.ln *.atac trace + +clean :: mostlyclean + -rm -rf $(MODEL)/SunWS_cache + -$(LIBTOOL) rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(LIB_OBJS:.o=.lo) $(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/ncurses-5.3/c++/NEWS b/ncurses-5.3/c++/NEWS new file mode 100644 index 0000000..299292d --- /dev/null +++ b/ncurses-5.3/c++/NEWS @@ -0,0 +1,42 @@ +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/ncurses-5.3/c++/PROBLEMS b/ncurses-5.3/c++/PROBLEMS new file mode 100644 index 0000000..81c1eba --- /dev/null +++ b/ncurses-5.3/c++/PROBLEMS @@ -0,0 +1,5 @@ +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/ncurses-5.3/c++/README-first b/ncurses-5.3/c++/README-first new file mode 100644 index 0000000..747fb1e --- /dev/null +++ b/ncurses-5.3/c++/README-first @@ -0,0 +1,58 @@ + 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 is derived +from the libg++ CursesWindow class but enhanced 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. E.g. you don't 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. + + ATTENTION LINUX USERS: There is currently some discussion of + replacing the BSD curses in the Linux libc with ncurses. If + this is done we could perhaps include these classes in the Linux + libg++ replacing the original CursesWindow class (and renaming it + to CursesWindow). This could be done because NCursesWindow can + be made easily to a superset of the CursesWindow class. + + +Original author: + Eric Newton for FSF's libg++ + +Authors of first ncurses based release (NCursesWindow, NCursesPanel): + Ulrich Drepper + and Anatoly Ivasyuk + +Author of this release: + Juergen Pfeifer http://www.familiepfeifer.de/Contact.aspx?Lang=en diff --git a/ncurses-5.3/c++/cursesapp.cc b/ncurses-5.3/c++/cursesapp.cc new file mode 100644 index 0000000..429002a --- /dev/null +++ b/ncurses-5.3/c++/cursesapp.cc @@ -0,0 +1,147 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,1999,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +#include "internal.h" +#include "cursesapp.h" + +MODULE_ID("$Id$") + +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; + while( (S=top()) ) { + pop(); + delete S; + } + delete Root_Window; + ::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 && top()) + top()->show(); + } + return (slk_stack ? FALSE : TRUE); +} + +Soft_Label_Key_Set* NCursesApplication::top() const { + if (slk_stack) + return slk_stack->SLKs; + else + return (Soft_Label_Key_Set*)0; +} + +int NCursesApplication::operator()(void) { + bool bColors = b_Colors; + Soft_Label_Key_Set* S; + + 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; + if (theApp) + THROW(new NCursesException("Application object already created.")); + else + theApp = this; +} diff --git a/ncurses-5.3/c++/cursesapp.h b/ncurses-5.3/c++/cursesapp.h new file mode 100644 index 0000000..3f63f0c --- /dev/null +++ b/ncurses-5.3/c++/cursesapp.h @@ -0,0 +1,164 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +// $Id$ + +#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); + +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/ncurses-5.3/c++/cursesf.cc b/ncurses-5.3/c++/cursesf.cc new file mode 100644 index 0000000..210cc1c --- /dev/null +++ b/ncurses-5.3/c++/cursesf.cc @@ -0,0 +1,427 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +#include "internal.h" +#include "cursesf.h" +#include "cursesapp.h" + +MODULE_ID("$Id$") + +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,(FIELD**)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 = (FORM*)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,(void*)hook); + + ::set_form_init (form, NCursesForm::frm_init); + ::set_form_term (form, NCursesForm::frm_term); + ::set_field_init (form, NCursesForm::fld_init); + ::set_field_term (form, NCursesForm::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 = (NCursesWindow*)0; + b_sub_owner = FALSE; + } + options_on(O_NL_OVERLOAD); + setDefaultAttributes(); +} + +NCursesForm::~NCursesForm() { + UserHook* hook = (UserHook*)::form_userptr(form); + delete hook; + if (b_sub_owner) { + delete sub; + ::set_form_sub(form,(WINDOW *)0); + } + if (form) { + FIELD** fields = ::form_fields(form); + int cnt = count(); + + OnError(::set_form_fields(form,(FIELD**)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 +NCursesForm::frm_init(FORM *f) { + getHook(f)->On_Form_Init(); +} + +void +NCursesForm::frm_term(FORM *f) { + getHook(f)->On_Form_Termination(); +} + +void +NCursesForm::fld_init(FORM *f) { + NCursesForm* F = getHook(f); + F->On_Field_Init (*(F->current_field ())); +} + +void +NCursesForm::fld_term(FORM *f) { + NCursesForm* F = 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 UserDefinedFieldType::fcheck(FIELD *f, const void *u) { + NCursesFormField* F = (NCursesFormField*)u; + assert(F != 0); + UserDefinedFieldType* udf = (UserDefinedFieldType*)(F->fieldtype()); + assert(udf != 0); + return udf->field_check(*F); +} + +bool UserDefinedFieldType::ccheck(int c, const void *u) { + NCursesFormField* F = (NCursesFormField*)u; + assert(F != 0); + UserDefinedFieldType* udf = + (UserDefinedFieldType*)(F->fieldtype()); + assert(udf != 0); + return udf->char_check(c); +} + +void* UserDefinedFieldType::makearg(va_list* va) { + return va_arg(*va,NCursesFormField*); +} + +FIELDTYPE* UserDefinedFieldType::generic_fieldtype = + ::new_fieldtype(UserDefinedFieldType::fcheck, + UserDefinedFieldType::ccheck); + +FIELDTYPE* UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice = + ::new_fieldtype(UserDefinedFieldType::fcheck, + UserDefinedFieldType::ccheck); + +bool UserDefinedFieldType_With_Choice::next_choice(FIELD *f, const void *u) { + NCursesFormField* F = (NCursesFormField*)u; + assert(F != 0); + UserDefinedFieldType_With_Choice* udf = + (UserDefinedFieldType_With_Choice*)(F->fieldtype()); + assert(udf != 0); + return udf->next(*F); +} + +bool UserDefinedFieldType_With_Choice::prev_choice(FIELD *f, const void *u) { + NCursesFormField* F = (NCursesFormField*)u; + assert(F != 0); + UserDefinedFieldType_With_Choice* udf = + (UserDefinedFieldType_With_Choice*)(F->fieldtype()); + assert(udf != 0); + return udf->previous(*F); +} + +class UDF_Init { +private: + int code; + static UDF_Init* I; +public: + UDF_Init() { + code = ::set_fieldtype_arg(UserDefinedFieldType::generic_fieldtype, + UserDefinedFieldType::makearg, + NULL, + NULL); + if (code==E_OK) + code = ::set_fieldtype_arg + (UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice, + UserDefinedFieldType::makearg, + NULL, + NULL); + if (code==E_OK) + code = ::set_fieldtype_choice + (UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice, + UserDefinedFieldType_With_Choice::next_choice, + UserDefinedFieldType_With_Choice::prev_choice); + } +}; + +UDF_Init* UDF_Init::I = new UDF_Init(); + diff --git a/ncurses-5.3/c++/cursesf.h b/ncurses-5.3/c++/cursesf.h new file mode 100644 index 0000000..2c72740 --- /dev/null +++ b/ncurses-5.3/c++/cursesf.h @@ -0,0 +1,825 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +// $Id$ + +#ifndef NCURSES_CURSESF_H_incl +#define NCURSES_CURSESF_H_incl 1 + +#include +#include + +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((FIELDTYPE*)0) { + } +}; + +// +// ------------------------------------------------------------------------- +// 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((FIELD*)0), ftype((NCursesFieldType*)0) { + } + + // Create a new field + NCursesFormField (int rows, + int cols, + int first_row = 0, + int first_col = 0, + int offscreen_rows = 0, + int additional_buffers = 0) + : ftype((NCursesFieldType*)0) { + field = ::new_field(rows,cols,first_row,first_col, + offscreen_rows, additional_buffers); + if (!field) + OnError(errno); + } + + 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& cols, + int& first_row, int& first_col, + int& offscreen_rows, int& additional_buffers) const { + OnError(::field_info(field, &rows, &cols, + &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 fore) { + OnError(::set_field_fore(field,fore)); + } + + // 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 back) { + OnError(::set_field_back(field,back)); + } + + // 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 pad) { + OnError(::set_field_pad(field,pad)); + } + + // Retrieve the fields padding character + inline int pad() const { + return ::field_pad(field); + } + + // Switch on the fields options + inline void options_on (Field_Options options) { + OnError (::field_opts_on (field, options)); + } + + // Switch off the fields options + inline void options_off (Field_Options options) { + OnError (::field_opts_off (field, options)); + } + + // Retrieve the fields options + inline Field_Options options () const { + return ::field_opts (field); + } + + // Set the fields options + inline void set_options (Field_Options options) { + OnError (::set_field_opts (field, options)); + } + + // 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; + } + +}; + +// +// ------------------------------------------------------------------------- +// 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 = (UserHook*)::form_userptr(f); + assert(hook != 0 && hook->m_owner==f); + return (NCursesForm*)(hook->m_back); + } + + // 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. + static void frm_init(FORM *); + static void frm_term(FORM *); + static void fld_init(FORM *); + static void fld_term(FORM *); + + // Calculate FIELD* array for the menu + FIELD** mapFields(NCursesFormField* nfields[]); + +protected: + // internal routines + inline void set_user(void *user) { + UserHook* uptr = (UserHook*)::form_userptr (form); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); + uptr->m_user = user; + } + + inline void *get_user() { + UserHook* uptr = (UserHook*)::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 lines, + int cols, + int begin_y = 0, + int begin_x = 0) + : NCursesPanel(lines,cols,begin_y,begin_x), + form ((FORM*)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() { + InitForm(Fields, with_frame, autoDelete_Fields); + } + + // Create a form in a panel with the given position and size. + NCursesForm (NCursesFormField* Fields[], + int lines, + int cols, + int begin_y, + int begin_x, + bool with_frame=FALSE, // reserve space for a frame? + bool autoDelete_Fields=FALSE) // do automatic cleanup? + : NCursesPanel(lines, cols, begin_y, begin_x) { + InitForm(Fields, with_frame, autoDelete_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& cols) const { + OnError(::scale_form(form,&rows,&cols)); + } + + // 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 page) { + OnError(::set_form_page(form,page)); + } + + // Retrieve current page number + int page() const { + return ::form_page(form); + } + + // Switch on the forms options + inline void options_on (Form_Options options) { + OnError (::form_opts_on (form, options)); + } + + // Switch off the forms options + inline void options_off (Form_Options options) { + OnError (::form_opts_off (form, options)); + } + + // Retrieve the forms options + inline Form_Options options () const { + return ::form_opts (form); + } + + // Set the forms options + inline void set_options (Form_Options options) { + OnError (::set_form_opts (form, options)); + } + + // 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 cols, + int first_row = 0, + int first_col = 0, + const T* p_UserData = (T*)0, + int offscreen_rows = 0, + int additional_buffers = 0) + : NCursesFormField (rows, cols, + first_row, first_col, + offscreen_rows, additional_buffers) { + if (field) + OnError(::set_field_userptr(field,(void *)p_UserData)); + } + + virtual ~NCursesUserField() {}; + + inline const T* UserData (void) const { + return (const T*)::field_userptr (field); + } + + inline virtual void setUserData(const T* p_UserData) { + if (field) + OnError (::set_field_userptr (field, (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 lines, + int cols, + int begin_y = 0, + int begin_x = 0, + const T* p_UserData = (T*)0) + : NCursesForm(lines,cols,begin_y,begin_x) { + if (form) + set_user ((void *)p_UserData); + } + +public: + NCursesUserForm (NCursesFormField Fields[], + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) + : NCursesForm (Fields, with_frame, autoDelete_Fields) { + }; + + NCursesUserForm (NCursesFormField Fields[], + const T* p_UserData = (T*)0, + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) + : NCursesForm (Fields, with_frame, autoDelete_Fields) { + if (form) + set_user ((void *)p_UserData); + }; + + NCursesUserForm (NCursesFormField Fields[], + int lines, + int cols, + int begin_y = 0, + int begin_x = 0, + const T* p_UserData = (T*)0, + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) + : NCursesForm (Fields, lines, cols, begin_y, begin_x, + with_frame, autoDelete_Fields) { + if (form) + set_user ((void *)p_UserData); + }; + + virtual ~NCursesUserForm() { + }; + + inline T* UserData (void) const { + return (T*)get_user (); + }; + + inline virtual void setUserData (const T* p_UserData) { + if (form) + set_user ((void *)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)); + } + +public: + Regular_Expression_Field(const char *expr) + : NCursesFieldType(TYPE_REGEXP) { + regex = new char[1 + ::strlen(expr)]; + (::strcpy)(regex,expr); + } + + ~Regular_Expression_Field() { + delete[] regex; + } +}; + +class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType { +private: + 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(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) { + } +}; + +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) { + } +}; +// +// ------------------------------------------------------------------------- +// 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. + static bool fcheck(FIELD *, const void*); + static bool ccheck(int c, const void *); + static void* 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) { + } +}; +// +// ------------------------------------------------------------------------- +// 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. + static bool next_choice(FIELD*, const void *); + static bool 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/ncurses-5.3/c++/cursesm.cc b/ncurses-5.3/c++/cursesm.cc new file mode 100644 index 0000000..ebf6ca8 --- /dev/null +++ b/ncurses-5.3/c++/cursesm.cc @@ -0,0 +1,383 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,1999,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +#include "internal.h" +#include "cursesm.h" +#include "cursesapp.h" + +MODULE_ID("$Id$") + +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 +NCursesMenu::mnu_init(MENU *m) { + getHook(m)->On_Menu_Init(); +} + +void +NCursesMenu::mnu_term(MENU *m) { + getHook(m)->On_Menu_Termination(); +} + +void +NCursesMenu::itm_init(MENU *m) { + NCursesMenu* M = getHook(m); + M->On_Item_Init (*(M->current_item ())); +} + +void +NCursesMenu::itm_term(MENU *m) { + NCursesMenu* M = 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** items = new ITEM*[itemCount + 1]; + + for (lcv=0;nitems[lcv]->item;++lcv) { + items[lcv] = nitems[lcv]->item; + } + items[lcv] = NULL; + + my_items = nitems; + + if (menu) + delete[] ::menu_items(menu); + return items; +} + +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 = (MENU*)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,(void*)hook); + + ::set_menu_init (menu, NCursesMenu::mnu_init); + ::set_menu_term (menu, NCursesMenu::mnu_term); + ::set_item_init (menu, NCursesMenu::itm_init); + ::set_item_term (menu, NCursesMenu::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 = (NCursesWindow*)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 = (UserHook*)::menu_userptr(menu); + delete hook; + if (b_sub_owner) { + delete sub; + ::set_menu_sub(menu,(WINDOW *)0); + } + if (menu) { + ITEM** itms = ::menu_items(menu); + int cnt = count(); + + OnError(::set_menu_items(menu,(ITEM**)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/ncurses-5.3/c++/cursesm.h b/ncurses-5.3/c++/cursesm.h new file mode 100644 index 0000000..5d71051 --- /dev/null +++ b/ncurses-5.3/c++/cursesm.h @@ -0,0 +1,593 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,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 * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +// $Id$ + +#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 = p_name ? ::new_item (p_name, p_descript) : (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. + + 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 options) { + OnError (::item_opts_on (item, options)); + } + // Switch on the items options + + inline void options_off (Item_Options options) { + OnError (::item_opts_off (item, options)); + } + // 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 options) { + OnError (::set_item_opts (item, options)); + } + // 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) { + } + + virtual ~NCursesMenuCallbackItem(); + + bool action(); +}; +// +// ------------------------------------------------------------------------- +// 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 = (UserHook*)::menu_userptr(m); + assert(hook != 0 && hook->m_owner==m); + return (NCursesMenu*)(hook->m_back); + } + + // 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. + static void mnu_init(MENU *); + static void mnu_term(MENU *); + static void itm_init(MENU *); + static void itm_term(MENU *); + + // Calculate ITEM* array for the menu + ITEM** mapItems(NCursesMenuItem* nitems[]); + +protected: + // internal routines + inline void set_user(void *user) { + UserHook* uptr = (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 = (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 lines, + int cols, + int begin_y = 0, + int begin_x = 0) + : NCursesPanel(lines,cols,begin_y,begin_x), + menu ((MENU*)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() { + InitMenu(Items, with_frame, autoDelete_Items); + } + + // Make a menu with a window of this size. + NCursesMenu (NCursesMenuItem* Items[], + int lines, + int cols, + 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(lines, cols, begin_y, begin_x) { + InitMenu(Items, with_frame, autoDelete_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& cols) { + ::menu_format(menu,&rows,&cols); + } + + // 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 *mark) { + OnError (::set_menu_mark (menu, mark)); + } + + // 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 = (T*)0) + : NCursesMenuItem (p_name, p_descript) { + if (item) + OnError (::set_item_userptr (item, (void *)p_UserData)); + }; + + virtual ~NCursesUserItem() {}; + + inline const T* UserData (void) const { + return (const T*)::item_userptr (item); + }; + + inline virtual void setUserData(const T* p_UserData) { + if (item) + OnError (::set_item_userptr (item, (void *)p_UserData)); + } +}; +// +// ------------------------------------------------------------------------- +// The same mechanism is used to attach user data to a menu +// ------------------------------------------------------------------------- +// +template class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu +{ +protected: + NCursesUserMenu( int lines, + int cols, + int begin_y = 0, + int begin_x = 0, + const T* p_UserData = (T*)0) + : NCursesMenu(lines,cols,begin_y,begin_x) { + if (menu) + set_user ((void *)p_UserData); + } + +public: + NCursesUserMenu (NCursesMenuItem Items[], + const T* p_UserData = (T*)0, + bool with_frame=FALSE, + bool autoDelete_Items=FALSE) + : NCursesMenu (Items, with_frame, autoDelete_Items) { + if (menu) + set_user ((void *)p_UserData); + }; + + NCursesUserMenu (NCursesMenuItem Items[], + int lines, + int cols, + int begin_y = 0, + int begin_x = 0, + const T* p_UserData = (T*)0, + bool with_frame=FALSE) + : NCursesMenu (Items, lines, cols, begin_y, begin_x, with_frame) { + if (menu) + set_user ((void *)p_UserData); + }; + + virtual ~NCursesUserMenu() { + }; + + inline T* UserData (void) const { + return (T*)get_user (); + }; + + inline virtual void setUserData (const T* p_UserData) { + if (menu) + set_user ((void *)p_UserData); + } +}; + +#endif // NCURSES_CURSESM_H_incl diff --git a/ncurses-5.3/c++/cursesmain.cc b/ncurses-5.3/c++/cursesmain.cc new file mode 100644 index 0000000..9af9a2e --- /dev/null +++ b/ncurses-5.3/c++/cursesmain.cc @@ -0,0 +1,58 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +#include "internal.h" +#include "cursesapp.h" + +MODULE_ID("$Id$") + +/* 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[]) +{ + NCursesApplication* A = NCursesApplication::getApplication(); + if (!A) + return(1); + else { + int res; + + A->handleArgs(argc,argv); + ::endwin(); + res = (*A)(); + ::endwin(); + return(res); + } +} diff --git a/ncurses-5.3/c++/cursesp.cc b/ncurses-5.3/c++/cursesp.cc new file mode 100644 index 0000000..f6dca52 --- /dev/null +++ b/ncurses-5.3/c++/cursesp.cc @@ -0,0 +1,130 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +#include "internal.h" +#include "cursesp.h" +#include + +MODULE_ID("$Id$") + +NCursesPanel* NCursesPanel::dummy = (NCursesPanel*)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, (void *)hook); +} + +NCursesPanel::~NCursesPanel() { + UserHook* hook = (UserHook*)::panel_userptr(p); + 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 *label) { + if (label) { + int x = (maxx() - ::strlen(label)) / 2; + if (x<0) + x=0; + OnError(addstr(row, x, label, width())); + } +} + +int +NCursesPanel::getKey(void) { + return getch(); +} diff --git a/ncurses-5.3/c++/cursesp.h b/ncurses-5.3/c++/cursesp.h new file mode 100644 index 0000000..ace65fd --- /dev/null +++ b/ncurses-5.3/c++/cursesp.h @@ -0,0 +1,222 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +#ifndef NCURSES_CURSESP_H_incl +#define NCURSES_CURSESP_H_incl 1 + +// $Id$ + +#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; + + void init(); // Initialize the panel object + +protected: + void set_user(void *user) { + UserHook* uptr = (UserHook*)::panel_userptr (p); + assert (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 = (UserHook*)::panel_userptr (p); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p); + return uptr->m_user; + } + + 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 lines, + int cols, + int begin_y = 0, + int begin_x = 0) + : NCursesWindow(lines,cols,begin_y,begin_x) { + init(); + } + // Create a panel with this size starting at the requested position. + + NCursesPanel() : NCursesWindow(::stdscr) { init(); } + // This constructor creates the default Panel associated with the + // ::stdscr window + + 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 lines, + int cols, + int begin_y = 0, + int begin_x = 0, + const T* p_UserData = (T*)0) + : NCursesPanel (lines, cols, begin_y, begin_x) { + if (p) + set_user ((void *)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 = (T*)0) : NCursesPanel() { + if (p) + set_user((void *)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 (T*)get_user (); + }; + // Retrieve the user data associated with the panel. + + virtual void setUserData (const T* p_UserData) { + if (p) + set_user ((void *)p_UserData); + } + // Associate the user panel with the user data pointed to by p_UserData. +}; + +#endif // NCURSES_CURSESP_H_incl diff --git a/ncurses-5.3/c++/cursespad.cc b/ncurses-5.3/c++/cursespad.cc new file mode 100644 index 0000000..5e9c248 --- /dev/null +++ b/ncurses-5.3/c++/cursespad.cc @@ -0,0 +1,276 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2001,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 * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +#include "internal.h" +#include "etip.h" +#include "cursesw.h" + +MODULE_ID("$Id$") + +NCursesPad::NCursesPad(int lines, int cols) + : NCursesWindow(), + viewWin((NCursesWindow*)0), + viewSub((NCursesWindow*)0), + h_gridsize(0), v_gridsize(0), + min_row(0), min_col(0) +{ + w = ::newpad(lines,cols); + if ((WINDOW*)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 ((NCursesWindow*)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 && ((NCursesWindow*)0 != viewWin)) { + res = (viewWin->refresh()); + } + return(res); +} + +int NCursesPad::noutrefresh() +{ + int res = OK; + NCursesWindow* W = Win(); + if ((NCursesWindow*)0 != W) { + res = copywin(*W,min_row,min_col, + 0,0,W->maxy(),W->maxx(), + 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 ((NCursesWindow*)0 == viewWin) + err_handler("Pad has no viewport"); + if (!viewWin->isDescendant(sub)) + THROW(new NCursesException("NCursesFramePad", E_SYSTEM_ERROR)); + viewSub = ⊂ +} + +void NCursesFramedPad::OnOperation(int pad_req) +{ + NCursesWindow* W = Win(); + NCursesWindow* Win = getWindow(); + + if (((NCursesWindow*)0 != W) && ((NCursesWindow*)0 != Win)) { + 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; + + Win->vline(1,Width+1,Height); + Win->attron(A_REVERSE); + if (v_len>=2) { + Win->addch(row+1,Width+1,ACS_UARROW); + for(i=2;iaddch(row+i,Width+1,' '); + Win->addch(row+v_len,Width+1,ACS_DARROW); + } + else { + for(i=1;i<=v_len;i++) + Win->addch(row+i,Width+1,' '); + } + Win->attroff(A_REVERSE); + + Win->hline(Height+1,1,Width); + Win->attron(A_REVERSE); + if (h_len >= 2) { + Win->addch(Height+1,col+1,ACS_LARROW); + for(i=2;iaddch(Height+1,col+i,' '); + Win->addch(Height+1,col+h_len,ACS_RARROW); + } + else { + for(i=1;i<=h_len;i++) + Win->addch(Height+1,col+i,' '); + } + Win->attroff(A_REVERSE); + } +} diff --git a/ncurses-5.3/c++/cursesw.cc b/ncurses-5.3/c++/cursesw.cc new file mode 100644 index 0000000..16f51a9 --- /dev/null +++ b/ncurses-5.3/c++/cursesw.cc @@ -0,0 +1,456 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- + +/* + Copyright (C) 1989 Free Software Foundation + written by Eric Newton (newton@rocky.oswego.edu) + + This file is part of the GNU C++ Library. This library is free + software; you can redistribute it and/or modify it under the terms of + the GNU Library General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your + option) any later version. This library is distributed in the hope + that it will be useful, but WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU Library General Public License for more details. + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + + modified by Ulrich Drepper (drepper@karlsruhe.gmd.de) + and Anatoly Ivasyuk (anatoly@nick.csh.rit.edu) + + modified by Juergen Pfeifer + Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +*/ + +#include "internal.h" +#include "cursesw.h" + +MODULE_ID("$Id$") + +#define COLORS_NEED_INITIALIZATION -1 +#define COLORS_NOT_INITIALIZED 0 +#define COLORS_MONOCHROME 1 +#define COLORS_ARE_REALLY_THERE 2 + +// declare static variables for the class +long NCursesWindow::count = 0L; +bool NCursesWindow::b_initialized = FALSE; + +/* + * The ncurses library has a fallback for vsscanf(), which may work... + */ +#if !(USE_STRSTREAM_VSCAN || USE_STRSTREAM_VSCAN_CAST) +# undef USE_STDIO_VSCAN +# define USE_STDIO_VSCAN 1 +#endif + +#if defined(__GNUG__) +# ifndef _IO_va_list +# define _IO_va_list char * +# endif +#endif + +int +NCursesWindow::scanw(const char* fmt, ...) +{ + int result = ERR; + char buf[BUFSIZ]; + + if (::wgetnstr(w, buf, sizeof(buf)) != ERR) { + va_list args; + va_start(args, fmt); +#if USE_STDIO_VSCAN + if (::vsscanf(buf, fmt, args) != -1) + result = OK; +#elif USE_STRSTREAM_VSCAN /* powerpc, os390 */ + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) + result = OK; +#elif USE_STRSTREAM_VSCAN_CAST /* pre-gcc 3.0 */ + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, (_IO_va_list)args) != -1) + result = OK; +#endif + va_end(args); + } + return result; +} + + +int +NCursesWindow::scanw(int y, int x, const char* fmt, ...) +{ + int result = ERR; + char buf[BUFSIZ]; + + if (::wmove(w, y, x) != ERR) { + if (::wgetnstr(w, buf, sizeof(buf)) != ERR) { + va_list args; + va_start(args, fmt); +#if USE_STDIO_VSCAN + if (::vsscanf(buf, fmt, args) != -1) + result = OK; +#elif USE_STRSTREAM_VSCAN /* powerpc, os390 */ + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) + result = OK; +#elif USE_STRSTREAM_VSCAN_CAST /* pre-gcc 3.0 */ + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, (_IO_va_list)args) != -1) + result = OK; +#endif + va_end(args); + } + } + return result; +} + + +int +NCursesWindow::printw(const char * fmt, ...) +{ + va_list args; + va_start(args, fmt); + char buf[BUFSIZ]; + ::vsprintf(buf, fmt, args); + va_end(args); + return waddstr(w, buf); +} + + +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) { + char buf[BUFSIZ]; + ::vsprintf(buf, fmt, args); + result = waddstr(w, buf); + } + va_end(args); + return result; +} + + +void +NCursesWindow::init(void) +{ + leaveok(0); + keypad(1); + meta(1); +} + +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(); + } +} + +NCursesWindow::NCursesWindow() { + initialize(); + + w = (WINDOW *)0; + init(); + alloced = FALSE; + subwins = par = sib = 0; + count++; +} + +NCursesWindow::NCursesWindow(int lines, int cols, int begin_y, int begin_x) +{ + initialize(); + + w = ::newwin(lines, cols, begin_y, begin_x); + if (w == 0) { + err_handler("Cannot construct window"); + } + init(); + + alloced = TRUE; + subwins = par = sib = 0; + count++; +} + +NCursesWindow::NCursesWindow(WINDOW* &window) +{ + initialize(); + + w = window; + init(); + alloced = FALSE; + subwins = par = sib = 0; + count++; +} + +NCursesWindow::NCursesWindow(NCursesWindow& win, int l, int c, + int begin_y, int begin_x, char absrel) +{ + initialize(); + if (absrel == 'a') { // absolute origin + begin_y -= win.begy(); + begin_x -= win.begx(); + } + + // Even though we treat subwindows as a tree, the standard curses + // library needs the `subwin' call to link to the parent in + // order to correctly perform refreshes, etc. + // Friendly enough, this also works for pads. + w = ::derwin(win.w, l, c, begin_y, begin_x); + if (w == 0) { + err_handler("Cannot construct subwindow"); + } + + par = &win; + sib = win.subwins; + win.subwins = this; + subwins = 0; + alloced = TRUE; + count++; +} + +NCursesWindow::NCursesWindow(NCursesWindow& win, + bool do_box NCURSES_PARAM_INIT(TRUE)) +{ + initialize(); + w = :: derwin(win.w,win.height()-2,win.width()-2,1,1); + if (w == 0) { + err_handler("Cannot construct subwindow"); + } + + par = &win; + sib = win.subwins; + win.subwins = this; + subwins = 0; + alloced = TRUE; + count++; + + 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; + +extern "C" int _nc_ripoffline(int,int (*init)(WINDOW*,int)); + +NCursesWindow::NCursesWindow(WINDOW *win, int cols) { + initialize(); + w = win; + assert((w->_maxx+1)==cols); + alloced = FALSE; + subwins = par = sib = 0; +} + +int NCursesWindow::ripoff_init(WINDOW *w, int cols) +{ + int res = ERR; + + RIPOFFINIT init = *prip++; + if (init) { + NCursesWindow* W = new NCursesWindow(w,cols); + res = init(*W); + } + return res; +} + +int NCursesWindow::ripoffline(int ripoff_lines, + int (*init)(NCursesWindow& win)) { + int code = ::_nc_ripoffline(ripoff_lines,ripoff_init); + if (code==OK && init && ripoff_lines) { + R_INIT[r_init_idx++] = init; + } + return code; +} + +bool +NCursesWindow::isDescendant(NCursesWindow& win) { + for (NCursesWindow* p = subwins; p != NULL; p = p->sib) { + if (p==&win) + return TRUE; + else { + if (p->isDescendant(win)) + return TRUE; + } + } + return FALSE; +} + +void +NCursesWindow::kill_subwindows() +{ + for (NCursesWindow* p = subwins; p != 0; p = p->sib) { + p->kill_subwindows(); + if (p->alloced) { + if (p->w != 0) + ::delwin(p->w); + p->alloced = FALSE; + } + p->w = 0; // cause a run-time error if anyone attempts to use... + } +} + + +NCursesWindow::~NCursesWindow() +{ + kill_subwindows(); + + if (par != 0) { // Snip us from the parent's list of subwindows. + NCursesWindow * win = par->subwins; + NCursesWindow * trail = 0; + for (;;) { + if (win == 0) + break; + else if (win == this) { + if (trail != 0) + trail->sib = win->sib; + else + par->subwins = win->sib; + break; + } else { + trail = win; + win = win->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::getcolor(int getback) const +{ + short fore, back; + + if (colorInitialized==COLORS_ARE_REALLY_THERE) { + if (::pair_content((short)PAIR_NUMBER(w->_attrs), &fore, &back)) + 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() +{ + if (colorInitialized==COLORS_ARE_REALLY_THERE) + return COLORS; + else + return 1; // monochrome (actually there are two ;-) +} + +short +NCursesWindow::getcolor() const +{ + if (colorInitialized==COLORS_ARE_REALLY_THERE) + return PAIR_NUMBER(w->_attrs); + else + return 0; // we only have pair zero +} + +int +NCursesWindow::setpalette(short fore, short back, short pair) +{ + if (colorInitialized==COLORS_ARE_REALLY_THERE) + return ::init_pair(pair, fore, back); + else + return OK; +} + +int +NCursesWindow::setpalette(short fore, short back) +{ + if (colorInitialized==COLORS_ARE_REALLY_THERE) + return setpalette(fore, back, (short)PAIR_NUMBER(w->_attrs)); + else + return OK; +} + + +int +NCursesWindow::setcolor(short pair) +{ + if (colorInitialized==COLORS_ARE_REALLY_THERE) { + 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 +extern "C" int _nc_has_mouse(void); + +bool NCursesWindow::has_mouse() const { + return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse()) + ? TRUE : FALSE); +} +#endif diff --git a/ncurses-5.3/c++/cursesw.h b/ncurses-5.3/c++/cursesw.h new file mode 100644 index 0000000..9c22ffd --- /dev/null +++ b/ncurses-5.3/c++/cursesw.h @@ -0,0 +1,1397 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * 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$ + +#include +#include +#include + +#if HAVE_STRSTREAM_H && (USE_STRSTREAM_VSCAN||USE_STRSTREAM_VSCAN_CAST) +#include +#endif + +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 echochar +inline int UNDEF(echochar)(chtype ch) { return echochar(ch); } +#undef echochar +#define echochar UNDEF(echochar) +#endif + +#ifdef insdelln +inline int UNDEF(insdelln)(int n) { return insdelln(n); } +#undef insdelln +#define insdelln UNDEF(insdelln) +#endif + +#ifdef addstr +/* The (char*) cast is to hack around missing const's */ +inline int UNDEF(addstr)(const char * str) { return addstr((char*)str); } +#undef addstr +#define addstr UNDEF(addstr) +#endif + +#ifdef attron +inline int UNDEF(attron)(chtype at) { return attron(at); } +#undef attron +#define attron UNDEF(attron) +#endif + +#ifdef attroff +inline int UNDEF(attroff)(chtype at) { return attroff(at); } +#undef attroff +#define attroff UNDEF(attroff) +#endif + +#ifdef attrset +inline chtype UNDEF(attrset)(chtype at) { return attrset(at); } +#undef attrset +#define attrset UNDEF(attrset) +#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 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 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 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 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 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 erase +inline int UNDEF(erase)() { return erase(); } +#undef erase +#define erase UNDEF(erase) +#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 getch +inline int UNDEF(getch)() { return getch(); } +#undef getch +#define getch UNDEF(getch) +#endif + +#ifdef getstr +inline int UNDEF(getstr)(char *_str) { return getstr(_str); } +#undef getstr +#define getstr UNDEF(getstr) +#endif + +#ifdef instr +inline int UNDEF(instr)(char *_str) { return instr(_str); } +#undef instr +#define instr UNDEF(instr) +#endif + +#ifdef innstr +inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str,n); } +#undef innstr +#define innstr UNDEF(innstr) +#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 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 winsstr +inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { + return winsstr(w,_str); } +#undef winsstr +#define winsstr UNDEF(winsstr) +#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 insstr +inline int UNDEF(insstr)(const char *_str) { + return insstr(_str); } +#undef insstr +#define insstr UNDEF(insstr) +#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 insnstr +inline int UNDEF(insnstr)(const char *_str, int n) { + return insnstr(_str,n); } +#undef insnstr +#define insnstr UNDEF(insnstr) +#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 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 getnstr +inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str,n); } +#undef getnstr +#define getnstr UNDEF(getnstr) +#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 getbegyx +inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); } +#undef getbegyx +#define getbegyx UNDEF(getbegyx) +#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 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 insch +inline int UNDEF(insch)(char c) { return insch(c); } +#undef insch +#define insch UNDEF(insch) +#endif + +#ifdef insertln +inline int UNDEF(insertln)() { return insertln(); } +#undef insertln +#define insertln UNDEF(insertln) +#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 refresh +inline int UNDEF(refresh)() { return refresh(); } +#undef refresh +#define refresh UNDEF(refresh) +#endif + +#ifdef redrawwin +inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); } +#undef redrawwin +#define redrawwin UNDEF(redrawwin) +#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 waddstr +inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); } +#undef waddstr +#define waddstr UNDEF(waddstr) +#endif + +#ifdef waddchstr +inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); } +#undef waddchstr +#define waddchstr UNDEF(waddchstr) +#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 + + +#ifdef wattroff +inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); } +#undef wattroff +#define wattroff UNDEF(wattroff) +#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 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 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 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 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, 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, chtype *str) +{ return mvwaddchstr(win, y, x, str); } +#undef mvwaddchstr +#define mvwaddchstr UNDEF(mvwaddchstr) +#endif + +#ifdef addnstr +inline int UNDEF(addnstr)(const char *str, int n) +{ return addnstr((char*)str, n); } +#undef addnstr +#define addnstr UNDEF(addnstr) +#endif + +#ifdef mvwaddnstr +inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n) +{ return mvwaddnstr(win, y, x, (char*)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, (char*)str); } +#undef mvwaddstr +#define mvwaddstr UNDEF(mvwaddstr) +#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 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 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 mvwinch +inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { + return mvwinch(win, y, x);} +#undef mvwinch +#define mvwinch UNDEF(mvwinch) +#endif + +#ifdef mvwinsch +inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, char c) +{ return mvwinsch(win, y, x, c); } +#undef mvwinsch +#define mvwinsch UNDEF(mvwinsch) +#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, (char*)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, (char*)str); } +#undef mvaddstr +#define mvaddstr UNDEF(mvaddstr) +#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 mvgetstr +inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);} +#undef mvgetstr +#define mvgetstr UNDEF(mvgetstr) +#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 mvinch +inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} +#undef mvinch +#define mvinch UNDEF(mvinch) +#endif + +#ifdef mvinsch +inline int UNDEF(mvinsch)(int y, int x, char c) +{ return mvinsch(y, x, c); } +#undef mvinsch +#define mvinsch UNDEF(mvinsch) +#endif + +#ifdef napms +inline void UNDEF(napms)(unsigned long x) { napms(x); } +#undef napms +#define napms UNDEF(napms) +#endif + +#ifdef fixterm +inline int UNDEF(fixterm)(void) { return fixterm(); } +#undef fixterm +#define fixterm UNDEF(fixterm) +#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 crmode +inline int UNDEF(crmode)(void) { return crmode(); } +#undef crmode +#define crmode UNDEF(crmode) +#endif + +#ifdef nocrmode +inline int UNDEF(nocrmode)(void) { return nocrmode(); } +#undef nocrmode +#define nocrmode UNDEF(nocrmode) +#endif + +#ifdef getbkgd +inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); } +#undef getbkgd +#define getbkgd UNDEF(getbkgd) +#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 + +/* + * + * C++ class for windows. + * + * + */ + +class NCURSES_IMPEXP NCursesWindow +{ + friend class NCursesMenu; + friend class NCursesForm; + +private: + static bool b_initialized; + static void initialize(); + static int ripoff_init(WINDOW *,int); + + void init(); + + short getcolor(int getback) 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 cols); + +protected: + 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 lines, // number of lines + int cols, // number of columns + int begin_y, // line origin + int begin_x); // col origin + + NCursesWindow(NCursesWindow& par,// parent window + int lines, // number of lines + int cols, // 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. + + 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 w->_begx; } + // Column of top left corner relative to stdscr + + int begy() const { return w->_begy; } + // Line of top left corner relative to stdscr + + int maxx() const { return w->_maxx; } + // Largest x coord in window + + int maxy() const { return w->_maxy; } + // 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 + + 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(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 + + // ------------------------------------------------------------------------- + // 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, (char*)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,(char*)str,n); } + // Move the cursor to the requested position and then perform the addstr + // 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 + + 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 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,(char)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, (int) at); } + // Switch off the window attributes; + + int attrset(chtype at) { return ::wattrset(w, (int) at); } + // Set 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 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,(int)(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 keypad(bool bf) { return ::keypad(w, bf); } + // If called with bf=TRUE, the application will interpret function keys. + + 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 overlay=TRUE) { + return ::copywin(w,win.w,sminrow,smincol,dminrow,dmincol, + dmaxrow,dmaxcol,(int)(overlay?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. + + // ------------------------------------------------------------------------- + // 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 lines, // number of lines + int cols, // number of columns + int begin_y, // line origin + int begin_x) // col origin + : NCursesWindow(lines,cols,begin_y,begin_x) { + useColors(); } + + NCursesColorWindow(NCursesWindow& par,// parent window + int lines, // number of lines + int cols, // number of columns + int begin_y, // absolute or relative + int begin_x, // origins: + char absrel = 'a') // if `a', by & bx are + : NCursesWindow(par,lines,cols, // 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 lines, int cols); + // create a pad with the given size + + 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 lines, int cols, + int v_grid = 1, int h_grid = 1) + : NCursesPad(lines,cols) { + 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/ncurses-5.3/c++/cursslk.cc b/ncurses-5.3/c++/cursslk.cc new file mode 100644 index 0000000..9ca2991 --- /dev/null +++ b/ncurses-5.3/c++/cursslk.cc @@ -0,0 +1,123 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +#include "internal.h" +#include "cursslk.h" +#include "cursesapp.h" +#include + +MODULE_ID("$Id$") + +void Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text) { + delete[] label; + label = new char[1 + ::strlen(text)]; + (::strcpy)(label,text); +} + +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() { + if (format==None) + Error("No default SLK layout"); + init(); +} + +Soft_Label_Key_Set::Soft_Label_Key_Set(Soft_Label_Key_Set::Label_Layout fmt) { + if (fmt==None) + Error("Invalid SLK Layout"); + if (count++==0) { + format = fmt; + if (ERR == ::slk_init((int)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/ncurses-5.3/c++/cursslk.h b/ncurses-5.3/c++/cursslk.h new file mode 100644 index 0000000..96fad50 --- /dev/null +++ b/ncurses-5.3/c++/cursslk.h @@ -0,0 +1,206 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +// $Id$ + +#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((char*)0),format(Left),num(-1) { + } + + virtual ~Soft_Label_Key() { + delete[] label; + }; + + public: + // Set the text of the Label + void operator=(char *text); + + // Set the Justification of the Label + inline void operator=(Justification just) { + format = just; + } + + // Retrieve the text of the label + inline char* operator()(void) const { + return 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(); + + 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/ncurses-5.3/c++/demo.cc b/ncurses-5.3/c++/demo.cc new file mode 100644 index 0000000..b9ab59b --- /dev/null +++ b/ncurses-5.3/c++/demo.cc @@ -0,0 +1,493 @@ +/* + * 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 + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en + * + * $Id$ + */ + +#include "cursesapp.h" +#include "cursesm.h" +#include "cursesf.h" + +#if HAVE_LIBC_H +# include +#endif + +extern "C" unsigned int sleep(unsigned int); + +#undef index // needed for NeXT + +// +// ------------------------------------------------------------------------- +// +class SillyDemo +{ + public: + void run(int sleeptime) { + + NCursesPanel *std = 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. + + std->box(); + std->move(std->height()/2,1); + std->hline(std->width()-2); + std->move(1,std->width()/2); + std->vline(std->height()-2); + std->addch(0,std->width()/2,ACS_TTEE); + std->addch(std->height()-1,std->width()/2,ACS_BTEE); + std->addch(std->height()/2,0,ACS_LTEE); + std->addch(std->height()/2,std->width()-1,ACS_RTEE); + std->addch(std->height()/2,std->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 std is just convenient - We know it's always + // valid until the end of the program. + + std->refresh(); + sleep(sleeptime); + + // Show what happens when panels are deleted and moved. + + sleep(sleeptime); + delete u; + std->refresh(); + + sleep(sleeptime); + delete z; + std->refresh(); + + sleep(sleeptime); + delete v; + std->refresh(); + + // show how it looks when a panel moves + sleep(sleeptime); + y->mvwin(5,30); + std->refresh(); + + sleep(sleeptime); + delete y; + std->refresh(); + + // show how it looks when you raise a panel + sleep(sleeptime); + w->top(); + std->refresh(); + + sleep(sleeptime); + delete w; + std->refresh(); + + sleep(sleeptime); + delete x; + + std->clear(); + std->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 std; + } +}; + +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, (const char*)0, p_UserData) + {}; + + ~MyAction() {} + + bool action() { + SillyDemo a; + a.run(NCursesUserItem::UserData()->sleeptime()); + return FALSE; + } +}; + +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,(int)::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 char *weekdays[]; + +public: + TestForm() : NCursesForm(13,51,(lines()-15)/2,(cols()-53)/2) { + + 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() { + delete mft; + delete ift; + delete eft; + } +}; + +char* TestForm::weekdays[] = { + "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", + "Friday", "Saturday", (char *)0 }; +// +// ------------------------------------------------------------------------- +// +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[5]; + ::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(); + 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 std; + NCursesPanel P(std.lines()-2,std.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((chtype)('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 *std = new NCursesPanel(); + + NCursesPanel *w = new NCursesPanel(std->lines() - 2, std->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 value = -1; + int result = 0; + while (value != 0) { + value = 0; + s->scanw("%d", &value); + if (value != 0) { + s->printw("%d: ", result += value); + } + s->refresh(); + } + s->printw("\nPress any key to continue..."); + s->getch(); + + delete s; + delete w; + delete std; + ::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) + { + 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() + { + 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[5]; + ::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 title = "Simple C++ Binding Demo"; + const int len = ::strlen(title); + + titleWindow->bkgd(screen_titles()); + titleWindow->addstr(0,(titleWindow->cols()-len)/2,title); + titleWindow->noutrefresh(); +} + + +int TestApplication::run() { + MyMenu M; + M(); + return 0; +} + +// +// ------------------------------------------------------------------------- +// +static TestApplication Demo; diff --git a/ncurses-5.3/c++/edit_cfg.sh b/ncurses-5.3/c++/edit_cfg.sh new file mode 100755 index 0000000..0703c53 --- /dev/null +++ b/ncurses-5.3/c++/edit_cfg.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# $Id$ +############################################################################## +# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders 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 +# +# Edit the default value of the etip.h file based on the autoconf-generated +# values: +# +# $1 = ncurses_cfg.h +# $2 = etip.h +# +echo "substituting autoconf'd values from $1 into $2" +for name in \ + CPP_HAS_PARAM_INIT \ + ETIP_NEEDS_MATH_EXCEPTION \ + ETIP_NEEDS_MATH_H \ + HAVE_BUILTIN_H \ + HAVE_GPP_BUILTIN_H \ + HAVE_GXX_BUILTIN_H \ + HAVE_STRSTREAM_H \ + HAVE_TYPEINFO \ + HAVE_VALUES_H \ + USE_STRSTREAM_VSCAN \ + USE_STRSTREAM_VSCAN_CAST +do + mv $2 $2.bak + if ( grep "[ ]$name[ ]1" $1 2>&1 >/dev/null) + then + value=1 + sed -e 's/define '$name'.*$/define '$name' 1/' $2.bak >$2 + else + value=0 + sed -e 's/define '$name'.*$/define '$name' 0/' $2.bak >$2 + 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/ncurses-5.3/c++/etip.h.in b/ncurses-5.3/c++/etip.h.in new file mode 100644 index 0000000..3056379 --- /dev/null +++ b/ncurses-5.3/c++/etip.h.in @@ -0,0 +1,292 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +// $Id$ + +#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_STRSTREAM_H +#define HAVE_STRSTREAM_H 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 USE_STRSTREAM_VSCAN +#define USE_STRSTREAM_VSCAN 0 +#endif + +#ifndef USE_STRSTREAM_VSCAN_CAST +#define USE_STRSTREAM_VSCAN_CAST 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 +# include +#else +# 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 + +// 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) + {}; + + virtual const char *classname() const { + return "NCursesWindow"; + } +}; + +class NCURSES_IMPEXP NCursesPanelException : public NCursesException +{ +public: + const NCursesPanel* p; + + NCursesPanelException (const char *msg, int err) : + NCursesException (msg, err), + p ((NCursesPanel*)0) + {}; + + NCursesPanelException (const NCursesPanel* panel, + const char *msg, + int err) : + NCursesException (msg, err), + p (panel) + {}; + + NCursesPanelException (int err) : + NCursesException ("panel library error", err), + p ((NCursesPanel*)0) + {}; + + NCursesPanelException (const NCursesPanel* panel, + int err) : + NCursesException ("panel library error", err), + p (panel) + {}; + + virtual const char *classname() const { + return "NCursesPanel"; + } + +}; + +class NCURSES_IMPEXP NCursesMenuException : public NCursesException +{ +public: + const NCursesMenu* m; + + NCursesMenuException (const char *msg, int err) : + NCursesException (msg, err), + m ((NCursesMenu *)0) + {}; + + NCursesMenuException (const NCursesMenu* menu, + const char *msg, + int err) : + NCursesException (msg, err), + m (menu) + {}; + + NCursesMenuException (int err) : + NCursesException ("menu library error", err), + m ((NCursesMenu *)0) + {}; + + NCursesMenuException (const NCursesMenu* menu, + int err) : + NCursesException ("menu library error", err), + m (menu) + {}; + + virtual const char *classname() const { + return "NCursesMenu"; + } + +}; + +class NCURSES_IMPEXP NCursesFormException : public NCursesException +{ +public: + const NCursesForm* f; + + NCursesFormException (const char *msg, int err) : + NCursesException (msg, err), + f ((NCursesForm*)0) + {}; + + NCursesFormException (const NCursesForm* form, + const char *msg, + int err) : + NCursesException (msg, err), + f (form) + {}; + + NCursesFormException (int err) : + NCursesException ("form library error", err), + f ((NCursesForm*)0) + {}; + + NCursesFormException (const NCursesForm* form, + int err) : + NCursesException ("form library error", err), + f (form) + {}; + + virtual const char *classname() const { + return "NCursesForm"; + } + +}; + +#if !((defined(__GNUG__) && defined(__EXCEPTIONS)) || defined(__SUNPRO_CC)) +# include + 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 + throw *e; +#endif +#elif defined(__SUNPRO_CC) +# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5) + genericerror(1, ((e != 0) ? (char *)(e->message) : "")); +#else + throw *e; +#endif +#else + if (e) + cerr << e->message << endl; + exit(0); +#endif +} + +#define THROWS(s) + +#endif // NCURSES_ETIP_H_incl diff --git a/ncurses-5.3/c++/headers b/ncurses-5.3/c++/headers new file mode 100644 index 0000000..89f8ec5 --- /dev/null +++ b/ncurses-5.3/c++/headers @@ -0,0 +1,39 @@ +# C++ headers +# $Id$ +############################################################################## +# 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 1997 +# +$(srcdir)/cursesapp.h +$(srcdir)/cursesf.h +$(srcdir)/cursesm.h +$(srcdir)/cursesp.h +$(srcdir)/cursesw.h +$(srcdir)/cursslk.h +etip.h diff --git a/ncurses-5.3/c++/internal.h b/ncurses-5.3/c++/internal.h new file mode 100644 index 0000000..c0f6fcc --- /dev/null +++ b/ncurses-5.3/c++/internal.h @@ -0,0 +1,50 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not 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 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * + ****************************************************************************/ + +// $Id$ + +#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 + +#define CTRL(x) ((x) & 0x1f) + +#endif // NCURSES_CPLUS_INTERNAL_H diff --git a/ncurses-5.3/c++/modules b/ncurses-5.3/c++/modules new file mode 100644 index 0000000..a2e2e60 --- /dev/null +++ b/ncurses-5.3/c++/modules @@ -0,0 +1,43 @@ +# Program modules +# $Id$ +############################################################################## +# 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 1995,1997 +# + +@ 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) diff --git a/ncurses-5.3/config.guess b/ncurses-5.3/config.guess new file mode 100755 index 0000000..9f4e5a6 --- /dev/null +++ b/ncurses-5.3/config.guess @@ -0,0 +1,1363 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-08-23' + +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# 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. +# +# 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. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +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." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +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 +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# This shell variable is my proudest work .. or something. --bje + +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +dummy=$tmpdir/dummy ; +files="$dummy.c $dummy.o $dummy.rel $dummy" ; +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $files ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; +unset files' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" 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 + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + eval $set_cc_for_build + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + 3-1307) + UNAME_MACHINE="alphaev7" + ;; + esac + fi + rm -f $dummy.s $dummy && rmdir $tmpdir + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # 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} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # 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 ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + 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 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 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 + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy && rmdir $tmpdir + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + 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 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; + 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 + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c && rmdir $tmpdir + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + 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 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + 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 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # 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 0 ;; + 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 + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + 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 + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + 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, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + 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 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) + OS_REL='' + 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 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +rm -f $dummy.c $dummy && rmdir $tmpdir + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +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` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/ncurses-5.3/config.log b/ncurses-5.3/config.log new file mode 100644 index 0000000..945786b --- /dev/null +++ b/ncurses-5.3/config.log @@ -0,0 +1,152 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by configure, which was +generated by GNU Autoconf 2.52.20011227. Invocation command line was + + $ ./configure --host=powerpc-rtems --prefix=/opt/rtems/ppc-rtems --libdir=/opt/rtems/ppc-rtems/mcp750/lib --includedir=/opt/rtems/ppc-rtems/mcp750/lib/include --without-ada --without-progs --without-cxx-binding --with-bool=unsigned char --disable-sigwinch --disable-database --with-fallbacks=xterm,vt100,linux,ansi + +## ---------- ## +## Platform. ## +## ---------- ## + +hostname = TiRex.local. +uname -m = Power Macintosh +uname -r = 6.2 +uname -s = Darwin +uname -v = Darwin Kernel Version 6.2: Tue Nov 5 22:00:03 PST 2002; root:xnu/xnu-344.12.2.obj~1/RELEASE_PPC + +/usr/bin/uname -p = powerpc +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +hostinfo = Mach kernel version: + Darwin Kernel Version 6.2: +Tue Nov 5 22:00:03 PST 2002; root:xnu/xnu-344.12.2.obj~1/RELEASE_PPC + + +Kernel configured for up to 2 processors. +1 processor is physically available. +Processor type: ppc7450 (PowerPC 7450) +Processor active: 0 +Primary memory available: 512.00 megabytes. +Default processor set: 62 tasks, 132 threads, 1 processors +Load average: 3.16, Mach factor: 0.23 +unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH = /sw/bin:/sw/sbin:/Users/eric/bin:/bin:/sbin:/usr/bin:/usr/sbin:/opt/rtems/bin:/Users/eric/src/EPICS/Darwin/epics/local/bin/darwin-ppc:/Users/eric/src/EPICS/Darwin/epics/base/bin/darwin-ppc:/Users/eric/src/EPICS/Darwin/epics/extensions/bin/darwin-ppc:/usr/X11R6/bin + +## ------------ ## +## Core tests. ## +## ------------ ## + +configure:1023: PATH=".;."; conftest.sh +./configure: conftest.sh: command not found +configure:1026: $? = 127 +configure:1043: result: Configuring NCURSES 5.3 ABI 5 (Wed Dec 18 17:34:31 CST 2002) +configure:1077: checking build system type +configure:1095: result: powerpc-apple-darwin6.2 +configure:1102: checking host system type +configure:1116: result: powerpc-unknown-rtems +configure:1124: checking target system type +configure:1138: result: powerpc-unknown-rtems +configure:1169: result: Configuring for rtems +configure:1222: checking for prefix +configure:1234: result: /opt/rtems/ppc-rtems +configure:1274: checking for powerpc-rtems-gcc +configure:1297: result: ppc-rtems-gcc --pipe -B/opt/rtems/ppc-rtems/mcp750/lib/ -specs bsp_specs -qrtems -mcpu=750 -Dmpc750 +configure:1560: checking for C compiler version +configure:1563: ppc-rtems-gcc --pipe -B/opt/rtems/ppc-rtems/mcp750/lib/ -specs bsp_specs -qrtems -mcpu=750 -Dmpc750 --version &5 +ppc-rtems-gcc (GCC) 3.2.1 +Copyright (C) 2002 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. + +configure:1566: $? = 0 +configure:1568: ppc-rtems-gcc --pipe -B/opt/rtems/ppc-rtems/mcp750/lib/ -specs bsp_specs -qrtems -mcpu=750 -Dmpc750 -v &5 +Reading specs from /opt/rtems/lib/gcc-lib/ppc-rtems/3.2.1/specs +Reading specs from /opt/rtems/ppc-rtems/mcp750/lib/bsp_specs +rename spec cpp to old_cpp +rename spec lib to old_lib +rename spec endfile to old_endfile +rename spec startfile to old_startfile +rename spec link to old_link +Configured with: ../gcc-3.2.1/configure --target=ppc-rtems --prefix=/opt/rtems --with-gnu-as --with-gnu-ld --with-newlib --verbose --with-system-zlib --disable-nls --enable-version-specific-runtime-libs --enable-threads=rtems --enable-languages=c,c++ +Thread model: rtems +gcc version 3.2.1 +configure:1571: $? = 0 +configure:1573: ppc-rtems-gcc --pipe -B/opt/rtems/ppc-rtems/mcp750/lib/ -specs bsp_specs -qrtems -mcpu=750 -Dmpc750 -V &5 +ppc-rtems-gcc: argument to `-V' is missing +configure:1576: $? = 1 +configure:1596: checking for C compiler default output +configure:1599: ppc-rtems-gcc --pipe -B/opt/rtems/ppc-rtems/mcp750/lib/ -specs bsp_specs -qrtems -mcpu=750 -Dmpc750 conftest.c >&5 +/opt/rtems/ppc-rtems/mcp750/lib/librtemsbsp.a(console.o): In function `__assert': +/Users/eric/src/RTEMS/build/ppc-rtems/c/mcp750/lib/libbsp/powerpc/motorola_powerpc/console/../../../../../../../../../rtems-cvs/c/src/lib/libbsp/powerpc/shared/console/console.c:60: multiple definition of `__assert' +/opt/rtems/lib/gcc-lib/ppc-rtems/3.2.1/../../../../ppc-rtems/lib/m750/libc.a(assert.o):/Users/eric/src/RTEMS/bt/build/ppc-rtems/m750/newlib/libc/stdlib/../../../../../../gcc-3.2.1/newlib/libc/stdlib/assert.c:56: first defined here +/opt/rtems/lib/gcc-lib/ppc-rtems/3.2.1/../../../../ppc-rtems/bin/ld: Warning: size of symbol `__assert' changed from 68 to 172 in /opt/rtems/ppc-rtems/mcp750/lib/librtemsbsp.a(console.o) +collect2: ld returned 1 exit status +configure:1602: $? = 1 +configure: failed program was: +#line 1580 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +configure:1625: error: C compiler cannot create executables + +## ----------------- ## +## Cache variables. ## +## ----------------- ## + +ac_cv_build=powerpc-apple-darwin6.2 +ac_cv_build_alias=powerpc-apple-darwin6.2 +ac_cv_env_CC_set=set +ac_cv_env_CC_value='ppc-rtems-gcc --pipe -B/opt/rtems/ppc-rtems/mcp750/lib/ -specs bsp_specs -qrtems -mcpu=750 -Dmpc750' +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_CXXCPP_set= +ac_cv_env_CXXCPP_value= +ac_cv_env_CXXFLAGS_set= +ac_cv_env_CXXFLAGS_value= +ac_cv_env_CXX_set=set +ac_cv_env_CXX_value='ppc-rtems-gcc --pipe -B/opt/rtems/ppc-rtems/mcp750/lib/ -specs bsp_specs -qrtems -mcpu=750 -Dmpc750' +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set=set +ac_cv_env_host_alias_value=powerpc-rtems +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_host=powerpc-unknown-rtems +ac_cv_host_alias=powerpc-rtems +ac_cv_prog_CC='ppc-rtems-gcc --pipe -B/opt/rtems/ppc-rtems/mcp750/lib/ -specs bsp_specs -qrtems -mcpu=750 -Dmpc750' +ac_cv_target=powerpc-unknown-rtems +ac_cv_target_alias=powerpc-rtems +cf_cv_abi_version=5 +cf_cv_rel_version=5.3 +cf_cv_system_name=rtems +cf_cv_timestamp='Wed Dec 18 17:34:31 CST 2002' + +## ------------ ## +## confdefs.h. ## +## ------------ ## + +#define SYSTEM_NAME "rtems" + + +configure: exit 77 diff --git a/ncurses-5.3/config.sub b/ncurses-5.3/config.sub new file mode 100755 index 0000000..b0222f7 --- /dev/null +++ b/ncurses-5.3/config.sub @@ -0,0 +1,1470 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-08-22' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . Submit a context +# 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. + +# 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. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +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." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# 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* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -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) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # 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 + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39 | mipstx39el \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # 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* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/ncurses-5.3/configure b/ncurses-5.3/configure new file mode 100755 index 0000000..c20c60f --- /dev/null +++ b/ncurses-5.3/configure @@ -0,0 +1,11969 @@ +#! /bin/sh +# From configure.in Revision: 1.274 . +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.52.20011227. +# +# 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/base/lib_initscr.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 +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP + +# +# 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 + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP 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:933: 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:944: 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:952: 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:968: 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:972: 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:978: 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:980: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:982: 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:1001: 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:1003: 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 + +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:1023: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:1026: \$? = $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" + +NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[ ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`" +NCURSES_MINOR="`egrep '^NCURSES_MINOR[ ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`" +NCURSES_PATCH="`egrep '^NCURSES_PATCH[ ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`" +cf_cv_abi_version=${NCURSES_MAJOR} +cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} +cf_cv_timestamp=`date` +echo "$as_me:1043: 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 + +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:1063: 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:1073: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:1077: 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:1086: 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:1090: 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:1095: 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:1102: 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:1111: 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:1116: 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 ; then + echo "$as_me:1124: 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:1133: 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:1138: 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:1169: 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:1173: 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:1175: 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:1183: WARNING: overriding system type to $withval" >&5 +echo "$as_me: WARNING: overriding system type to $withval" >&2;} + cf_cv_system_name=$withval +fi; + +# We need a configure script only when compiling as part of GNU C library. +# Here we have to generate one of the files we need while compiling. +# +# The only problem is that users of the package might think they have to +# run configure themself and find it irritating when nothing happens. +# +# So we try here to find out whether we are called from the glibc configure +# or by a user. +# + +# Check whether --enable-add-ons or --disable-add-ons was given. +if test "${enable_add_ons+set}" = set; then + enableval="$enable_add_ons" + glibc_add_on=yes +else + glibc_add_on= +fi; + +if test x"$glibc_add_on" = "xyes" ; then + rm -f $srcdir/Banner + # We are in glibc. + rm -f $srcdir/Makefile + cp $srcdir/Makefile.glibc $srcdir/Makefile + echo "ncurses `grep \"^[ ]*ncurses-version[ ]*=.*$\" \ + $srcdir/Makefile | sed -e \ + 's/^[ ]*ncurses-version[ ]*=[ ]*\([^ ^ ]*\)[ ]*$/\1/'`" > $srcdir/Banner + exit 0 +fi + +### Save the given $CFLAGS to allow user-override. +cf_user_CFLAGS="$CFLAGS" + +### Default install-location + +echo "$as_me:1222: 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*|netbsd*|freebsd*|linux*|cygwin*) + prefix=/usr + ;; + *) prefix=$ac_default_prefix + ;; + esac +fi +echo "$as_me:1234: result: $prefix" >&5 +echo "${ECHO_T}$prefix" >&6 + +if test "x$prefix" = "xNONE" ; then +echo "$as_me:1238: 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:1261: 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 +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:1274: 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:1289: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1297: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1300: 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:1309: 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:1324: 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:1332: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1335: 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:1348: 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:1363: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1371: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1374: 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:1383: 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:1398: 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:1406: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1409: 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:1422: 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:1442: 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:1464: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1467: 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:1478: 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:1493: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1501: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1504: 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:1517: 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:1532: 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:1540: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1543: 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:1555: 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:1560:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:1563: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:1566: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1568: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:1571: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1573: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:1576: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 1580 "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:1596: 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:1599: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:1602: \$? = $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 | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + 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:1625: 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:1631: 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:1636: 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:1642: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1645: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:1652: 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:1660: 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:1667: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:1669: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:1672: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:1674: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1677: \$? = $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 | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:1693: 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:1699: 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:1705: 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 1711 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:1723: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1726: \$? = $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_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1738: 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:1745: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:1749: 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 1755 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1770: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1773: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1776: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1779: \$? = $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:1791: 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:1797: 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 1803 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1815: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1818: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1821: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1824: \$? = $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:1834: 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:1861: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1864: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1867: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1870: \$? = $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 1882 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1895: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1898: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1901: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1904: \$? = $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 1914 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1926: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1929: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1932: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1935: \$? = $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 -f 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 + +GCC_VERSION=none +if test "$GCC" = yes ; then + echo "$as_me:1964: checking version of gcc" >&5 +echo $ECHO_N "checking version of gcc... $ECHO_C" >&6 + GCC_VERSION="`${CC} --version|head -1`" + echo "$as_me:1967: result: $GCC_VERSION" >&5 +echo "${ECHO_T}$GCC_VERSION" >&6 +fi + +# If we're cross-compiling, allow the user to override the tools and their +# options. The configure script is oriented toward identifying the target +# compiler, etc., but we need a host compiler to generate parts of the source. +BUILD_CC='$(CC)' +BUILD_CFLAGS='$(CFLAGS)' +BUILD_CPPFLAGS='$(CPPFLAGS)' +BUILD_LDFLAGS='$(LDFLAGS)' +BUILD_LIBS='$(LIBS)' +if test "$host_alias" != "$target_alias" ; then + +# 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 $CC gcc cc +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:1990: 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:2005: 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:2013: result: $BUILD_CC" >&5 +echo "${ECHO_T}$BUILD_CC" >&6 +else + echo "$as_me:2016: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$BUILD_CC" && break +done + +fi; + +# 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; + +# 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; + +# 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; + +# 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; +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 +echo "$as_me:2055: 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 2076 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:2081: \"$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:2087: \$? = $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 2110 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2114: \"$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:2120: \$? = $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:2157: 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 2167 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:2172: \"$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:2178: \$? = $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 2201 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2205: \"$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:2211: \$? = $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:2239: 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 + +if test $ac_cv_c_compiler_gnu = yes; then + echo "$as_me:2251: 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 2258 "configure" +#include "confdefs.h" +#include +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 -f conftest* + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +#line 2273 "configure" +#include "confdefs.h" +#include +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 -f conftest* + + fi +fi +echo "$as_me:2286: 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:2293: 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:2298: 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:2312: result: no" >&5 +echo "${ECHO_T}no" >&6 + ISC= +fi + +echo "$as_me:2317: 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_new_cflags= +cf_new_cppflags= +for cf_add_cflags in $cf_arg +do + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + 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 + + cat >conftest.$ac_ext <<_ACEOF +#line 2373 "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:2394: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2397: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2400: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2403: \$? = $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:2416: 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_new_cflags= +cf_new_cppflags= +for cf_add_cflags in $cf_cv_ansi_cc +do + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + 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 + +else + cat >>confdefs.h <<\EOF +#define CC_HAS_PROTOS 1 +EOF + +fi +fi + +if test "$cf_cv_ansi_cc" = "no"; then + { { echo "$as_me:2461: 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 + +PROG_EXT= +case $cf_cv_system_name in +os2*) + # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@ + CFLAGS="$CFLAGS -Zmt" + CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" + CXXFLAGS="$CXXFLAGS -Zmt" + LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"` + PROG_EXT=".exe" + ;; +cygwin*) + PROG_EXT=".exe" + ;; +esac + +test -n "$PROG_EXT" && cat >>confdefs.h <&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 +else + case $LDCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$LDPATH" +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_LDCONFIG="$ac_dir/$ac_word" + echo "$as_me:2517: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +LDCONFIG=$ac_cv_path_LDCONFIG + +if test -n "$LDCONFIG"; then + echo "$as_me:2528: result: $LDCONFIG" >&5 +echo "${ECHO_T}$LDCONFIG" >&6 +else + echo "$as_me:2531: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + ;; +esac + +echo "$as_me:2538: 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. +if test "${with_cxx+set}" = set; then + withval="$with_cxx" + cf_with_cxx=$withval +else + cf_with_cxx=yes +fi; +echo "$as_me:2548: result: $cf_with_cxx" >&5 +echo "${ECHO_T}$cf_with_cxx" >&6 +if test "X$cf_with_cxx" = Xno ; then + CXX="" + GXX="" +else + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +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 +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + 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:2564: 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 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_tool_prefix$ac_prog" +echo "$as_me:2579: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:2587: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:2590: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +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:2603: 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 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_CXX="$ac_prog" +echo "$as_me:2618: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:2626: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:2629: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + +# Provide some information about the compiler. +echo "$as_me:2641:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:2644: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:2647: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:2649: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:2652: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:2654: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:2657: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:2660: 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 2666 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2681: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2684: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2687: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2690: \$? = $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_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:2702: 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:2708: 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 2714 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2726: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2729: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2732: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2735: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cxx_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2745: 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 +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +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 2772 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2785: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2788: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2791: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2794: \$? = $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 2804 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2816: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2819: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2822: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2825: \$? = $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 -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +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 + + fi + +GXX_VERSION=none +if test "$GXX" = yes; then + echo "$as_me:2851: checking version of g++" >&5 +echo $ECHO_N "checking version of g++... $ECHO_C" >&6 + GXX_VERSION="`${CXX-g++} --version|head -1`" + echo "$as_me:2854: result: $GXX_VERSION" >&5 +echo "${ECHO_T}$GXX_VERSION" >&6 + case $GXX_VERSION in + 1*|2.[0-6]*) + GXX=""; CXX=""; ac_cv_cxx_compiler_gnu=no + cf_cxx_library=no + { echo "$as_me:2860: WARNING: templates do not work" >&5 +echo "$as_me: WARNING: templates do not work" >&2;} + ;; + esac +fi + +echo "$as_me:2866: 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. +if test "${with_cxx_binding+set}" = set; then + withval="$with_cxx_binding" + cf_with_cxx_binding=$withval +else + cf_with_cxx_binding=$cf_with_cxx +fi; +echo "$as_me:2876: result: $cf_with_cxx_binding" >&5 +echo "${ECHO_T}$cf_with_cxx_binding" >&6 + +echo "$as_me:2879: 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. +if test "${with_ada+set}" = set; then + withval="$with_ada" + cf_with_ada=$withval +else + cf_with_ada=yes +fi; +echo "$as_me:2889: result: $cf_with_ada" >&5 +echo "${ECHO_T}$cf_with_ada" >&6 + +echo "$as_me:2892: 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. +if test "${with_progs+set}" = set; then + withval="$with_progs" + cf_with_progs=$withval +else + cf_with_progs=yes +fi; +echo "$as_me:2902: result: $cf_with_progs" >&5 +echo "${ECHO_T}$cf_with_progs" >&6 + +echo "$as_me:2905: 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. +if test "${with_curses_h+set}" = set; then + withval="$with_curses_h" + with_curses_h=$withval +else + with_curses_h=yes +fi; +echo "$as_me:2915: result: $with_curses_h" >&5 +echo "${ECHO_T}$with_curses_h" >&6 + +modules_to_build="ncurses" +if test "X$cf_with_progs" != Xno ; then +modules_to_build="$modules_to_build progs tack" +fi +modules_to_build="$modules_to_build panel menu form" + +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 + +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:2941: 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:2956: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:2964: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:2967: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:2974: 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:2994: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:2998: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +# 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:3015: 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:3064: 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 + +echo "$as_me:3085: 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:3124: 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 + +echo "$as_me:3134: 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 + + 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 +echo "$as_me:3150: 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 + +echo "$as_me:3156: 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:3160: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:3163: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +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:3170: 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:3185: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:3193: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:3196: 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:3205: 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:3220: 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:3229: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:3232: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +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:3243: 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:3258: 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:3267: result: $MAKE_LOWER_TAGS" >&5 +echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 +else + echo "$as_me:3270: 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:3277: 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:3292: 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:3301: result: $MAKE_UPPER_TAGS" >&5 +echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 +else + echo "$as_me:3304: 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 + +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:3328: 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:3343: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +LINT=$ac_cv_prog_LINT +if test -n "$LINT"; then + echo "$as_me:3351: result: $LINT" >&5 +echo "${ECHO_T}$LINT" >&6 +else + echo "$as_me:3354: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$LINT" && break +done + +for ac_prog in man man_db +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:3365: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MAN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$MAN"; then + ac_cv_prog_MAN="$MAN" # 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_MAN="$ac_prog" +echo "$as_me:3380: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +MAN=$ac_cv_prog_MAN +if test -n "$MAN"; then + echo "$as_me:3388: result: $MAN" >&5 +echo "${ECHO_T}$MAN" >&6 +else + echo "$as_me:3391: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$MAN" && break +done + +if test "${cf_cv_subst_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +echo "$as_me:3402: checking for loader (symbol LD)" >&5 +echo $ECHO_N "checking for loader (symbol LD)... $ECHO_C" >&6 +test -z "$LD" && LD=ld +echo "$as_me:3405: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 + +cf_cv_subst_LD=$LD +fi + +LD=${cf_cv_subst_LD} + +if test "${cf_cv_subst_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +echo "$as_me:3417: checking for archiver (symbol AR)" >&5 +echo $ECHO_N "checking for archiver (symbol AR)... $ECHO_C" >&6 +test -z "$AR" && AR=ar +echo "$as_me:3420: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 + +cf_cv_subst_AR=$AR +fi + +AR=${cf_cv_subst_AR} + +if test "${cf_cv_subst_AR_OPTS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +echo "$as_me:3432: checking for archiver options (symbol AR_OPTS)" >&5 +echo $ECHO_N "checking for archiver options (symbol AR_OPTS)... $ECHO_C" >&6 +test -z "$AR_OPTS" && AR_OPTS=rv +echo "$as_me:3435: result: $AR_OPTS" >&5 +echo "${ECHO_T}$AR_OPTS" >&6 + +cf_cv_subst_AR_OPTS=$AR_OPTS +fi + +AR_OPTS=${cf_cv_subst_AR_OPTS} + +echo "$as_me:3443: 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` + 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 no match "$cf_result" + ;; + esac + done + rm -f cf_makeflags.tmp + +fi +echo "$as_me:3476: result: $cf_cv_makeflags" >&5 +echo "${ECHO_T}$cf_cv_makeflags" >&6 + +echo "$as_me:3479: 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:3492: result: $DESTDIR" >&5 +echo "${ECHO_T}$DESTDIR" >&6 + +############################################################################### + +### 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:3502: 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. +if test "${with_libtool+set}" = set; then + withval="$with_libtool" + with_libtool=$withval +else + with_libtool=no +fi; +echo "$as_me:3512: result: $with_libtool" >&5 +echo "${ECHO_T}$with_libtool" >&6 +if test "$with_libtool" = "yes"; then + cf_list_models="$cf_list_models libtool" + test -z "$LIBTOOL" && LIBTOOL=libtool +else + LIBTOOL="" +fi + +echo "$as_me:3521: 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. +if test "${with_shared+set}" = set; then + withval="$with_shared" + with_shared=$withval +else + with_shared=no +fi; +echo "$as_me:3531: result: $with_shared" >&5 +echo "${ECHO_T}$with_shared" >&6 +test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" + +echo "$as_me:3535: 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. +if test "${with_normal+set}" = set; then + withval="$with_normal" + with_normal=$withval +else + with_normal=yes +fi; +echo "$as_me:3545: result: $with_normal" >&5 +echo "${ECHO_T}$with_normal" >&6 +test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal" + +echo "$as_me:3549: 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. +if test "${with_debug+set}" = set; then + withval="$with_debug" + with_debug=$withval +else + with_debug=yes +fi; +echo "$as_me:3559: result: $with_debug" >&5 +echo "${ECHO_T}$with_debug" >&6 +test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug" + +echo "$as_me:3563: 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. +if test "${with_profile+set}" = set; then + withval="$with_profile" + with_profile=$withval +else + with_profile=no +fi; +echo "$as_me:3573: result: $with_profile" >&5 +echo "${ECHO_T}$with_profile" >&6 +test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" + +############################################################################### + +echo "$as_me:3579: 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" = "yes" && cf_list_models=libtool +echo "$as_me:3583: 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:3588: 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:3591: result: $DFT_LWR_MODEL" >&5 +echo "${ECHO_T}$DFT_LWR_MODEL" >&6 + +DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +TINFO_NAME=tinfo + +LIB_NAME=ncurses + +LIB_DIR=../lib + + case $cf_cv_system_name in + OS/2*) LIB_PREFIX='' ;; + os2*) LIB_PREFIX='' ;; + *) LIB_PREFIX='lib' ;; + esac +cf_prefix=$LIB_PREFIX + +LIB_PREFIX=$cf_prefix + +LIB_SUFFIX= + +############################################################################### + +echo "$as_me:3615: 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. +if test "${with_termlib+set}" = set; then + withval="$with_termlib" + with_termlib=$withval +else + with_termlib=no +fi; +echo "$as_me:3625: result: $with_termlib" >&5 +echo "${ECHO_T}$with_termlib" >&6 + +### Checks for special libraries, must be done up-front. +echo "$as_me:3629: checking if you want to link with dbmalloc for testing" >&5 +echo $ECHO_N "checking if you want to link with 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" + with_dbmalloc=$withval +else + with_dbmalloc=no +fi; +echo "$as_me:3639: result: $with_dbmalloc" >&5 +echo "${ECHO_T}$with_dbmalloc" >&6 +if test "$with_dbmalloc" = yes ; then + +echo "$as_me:3643: 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 3651 "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:3670: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3673: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3676: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3679: \$? = $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:3690: 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 link with 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" + with_dmalloc=$withval +else + with_dmalloc=no +fi; +echo "$as_me:3713: result: $with_dmalloc" >&5 +echo "${ECHO_T}$with_dmalloc" >&6 +if test "$with_dmalloc" = yes ; then + +echo "$as_me:3717: 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 3725 "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:3744: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3747: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3750: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3753: \$? = $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:3764: 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 link with the gpm mouse library... $ECHO_C" >&6 + +# Check whether --with-gpm or --without-gpm was given. +if test "${with_gpm+set}" = set; then + withval="$with_gpm" + with_gpm=$withval +else + with_gpm=no +fi; +echo "$as_me:3788: result: $with_gpm" >&5 +echo "${ECHO_T}$with_gpm" >&6 +if test "$with_gpm" = yes ; then + echo "$as_me:3791: 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 3799 "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:3818: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3821: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3824: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3827: \$? = $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:3838: 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 + + EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS" + SHLIB_LIST="-lgpm $SHLIB_LIST" + cat >>confdefs.h <<\EOF +#define HAVE_LIBGPM 1 +EOF + +for ac_header in gpm.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:3851: 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 3857 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:3861: \"$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:3867: \$? = $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:3886: 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: WARNING: Cannot link with gpm library - read the FAQ" >&2;} +fi + +fi + +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 + +if test X"$CXX_G_OPT" = X"" ; then + CXX_G_OPT='-g' + test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT='' +fi + +echo "$as_me:3913: 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='' ;; +normal) LD_MODEL='' ;; +debug) LD_MODEL=$CC_G_OPT ;; +profile) LD_MODEL='-pg';; +shared) LD_MODEL='' ;; +esac +echo "$as_me:3922: result: $LD_MODEL" >&5 +echo "${ECHO_T}$LD_MODEL" >&6 + +echo "$as_me:3925: 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 +else + cf_cv_ld_rpath=no +fi; +echo "$as_me:3935: result: $cf_cv_ld_rpath" >&5 +echo "${ECHO_T}$cf_cv_ld_rpath" >&6 + + LOCAL_LDFLAGS= + LOCAL_LDFLAGS2= + LD_SHARED_OPTS= + INSTALL_LIB="-m 644" + + cf_cv_do_symlinks=no + + echo "$as_me:3945: 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:3960: 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:3969: 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:3978: 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 3985 "configure" +#include "confdefs.h" +#include +int +main () +{ +int x = 1 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3997: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4000: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4003: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4006: \$? = $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:4015: 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*) + MK_SHARED_LIB='$(CC) -o $@ -Xlinker -soname=`basename $@` -nostart -e 0' + ;; + cygwin*) + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared -Wl,--out-implib=$(IMPORT_LIB) -Wl,--export-all-symbols -o $(SHARED_LIB)' + cf_cv_shlib_version=cygdll + cf_cv_shlib_version_infix=cygdll + ;; + darwin*) + EXTRA_CFLAGS="-no-cpp-precomp" + CC_SHARED_OPTS="-dynamic" + MK_SHARED_LIB='$(CC) -dynamiclib -install_name $(DESTDIR)$(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 + ;; + hpux*) + # (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*) + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" + fi + # tested with IRIX 5.2 and 'cc'. + if test "$GCC" != yes; then + CC_SHARED_OPTS='-KPIC' + fi + MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $@` -o $@' + cf_cv_rm_so_locs=yes + ;; + linux*|gnu*) + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" + fi + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION),-stats,-lc -o $@' + ;; + openbsd2*) + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + MK_SHARED_LIB='$(LD) -Bshareable -soname,`basename $@.$(ABI_VERSION)` -o $@' + ;; + openbsd*|freebsd*) + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + MK_SHARED_LIB='$(LD) -Bshareable -o $@' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + ;; + netbsd*) + 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,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" + MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@' + if test "$cf_cv_shlib_version" = auto; then + if test ! -f /usr/libexec/ld.elf_so; then + cf_cv_shlib_version=rel + fi + fi + else + MK_SHARED_LIB='$(LD) -Bshareable -o $@' + fi + ;; + 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 + 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,`pwd`/lib" + 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 + # tested with osr5.0.5 + if test "$ac_cv_c_compiler_gnu" != 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 + # 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*) + # tested with SunOS 4.1.1 and gcc 2.7.0 + if test "$ac_cv_c_compiler_gnu" != 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*) + # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 + if test "$ac_cv_c_compiler_gnu" != yes; then + CC_SHARED_OPTS='-KPIC' + fi + MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@' + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-R `pwd`/lib:\$(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" + fi + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + ;; + sysv5uw7*|unix_sv*) + # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) + if test "$ac_cv_c_compiler_gnu" != 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 $@') + test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes + ;; + *) + { echo "$as_me:4182: 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 + echo "$as_me:4190: 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 4195 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4207: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4210: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4213: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4216: \$? = $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:4226: 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:4235: 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 + +############################################################################### + +### use option --disable-overwrite to leave out the link to -lcurses +echo "$as_me:4245: 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. +if test "${enable_overwrite+set}" = set; then + enableval="$enable_overwrite" + with_overwrite=$enableval +else + if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi +fi; +echo "$as_me:4255: result: $with_overwrite" >&5 +echo "${ECHO_T}$with_overwrite" >&6 + +echo "$as_me:4258: 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. +if test "${enable_database+set}" = set; then + enableval="$enable_database" + use_database=$enableval +else + use_database=yes +fi; +echo "$as_me:4268: result: $use_database" >&5 +echo "${ECHO_T}$use_database" >&6 + +case $host_os in #(vi +os2*) #(vi + TERMINFO_SRC='${top_srcdir}/misc/emx.src' + ;; +*) #(vi + TERMINFO_SRC='${top_srcdir}/misc/terminfo.src' + ;; +esac + + case $cf_cv_system_name in + os2*) PATHSEP=';' ;; + *) PATHSEP=':' ;; + esac + +if test "$use_database" != no ; then + cat >>confdefs.h <<\EOF +#define USE_DATABASE 1 +EOF + + echo "$as_me:4290: 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" + TERMINFO_SRC=$withval +fi; + echo "$as_me:4298: result: $TERMINFO_SRC" >&5 +echo "${ECHO_T}$TERMINFO_SRC" >&6 +fi + +echo "$as_me:4302: 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. +if test "${with_fallbacks+set}" = set; then + withval="$with_fallbacks" + with_fallback=$withval +else + with_fallback= +fi; +echo "$as_me:4312: result: $with_fallback" >&5 +echo "${ECHO_T}$with_fallback" >&6 +FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'` + +MAKE_TERMINFO= +if test "$use_database" = no ; then + TERMINFO="${datadir}/terminfo" + MAKE_TERMINFO="#" +else + +echo "$as_me:4322: 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. +if test "${with_terminfo_dirs+set}" = set; then + withval="$with_terminfo_dirs" + +else + withval=${TERMINFO_DIRS-${datadir}/terminfo} +fi; +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +cf_dst_path= +for cf_src_path in $withval +do + +case ".$cf_src_path" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(vi + eval cf_src_path="$cf_src_path" + case ".$cf_src_path" in #(vi + .NONE/*) + cf_src_path=`echo $cf_src_path | sed -e s%NONE%$ac_default_prefix%` + ;; + esac + ;; #(vi +.NONE/*) + cf_src_path=`echo $cf_src_path | sed -e s%NONE%$ac_default_prefix%` + ;; +*) + { { echo "$as_me:4356: 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; }; } + ;; +esac + + test -n "$cf_dst_path" && cf_dst_path="${cf_dst_path}:" + cf_dst_path="${cf_dst_path}${cf_src_path}" +done +IFS="$ac_save_ifs" + +eval 'TERMINFO_DIRS="$cf_dst_path"' + +echo "$as_me:4369: result: $TERMINFO_DIRS" >&5 +echo "${ECHO_T}$TERMINFO_DIRS" >&6 +test -n "$TERMINFO_DIRS" && cat >>confdefs.h <&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. +if test "${with_default_terminfo_dir+set}" = set; then + withval="$with_default_terminfo_dir" + +else + withval="${TERMINFO-${datadir}/terminfo}" +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%$ac_default_prefix%` + ;; + esac + ;; #(vi +.NONE/*) + withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%` + ;; +*) + { { echo "$as_me:4404: error: expected a pathname, not \"$withval\"" >&5 +echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + +eval TERMINFO="$withval" + +echo "$as_me:4412: result: $TERMINFO" >&5 +echo "${ECHO_T}$TERMINFO" >&6 +cat >>confdefs.h <&5 +echo $ECHO_N "checking if big-core option selected... $ECHO_C" >&6 + +# Check whether --enable-big-core or --disable-big-core was given. +if test "${enable_big_core+set}" = set; then + enableval="$enable_big_core" + with_big_core=$enableval +else + if test "$cross_compiling" = yes; then + with_big_core=no +else + cat >conftest.$ac_ext <<_ACEOF +#line 4434 "configure" +#include "confdefs.h" + +#include +#include +int main() { + unsigned long n = 6000000L; + char *s = malloc(n); + if (s != 0) + s[0] = s[n-1] = 0; + exit(s == 0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4448: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4451: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4453: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4456: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + with_big_core=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +with_big_core=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi; +echo "$as_me:4468: 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 +EOF + +### use option --enable-termcap to compile in the termcap fallback support +echo "$as_me:4475: 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. +if test "${enable_termcap+set}" = set; then + enableval="$enable_termcap" + with_termcap=$enableval +else + with_termcap=no +fi; +echo "$as_me:4485: 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:4491: 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 + fi + cat >>confdefs.h <<\EOF +#define PURE_TERMINFO 1 +EOF + +else + +cat >>confdefs.h <<\EOF +#define USE_TERMCAP 1 +EOF + +echo "$as_me:4506: 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. +if test "${with_termpath+set}" = set; then + withval="$with_termpath" + +else + withval=${TERMPATH-/etc/termcap:/usr/share/misc/termcap} +fi; +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +cf_dst_path= +for cf_src_path in $withval +do + +case ".$cf_src_path" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(vi + eval cf_src_path="$cf_src_path" + case ".$cf_src_path" in #(vi + .NONE/*) + cf_src_path=`echo $cf_src_path | sed -e s%NONE%$ac_default_prefix%` + ;; + esac + ;; #(vi +.NONE/*) + cf_src_path=`echo $cf_src_path | sed -e s%NONE%$ac_default_prefix%` + ;; +*) + { { echo "$as_me:4540: 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; }; } + ;; +esac + + test -n "$cf_dst_path" && cf_dst_path="${cf_dst_path}:" + cf_dst_path="${cf_dst_path}${cf_src_path}" +done +IFS="$ac_save_ifs" + +eval 'TERMPATH="$cf_dst_path"' + +echo "$as_me:4553: result: $TERMPATH" >&5 +echo "${ECHO_T}$TERMPATH" >&6 +test -n "$TERMPATH" && cat >>confdefs.h <&5 +echo $ECHO_N "checking if fast termcap-loader is needed... $ECHO_C" >&6 + +# Check whether --enable-getcap or --disable-getcap was given. +if test "${enable_getcap+set}" = set; then + enableval="$enable_getcap" + with_getcap=$enableval +else + with_getcap=no +fi; +echo "$as_me:4570: 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:4576: 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. +if test "${enable_getcap_cache+set}" = set; then + enableval="$enable_getcap_cache" + with_getcap_cache=$enableval +else + with_getcap_cache=no +fi; +echo "$as_me:4586: 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 +EOF + +fi + +### Use option --enable-symlinks to make tic use symlinks, not hard links +### to reduce storage requirements for the terminfo database. + +for ac_func in \ + remove \ + unlink +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:4602: 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 4608 "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:4639: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4642: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4645: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4648: \$? = $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:4658: 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 $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 4681 "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:4712: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4715: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4718: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4721: \$? = $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:4731: 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 link/symlink functions work... $ECHO_C" >&6 +if test "${cf_cv_link_funcs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cf_cv_link_funcs= + for cf_func in link symlink ; do + if test "$cross_compiling" = yes; then + + eval 'ac_cv_func_'$cf_func'=error' +else + cat >conftest.$ac_ext <<_ACEOF +#line 4755 "configure" +#include "confdefs.h" + +#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 + exit (fail); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4785: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4788: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4790: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4793: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_link_funcs="$cf_cv_link_funcs $cf_func" + eval 'ac_cv_func_'$cf_func'=yes' +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + + eval 'ac_cv_func_'$cf_func'=no' +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + done + test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no + +fi +echo "$as_me:4811: 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 +EOF + + test "$ac_cv_func_symlink" = yes && cat >>confdefs.h <<\EOF +#define HAVE_SYMLINK 1 +EOF + +fi + +with_links=no +with_symlinks=no + +if test "$ac_cv_func_link" != yes ; then + echo "$as_me:4827: checking if tic should use symbolic links" >&5 +echo $ECHO_N "checking if tic should use symbolic links... $ECHO_C" >&6 + if test "$ac_cv_func_symlink" = yes ; then + with_symlinks=yes + else + with_symlinks=no + fi + echo "$as_me:4834: result: $with_symlinks" >&5 +echo "${ECHO_T}$with_symlinks" >&6 +elif test "$ac_cv_func_symlink" != yes ; then + echo "$as_me:4837: 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:4844: result: $with_links" >&5 +echo "${ECHO_T}$with_links" >&6 +else + echo "$as_me:4847: 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. +if test "${enable_symlinks+set}" = set; then + enableval="$enable_symlinks" + with_symlinks=$enableval +else + with_symlinks=no +fi; + echo "$as_me:4857: result: $with_symlinks" >&5 +echo "${ECHO_T}$with_symlinks" >&6 +fi + +test "$with_links" = yes && cat >>confdefs.h <<\EOF +#define USE_LINKS 1 +EOF + +test "$with_symlinks" = yes && cat >>confdefs.h <<\EOF +#define USE_SYMLINKS 1 +EOF + +### use option --enable-broken-linker to force on use of broken-linker support +echo "$as_me:4870: 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 +fi; +echo "$as_me:4880: 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 + + ;; + esac +fi + +### use option --with-bool to override bool's type +echo "$as_me:4905: 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. +if test "${with_bool+set}" = set; then + withval="$with_bool" + NCURSES_BOOL="$withval" +else + NCURSES_BOOL=auto +fi; +echo "$as_me:4915: result: $NCURSES_BOOL" >&5 +echo "${ECHO_T}$NCURSES_BOOL" >&6 + +### use option --with-ospeed to override ospeed's type +echo "$as_me:4919: 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. +if test "${with_ospeed+set}" = set; then + withval="$with_ospeed" + NCURSES_OSPEED="$withval" +else + NCURSES_OSPEED=short +fi; +echo "$as_me:4929: result: $NCURSES_OSPEED" >&5 +echo "${ECHO_T}$NCURSES_OSPEED" >&6 + +### use option --enable-bsdpad to have tputs process BSD-style prefix padding +echo "$as_me:4933: 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. +if test "${enable_bsdpad+set}" = set; then + enableval="$enable_bsdpad" + with_bsdpad=$enableval +else + with_bsdpad=no +fi; +echo "$as_me:4943: result: $with_bsdpad" >&5 +echo "${ECHO_T}$with_bsdpad" >&6 +test "$with_bsdpad" = yes && cat >>confdefs.h <<\EOF +#define BSD_TPUTS 1 +EOF + +### Enable compiling-in rcs id's +echo "$as_me:4950: 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:4960: 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 + +############################################################################### + +echo "$as_me:4968: 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. +if test "${with_manpage_format+set}" = set; then + withval="$with_manpage_format" + MANPAGE_FORMAT=$withval +else + MANPAGE_FORMAT=unknown +fi; + +case ".$MANPAGE_FORMAT" in +.gzip|.compress|.BSDI|.normal|.formatted) # (vi + ;; +.unknown|.) # (vi + if test -z "$MANPATH" ; then + MANPATH="/usr/man:/usr/share/man" + fi + # look for the 'date' man-page (it's most likely to be installed!) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" + MANPAGE_FORMAT=unknown + for cf_dir in $MANPATH; do + test -z "$cf_dir" && cf_dir=/usr/man + for cf_name in $cf_dir/*/date.[01]* $cf_dir/*/date + do + cf_test=`echo $cf_name | sed -e 's/*//'` + if test "x$cf_test" = "x$cf_name" ; then + case "$cf_name" in + *.gz) MANPAGE_FORMAT=gzip;; + *.Z) MANPAGE_FORMAT=compress;; + *.0) MANPAGE_FORMAT=BSDI,formatted;; + *) MANPAGE_FORMAT=normal;; + esac + break + fi + done + if test "$MANPAGE_FORMAT" != "unknown" ; then + break + fi + done + IFS="$ac_save_ifs" + ;; +.*) # (vi + { echo "$as_me:5011: WARNING: Unexpected manpage-format" >&5 +echo "$as_me: WARNING: Unexpected manpage-format" >&2;} + ;; +esac + +echo "$as_me:5016: result: $MANPAGE_FORMAT" >&5 +echo "${ECHO_T}$MANPAGE_FORMAT" >&6 + +echo "$as_me:5019: 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. +if test "${with_manpage_renames+set}" = set; then + withval="$with_manpage_renames" + MANPAGE_RENAMES=$withval +else + MANPAGE_RENAMES=yes +fi; + +case ".$MANPAGE_RENAMES" in #(vi +.no) #(vi + ;; +.|.yes) + # Debian 'man' program? + if test -f /etc/debian_version ; then + MANPAGE_RENAMES=`cd $srcdir && pwd`/man/man_db.renames + else + MANPAGE_RENAMES=no + fi + ;; +esac + +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:5047: error: not a filename: $MANPAGE_RENAMES" >&5 +echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;} + { (exit 1); exit 1; }; } + fi + + test ! -d man && mkdir man + + # Construct a sed-script to perform renaming within man-pages + if test -n "$MANPAGE_RENAMES" ; then + test ! -d man && mkdir man + sh $srcdir/man/make_sed.sh $MANPAGE_RENAMES >man/edit_man.sed + fi +fi + +echo "$as_me:5061: result: $MANPAGE_RENAMES" >&5 +echo "${ECHO_T}$MANPAGE_RENAMES" >&6 + +echo "$as_me:5064: checking for manpage symlinks" >&5 +echo $ECHO_N "checking for manpage symlinks... $ECHO_C" >&6 + +# Check whether --with-manpage-symlinks or --without-manpage-symlinks was given. +if test "${with_manpage_symlinks+set}" = set; then + withval="$with_manpage_symlinks" + MANPAGE_SYMLINKS=$withval +else + MANPAGE_SYMLINKS=yes +fi; + +echo "$as_me:5075: result: $MANPAGE_SYMLINKS" >&5 +echo "${ECHO_T}$MANPAGE_SYMLINKS" >&6 + +echo "$as_me:5078: 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. +if test "${with_manpage_tbl+set}" = set; then + withval="$with_manpage_tbl" + MANPAGE_TBL=$withval +else + MANPAGE_TBL=no +fi; + +echo "$as_me:5089: result: $MANPAGE_TBL" >&5 +echo "${ECHO_T}$MANPAGE_TBL" >&6 + + if test "$prefix" = "NONE" ; then + cf_prefix="$ac_default_prefix" + else + cf_prefix="$prefix" + fi + + case "$MANPAGE_FORMAT" in # (vi + *formatted*) # (vi + cf_subdir='$mandir/cat' + cf_format=yes + ;; + *) + cf_subdir='$mandir/man' + cf_format=no + ;; + esac + +test ! -d man && mkdir man +cat >man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <\$TMP +CF_EOF +else +cat >>man/edit_man.sh <\$TMP +CF_EOF +fi +if test $MANPAGE_TBL = yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi +if test $with_curses_h != yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi +if test $cf_format = yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi +case "$MANPAGE_FORMAT" in #(vi +*compress*) #(vi +cat >>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <&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:5330: 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_CURSES_VERSION 1 +EOF + + cat >>confdefs.h <<\EOF +#define HAVE_HAS_KEY 1 +EOF + + cat >>confdefs.h <<\EOF +#define HAVE_RESIZETERM 1 +EOF + + cat >>confdefs.h <<\EOF +#define HAVE_USE_DEFAULT_COLORS 1 +EOF + + cat >>confdefs.h <<\EOF +#define HAVE_WRESIZE 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:5363: 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:5373: 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 + +echo "$as_me:5380: 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. +if test "${enable_no_padding+set}" = set; then + enableval="$enable_no_padding" + with_no_padding=$enableval +else + with_no_padding=$with_ext_funcs +fi; +echo "$as_me:5390: 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 + +### use option --enable-sigwinch to turn on use of SIGWINCH logic +echo "$as_me:5397: 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. +if test "${enable_sigwinch+set}" = set; then + enableval="$enable_sigwinch" + with_sigwinch=$enableval +else + with_sigwinch=$with_ext_funcs +fi; +echo "$as_me:5407: 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:5414: 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. +if test "${enable_tcap_names+set}" = set; then + enableval="$enable_tcap_names" + with_tcap_names=$enableval +else + with_tcap_names=$with_ext_funcs +fi; +echo "$as_me:5424: result: $with_tcap_names" >&5 +echo "${ECHO_T}$with_tcap_names" >&6 +NCURSES_XNAMES=0 +test "$with_tcap_names" = yes && NCURSES_XNAMES=1 + +############################################################################### +# These options are relatively safe to experiment with. + +echo "$as_me:5432: 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:5442: 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:5446: 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. +if test "${enable_hard_tabs+set}" = set; then + enableval="$enable_hard_tabs" + with_hardtabs=$enableval +else + with_hardtabs=$with_develop +fi; +echo "$as_me:5456: result: $with_hardtabs" >&5 +echo "${ECHO_T}$with_hardtabs" >&6 +test "$with_hardtabs" = yes && cat >>confdefs.h <<\EOF +#define USE_HARD_TABS 1 +EOF + +echo "$as_me:5462: checking if you want to use restrict environment when running as root" >&5 +echo $ECHO_N "checking if you want to use restrict environment when running as root... $ECHO_C" >&6 + +# Check whether --enable-root-environ or --disable-root-environ was given. +if test "${enable_root_environ+set}" = set; then + enableval="$enable_root_environ" + with_root_environ=$enableval +else + with_root_environ=yes +fi; +echo "$as_me:5472: 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 +EOF + +### use option --enable-xmc-glitch to turn on use of magic-cookie optimize +echo "$as_me:5479: 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. +if test "${enable_xmc_glitch+set}" = set; then + enableval="$enable_xmc_glitch" + with_xmc_glitch=$enableval +else + with_xmc_glitch=$with_develop +fi; +echo "$as_me:5489: result: $with_xmc_glitch" >&5 +echo "${ECHO_T}$with_xmc_glitch" >&6 +test "$with_xmc_glitch" = yes && cat >>confdefs.h <<\EOF +#define USE_XMC_SUPPORT 1 +EOF + +############################################################################### +# These are just experimental, probably should not be in a package: + +echo "$as_me:5498: 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. +if test "${enable_assumed_color+set}" = set; then + enableval="$enable_assumed_color" + with_assumed_color=$enableval +else + with_assumed_color=yes +fi; +echo "$as_me:5508: 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:5515: 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. +if test "${enable_hashmap+set}" = set; then + enableval="$enable_hashmap" + with_hashmap=$enableval +else + with_hashmap=yes +fi; +echo "$as_me:5525: 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:5532: 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. +if test "${enable_colorfgbg+set}" = set; then + enableval="$enable_colorfgbg" + with_colorfgbg=$enableval +else + with_colorfgbg=no +fi; +echo "$as_me:5542: result: $with_colorfgbg" >&5 +echo "${ECHO_T}$with_colorfgbg" >&6 +test "$with_colorfgbg" = yes && cat >>confdefs.h <<\EOF +#define USE_COLORFGBG 1 +EOF + +echo "$as_me:5548: 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. +if test "${enable_safe_sprintf+set}" = set; then + enableval="$enable_safe_sprintf" + with_safe_sprintf=$enableval +else + with_safe_sprintf=no +fi; +echo "$as_me:5558: 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 +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:5567: 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. +if test "${enable_scroll_hints+set}" = set; then + enableval="$enable_scroll_hints" + with_scroll_hints=$enableval +else + with_scroll_hints=yes +fi; +echo "$as_me:5577: 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 +EOF + +fi + +### use option --enable-widec to turn on use of wide-character support +NCURSES_CH_T=chtype +NCURSES_LIBUTF8=0 +NCURSES_MBSTATE_T=0 +echo "$as_me:5589: checking if you want experimental wide-character code" >&5 +echo $ECHO_N "checking if you want experimental 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:5599: result: $with_widec" >&5 +echo "${ECHO_T}$with_widec" >&6 +if test "$with_widec" = yes ; then + LIB_SUFFIX="w${LIB_SUFFIX}" + cat >>confdefs.h <<\EOF +#define USE_WIDEC_SUPPORT 1 +EOF + + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" + # with_overwrite=no + NCURSES_CH_T=cchar_t + echo "$as_me:5610: checking for putwc" >&5 +echo $ECHO_N "checking for putwc... $ECHO_C" >&6 +if test "${ac_cv_func_putwc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5616 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char putwc (); 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 putwc (); +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_putwc) || defined (__stub___putwc) +choke me +#else +f = putwc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5647: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5650: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5653: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5656: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_putwc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_putwc=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:5666: result: $ac_cv_func_putwc" >&5 +echo "${ECHO_T}$ac_cv_func_putwc" >&6 + +if test "$ac_cv_func_putwc" != yes ; then + +echo "$as_me:5671: checking for putwc in libutf8" >&5 +echo $ECHO_N "checking for putwc in libutf8... $ECHO_C" >&6 +if test "${cf_cv_libutf8+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cf_save_LIBS="$LIBS" + LIBS="-lutf8 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 5680 "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:5693: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5696: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5699: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5702: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_libutf8=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_libutf8=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS="$cf_save_LIBS" + +fi +echo "$as_me:5714: result: $cf_cv_libutf8" >&5 +echo "${ECHO_T}$cf_cv_libutf8" >&6 + +if test "$cf_cv_libutf8" = yes ; then + cat >>confdefs.h <<\EOF +#define HAVE_LIBUTF8_H 1 +EOF + + LIBS="-lutf8 $LIBS" +fi + + if test "$cf_cv_libutf8" = yes ; then + NCURSES_LIBUTF8=1 + fi +fi + +# This is needed on Tru64 5.0 to declare mbstate_t +echo "$as_me:5731: 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 5738 "configure" +#include "confdefs.h" + +#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:5754: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5757: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5760: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5763: \$? = $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 5770 "configure" +#include "confdefs.h" + +#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:5787: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5790: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5793: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5796: \$? = $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:5808: 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 + +fi + +if test "$cf_cv_mbstate_t" != unknown ; then + cat >>confdefs.h <<\EOF +#define HAVE_MBSTATE_T 1 +EOF + +fi + + if test $cf_cv_mbstate_t = yes ; then + NCURSES_MBSTATE_T=1 + fi +fi + +echo "$as_me:5830: checking for terminal capabilities file" >&5 +echo $ECHO_N "checking for terminal capabilities file... $ECHO_C" >&6 + +# Check whether --with-caps or --without-caps was given. +if test "${with_caps+set}" = set; then + withval="$with_caps" + TERMINFO_CAPS=Caps.$withval +else + TERMINFO_CAPS=Caps +fi; +test -f ${srcdir}/include/${TERMINFO_CAPS} || TERMINFO_CAPS=Caps +echo "$as_me:5841: result: $TERMINFO_CAPS" >&5 +echo "${ECHO_T}$TERMINFO_CAPS" >&6 + +############################################################################### + +### use option --disable-echo to suppress full display compiling commands +echo "$as_me:5847: 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. +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 $@ ... ;' + test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent" +fi +echo "$as_me:5863: result: $with_echo" >&5 +echo "${ECHO_T}$with_echo" >&6 + +### use option --enable-warnings to turn on all gcc warnings +echo "$as_me:5867: 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:5875: result: $with_warnings" >&5 +echo "${ECHO_T}$with_warnings" >&6 + +if test -n "$with_warnings"; then + ADAFLAGS="$ADAFLAGS -gnatg" + +if test "$GCC" = yes +then + cat > conftest.$ac_ext <&5 +echo "$as_me: checking for $CC warning options..." >&6;} + cf_save_CFLAGS="$CFLAGS" + EXTRA_CFLAGS="-W -Wall" + cf_warn_CONST="" + test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" + for cf_opt in \ + 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:5907: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5910: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:5912: result: ... -$cf_opt" >&5 +echo "${ECHO_T}... -$cf_opt" >&6 + EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" + test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES" + fi + done + rm -f conftest* + CFLAGS="$cf_save_CFLAGS" +fi + +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 + scanf|printf) + cat >conftest.h <conftest.h <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5986: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:5988: result: ... $cf_attribute" >&5 +echo "${ECHO_T}... $cf_attribute" >&6 + cat conftest.h >>confdefs.h +# else +# sed -e 's/__attr.*/\/*nothing*\//' conftest.h >>confdefs.h + fi + done +else + fgrep define conftest.i >>confdefs.h +fi +rm -rf conftest* +fi + +### use option --enable-assertions to turn on generation of assertion code +echo "$as_me:6002: 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:6012: 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 + +# Check whether --enable-leaks or --disable-leaks was given. +if test "${enable_leaks+set}" = set; then + enableval="$enable_leaks" + test "$enableval" = no && cat >>confdefs.h <<\EOF +#define NO_LEAKS 1 +EOF + +fi; +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; + +### Checks for libraries. +echo "$as_me:6065: 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 6071 "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:6102: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6105: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6108: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6111: \$? = $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:6121: 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:6130: 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 6138 "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:6157: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6160: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6163: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6166: \$? = $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:6177: 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 + +echo "$as_me:6189: 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 6196 "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:6211: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6214: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6217: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6220: \$? = $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:6230: 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 + +### Checks for header files. + +echo "$as_me:6239: 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 6246 "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:6261: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6264: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6267: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6270: \$? = $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 6279 "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:6294: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6297: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6300: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6303: \$? = $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:6318: 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" + +echo "$as_me:6322: 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 6328 "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:6336: \"$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:6342: \$? = $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 6364 "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 -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 6382 "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 -f 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 6403 "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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:6429: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6432: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:6434: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6437: \$? = $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:6450: 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:6463: 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 6469 "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:6484: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6487: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6490: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6493: \$? = $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:6503: 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 6524 "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:6543: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6546: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6549: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6552: \$? = $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:6563: 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:6570: 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 6578 "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:6597: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6600: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6603: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6606: \$? = $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:6617: 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:6625: 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 6631 "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:6647: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6650: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6653: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6656: \$? = $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:6666: 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 + +echo "$as_me:6676: 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 6683 "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:6701: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6704: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6707: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6710: \$? = $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 6718 "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:6733: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6736: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6739: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6742: \$? = $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 6752 "configure" +#include "confdefs.h" +#include +int +main () +{ + + char *p = compile("", "", ""); + int x = step("", ""); + + ; + 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 + 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 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +fi + +echo "$as_me:6792: 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 + ;; + regexp.h) cat >>confdefs.h <<\EOF +#define HAVE_REGEXP_H_FUNCS 1 +EOF + ;; + regexpr.h) cat >>confdefs.h <<\EOF +#define HAVE_REGEXPR_H_FUNCS 1 +EOF + ;; +esac + +for ac_header in \ +fcntl.h \ +getopt.h \ +libc.h \ +limits.h \ +locale.h \ +poll.h \ +sys/bsdtypes.h \ +sys/ioctl.h \ +sys/param.h \ +sys/poll.h \ +sys/select.h \ +sys/time.h \ +sys/times.h \ +ttyent.h \ +unistd.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:6828: 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 6834 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:6838: \"$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:6844: \$? = $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:6863: 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:6877: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 6885 "configure" +#include "confdefs.h" + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6897: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6900: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6903: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6906: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_cposix_main=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_cposix_main=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6917: 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 $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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-linet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 6936 "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 bzero (); +int +main () +{ +bzero (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6955: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6958: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6961: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6964: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_inet_bzero=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_inet_bzero=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6975: 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" +fi +fi + +echo "$as_me:6982: 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 6989 "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:7009: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7012: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7015: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7018: \$? = $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:7030: 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 + +### 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 + +echo "$as_me:7043: 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 7051 "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:7100: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7103: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7106: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7109: \$? = $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:7126: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:7129: 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:7134: 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 7140 "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:7198: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7201: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7204: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7207: \$? = $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:7217: 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:7227: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +#line 7235 "configure" +#include "confdefs.h" +#ifndef __cplusplus +static $ac_kw int static_foo () {return 0; } +$ac_kw int foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7244: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7247: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7250: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7253: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_inline=$ac_kw; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done + +fi +echo "$as_me:7264: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 +case $ac_cv_c_inline in + inline | yes) ;; + no) +cat >>confdefs.h <<\EOF +#define inline +EOF + ;; + *) cat >>confdefs.h <>confdefs.h <<\EOF +#define CC_HAS_INLINE_FUNCS 1 +EOF + +echo "$as_me:7283: 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 7290 "configure" +#include "confdefs.h" + +int +main () +{ +long x = 1L + 1UL + 1U + 1 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7302: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7305: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7308: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7311: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_unsigned_literals=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_unsigned_literals=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi + +echo "$as_me:7323: result: $cf_cv_unsigned_literals" >&5 +echo "${ECHO_T}$cf_cv_unsigned_literals" >&6 + +echo "$as_me:7326: 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 +else + + if test "$cross_compiling" = yes; then + cf_cv_typeof_chtype=long +else + cat >conftest.$ac_ext <<_ACEOF +#line 7336 "configure" +#include "confdefs.h" + +#ifdef USE_WIDEC_SUPPORT +#include /* we want wchar_t */ +#define WANT_BITS 39 +#else +#define WANT_BITS 31 +#endif +#include +int main() +{ + FILE *fp = fopen("cf_test.out", "w"); + if (fp != 0) { + char *result = "long"; +#ifdef USE_WIDEC_SUPPORT + /* + * If wchar_t is smaller than a long, it must be an int or a + * short. We prefer not to use a short anyway. + */ + if (sizeof(unsigned long) > sizeof(wchar_t)) + result = "int"; +#endif + if (sizeof(unsigned long) > sizeof(unsigned int)) { + int n; + unsigned int x; + for (n = 0; n < WANT_BITS; n++) { + unsigned int y = (x >> n); + if (y != 1 || x == 0) { + x = 0; + break; + } + } + /* + * If x is nonzero, an int is big enough for the bits + * that we want. + */ + result = (x != 0) ? "int" : "long"; + } + fputs(result, fp); + fclose(fp); + } + exit(0); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:7383: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7386: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:7388: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7391: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_typeof_chtype=`cat cf_test.out` +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_typeof_chtype=long +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + rm -f cf_test.out + +fi + +echo "$as_me:7406: result: $cf_cv_typeof_chtype" >&5 +echo "${ECHO_T}$cf_cv_typeof_chtype" >&6 + +cat >>confdefs.h <&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 7426 "configure" +#include "confdefs.h" + +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#include +#include +int +main () +{ +long x = (long) errno + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7444: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7447: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7450: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7453: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_dcl_errno=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_dcl_errno=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:7464: result: $cf_cv_dcl_errno" >&5 +echo "${ECHO_T}$cf_cv_dcl_errno" >&6 + +if test "$cf_cv_dcl_errno" = no ; then + +cf_result=`echo "decl_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <&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 7486 "configure" +#include "confdefs.h" + +#undef errno +extern int errno; + +int +main () +{ +errno = 2 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7501: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7504: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7507: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7510: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have_errno=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have_errno=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +fi +echo "$as_me:7521: result: $cf_cv_have_errno" >&5 +echo "${ECHO_T}$cf_cv_have_errno" >&6 + +if test "$cf_cv_have_errno" = yes ; then + +cf_result=`echo "have_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <&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:7548: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + mv conftest.o data.o && \ + ( $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 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7571: \$? = $ac_status" >&5 + (exit $ac_status); }; then + mv conftest.o func.o && \ + ( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null + fi + rm -f conftest.$ac_ext func.o + ( eval $ac_cv_prog_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 7584 "configure" +#include "confdefs.h" + + int main() + { + extern int testfunc(); + exit (!testfunc()); + } + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:7595: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7598: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:7600: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7603: \$? = $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:7618: 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. + +for ac_func in \ +getcwd \ +getegid \ +geteuid \ +getttynam \ +issetugid \ +memccpy \ +nanosleep \ +poll \ +remove \ +select \ +setbuf \ +setbuffer \ +setvbuf \ +sigaction \ +sigvec \ +strdup \ +strstr \ +tcgetpgrp \ +times \ +vsnprintf \ + +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:7655: 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 7661 "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:7692: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7695: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7698: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7701: \$? = $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:7711: 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 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 7730 "configure" +#include "confdefs.h" + +#include +int +main () +{ + + char temp[128]; + char *buf = temp; + char *db_array = temp; + cgetent(&buf, /* int *, */ &db_array, "vt100"); + cgetcap(buf, "tc", '='); + cgetmatch(buf, "tc"); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7750: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7753: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7756: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7759: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_cgetent=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_cgetent=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +fi + +echo "$as_me:7771: 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 +EOF + +fi + +echo "$as_me:7779: 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 7786 "configure" +#include "confdefs.h" +#include +int +main () +{ +int x = isascii(' ') + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7798: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7801: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7804: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7807: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have_isascii=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have_isascii=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +fi +echo "$as_me:7818: 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:7825: 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 7828 "configure" +#include "confdefs.h" + +#include +#include +int +main () +{ +struct sigaction act + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7842: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7845: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7848: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7851: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + sigact_bad=no +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +#line 7859 "configure" +#include "confdefs.h" + +#define _POSIX_SOURCE +#include +#include +int +main () +{ +struct sigaction act + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7874: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7877: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7880: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7883: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + sigact_bad=yes + cat >>confdefs.h <<\EOF +#define SVR4_ACTION 1 +EOF + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +sigact_bad=unknown +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:7898: result: $sigact_bad" >&5 +echo "${ECHO_T}$sigact_bad" >&6 +fi + +for ac_header in \ +termio.h \ +termios.h \ +unistd.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:7909: 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 7915 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:7919: \"$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:7925: \$? = $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:7944: 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_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 7965 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:7969: \"$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:7975: \$? = $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:7994: 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 whether termios.h needs _POSIX_SOURCE... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line 8015 "configure" +#include "confdefs.h" +#include +int +main () +{ +struct termios foo; int x = foo.c_iflag + ; + 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 + termios_bad=no +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +#line 8044 "configure" +#include "confdefs.h" + +#define _POSIX_SOURCE +#include +int +main () +{ +struct termios foo; int x = foo.c_iflag + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8058: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8061: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8064: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8067: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + termios_bad=unknown +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +termios_bad=yes cat >>confdefs.h <<\EOF +#define SVR4_TERMIO 1 +EOF + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + echo "$as_me:8082: result: $termios_bad" >&5 +echo "${ECHO_T}$termios_bad" >&6 + fi +fi + +echo "$as_me:8087: 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 8094 "configure" +#include "confdefs.h" + +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_TERMIOS_H +#include +#define TTY struct termios +#else +#ifdef HAVE_TERMIO_H +#include +#define TTY struct termio +#endif +#endif + +int +main () +{ + +TTY foo; +tcgetattr(1, &foo); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8122: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8125: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8128: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8131: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have_tcgetattr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have_tcgetattr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8141: 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:8147: 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 8154 "configure" +#include "confdefs.h" + +#include +#include +int +main () +{ + + va_list ap; + vsscanf("from", "%d", ap) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8170: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8173: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8176: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8179: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_func_vsscanf=vsscanf +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +#line 8187 "configure" +#include "confdefs.h" + +#include +#include +int +main () +{ + + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (vfscanf(&strbuf, "%d", ap)) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8209: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8212: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8215: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8218: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_func_vsscanf=vfscanf +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +#line 8226 "configure" +#include "confdefs.h" + +#include +#include +int +main () +{ + + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (_doscan(&strbuf, "%d", ap)) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8248: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8251: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8254: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8257: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_func_vsscanf=_doscan +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + +cf_cv_func_vsscanf=no +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 +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8272: result: $cf_cv_func_vsscanf" >&5 +echo "${ECHO_T}$cf_cv_func_vsscanf" >&6 + +case $cf_cv_func_vsscanf in #(vi +vsscanf) cat >>confdefs.h <<\EOF +#define HAVE_VSSCANF 1 +EOF +;; #(vi +vfscanf) cat >>confdefs.h <<\EOF +#define HAVE_VFSCANF 1 +EOF +;; #(vi +_doscan) cat >>confdefs.h <<\EOF +#define HAVE__DOSCAN 1 +EOF +;; +esac + +echo "$as_me:8290: 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* +if test "$cross_compiling" = yes; then + echo "$as_me:8298: 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 8304 "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:8335: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8338: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8341: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8344: \$? = $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:8354: result: $ac_cv_func_mkstemp" >&5 +echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 + +else + cat >conftest.$ac_ext <<_ACEOF +#line 8359 "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; + exit(result); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:8397: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8400: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:8402: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8405: \$? = $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:8420: result: $cf_cv_func_mkstemp" >&5 +echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 +if test "$cf_cv_func_mkstemp" = yes ; then + cat >>confdefs.h <<\EOF +#define HAVE_MKSTEMP 1 +EOF + +fi + +# setup for prototype of fallback for vsscanf() +if test "$cf_cv_func_vsscanf" = vsscanf ; then + HAVE_VSSCANF=1 +else + HAVE_VSSCANF=0 +fi + +if test "$cross_compiling" = yes ; then + { echo "$as_me:8437: 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:8440: 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:8446: 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 8451 "configure" +#include "confdefs.h" +#include +/* If setvbuf has the reversed format, exit 0. */ +int +main () +{ + /* This call has the arguments reversed. + A reversed system may check and see that the address of main + is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */ + if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0) + exit(1); + putc('\r', stdout); + exit(0); /* Non-reversed systems segv here. */ +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:8468: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8471: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:8473: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8476: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_setvbuf_reversed=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_setvbuf_reversed=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f core core.* *.core +fi +echo "$as_me:8489: 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 + +cat >>confdefs.h <<\EOF +#define SETVBUF_REVERSED 1 +EOF + +fi + +fi +echo "$as_me:8500: 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 8506 "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:8528: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8531: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8534: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8537: \$? = $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:8547: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 + +cat >>confdefs.h <&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 8561 "configure" +#include "confdefs.h" + +#include +int +main () +{ +sigaction_t x + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8574: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8577: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8580: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8583: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_type_sigaction=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_type_sigaction=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi + +echo "$as_me:8594: 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:8600: 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 +else + + cf_cv_sizechange=unknown + cf_save_CPPFLAGS="$CPPFLAGS" + +for cf_opts in "" "NEED_PTEM_H" +do + + CPPFLAGS="$cf_save_CPPFLAGS" + test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts" + cat >conftest.$ac_ext <<_ACEOF +#line 8615 "configure" +#include "confdefs.h" +#include +#ifdef HAVE_TERMIOS_H +#include +#else +#ifdef HAVE_TERMIO_H +#include +#endif +#endif +#ifdef NEED_PTEM_H +/* This is a workaround for SCO: they neglected to define struct winsize in + * termios.h -- it's only in termio.h and ptem.h + */ +#include +#include +#endif +#if !defined(sun) || !defined(HAVE_TERMIOS_H) +#include +#endif + +int +main () +{ + +#ifdef TIOCGSIZE + struct ttysize win; /* FIXME: what system is this? */ + int y = win.ts_lines; + int x = win.ts_cols; +#else +#ifdef TIOCGWINSZ + struct winsize win; + int y = win.ws_row; + int x = win.ws_col; +#else + no TIOCGSIZE or TIOCGWINSZ +#endif /* TIOCGWINSZ */ +#endif /* TIOCGSIZE */ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8659: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8662: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8665: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8668: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_sizechange=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_sizechange=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + CPPFLAGS="$cf_save_CPPFLAGS" + if test "$cf_cv_sizechange" = yes ; then + echo "size-change succeeded ($cf_opts)" >&5 + test -n "$cf_opts" && cf_cv_sizechange="$cf_opts" + break + fi +done + +fi +echo "$as_me:8687: result: $cf_cv_sizechange" >&5 +echo "${ECHO_T}$cf_cv_sizechange" >&6 +if test "$cf_cv_sizechange" != no ; then + cat >>confdefs.h <<\EOF +#define HAVE_SIZECHANGE 1 +EOF + + case $cf_cv_sizechange in #(vi + NEED*) + cat >>confdefs.h <&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 8710 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char memmove (); 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 memmove (); +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_memmove) || defined (__stub___memmove) +choke me +#else +f = memmove; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8741: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8744: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8747: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8750: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_memmove=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_memmove=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8760: 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:8766: 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 8772 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char bcopy (); 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 bcopy (); +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_bcopy) || defined (__stub___bcopy) +choke me +#else +f = bcopy; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8803: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8806: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8809: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8812: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_bcopy=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_bcopy=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8822: 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:8826: 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 +else + + if test "$cross_compiling" = yes; then + cf_cv_good_bcopy=unknown +else + cat >conftest.$ac_ext <<_ACEOF +#line 8836 "configure" +#include "confdefs.h" + +int main() { + static char data[] = "abcdefghijklmnopqrstuwwxyz"; + char temp[40]; + bcopy(data, temp, sizeof(data)); + bcopy(temp+10, temp, 15); + bcopy(temp+5, temp+15, 10); + exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz")); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:8850: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8853: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:8855: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8858: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_good_bcopy=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_good_bcopy=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi +echo "$as_me:8871: result: $cf_cv_good_bcopy" >&5 +echo "${ECHO_T}$cf_cv_good_bcopy" >&6 + +else + cf_cv_good_bcopy=no +fi + + if test "$cf_cv_good_bcopy" = yes ; then + cat >>confdefs.h <<\EOF +#define USE_OK_BCOPY 1 +EOF + + else + cat >>confdefs.h <<\EOF +#define USE_MY_MEMMOVE 1 +EOF + + fi + +fi + +echo "$as_me:8892: 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 +else + +if test "$cross_compiling" = yes; then + cf_cv_working_poll=unknown +else + cat >conftest.$ac_ext <<_ACEOF +#line 8902 "configure" +#include "confdefs.h" + +#include +#ifdef HAVE_POLL_H +#include +#else +#include +#endif +int main() { + struct pollfd myfds; + int ret; + + myfds.fd = 0; + myfds.events = POLLIN; + + ret = poll(&myfds, 1, 100); + exit(ret != 0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:8923: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8926: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (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_working_poll=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_working_poll=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:8943: 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 + +if test -z "$cf_user_CFLAGS" ; then + CFLAGS=`echo ${CFLAGS} | sed -e 's/-g //' -e 's/-g$//'` + CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's/-g //' -e 's/-g$//'` +fi + +echo "$as_me:8954: checking for stdbool.h" >&5 +echo $ECHO_N "checking for stdbool.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 8960 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:8964: \"$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:8970: \$? = $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_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdbool_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:8989: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 +if test $ac_cv_header_stdbool_h = yes; then + cf_cv_header_stdbool_h=1 +else + cf_cv_header_stdbool_h=0 +fi + +echo "$as_me:8997: 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line 9004 "configure" +#include "confdefs.h" + +#include +#include + +int +main () +{ +bool x = false + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:9019: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9022: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:9025: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9028: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_cc_bool_type=1 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_cc_bool_type=0 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi + +if test "$cf_cv_cc_bool_type" = 1 +then echo "$as_me:9041: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else echo "$as_me:9043: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -n "$CXX" ; then + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +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 + +if test -n "$GXX" ; then +case $cf_cv_system_name in #(vi +os2*) #(vi + cf_stdcpp_libname=stdcpp + ;; +*) + cf_stdcpp_libname=stdc++ + ;; +esac +echo "$as_me:9063: 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" +cat >conftest.$ac_ext <<_ACEOF +#line 9072 "configure" +#include "confdefs.h" + +#include +int +main () +{ + +char buf[80]; +strstreambuf foo(buf, sizeof(buf)) + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9088: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9091: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9094: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9097: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_libstdcpp=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_libstdcpp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS="$cf_save" + +fi +echo "$as_me:9109: result: $cf_cv_libstdcpp" >&5 +echo "${ECHO_T}$cf_cv_libstdcpp" >&6 +test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +fi + + case $GXX_VERSION in + 1*|2.0-6*) + cf_cxx_library=yes + ;; + *-2.7*|2.7*) + +cf_cxx_library=unknown +case $cf_cv_system_name in #(vi +os2*) #(vi + cf_gpp_libname=gpp + ;; +*) + cf_gpp_libname=g++ + ;; +esac +if test "$ac_cv_cxx_compiler_gnu" = yes; then + echo "$as_me:9130: 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" + cat >conftest.$ac_ext <<_ACEOF +#line 9135 "configure" +#include "confdefs.h" + +#include <$cf_gpp_libname/builtin.h> + +int +main () +{ +two_arg_error_handler_t foo2 = lib_error_handler + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9149: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9152: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9155: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9158: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cxx_library=yes + CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + if test "$cf_gpp_libname" = cpp ; then + cat >>confdefs.h <<\EOF +#define HAVE_GPP_BUILTIN_H 1 +EOF + + else + cat >>confdefs.h <<\EOF +#define HAVE_GXX_BUILTIN_H 1 +EOF + + fi +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +#line 9177 "configure" +#include "confdefs.h" + +#include + +int +main () +{ +two_arg_error_handler_t foo2 = lib_error_handler + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9191: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9194: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9197: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9200: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cxx_library=yes + CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + cat >>confdefs.h <<\EOF +#define HAVE_BUILTIN_H 1 +EOF + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cxx_library=no +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" + echo "$as_me:9217: result: $cf_cxx_library" >&5 +echo "${ECHO_T}$cf_cxx_library" >&6 +fi + + ;; + *) + cf_cxx_library=no + ;; + esac + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +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 +echo "$as_me:9232: 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_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 9249 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:9254: \"$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:9260: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_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 9283 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:9287: \"$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:9293: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_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_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:9330: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_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 9340 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:9345: \"$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:9351: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_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 9374 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:9378: \"$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:9384: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_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:9412: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +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 + +for ac_header in typeinfo +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:9426: 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 9432 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:9436: \"$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:9442: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_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:9461: 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 stdbool.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 9477 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:9481: \"$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:9487: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdbool_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:9506: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 +if test $ac_cv_header_stdbool_h = yes; then + cf_cv_header_stdbool_h=1 +else + cf_cv_header_stdbool_h=0 +fi + +echo "$as_me:9514: 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line 9521 "configure" +#include "confdefs.h" + +#include +#include + +int +main () +{ +bool x = false + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:9536: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9539: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:9542: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9545: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_builtin_bool=1 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_builtin_bool=0 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi + +if test "$cf_cv_builtin_bool" = 1 +then echo "$as_me:9558: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else echo "$as_me:9560: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +echo "$as_me:9564: 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 +else + + rm -f cf_test.out + if test "$cross_compiling" = yes; then + cf_cv_type_of_bool=unknown +else + cat >conftest.$ac_ext <<_ACEOF +#line 9575 "configure" +#include "confdefs.h" + +#include +#include + +#if defined(__cplusplus) + +#ifdef HAVE_GXX_BUILTIN_H +#include +#elif HAVE_GPP_BUILTIN_H +#include +#elif HAVE_BUILTIN_H +#include +#endif + +#else + +#if $cf_cv_header_stdbool_h +#include +#endif + +#endif + +main() +{ + FILE *fp = fopen("cf_test.out", "w"); + if (fp != 0) { + bool x = true; + if ((bool)(-x) >= 0) + fputs("unsigned ", fp); + if (sizeof(x) == sizeof(int)) fputs("int", fp); + else if (sizeof(x) == sizeof(char)) fputs("char", fp); + else if (sizeof(x) == sizeof(short))fputs("short",fp); + else if (sizeof(x) == sizeof(long)) fputs("long", fp); + fclose(fp); + } + exit(0); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:9617: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9620: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:9622: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9625: \$? = $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 + cf_cv_type_of_bool=unknown + fi +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_type_of_bool=unknown +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi + + rm -f cf_test.out +echo "$as_me:9643: 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:9649: 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:9654: 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" +for cf_math in "" MATH_H +do +for cf_excp in "" MATH_EXCEPTION +do + CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu" + 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 9666 "configure" +#include "confdefs.h" + +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:9680: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9683: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:9686: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9689: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + test -n "$cf_math" && cat >>confdefs.h <>confdefs.h <&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +done +echo "$as_me:9710: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 +CXXFLAGS="$cf_save_CXXFLAGS" + +if test -n "$CXX"; then +echo "$as_me:9715: 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 +else + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + if test "$cross_compiling" = yes; then + cf_cv_cpp_param_init=unknown +else + cat >conftest.$ac_ext <<_ACEOF +#line 9731 "configure" +#include "confdefs.h" + +class TEST { +private: + int value; +public: + TEST(int x = 1); + ~TEST(); +}; + +TEST::TEST(int x = 1) // some compilers do not like second initializer +{ + value = x; +} +void main() { } + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:9750: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9753: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:9755: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9758: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_cpp_param_init=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_cpp_param_init=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +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 + +fi +echo "$as_me:9776: 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 +#define CPP_HAS_PARAM_INIT 1 +EOF + +if test -n "$CXX"; then + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +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 + +for ac_header in strstream.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:9794: 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 9800 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:9804: \"$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:9810: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_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:9829: 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 if $CXX supports vscan function... $ECHO_C" >&6 +if test "${cf_cv_cpp_vscan_func+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + for cf_vscan_func in strstream strstream_cast stdio + do + case $cf_vscan_func in #(vi + stdio) cf_vscan_defs=USE_STDIO_VSCAN ;; #(vi + strstream) cf_vscan_defs=USE_STRSTREAM_VSCAN ;; + strstream_cast) cf_vscan_defs=USE_STRSTREAM_VSCAN_CAST ;; + esac + cat >conftest.$ac_ext <<_ACEOF +#line 9853 "configure" +#include "confdefs.h" + +#include +#include +#define $cf_vscan_defs 1 +#if defined(USE_STDIO_VSCAN) +#elif defined(HAVE_STRSTREAM_H) && defined(USE_STRSTREAM_VSCAN) +#include +#endif + +int scanw(const char* fmt, ...) +{ + int result = -1; + char buf[BUFSIZ]; + + va_list args; + va_start(args, fmt); +#if defined(USE_STDIO_VSCAN) + if (::vsscanf(buf, fmt, args) != -1) + result = 0; +#elif defined(USE_STRSTREAM_VSCAN) + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) + result = 0; +#elif defined(USE_STRSTREAM_VSCAN_CAST) + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, (_IO_va_list)args) != -1) + result = 0; +#else +#error case $cf_vscan_func failed +#endif + va_end(args); + return result; +} + +int +main () +{ +int tmp, foo = scanw("%d", &tmp) + ; + 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 + cf_cv_cpp_vscan_func=$cf_vscan_func; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_cpp_vscan_func=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + test "$cf_cv_cpp_vscan_func" != no && break + done + +fi +echo "$as_me:9920: result: $cf_cv_cpp_vscan_func" >&5 +echo "${ECHO_T}$cf_cv_cpp_vscan_func" >&6 + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +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 + +fi + +case $cf_cv_cpp_vscan_func in #(vi +stdio) #(vi + cat >>confdefs.h <<\EOF +#define CPP_HAS_VSCAN_FUNC 1 +EOF + + cat >>confdefs.h <<\EOF +#define USE_STDIO_VSCAN 1 +EOF + + ;; +strstream) + cat >>confdefs.h <<\EOF +#define CPP_HAS_VSCAN_FUNC 1 +EOF + + cat >>confdefs.h <<\EOF +#define USE_STRSTREAM_VSCAN 1 +EOF + + ;; +strstream_cast) + cat >>confdefs.h <<\EOF +#define CPP_HAS_VSCAN_FUNC 1 +EOF + + cat >>confdefs.h <<\EOF +#define USE_STRSTREAM_VSCAN_CAST 1 +EOF + + ;; +esac + + CXX_AR='$(AR)' + CXX_AR_OPTS='$(AR_OPTS)' + case $cf_cv_system_name in #(vi + irix*) #(vi + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-ar -o' + fi + ;; + sco3.2v5*) #(vi + CXXLDFLAGS="-u main" + ;; + solaris2*) + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-xar -o' + fi + ;; + esac + +else + cf_cxx_library=no + cf_cv_builtin_bool=1 + + # Just because we are not configuring against C++ right now does not + # mean that a user will not want to use C++. Some distributors disable + # the C++ portion of this configuration as a shortcut (or just to avoid + # compiling the demo in the c++ directory). So we need a reasonable + # default for the 'bool' type. + # + # Caveat: since the storage of the bool type is not standardized, it + # may change. + + if test "$NCURSES_BOOL" != auto ; then + cf_cv_type_of_bool=$NCURSES_AUTO + else + if test "$cf_cv_header_stdbool_h" = 1 ; then + +echo "$as_me:10002: 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 +else + + rm -f cf_test.out + if test "$cross_compiling" = yes; then + cf_cv_type_of_bool=unknown +else + cat >conftest.$ac_ext <<_ACEOF +#line 10013 "configure" +#include "confdefs.h" + +#include +#include + +#if defined(__cplusplus) + +#ifdef HAVE_GXX_BUILTIN_H +#include +#elif HAVE_GPP_BUILTIN_H +#include +#elif HAVE_BUILTIN_H +#include +#endif + +#else + +#if $cf_cv_header_stdbool_h +#include +#endif + +#endif + +main() +{ + FILE *fp = fopen("cf_test.out", "w"); + if (fp != 0) { + bool x = true; + if ((bool)(-x) >= 0) + fputs("unsigned ", fp); + if (sizeof(x) == sizeof(int)) fputs("int", fp); + else if (sizeof(x) == sizeof(char)) fputs("char", fp); + else if (sizeof(x) == sizeof(short))fputs("short",fp); + else if (sizeof(x) == sizeof(long)) fputs("long", fp); + fclose(fp); + } + exit(0); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:10055: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10058: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:10060: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10063: \$? = $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 + cf_cv_type_of_bool=unknown + fi +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_type_of_bool=unknown +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi + + rm -f cf_test.out +echo "$as_me:10081: 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:10087: 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:10093: 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:10099: result: $cf_cv_type_of_bool" >&5 +echo "${ECHO_T}$cf_cv_type_of_bool" >&6 + fi + 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:10109: 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 +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:10124: 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:10133: result: $gnat_exists" >&5 +echo "${ECHO_T}$gnat_exists" >&6 +else + echo "$as_me:10136: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test "$ac_cv_prog_gnat_exists" = no; then + cf_ada_make= +else + +cf_cv_gnat_version=`$cf_ada_make -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\ + sed -e 's/[^0-9 \.]//g' | $AWK '{print $1;}'` +case $cf_cv_gnat_version in + 3.1[1-9]*|3.[2-9]*|[4-9].*) + cf_cv_prog_gnat_correct=yes + ;; + *) echo Unsupported GNAT version $cf_cv_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. + cf_cv_prog_gnat_correct=no + ;; +esac +case $cf_cv_gnat_version in + 3.1*|[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:10166: 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:10181: 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:10190: result: $M4_exists" >&5 +echo "${ECHO_T}$M4_exists" >&6 +else + echo "$as_me:10193: 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:10202: checking if GNAT works" >&5 +echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 + +rm -f 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 -f conftest* + + echo "$as_me:10230: 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" + +# 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; + + 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/lib/ada/adainclude}" +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%$ac_default_prefix%` + ;; + esac + ;; #(vi +.NONE/*) + withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%` + ;; +*) + { { echo "$as_me:10273: error: expected a pathname, not \"$withval\"" >&5 +echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + +eval ADA_INCLUDE="$withval" + +# 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; +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%$ac_default_prefix%` + ;; + esac + ;; #(vi +.NONE/*) + withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%` + ;; +*) + { { echo "$as_me:10307: error: expected a pathname, not \"$withval\"" >&5 +echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + +eval ADA_OBJECTS="$withval" + +fi +fi + +### It's not possible to appease gcc 2.6.3's conversion-warnings if we're +### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too +### badly to consider using for development purposes, but 2.5.8 is okay. +if test -n "$with_warnings"; then + case $GCC_VERSION in + 2.6.3) + if test "$cf_cv_type_of_bool" != "char"; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" + fi + ;; + 2.5*) + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" + ;; + esac +fi + +### Construct the library-subsets, if any, from this set of keywords: +### none, base, ext_funcs, termlib. +echo "$as_me:10336: checking for library subsets" >&5 +echo $ECHO_N "checking for library subsets... $ECHO_C" >&6 +if test "$with_termlib" = yes ; then + LIB_SUBSETS="termlib " +else + LIB_SUBSETS="termlib+" +fi +LIB_SUBSETS="${LIB_SUBSETS}base" +test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" +test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" +echo "$as_me:10346: result: $LIB_SUBSETS" >&5 +echo "${ECHO_T}$LIB_SUBSETS" >&6 + +LIB_TRACING=DEBUG +ADA_TRACE=FALSE +case "$CFLAGS $CPPFLAGS" in +*-DTRACE*) + LIB_TRACING=all + ADA_TRACE=TRUE + ;; +esac + +### 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="$ACPPFLAGS -I. -I../../include" +if test "$srcdir" != "."; then + ACPPFLAGS="$ACPPFLAGS -I\$(srcdir)/../../include" +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:10393: 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:10404: result: $DFT_ARG_SUFFIX" >&5 +echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 + +echo "$as_me:10407: checking default library-dependency suffix" >&5 +echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 + + case $DFT_LWR_MODEL in + libtool) DFT_DEP_SUFFIX='.la' ;; + normal) DFT_DEP_SUFFIX='.a' ;; + debug) DFT_DEP_SUFFIX='_g.a' ;; + profile) DFT_DEP_SUFFIX='_p.a' ;; + shared) + case $cf_cv_system_name in + cygwin*) DFT_DEP_SUFFIX='.dll' ;; + darwin*) DFT_DEP_SUFFIX='.dylib' ;; + hpux*) DFT_DEP_SUFFIX='.sl' ;; + *) DFT_DEP_SUFFIX='.so' ;; + esac + esac + test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" +if test $DFT_LWR_MODEL = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + DFT_DEP_SUFFIX=".dll.a" + ;; + esac +fi +echo "$as_me:10431: result: $DFT_DEP_SUFFIX" >&5 +echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 + +echo "$as_me:10434: 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:10450: result: $DFT_OBJ_SUBDIR" >&5 +echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 + +# libtool thinks it can make c++ shared libraries (perhaps only g++) +echo "$as_me:10454: checking c++ library-dependency suffix" >&5 +echo $ECHO_N "checking c++ library-dependency suffix... $ECHO_C" >&6 +if test "$with_libtool" = "yes"; then + CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX +else + + case normal in + libtool) CXX_LIB_SUFFIX='.la' ;; + normal) CXX_LIB_SUFFIX='.a' ;; + debug) CXX_LIB_SUFFIX='_g.a' ;; + profile) CXX_LIB_SUFFIX='_p.a' ;; + shared) + case $cf_cv_system_name in + cygwin*) CXX_LIB_SUFFIX='.dll' ;; + darwin*) CXX_LIB_SUFFIX='.dylib' ;; + hpux*) CXX_LIB_SUFFIX='.sl' ;; + *) CXX_LIB_SUFFIX='.so' ;; + esac + esac + test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}" +fi +echo "$as_me:10475: result: $CXX_LIB_SUFFIX" >&5 +echo "${ECHO_T}$CXX_LIB_SUFFIX" >&6 + +TINFO_LIST="$SHLIB_LIST" +test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}" + +echo "$as_me:10481: 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:10486: result: $includedir" >&5 +echo "${ECHO_T}$includedir" >&6 + +### Resolve a conflict between normal and wide-curses by forcing applications +### that will need libutf8 to add it to their configure script. +if test "$with_overwrite" != no ; then +if test "$NCURSES_LIBUTF8" = 1 ; then + NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)' + { echo "$as_me:10494: 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 + +### Set up low-level terminfo dependencies for makefiles. Note that we +### could override this. +if test "$with_termlib" = yes ; then + TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}" + if test "$DFT_LWR_MODEL" = "libtool"; then + TEST_ARGS="${TEST_DEPS}" + else + TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}" + fi +fi +PROG_DEPS="$TEST_DEPS" +PROG_ARGS="$TEST_ARGS" + +### Construct the list of subdirectories for which we'll customize makefiles +### with the appropriate compile-rules. + +echo "$as_me:10515: checking for src modules" >&5 +echo $ECHO_N "checking for src modules... $ECHO_C" >&6 + +# dependencies and linker-arguments for test-programs +TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX} $TEST_DEPS" +if test "$DFT_LWR_MODEL" = "libtool"; then + TEST_ARGS="${TEST_DEPS}" +else + TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS" +fi + +# dependencies and linker-arguments for utility-programs +PROG_ARGS="$TEST_ARGS" + +cf_cv_src_modules= +for cf_dir in $modules_to_build +do + if test -f $srcdir/$cf_dir/modules; then + + # We may/may not have tack in the distribution, though the + # makefile is. + if test $cf_dir = tack ; then + if test ! -f $srcdir/${cf_dir}/${cf_dir}.h; then + continue + fi + fi + + if test -z "$cf_cv_src_modules"; then + cf_cv_src_modules=$cf_dir + else + cf_cv_src_modules="$cf_cv_src_modules $cf_dir" + fi + + # Make the ncurses_cfg.h file record the library interface files as + # well. These are header files that are the same name as their + # directory. Ncurses is the only library that does not follow + # that pattern. + if test $cf_dir = tack ; then + continue + elif test -f $srcdir/${cf_dir}/${cf_dir}.h; then + +cf_have_include=`echo "$cf_dir" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <>confdefs.h <&5 +echo "${ECHO_T}$cf_cv_src_modules" >&6 +TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" + +PROG_ARGS="-L${LIB_DIR} $PROG_ARGS" + +SRC_SUBDIRS="man include" +for cf_dir in $cf_cv_src_modules +do + SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" +done +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 samples" +fi + +SUB_MAKEFILES= +for cf_dir in $SRC_SUBDIRS +do + SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile" +done + +if test -n "$ADA_SUBDIRS"; then + for cf_dir in $ADA_SUBDIRS + do + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" + done + +fi + +DIRS_TO_MAKE="lib" +for cf_item in $cf_list_models +do + + case $cf_item in + libtool) cf_subdir='obj_lo' ;; + normal) cf_subdir='objects' ;; + debug) cf_subdir='obj_g' ;; + profile) cf_subdir='obj_p' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + cf_subdir='objects' ;; + *) + cf_subdir='obj_s' ;; + esac + esac + + for cf_item2 in $DIRS_TO_MAKE + do + test $cf_item2 = $cf_subdir && break + done + test ".$cf_item2" != ".$cf_subdir" && DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" +done +for cf_dir in $DIRS_TO_MAKE +do + test ! -d $cf_dir && mkdir $cf_dir +done + +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:10728: 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:10904: 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:10923: 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.20011227, 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. + "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/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;; + "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;; + "misc/run_tic.sh" ) CONFIG_FILES="$CONFIG_FILES misc/run_tic.sh:misc/run_tic.in" ;; + "$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:11003: 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,@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_cc_bool_type@,$cf_cv_cc_bool_type,;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,@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,@BUILD_CC@,$BUILD_CC,;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,@CPP@,$CPP,;t t +s,@PROG_EXT@,$PROG_EXT,;t t +s,@LDCONFIG@,$LDCONFIG,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;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,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t +s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t +s,@LINT@,$LINT,;t t +s,@MAN@,$MAN,;t t +s,@LINT_OPTS@,$LINT_OPTS,;t t +s,@LD@,$LD,;t t +s,@AR@,$AR,;t t +s,@AR_OPTS@,$AR_OPTS,;t t +s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t +s,@DESTDIR@,$DESTDIR,;t t +s,@cf_list_models@,$cf_list_models,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t +s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t +s,@TINFO_NAME@,$TINFO_NAME,;t t +s,@LIB_NAME@,$LIB_NAME,;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,@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_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,@TERMINFO_SRC@,$TERMINFO_SRC,;t t +s,@PATHSEP@,$PATHSEP,;t t +s,@FALLBACK_LIST@,$FALLBACK_LIST,;t t +s,@TERMINFO_DIRS@,$TERMINFO_DIRS,;t t +s,@TERMINFO@,$TERMINFO,;t t +s,@MAKE_TERMINFO@,$MAKE_TERMINFO,;t t +s,@TERMPATH@,$TERMPATH,;t t +s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t +s,@NCURSES_BOOL@,$NCURSES_BOOL,;t t +s,@NCURSES_OSPEED@,$NCURSES_OSPEED,;t t +s,@MANPAGE_RENAMES@,$MANPAGE_RENAMES,;t t +s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t +s,@NCURSES_CONST@,$NCURSES_CONST,;t t +s,@NCURSES_XNAMES@,$NCURSES_XNAMES,;t t +s,@NCURSES_CH_T@,$NCURSES_CH_T,;t t +s,@NCURSES_LIBUTF8@,$NCURSES_LIBUTF8,;t t +s,@NCURSES_MBSTATE_T@,$NCURSES_MBSTATE_T,;t t +s,@TERMINFO_CAPS@,$TERMINFO_CAPS,;t t +s,@ECHO_LINK@,$ECHO_LINK,;t t +s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t +s,@MATH_LIB@,$MATH_LIB,;t t +s,@cf_cv_typeof_chtype@,$cf_cv_typeof_chtype,;t t +s,@cf_cv_1UL@,$cf_cv_1UL,;t t +s,@HAVE_VSSCANF@,$HAVE_VSSCANF,;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,@CXXLIBS@,$CXXLIBS,;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,@ADA_INCLUDE@,$ADA_INCLUDE,;t t +s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t +s,@ADA_TRACE@,$ADA_TRACE,;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,@CXX_LIB_SUFFIX@,$CXX_LIB_SUFFIX,;t t +s,@EXTRA_LIBS@,$EXTRA_LIBS,;t t +s,@TINFO_LIST@,$TINFO_LIST,;t t +s,@SHLIB_LIST@,$SHLIB_LIST,;t t +s,@TEST_DEPS@,$TEST_DEPS,;t t +s,@TEST_ARGS@,$TEST_ARGS,;t t +s,@PROG_ARGS@,$PROG_ARGS,;t t +s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t +s,@DIRS_TO_MAKE@,$DIRS_TO_MAKE,;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:11329: 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:11347: 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:11360: 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:11426: 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:11437: 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:11450: 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 >> $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:11508: $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 ) + + case $cf_cv_system_name in + OS/2*) LIB_PREFIX='' ;; + os2*) LIB_PREFIX='' ;; + *) LIB_PREFIX='lib' ;; + esac +cf_prefix=$LIB_PREFIX + +for cf_dir in $SRC_SUBDIRS +do + if test -f $srcdir/$cf_dir/modules; then + + IMPORT_LIB= + SHARED_LIB= + LIBS_TO_MAKE= + for cf_item in $CF_LIST_MODELS + do + + case $cf_item in + libtool) cf_suffix='.la' ;; + normal) cf_suffix='.a' ;; + debug) cf_suffix='_g.a' ;; + profile) cf_suffix='_p.a' ;; + shared) + case $cf_cv_system_name in + cygwin*) cf_suffix='.dll' ;; + darwin*) cf_suffix='.dylib' ;; + hpux*) cf_suffix='.sl' ;; + *) cf_suffix='.so' ;; + esac + esac + test -n "$LIB_SUFFIX" && cf_suffix="${LIB_SUFFIX}${cf_suffix}" + + if test $cf_item = shared ; then + if test "$cf_cv_do_symlinks" = yes ; then + case "$cf_cv_shlib_version" in #(vi + rel) #(vi + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(REL_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; + esac + ;; + abi) + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(ABI_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;; + esac + ;; + esac + fi + # cygwin needs import library, and has unique naming convention + if test $cf_cv_shlib_version = cygdll ; then + SHARED_LIB="../lib/${cf_prefix}${cf_dir}\$(ABI_VERSION).dll" + IMPORT_LIB="../lib/${cf_prefix}${cf_dir}.dll.a" + LIBS_TO_MAKE="$LIBS_TO_MAKE \$(SHARED_LIB) \$(IMPORT_LIB)" + continue + fi + fi + LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/${cf_prefix}${cf_dir}${cf_suffix}" + done + + if test $cf_dir = ncurses ; then + cf_subsets="$LIB_SUBSETS" + case "$LIB_SUBSETS" in #(vi + termlib+*) #(vi + ;; + *) #(vi + cf_item=`echo $LIBS_TO_MAKE |sed -e s/$LIB_NAME/$TINFO_NAME/g` + LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE" + ;; + esac + else + cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib //'` + fi + + sed -e "s%@LIBS_TO_MAKE@%$LIBS_TO_MAKE%" \ + -e "s%@IMPORT_LIB@%$IMPORT_LIB%" \ + -e "s%@SHARED_LIB@%$SHARED_LIB%" \ + $cf_dir/Makefile >$cf_dir/Makefile.out + mv $cf_dir/Makefile.out $cf_dir/Makefile + + $AWK -f $srcdir/mk-0th.awk \ + libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" \ + $srcdir/$cf_dir/modules >>$cf_dir/Makefile + + for cf_subset in $cf_subsets + do + cf_subdirs= + for cf_item in $CF_LIST_MODELS + do + echo "Appending rules for ${cf_item} model (${cf_dir}: ${cf_subset})" + +CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + case $cf_item in + libtool) cf_suffix='.la' ;; + normal) cf_suffix='.a' ;; + debug) cf_suffix='_g.a' ;; + profile) cf_suffix='_p.a' ;; + shared) + case $cf_cv_system_name in + cygwin*) cf_suffix='.dll' ;; + darwin*) cf_suffix='.dylib' ;; + hpux*) cf_suffix='.sl' ;; + *) cf_suffix='.so' ;; + esac + esac + test -n "$LIB_SUFFIX" && cf_suffix="${LIB_SUFFIX}${cf_suffix}" + + case $cf_item in + libtool) cf_subdir='obj_lo' ;; + normal) cf_subdir='objects' ;; + debug) cf_subdir='obj_g' ;; + profile) cf_subdir='obj_p' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + cf_subdir='objects' ;; + *) + cf_subdir='obj_s' ;; + esac + esac + + # These dependencies really are for development, not + # builds, but they are useful in porting, too. + cf_depend="../include/ncurses_cfg.h" + if test "$srcdir" = "."; then + cf_reldir="." + else + cf_reldir="\$(srcdir)" + fi + + if test -f $srcdir/$cf_dir/$cf_dir.priv.h; then + cf_depend="$cf_depend $cf_reldir/$cf_dir.priv.h" + elif test -f $srcdir/$cf_dir/curses.priv.h; then + cf_depend="$cf_depend $cf_reldir/curses.priv.h" + fi + + $AWK -f $srcdir/mk-1st.awk \ + name=$cf_dir \ + traces=$LIB_TRACING \ + MODEL=$CF_ITEM \ + model=$cf_subdir \ + prefix=$cf_prefix \ + suffix=$cf_suffix \ + subset=$cf_subset \ + ShlibVer=$cf_cv_shlib_version \ + ShlibVerInfix=$cf_cv_shlib_version_infix \ + DoLinks=$cf_cv_do_symlinks \ + rmSoLocs=$cf_cv_rm_so_locs \ + ldconfig="$LDCONFIG" \ + overwrite=$WITH_OVERWRITE \ + depend="$cf_depend" \ + target="$target" \ + $srcdir/$cf_dir/modules >>$cf_dir/Makefile + for cf_subdir2 in $cf_subdirs lib + do + test $cf_subdir = $cf_subdir2 && break + done + test "${cf_subset}.${cf_subdir2}" != "${cf_subset}.${cf_subdir}" && \ + $AWK -f $srcdir/mk-2nd.awk \ + name=$cf_dir \ + traces=$LIB_TRACING \ + MODEL=$CF_ITEM \ + model=$cf_subdir \ + subset=$cf_subset \ + srcdir=$srcdir \ + echo=$WITH_ECHO \ + $srcdir/$cf_dir/modules >>$cf_dir/Makefile + cf_subdirs="$cf_subdirs $cf_subdir" + done + done + fi + + echo ' cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) $@' >>Makefile +done + +for cf_dir in $SRC_SUBDIRS +do + if test -f $cf_dir/Makefile ; then + case "$cf_dir" in + Ada95) #(vi + echo 'libs \' >> Makefile + echo 'install.libs \' >> Makefile + echo 'uninstall.libs ::' >> Makefile + echo ' cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) $@' >> Makefile + ;; + esac + fi + + if test -f $srcdir/$cf_dir/modules; then + echo >> Makefile + if test -f $srcdir/$cf_dir/headers; then +cat >> Makefile <> Makefile +fi +cat >> Makefile <> Makefile <> Makefile <> Makefile <headers.sh <>headers.sh </<\$END\/\$NAME>/" >> \$TMPSED + done + ;; +*) + echo "" >> \$TMPSED + ;; +esac +CF_EOF +else + cat >>headers.sh <//" >> \$TMPSED + NAME=ncurses.h + fi + echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED + done + ;; +*) + echo "s///" >> \$TMPSED + ;; +esac +CF_EOF +fi +cat >>headers.sh < \$TMPSRC +NAME=\`basename \$SRC\` +CF_EOF +if test $WITH_CURSES_H != yes; then + cat >>headers.sh <>headers.sh <>$cf_dir/Makefile <>$cf_dir/Makefile + j=$i + done + echo " $j" >>$cf_dir/Makefile + for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"` + do + echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(DESTDIR)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile + test $i = curses.h && test $WITH_CURSES_H = yes && echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile + done + + cat >>$cf_dir/Makefile <>$cf_dir/Makefile + test $i = curses.h && echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile + done + fi + + if test -f $srcdir/$cf_dir/modules; then + if test "$cf_dir" != "c++" ; then + cat >>$cf_dir/Makefile <<"CF_EOF" +depend : $(AUTO_SRC) + makedepend -- $(CPPFLAGS) -- $(C_SRC) + +# DO NOT DELETE THIS LINE -- make depend depends on it. +CF_EOF + fi + fi +done + + ;; + 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/ncurses-5.3/configure.in b/ncurses-5.3/configure.in new file mode 100644 index 0000000..a1f4979 --- /dev/null +++ b/ncurses-5.3/configure.in @@ -0,0 +1,1335 @@ +dnl*************************************************************************** +dnl Copyright (c) 1998-2001,2002 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 1995-on +dnl +dnl $Id$ +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$) +AC_INIT(ncurses/base/lib_initscr.c) +AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) + +CF_SUBST_NCURSES_VERSION +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]) + +# We need a configure script only when compiling as part of GNU C library. +# Here we have to generate one of the files we need while compiling. +# +# The only problem is that users of the package might think they have to +# run configure themself and find it irritating when nothing happens. +# +# So we try here to find out whether we are called from the glibc configure +# or by a user. +# +dnl Check if we are a drop-in addition to glibc. +AC_ARG_ENABLE(add-ons, dnl +[ --enable-add-ons=DIR... used to check if we are a glibc add-on.], + [glibc_add_on=yes], + [glibc_add_on=]) + +if test x"$glibc_add_on" = "xyes" ; then + rm -f $srcdir/Banner + # We are in glibc. + rm -f $srcdir/Makefile + cp $srcdir/Makefile.glibc $srcdir/Makefile + echo "ncurses `grep \"^[[ ]]*ncurses-version[[ ]]*=.*$\" \ + $srcdir/Makefile | sed -e \ + 's/^[[ ]]*ncurses-version[[ ]]*=[[ ]]*\([[^ ^ ]]*\)[[ ]]*$/\1/'`" > $srcdir/Banner + exit 0 +fi + +### Save the given $CFLAGS to allow user-override. +cf_user_CFLAGS="$CFLAGS" + +### Default install-location +CF_CFG_DEFAULTS + +### Checks for programs. +AC_PROG_CC +GCC_VERSION=none +if test "$GCC" = yes ; then + AC_MSG_CHECKING(version of gcc) + GCC_VERSION="`${CC} --version|head -1`" + AC_MSG_RESULT($GCC_VERSION) +fi + +# If we're cross-compiling, allow the user to override the tools and their +# options. The configure script is oriented toward identifying the target +# compiler, etc., but we need a host compiler to generate parts of the source. +BUILD_CC='$(CC)' +BUILD_CFLAGS='$(CFLAGS)' +BUILD_CPPFLAGS='$(CPPFLAGS)' +BUILD_LDFLAGS='$(LDFLAGS)' +BUILD_LIBS='$(LIBS)' +if test "$host_alias" != "$target_alias" ; then + AC_ARG_WITH(build-cc, + [ --with-build-cc=XXX if cross-compiling, the host C compiler (\$BUILD_CC)], + [BUILD_CC="$withval"], + [AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)]) + AC_ARG_WITH(build-cflags, + [ --with-build-cflags=XXX if cross-compiling, the host C compiler-flags], + [BUILD_CFLAGS="$withval"]) + AC_ARG_WITH(build-cppflags, + [ --with-build-cppflags=XXX if cross-compiling, the host C preprocessor-flags], + [BUILD_CPPFLAGS="$withval"]) + AC_ARG_WITH(build-ldflags, + [ --with-build-ldflags=XXX if cross-compiling, the host linker-flags], + [BUILD_LDFLAGS="$withval"]) + AC_ARG_WITH(build-libs, + [ --with-build-libs=XXX if cross-compiling, the host libraries], + [BUILD_LIBS="$withval"]) +fi +AC_SUBST(BUILD_CC) +AC_SUBST(BUILD_CFLAGS) +AC_SUBST(BUILD_CPPFLAGS) +AC_SUBST(BUILD_LDFLAGS) +AC_SUBST(BUILD_LIBS) + +AC_PROG_CPP +AC_PROG_GCC_TRADITIONAL +AC_ISC_POSIX +CF_ANSI_CC_REQD +CF_PROG_EXT + +case "$cf_cv_system_name" in +freebsd*) #(vi + test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R" + ;; +*) LDPATH=$PATH:/sbin:/usr/sbin + AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH) + ;; +esac +AC_SUBST(LDCONFIG) + +dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the +dnl configure script by not letting us test if C++ +dnl is present, making this option necessary. +AC_MSG_CHECKING(if you want to ensure bool is consistent with C++) +AC_ARG_WITH(cxx, + [ --without-cxx do not adjust ncurses bool to match C++], + [cf_with_cxx=$withval], + [cf_with_cxx=yes]) +AC_MSG_RESULT($cf_with_cxx) +if test "X$cf_with_cxx" = Xno ; then + CXX="" + GXX="" +else + pushdef([AC_MSG_ERROR], + [AC_MSG_RESULT([You don't have any C++ compiler, too bad]); dnl + cf_with_cxx=no; CXX=""; GXX="";])dnl + AC_PROG_CXX + popdef([AC_MSG_ERROR])dnl +fi + +GXX_VERSION=none +if test "$GXX" = yes; then + AC_MSG_CHECKING(version of g++) + GXX_VERSION="`${CXX-g++} --version|head -1`" + AC_MSG_RESULT($GXX_VERSION) + case $GXX_VERSION in + 1*|2.[[0-6]]*) + GXX=""; CXX=""; ac_cv_prog_gxx=no + cf_cxx_library=no + AC_MSG_WARN(templates do not work) + ;; + esac +fi + +AC_MSG_CHECKING(if you want to build C++ binding and demo) +AC_ARG_WITH(cxx-binding, + [ --without-cxx-binding do not build C++ binding and demo], + [cf_with_cxx_binding=$withval], + [cf_with_cxx_binding=$cf_with_cxx]) +AC_MSG_RESULT($cf_with_cxx_binding) + +AC_MSG_CHECKING(if you want to build with Ada95) +AC_ARG_WITH(ada, + [ --without-ada suppress check for Ada95, don't build demo], + [cf_with_ada=$withval], + [cf_with_ada=yes]) +AC_MSG_RESULT($cf_with_ada) + +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)], + [cf_with_progs=$withval], + [cf_with_progs=yes]) +AC_MSG_RESULT($cf_with_progs) + +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], + [with_curses_h=$withval], + [with_curses_h=yes]) +AC_MSG_RESULT($with_curses_h) + +modules_to_build="ncurses" +if test "X$cf_with_progs" != Xno ; then +modules_to_build="$modules_to_build progs tack" +fi +modules_to_build="$modules_to_build panel menu form" + +AC_ARG_PROGRAM +AC_PROG_AWK +AC_PROG_MAKE_SET +CF_PROG_INSTALL +AC_SYS_LONG_FILE_NAMES +CF_MIXEDCASE_FILENAMES +AC_PROG_LN_S +AC_PROG_RANLIB +CF_MAKE_TAGS +AC_CHECK_PROGS(LINT, tdlint lint alint) +AC_CHECK_PROGS(MAN, man man_db) +AC_SUBST(LINT_OPTS) + +dnl These are standard among *NIX systems, but not when cross-compiling +CF_SUBST(loader,LD,ld) +CF_SUBST(archiver,AR,ar) +CF_SUBST(archiver options,AR_OPTS,rv) + +CF_MAKEFLAGS + +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(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_SUBST(cf_list_models)dnl the complete list of models ("normal debug") + +AC_MSG_CHECKING(if you want to build libraries with libtool) +AC_ARG_WITH(libtool, + [ --with-libtool generate libraries with libtool], + [with_libtool=$withval], + [with_libtool=no]) +AC_MSG_RESULT($with_libtool) +if test "$with_libtool" = "yes"; then + cf_list_models="$cf_list_models libtool" + test -z "$LIBTOOL" && LIBTOOL=libtool +else + LIBTOOL="" +fi +AC_SUBST(LIBTOOL) + +AC_MSG_CHECKING(if you want to build shared libraries) +AC_ARG_WITH(shared, + [ --with-shared generate shared-libraries], + [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(if you want to build static libraries) +AC_ARG_WITH(normal, + [ --with-normal generate normal-libraries (default)], + [with_normal=$withval], + [with_normal=yes]) +AC_MSG_RESULT($with_normal) +test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal" + +AC_MSG_CHECKING(if you want to build debug libraries) +AC_ARG_WITH(debug, + [ --with-debug generate debug-libraries (default)], + [with_debug=$withval], + [with_debug=yes]) +AC_MSG_RESULT($with_debug) +test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug" + +AC_MSG_CHECKING(if you want to build profiling libraries) +AC_ARG_WITH(profile, + [ --with-profile generate profile-libraries], + [with_profile=$withval], + [with_profile=no]) +AC_MSG_RESULT($with_profile) +test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" + +############################################################################### + +AC_MSG_CHECKING(for specified models) +test -z "$cf_list_models" && cf_list_models=normal +dnl If we use libtool to generate libraries, then it must be the only +dnl specified model. +test "$with_libtool" = "yes" && cf_list_models=libtool +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") + +TINFO_NAME=tinfo +AC_SUBST(TINFO_NAME) + +LIB_NAME=ncurses +AC_SUBST(LIB_NAME) + +LIB_DIR=../lib +CF_LIB_PREFIX(cf_prefix) +LIB_PREFIX=$cf_prefix +AC_SUBST(LIB_PREFIX) + +LIB_SUFFIX= +AC_SUBST(LIB_SUFFIX) + +############################################################################### + +AC_MSG_CHECKING(if you want to build a separate terminfo library) +AC_ARG_WITH(termlib, + [ --with-termlib generate separate terminfo library], + [with_termlib=$withval], + [with_termlib=no]) +AC_MSG_RESULT($with_termlib) + +### Checks for special libraries, must be done up-front. +AC_MSG_CHECKING(if you want to link with dbmalloc for testing) +AC_ARG_WITH(dbmalloc, + [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], + [with_dbmalloc=$withval], + [with_dbmalloc=no]) +AC_MSG_RESULT($with_dbmalloc) +if test "$with_dbmalloc" = yes ; then + AC_CHECK_LIB(dbmalloc,debug_malloc) +fi + +AC_MSG_CHECKING(if you want to link with dmalloc for testing) +AC_ARG_WITH(dmalloc, + [ --with-dmalloc test: use Gray Watson's dmalloc library], + [with_dmalloc=$withval], + [with_dmalloc=no]) +AC_MSG_RESULT($with_dmalloc) +if test "$with_dmalloc" = yes ; then + AC_CHECK_LIB(dmalloc,dmalloc_debug) +fi + +SHLIB_LIST="" +AC_MSG_CHECKING(if you want to link with the gpm mouse library) +AC_ARG_WITH(gpm, + [ --with-gpm use Alessandro Rubini's GPM library], + [with_gpm=$withval], + [with_gpm=no]) +AC_MSG_RESULT($with_gpm) +if test "$with_gpm" = yes ; then + AC_CHECK_LIB(gpm,Gpm_Open,[ + EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS" + SHLIB_LIST="-lgpm $SHLIB_LIST" + AC_DEFINE(HAVE_LIBGPM) + AC_CHECK_HEADERS(gpm.h) + ],AC_MSG_WARN(Cannot link with gpm library - read the FAQ)) +fi + +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) + +if test X"$CXX_G_OPT" = X"" ; then + CXX_G_OPT='-g' + test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT='' +fi +AC_SUBST(CXX_G_OPT) + +AC_MSG_CHECKING(for default loader flags) +case $DFT_LWR_MODEL in +libtool) LD_MODEL='' ;; +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) + +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_SHARED_OPTS +if test "$CC_SHARED_OPTS" = "unknown"; then + for model in $cf_list_models; do + if test "$model" = "shared"; then + AC_ERROR(Shared libraries are not supported in this version) + fi + done +fi + +############################################################################### +CF_HELP_MESSAGE(Fine-Tuning Your Configuration:) + +### use option --disable-overwrite to leave out the link to -lcurses +AC_MSG_CHECKING(if you wish to install ncurses overwriting curses) +AC_ARG_ENABLE(overwrite, + [ --disable-overwrite leave out the link to -lcurses], + [with_overwrite=$enableval], + [if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi]) +AC_MSG_RESULT($with_overwrite) + +AC_MSG_CHECKING(if external terminfo-database is used) +AC_ARG_ENABLE(database, + [ --disable-database do not use terminfo, only fallbacks/termcap], + [use_database=$enableval], + [use_database=yes]) +AC_MSG_RESULT($use_database) + +case $host_os in #(vi +os2*) #(vi + TERMINFO_SRC='${top_srcdir}/misc/emx.src' + ;; +*) #(vi + TERMINFO_SRC='${top_srcdir}/misc/terminfo.src' + ;; +esac +AC_SUBST(TERMINFO_SRC) + +CF_PATHSEP +if test "$use_database" != no ; then + AC_DEFINE(USE_DATABASE) + AC_MSG_CHECKING(which terminfo source-file will be installed) + AC_ARG_ENABLE(database, + [ --with-database=XXX specify terminfo source to install], + [TERMINFO_SRC=$withval]) + AC_MSG_RESULT($TERMINFO_SRC) +fi + +AC_MSG_CHECKING(for list of fallback descriptions) +AC_ARG_WITH(fallbacks, + [ --with-fallbacks=XXX specify list of fallback terminal descriptions], + [with_fallback=$withval], + [with_fallback=]) +AC_MSG_RESULT($with_fallback) +FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'` +AC_SUBST(FALLBACK_LIST) + +MAKE_TERMINFO= +if test "$use_database" = no ; then + TERMINFO="${datadir}/terminfo" + MAKE_TERMINFO="#" +else + +AC_MSG_CHECKING(for list of terminfo directories) +CF_WITH_PATHLIST(terminfo-dirs, + [ --with-terminfo-dirs=XXX specify list of terminfo directories], + TERMINFO_DIRS, + DATADIR/terminfo, + ${datadir}/terminfo) +AC_MSG_RESULT($TERMINFO_DIRS) +test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS") + +AC_MSG_CHECKING(for default terminfo directory) +CF_WITH_PATH(default-terminfo-dir, + [ --with-default-terminfo-dir=DIR default terminfo directory], + TERMINFO, + DATADIR/terminfo, + ${datadir}/terminfo) +AC_MSG_RESULT($TERMINFO) +AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO") + +fi + +AC_SUBST(TERMINFO) +AC_SUBST(MAKE_TERMINFO) + +### use option --disable-big-core to make tic run on small machines +### We need 4Mb, check if we can allocate 50% more than that. +AC_MSG_CHECKING(if big-core option selected) +AC_ARG_ENABLE(big-core, + [ --disable-big-core assume machine has little memory], + [with_big_core=$enableval], + [AC_TRY_RUN([ +#include +#include +int main() { + unsigned long n = 6000000L; + char *s = malloc(n); + if (s != 0) + s[0] = s[n-1] = 0; + exit(s == 0); +}], + [with_big_core=yes], + [with_big_core=no], + [with_big_core=no])]) +AC_MSG_RESULT($with_big_core) +test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE) + +### use option --enable-termcap to compile in the termcap fallback support +AC_MSG_CHECKING(if you want termcap-fallback support) +AC_ARG_ENABLE(termcap, + [ --enable-termcap compile in termcap fallback support], + [with_termcap=$enableval], + [with_termcap=no]) +AC_MSG_RESULT($with_termcap) + +if test "$with_termcap" != "yes" ; then + if test "$use_database" = no ; then + if test -z $with_fallback ; then + AC_ERROR(You have disabled the database w/o specifying fallbacks) + fi + fi + AC_DEFINE(PURE_TERMINFO) +else + +AC_DEFINE(USE_TERMCAP) +AC_MSG_CHECKING(for list of termcap files) +CF_WITH_PATHLIST(termpath, + [ --with-termpath=XXX specify list of termcap files], + TERMPATH, + /etc/termcap:/usr/share/misc/termcap) +AC_MSG_RESULT($TERMPATH) +test -n "$TERMPATH" && AC_DEFINE_UNQUOTED(TERMPATH,"$TERMPATH") + +### use option --enable-getcap to use a hacked getcap for reading termcaps +AC_MSG_CHECKING(if fast termcap-loader is needed) +AC_ARG_ENABLE(getcap, + [ --enable-getcap fast termcap load, no xrefs to terminfo], + [with_getcap=$enableval], + [with_getcap=no]) +AC_MSG_RESULT($with_getcap) +test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP) + +AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo) +AC_ARG_ENABLE(getcap-cache, + [ --enable-getcap-cache cache translated termcaps in ~/.terminfo], + [with_getcap_cache=$enableval], + [with_getcap_cache=no]) +AC_MSG_RESULT($with_getcap_cache) +test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE) + +fi + +### Use option --enable-symlinks to make tic use symlinks, not hard links +### to reduce storage requirements for the terminfo database. +CF_LINK_FUNCS + +with_links=no +with_symlinks=no + +if test "$ac_cv_func_link" != yes ; then + AC_MSG_CHECKING(if tic should use symbolic links) + if test "$ac_cv_func_symlink" = yes ; then + with_symlinks=yes + else + with_symlinks=no + fi + AC_MSG_RESULT($with_symlinks) +elif test "$ac_cv_func_symlink" != yes ; then + AC_MSG_CHECKING(if tic should use hard links) + if test "$ac_cv_func_link" = yes ; then + with_links=yes + else + with_links=no + fi + AC_MSG_RESULT($with_links) +else + AC_MSG_CHECKING(if tic should use symbolic links) + AC_ARG_ENABLE(symlinks, + [ --enable-symlinks make tic use symbolic links not hard links], + [with_symlinks=$enableval], + [with_symlinks=no]) + AC_MSG_RESULT($with_symlinks) +fi + +test "$with_links" = yes && AC_DEFINE(USE_LINKS) +test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS) + +### 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]) +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) + +### use option --with-bool to override bool's type +AC_MSG_CHECKING(for type of bool) +AC_ARG_WITH(bool, + [ --with-bool=TYPE override fallback type of bool variable], + [NCURSES_BOOL="$withval"], + [NCURSES_BOOL=auto]) +AC_MSG_RESULT($NCURSES_BOOL) +AC_SUBST(NCURSES_BOOL) + +### use option --with-ospeed to override ospeed's type +AC_MSG_CHECKING(for type of ospeed) +AC_ARG_WITH(ospeed, + [ --with-ospeed=TYPE override type of ospeed variable], + [NCURSES_OSPEED="$withval"], + [NCURSES_OSPEED=short]) +AC_MSG_RESULT($NCURSES_OSPEED) +AC_SUBST(NCURSES_OSPEED) + +### use option --enable-bsdpad to have tputs process BSD-style prefix padding +AC_MSG_CHECKING(if tputs should process BSD-style prefix padding) +AC_ARG_ENABLE(bsdpad, + [ --enable-bsdpad recognize BSD-style prefix padding], + [with_bsdpad=$enableval], + [with_bsdpad=no]) +AC_MSG_RESULT($with_bsdpad) +test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS) + +### 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_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ]) + +############################################################################### +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_CURSES_VERSION) + AC_DEFINE(HAVE_HAS_KEY) + AC_DEFINE(HAVE_RESIZETERM) + AC_DEFINE(HAVE_USE_DEFAULT_COLORS) + AC_DEFINE(HAVE_WRESIZE) + 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) + +AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code) +AC_ARG_ENABLE(no-padding, + [ --enable-no-padding compile with \$NCURSES_NO_PADDING code], + [with_no_padding=$enableval], + [with_no_padding=$with_ext_funcs]) +AC_MSG_RESULT($with_no_padding) +test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING) + +### use option --enable-sigwinch to turn on use of SIGWINCH logic +AC_MSG_CHECKING(if you want SIGWINCH handler) +AC_ARG_ENABLE(sigwinch, + [ --enable-sigwinch compile with SIGWINCH handler], + [with_sigwinch=$enableval], + [with_sigwinch=$with_ext_funcs]) +AC_MSG_RESULT($with_sigwinch) +test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH) + +### use option --enable-tcap-names to allow user to define new capabilities +AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap) +AC_ARG_ENABLE(tcap-names, + [ --enable-tcap-names compile with user-definable terminal capabilities], + [with_tcap_names=$enableval], + [with_tcap_names=$with_ext_funcs]) +AC_MSG_RESULT($with_tcap_names) +NCURSES_XNAMES=0 +test "$with_tcap_names" = yes && NCURSES_XNAMES=1 +AC_SUBST(NCURSES_XNAMES) + +############################################################################### +# 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, + [ --with-develop enable all development options], + [with_develop=$withval], + [with_develop=no]) +AC_MSG_RESULT($with_develop) + +### use option --enable-hard-tabs to turn on use of hard-tabs optimize +AC_MSG_CHECKING(if you want hard-tabs code) +AC_ARG_ENABLE(hard-tabs, + [ --enable-hard-tabs compile with hard-tabs code], + [with_hardtabs=$enableval], + [with_hardtabs=$with_develop]) +AC_MSG_RESULT($with_hardtabs) +test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS) + +AC_MSG_CHECKING(if you want to use restrict environment when running as root) +AC_ARG_ENABLE(root-environ, + [ --disable-root-environ limit environment when running as root], + [with_root_environ=$enableval], + [with_root_environ=yes]) +AC_MSG_RESULT($with_root_environ) +test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON) + +### use option --enable-xmc-glitch to turn on use of magic-cookie optimize +AC_MSG_CHECKING(if you want limited support for xmc) +AC_ARG_ENABLE(xmc-glitch, + [ --enable-xmc-glitch compile with limited support for xmc], + [with_xmc_glitch=$enableval], + [with_xmc_glitch=$with_develop]) +AC_MSG_RESULT($with_xmc_glitch) +test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT) + +############################################################################### +# These are just experimental, probably should not be in a package: +CF_HELP_MESSAGE(Experimental Code:) + +AC_MSG_CHECKING(if you do not want to assume colors are white-on-black) +AC_ARG_ENABLE(assumed-color, + [ --disable-assumed-color do not assume anything about default-colors], + [with_assumed_color=$enableval], + [with_assumed_color=yes]) +AC_MSG_RESULT($with_assumed_color) +test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR) + +### use option --enable-hashmap to turn on use of hashmap scrolling logic +AC_MSG_CHECKING(if you want hashmap scrolling-optimization code) +AC_ARG_ENABLE(hashmap, + [ --disable-hashmap compile without hashmap scrolling-optimization], + [with_hashmap=$enableval], + [with_hashmap=yes]) +AC_MSG_RESULT($with_hashmap) +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], + [with_colorfgbg=$enableval], + [with_colorfgbg=no]) +AC_MSG_RESULT($with_colorfgbg) +test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG) + +AC_MSG_CHECKING(if you want experimental safe-sprintf code) +AC_ARG_ENABLE(safe-sprintf, + [ --enable-safe-sprintf compile with experimental safe-sprintf code], + [with_safe_sprintf=$enableval], + [with_safe_sprintf=no]) +AC_MSG_RESULT($with_safe_sprintf) +test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF) + +### 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 +AC_MSG_CHECKING(if you want to experiment without scrolling-hints code) +AC_ARG_ENABLE(scroll-hints, + [ --disable-scroll-hints compile without scroll-hints code], + [with_scroll_hints=$enableval], + [with_scroll_hints=yes]) +AC_MSG_RESULT($with_scroll_hints) +test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS) +fi + +### use option --enable-widec to turn on use of wide-character support +NCURSES_CH_T=chtype +NCURSES_LIBUTF8=0 +NCURSES_MBSTATE_T=0 +AC_MSG_CHECKING(if you want experimental wide-character code) +AC_ARG_ENABLE(widec, + [ --enable-widec compile with experimental wide-char/UTF-8 code], + [with_widec=$enableval], + [with_widec=no]) +AC_MSG_RESULT($with_widec) +if test "$with_widec" = yes ; then + LIB_SUFFIX="w${LIB_SUFFIX}" + AC_DEFINE(USE_WIDEC_SUPPORT) + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" + # with_overwrite=no + NCURSES_CH_T=cchar_t + AC_CHECK_FUNC(putwc) +if test "$ac_cv_func_putwc" != yes ; then + CF_LIBUTF8 + if test "$cf_cv_libutf8" = yes ; then + NCURSES_LIBUTF8=1 + fi +fi + CF_MBSTATE_T + if test $cf_cv_mbstate_t = yes ; then + NCURSES_MBSTATE_T=1 + fi +fi +AC_SUBST(NCURSES_CH_T) +AC_SUBST(NCURSES_LIBUTF8) +AC_SUBST(NCURSES_MBSTATE_T) + +AC_MSG_CHECKING(for terminal capabilities file) +AC_ARG_WITH(caps, + [ --with-caps=alt compile with experimental alternate Caps file], + [TERMINFO_CAPS=Caps.$withval], + [TERMINFO_CAPS=Caps]) +test -f ${srcdir}/include/${TERMINFO_CAPS} || TERMINFO_CAPS=Caps +AC_MSG_RESULT($TERMINFO_CAPS) +AC_SUBST(TERMINFO_CAPS) + +############################################################################### +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 $@ ... ;' + test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent" +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 -n "$with_warnings"; then + ADAFLAGS="$ADAFLAGS -gnatg" + CF_GCC_WARNINGS +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_ARG_ENABLE(leaks, + [ --disable-leaks test: suppress permanent memory-leaks], + [test "$enableval" = no && AC_DEFINE(NO_LEAKS)]) +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)]) + +### Checks for libraries. +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_MATH_LIB(MATH_LIB,sin(x)) +AC_SUBST(MATH_LIB) + +### Checks for header files. +CF_GNU_SOURCE +AC_STDC_HEADERS +AC_HEADER_DIRENT +AC_HEADER_TIME +CF_REGEX + +dnl These are some other potentially nonportable headers. +AC_CHECK_HEADERS( \ +fcntl.h \ +getopt.h \ +libc.h \ +limits.h \ +locale.h \ +poll.h \ +sys/bsdtypes.h \ +sys/ioctl.h \ +sys/param.h \ +sys/poll.h \ +sys/select.h \ +sys/time.h \ +sys/times.h \ +ttyent.h \ +unistd.h \ +) + +# check for ISC (this may also define _POSIX_SOURCE) +# 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()' +fi + +CF_SYS_TIME_SELECT + +### checks for compiler characteristics +AC_LANG_C +AC_C_CONST +AC_C_INLINE +test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS) + +CF_TYPEOF_CHTYPE + +### Checks for external-data +CF_ERRNO +CF_LINK_DATAONLY + +### Checks for library functions. +AC_CHECK_FUNCS( \ +getcwd \ +getegid \ +geteuid \ +getttynam \ +issetugid \ +memccpy \ +nanosleep \ +poll \ +remove \ +select \ +setbuf \ +setbuffer \ +setvbuf \ +sigaction \ +sigvec \ +strdup \ +strstr \ +tcgetpgrp \ +times \ +vsnprintf \ +) +if test "$with_getcap" = "yes" ; then + CF_CGETENT +fi + +CF_ISASCII +CF_STRUCT_SIGACTION +CF_FUNC_TERMIOS +CF_FUNC_VSSCANF +CF_MKSTEMP + +# setup for prototype of fallback for vsscanf() +if test "$cf_cv_func_vsscanf" = vsscanf ; then + HAVE_VSSCANF=1 +else + HAVE_VSSCANF=0 +fi +AC_SUBST(HAVE_VSSCANF) + +dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS +if test "$cross_compiling" = yes ; then + AC_MSG_WARN(cross compiling: assume setvbuf params not reversed) +else + AC_FUNC_SETVBUF_REVERSED +fi +AC_TYPE_SIGNAL +CF_TYPE_SIGACTION +CF_SIZECHANGE +CF_FUNC_MEMMOVE +CF_FUNC_POLL + +dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS +if test -z "$cf_user_CFLAGS" ; then + CF_STRIP_G_OPT(CFLAGS) + CF_STRIP_G_OPT(CXXFLAGS) +fi + +dnl Check for C++ compiler characteristics (and ensure that it's there!) +CF_BOOL_DECL(cf_cv_cc_bool_type) +if test -n "$CXX" ; then + AC_LANG_CPLUSPLUS + CF_STDCPP_LIBRARY + + case $GXX_VERSION in + 1*|2.[0-6]*) + cf_cxx_library=yes + ;; + *-2.7*|2.7*) + CF_GPP_LIBRARY + ;; + *) + cf_cxx_library=no + ;; + esac + + AC_CHECK_HEADERS(typeinfo) + + CF_BOOL_DECL + CF_BOOL_SIZE + CF_ETIP_DEFINES + CF_CPP_PARAM_INIT + CF_CPP_VSCAN_FUNC + + CXX_AR='$(AR)' + CXX_AR_OPTS='$(AR_OPTS)' + case $cf_cv_system_name in #(vi + irix*) #(vi + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-ar -o' + fi + ;; + sco3.2v5*) #(vi + CXXLDFLAGS="-u main" + ;; + solaris2*) + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-xar -o' + fi + ;; + esac + AC_SUBST(CXXLDFLAGS) + AC_SUBST(CXX_AR) + AC_SUBST(CXX_AR_OPTS) +else + cf_cxx_library=no + cf_cv_builtin_bool=1 + + # Just because we are not configuring against C++ right now does not + # mean that a user will not want to use C++. Some distributors disable + # the C++ portion of this configuration as a shortcut (or just to avoid + # compiling the demo in the c++ directory). So we need a reasonable + # default for the 'bool' type. + # + # Caveat: since the storage of the bool type is not standardized, it + # may change. + + if test "$NCURSES_BOOL" != auto ; then + cf_cv_type_of_bool=$NCURSES_AUTO + else + if test "$cf_cv_header_stdbool_h" = 1 ; then + CF_BOOL_SIZE + else + AC_MSG_CHECKING(for fallback type of bool) + case "$host_cpu" in #(vi + i?86) cf_cv_type_of_bool=char ;; #(vi + *) cf_cv_type_of_bool=int ;; + esac + AC_MSG_RESULT($cf_cv_type_of_bool) + fi + fi +fi +AC_SUBST(CXXLIBS) + +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_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 +if test "$cf_cv_prog_gnat_correct" = yes; then + ADAFLAGS="-O3 -gnatpn $ADAFLAGS" + + 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) + + 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 + +### It's not possible to appease gcc 2.6.3's conversion-warnings if we're +### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too +### badly to consider using for development purposes, but 2.5.8 is okay. +if test -n "$with_warnings"; then + case $GCC_VERSION in + 2.6.3) + if test "$cf_cv_type_of_bool" != "char"; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" + fi + ;; + 2.5*) + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" + ;; + esac +fi + +### Construct the library-subsets, if any, from this set of keywords: +### none, base, ext_funcs, termlib. +AC_MSG_CHECKING(for library subsets) +if test "$with_termlib" = yes ; then + LIB_SUBSETS="termlib " +else + LIB_SUBSETS="termlib+" +fi +LIB_SUBSETS="${LIB_SUBSETS}base" +test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" +test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" +AC_MSG_RESULT($LIB_SUBSETS) + +LIB_TRACING=DEBUG +ADA_TRACE=FALSE +case "$CFLAGS $CPPFLAGS" in +*-DTRACE*) + LIB_TRACING=all + ADA_TRACE=TRUE + ;; +esac +AC_SUBST(ADA_TRACE) + +### 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_DEP_SUFFIX)dnl +if test $DFT_LWR_MODEL = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + DFT_DEP_SUFFIX=".dll.a" + ;; + esac +fi +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) + +# libtool thinks it can make c++ shared libraries (perhaps only g++) +AC_MSG_CHECKING(c++ library-dependency suffix) +if test "$with_libtool" = "yes"; then + CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX +else + CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX)dnl we normally make a static library +fi +AC_MSG_RESULT($CXX_LIB_SUFFIX) +AC_SUBST(CXX_LIB_SUFFIX) + +TINFO_LIST="$SHLIB_LIST" +test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}" + +AC_MSG_CHECKING(where we will install curses.h) +test "$with_overwrite" = no && \ +test "x$includedir" = 'x${prefix}/include' && \ + includedir='$(prefix)/include/ncurses'${LIB_SUFFIX} +AC_MSG_RESULT($includedir) + +### Resolve a conflict between normal and wide-curses by forcing applications +### that will need libutf8 to add it to their configure script. +if test "$with_overwrite" != no ; then +if test "$NCURSES_LIBUTF8" = 1 ; then + NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)' + AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h) +fi +fi + +AC_SUBST(EXTRA_LIBS) +AC_SUBST(TINFO_LIST) +AC_SUBST(SHLIB_LIST) + +### Set up low-level terminfo dependencies for makefiles. Note that we +### could override this. +if test "$with_termlib" = yes ; then + TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}" + if test "$DFT_LWR_MODEL" = "libtool"; then + TEST_ARGS="${TEST_DEPS}" + else + TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}" + fi +fi +PROG_DEPS="$TEST_DEPS" +PROG_ARGS="$TEST_ARGS" + +### Construct the list of subdirectories for which we'll customize makefiles +### with the appropriate compile-rules. + +CF_SRC_MODULES($modules_to_build) +CF_DIRS_TO_MAKE + +AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP') + +### Now that we're done running tests, add the compiler-warnings, if any +CFLAGS="$CFLAGS $EXTRA_CFLAGS" + +################################################################################ +AC_OUTPUT( \ + include/MKterm.h.awk \ + include/curses.head:include/curses.h.in \ + include/termcap.h \ + include/unctrl.h \ + misc/run_tic.sh:misc/run_tic.in \ + $SUB_MAKEFILES \ + Makefile,[ +CF_LIB_RULES +],[ +### Special initialization commands, used to pass information from the +### configuration-run into config.status + +AWK="$AWK" +CF_LIST_MODELS="$cf_list_models" +DFT_LWR_MODEL="$DFT_LWR_MODEL" +LDCONFIG="$LDCONFIG" +LIB_NAME="$LIB_NAME" +LIB_SUBSETS="$LIB_SUBSETS" +LIB_SUFFIX="$LIB_SUFFIX" +LIB_TRACING="$LIB_TRACING" +MAKE_TERMINFO="$MAKE_TERMINFO" +NCURSES_OSPEED="$NCURSES_OSPEED" +SRC_SUBDIRS="$SRC_SUBDIRS" +TERMINFO="$TERMINFO" +TINFO_NAME="$TINFO_NAME" +WITH_CURSES_H="$with_curses_h" +WITH_ECHO="$with_echo" +WITH_OVERWRITE="$with_overwrite" +cf_cv_abi_version="$cf_cv_abi_version" +cf_cv_do_symlinks="$cf_cv_do_symlinks" +cf_cv_rel_version="$cf_cv_rel_version" +cf_cv_rm_so_locs="$cf_cv_rm_so_locs" +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_cxx_binding="$cf_with_cxx_binding" +target="$target" + +],cat)dnl +${MAKE-make} preinstall diff --git a/ncurses-5.3/convert_configure.pl b/ncurses-5.3/convert_configure.pl new file mode 100644 index 0000000..dea92ca --- /dev/null +++ b/ncurses-5.3/convert_configure.pl @@ -0,0 +1,90 @@ +extproc perl -S -w + +# The converted script is written to stdout, so run this script as +# convert_configure configure > configure.cmd +# +# When the converted script runs, it expects that /tmp dir is +# available (so we create it). +# +# run the result like this: +# .\configure + +# Some frequent manual intervention: +# a) Some makefiles hardwire SHELL = /bin/sh ==> change to: sh +# b) Some makefiles recognize that exe files terminate on .exe +# You need to give this script -no-zexe option... + +shift, $no_zexe = 1 if @ARGV and $ARGV[0] eq '-no-zexe'; + +mkdir '/tmp', 0777 unless -d '/tmp'; + +print <) { + if (/for\s+(\w+)\s+in\s*\$(PATH|ac_dummy)\s*;/) { + $checking_path = 1; + $varname = $1; + $subst= < $@ + +ANNOUNCE : doc/html/announce.html + $(DUMP) doc/html/announce.html > $@ + +doc/ncurses-intro.doc: doc/html/ncurses-intro.html + $(DUMP2) doc/html/ncurses-intro.html > $@ +doc/hackguide.doc: doc/html/hackguide.html + $(DUMP2) doc/html/hackguide.html > $@ + +MANPROG = tbl | nroff -man + +manhtml: MANIFEST + @rm -f doc/html/man/*.html + @mkdir -p doc/html/man + @rm -f subst.tmp ; + @for f in man/*.[0-9]*; do \ + m=`basename $$f` ;\ + x=`echo $$m | awk -F. '{print $$2;}'` ;\ + xu=`echo $$x | dd conv=ucase 2>/dev/null` ;\ + if [ "$${x}" != "$${xu}" ]; then \ + echo "s/$${xu}/$${x}/g" >> subst.tmp ;\ + fi ;\ + done + # change some things to make weblint happy: + @echo 's///g' >> subst.tmp + @echo 's/<\/B>/<\/STRONG>/g' >> subst.tmp + @echo 's///g' >> subst.tmp + @echo 's/<\/I>/<\/EM>/g' >> subst.tmp + @sort < subst.tmp | uniq > subst.sed + @echo '/<\/TITLE>/a\' >> subst.sed + @echo '\' >> subst.sed + @echo '' >> subst.sed + @rm -f subst.tmp + @for f in man/*.[0-9]* ; do \ + m=`basename $$f` ;\ + T=`egrep '^.TH' $$f|sed -e 's/^.TH //' -e s'/"//g' -e 's/[ ]\+$$//'` ; \ + g=$${m}.html ;\ + if [ -f doc/html/$$g ]; then chmod +w doc/html/$$g; fi;\ + echo "Converting $$m to HTML" ;\ + echo '' > doc/html/man/$$g ;\ + echo '' >> doc/html/man/$$g ;\ + man/edit_man.sh editing /usr/man man $$f | $(MANPROG) | tr '\255' '-' | $(MAN2HTML) -title "$$T" | \ + sed -f subst.sed |\ + sed -e 's/"curses.3x.html"/"ncurses.3x.html"/g' \ + >> doc/html/man/$$g ;\ + done + @rm -f subst.sed + @sed -e "\%./doc/html/man/%d" < MANIFEST > MANIFEST.tmp + @find ./doc/html/man -type f -print >> MANIFEST.tmp + @chmod u+w MANIFEST + @sort -u < MANIFEST.tmp > MANIFEST + @rm -f MANIFEST.tmp + +# +# Please note that this target can only be properly built if the build of the +# Ada95 subdir has been done. The reason is, that the gnathtml tool uses the +# .ali files generated by the Ada95 compiler during the build process. These +# .ali files contain cross referencing information required by gnathtml. +adahtml: MANIFEST + if [ ! -z "$(GNATHTML)" ]; then \ + (cd ./Ada95/gen ; make html) ;\ + sed -e "\%./doc/html/ada/%d" < MANIFEST > MANIFEST.tmp ;\ + find ./doc/html/ada -type f -print >> MANIFEST.tmp ;\ + sort -u < MANIFEST.tmp > MANIFEST ;\ + rm -f MANIFEST.tmp ;\ + fi + +# Prepare distribution for version control +vcprepare: + find . -type d -exec mkdir {}/RCS \; + +# Write-lock almost all files not under version control. +ADA_EXCEPTIONS=$(shell eval 'a="\\\\\|";for x in Ada95/gen/terminal*.m4; do echo -n $${a}Ada95/ada_include/`basename $${x} .m4`; done') +EXCEPTIONS = 'announce.html$\\|ANNOUNCE\\|misc/.*\\.doc\\|man/terminfo.5\\|lib_gen.c'$(ADA_EXCEPTIONS) +writelock: + for x in `grep -v $(EXCEPTIONS) MANIFEST`; do if [ ! -f `dirname $$x`/RCS/`basename $$x`,v ]; then chmod a-w $${x}; fi; done + +# This only works on a clean source tree, of course. +MANIFEST: + -rm -f $@ + touch $@ + find . -type f -print |sort | fgrep -v .lsm |fgrep -v .spec >$@ + +TAGS: + etags */*.[ch] + +# Makefile ends here diff --git a/ncurses-5.3/doc/hackguide.doc b/ncurses-5.3/doc/hackguide.doc new file mode 100644 index 0000000..e9828d2 --- /dev/null +++ b/ncurses-5.3/doc/hackguide.doc @@ -0,0 +1,687 @@ + + A Hacker's Guide to NCURSES + + Contents + + * Abstract + * Objective of the Package + + Why System V Curses? + + How to Design Extensions + * Portability and Configuration + * Documentation Conventions + * How to Report Bugs + * A Tour of the Ncurses Library + + Library Overview + + The Engine Room + + Keyboard Input + + Mouse Events + + Output and Screen Updating + * The Forms and Menu Libraries + * A Tour of the Terminfo Compiler + + Translation of Non-use Capabilities + + Use Capability Resolution + + Source-Form Translation + * Other Utilities + * Style Tips for Developers + * Porting Hints + + Abstract + + This document is a hacker's tour of the ncurses library and utilities. + It discusses design philosophy, implementation methods, and the + conventions used for coding and documentation. It is recommended + reading for anyone who is interested in porting, extending or + improving the package. + + Objective of the Package + + The objective of the ncurses package is to provide a free software API + for character-cell terminals and terminal emulators with the following + characteristics: + * Source-compatible with historical curses implementations + (including the original BSD curses and System V curses. + * Conformant with the XSI Curses standard issued as part of XPG4 by + X/Open. + * High-quality -- stable and reliable code, wide portability, good + packaging, superior documentation. + * Featureful -- should eliminate as much of the drudgery of C + interface programming as possible, freeing programmers to think at + a higher level of design. + + These objectives are in priority order. So, for example, source + compatibility with older version must trump featurefulness -- we + cannot add features if it means breaking the portion of the API + corresponding to historical curses versions. + +Why System V Curses? + + We used System V curses as a model, reverse-engineering their API, in + order to fulfill the first two objectives. + + System V curses implementations can support BSD curses programs with + just a recompilation, so by capturing the System V API we also capture + BSD's. + + More importantly for the future, the XSI Curses standard issued by + X/Open is explicitly and closely modeled on System V. So conformance + with System V took us most of the way to base-level XSI conformance. + +How to Design Extensions + + The third objective (standards conformance) requires that it be easy + to condition source code using ncurses so that the absence of + nonstandard extensions does not break the code. + + Accordingly, we have a policy of associating with each nonstandard + extension a feature macro, so that ncurses client code can use this + macro to condition in or out the code that requires the ncurses + extension. + + For example, there is a macro NCURSES_MOUSE_VERSION which XSI Curses + does not define, but which is defined in the ncurses library header. + You can use this to condition the calls to the mouse API calls. + + Portability and Configuration + + Code written for ncurses may assume an ANSI-standard C compiler and + POSIX-compatible OS interface. It may also assume the presence of a + System-V-compatible select(2) call. + + We encourage (but do not require) developers to make the code friendly + to less-capable UNIX environments wherever possible. + + We encourage developers to support OS-specific optimizations and + methods not available under POSIX/ANSI, provided only that: + * All such code is properly conditioned so the build process does + not attempt to compile it under a plain ANSI/POSIX environment. + * Adding such implementation methods does not introduce + incompatibilities in the ncurses API between platforms. + + We use GNU autoconf(1) as a tool to deal with portability issues. The + right way to leverage an OS-specific feature is to modify the autoconf + specification files (configure.in and aclocal.m4) to set up a new + feature macro, which you then use to condition your code. + + Documentation Conventions + + There are three kinds of documentation associated with this package. + Each has a different preferred format: + * Package-internal files (README, INSTALL, TO-DO etc.) + * Manual pages. + * Everything else (i.e., narrative documentation). + + Our conventions are simple: + 1. Maintain package-internal files in plain text. The expected viewer + for them more(1) or an editor window; there's no point in + elaborate mark-up. + 2. Mark up manual pages in the man macros. These have to be viewable + through traditional man(1) programs. + 3. Write everything else in HTML. + + When in doubt, HTMLize a master and use lynx(1) to generate plain + ASCII (as we do for the announcement document). + + The reason for choosing HTML is that it's (a) well-adapted for on-line + browsing through viewers that are everywhere; (b) more easily readable + as plain text than most other mark-ups, if you don't have a viewer; + and (c) carries enough information that you can generate a + nice-looking printed version from it. Also, of course, it make + exporting things like the announcement document to WWW pretty trivial. + + How to Report Bugs + + The reporting address for bugs is bug-ncurses@gnu.org. This is a + majordomo list; to join, write to bug-ncurses-request@gnu.org with a + message containing the line: + subscribe @ + + The ncurses code is maintained by a small group of volunteers. While + we try our best to fix bugs promptly, we simply don't have a lot of + hours to spend on elementary hand-holding. We rely on intelligent + cooperation from our users. If you think you have found a bug in + ncurses, there are some steps you can take before contacting us that + will help get the bug fixed quickly. + + In order to use our bug-fixing time efficiently, we put people who + show us they've taken these steps at the head of our queue. This means + that if you don't, you'll probably end up at the tail end and have to + wait a while. + 1. Develop a recipe to reproduce the bug. + Bugs we can reproduce are likely to be fixed very quickly, often + within days. The most effective single thing you can do to get a + quick fix is develop a way we can duplicate the bad behavior -- + ideally, by giving us source for a small, portable test program + that breaks the library. (Even better is a keystroke recipe using + one of the test programs provided with the distribution.) + 2. Try to reproduce the bug on a different terminal type. + In our experience, most of the behaviors people report as library + bugs are actually due to subtle problems in terminal descriptions. + This is especially likely to be true if you're using a traditional + asynchronous terminal or PC-based terminal emulator, rather than + xterm or a UNIX console entry. + It's therefore extremely helpful if you can tell us whether or not + your problem reproduces on other terminal types. Usually you'll + have both a console type and xterm available; please tell us + whether or not your bug reproduces on both. + If you have xterm available, it is also good to collect xterm + reports for different window sizes. This is especially true if you + normally use an unusual xterm window size -- a surprising number + of the bugs we've seen are either triggered or masked by these. + 3. Generate and examine a trace file for the broken behavior. + Recompile your program with the debugging versions of the + libraries. Insert a trace() call with the argument set to + TRACE_UPDATE. (See "Writing Programs with NCURSES" for details on + trace levels.) Reproduce your bug, then look at the trace file to + see what the library was actually doing. + Another frequent cause of apparent bugs is application coding + errors that cause the wrong things to be put on the virtual + screen. Looking at the virtual-screen dumps in the trace file will + tell you immediately if this is happening, and save you from the + possible embarrassment of being told that the bug is in your code + and is your problem rather than ours. + If the virtual-screen dumps look correct but the bug persists, + it's possible to crank up the trace level to give more and more + information about the library's update actions and the control + sequences it issues to perform them. The test directory of the + distribution contains a tool for digesting these logs to make them + less tedious to wade through. + Often you'll find terminfo problems at this stage by noticing that + the escape sequences put out for various capabilities are wrong. + If not, you're likely to learn enough to be able to characterize + any bug in the screen-update logic quite exactly. + 4. Report details and symptoms, not just interpretations. + If you do the preceding two steps, it is very likely that you'll + discover the nature of the problem yourself and be able to send us + a fix. This will create happy feelings all around and earn you + good karma for the first time you run into a bug you really can't + characterize and fix yourself. + If you're still stuck, at least you'll know what to tell us. + Remember, we need details. If you guess about what is safe to + leave out, you are too likely to be wrong. + If your bug produces a bad update, include a trace file. Try to + make the trace at the least voluminous level that pins down the + bug. Logs that have been through tracemunch are OK, it doesn't + throw away any information (actually they're better than + un-munched ones because they're easier to read). + If your bug produces a core-dump, please include a symbolic stack + trace generated by gdb(1) or your local equivalent. + Tell us about every terminal on which you've reproduced the bug -- + and every terminal on which you can't. Ideally, sent us terminfo + sources for all of these (yours might differ from ours). + Include your ncurses version and your OS/machine type, of course! + You can find your ncurses version in the curses.h file. + + If your problem smells like a logic error or in cursor movement or + scrolling or a bad capability, there are a couple of tiny test frames + for the library algorithms in the progs directory that may help you + isolate it. These are not part of the normal build, but do have their + own make productions. + + The most important of these is mvcur, a test frame for the + cursor-movement optimization code. With this program, you can see + directly what control sequences will be emitted for any given cursor + movement or scroll/insert/delete operations. If you think you've got a + bad capability identified, you can disable it and test again. The + program is command-driven and has on-line help. + + If you think the vertical-scroll optimization is broken, or just want + to understand how it works better, build hashmap and read the header + comments of hardscroll.c and hashmap.c; then try it out. You can also + test the hardware-scrolling optimization separately with hardscroll. + + There's one other interactive tester, tctest, that exercises + translation between termcap and terminfo formats. If you have a + serious need to run this, you probably belong on our development team! + + A Tour of the Ncurses Library + +Library Overview + + Most of the library is superstructure -- fairly trivial convenience + interfaces to a small set of basic functions and data structures used + to manipulate the virtual screen (in particular, none of this code + does any I/O except through calls to more fundamental modules + described below). The files + + lib_addch.c lib_bkgd.c lib_box.c lib_chgat.c lib_clear.c + lib_clearok.c lib_clrbot.c lib_clreol.c lib_colorset.c lib_data.c + lib_delch.c lib_delwin.c lib_echo.c lib_erase.c lib_gen.c + lib_getstr.c lib_hline.c lib_immedok.c lib_inchstr.c lib_insch.c + lib_insdel.c lib_insstr.c lib_instr.c lib_isendwin.c lib_keyname.c + lib_leaveok.c lib_move.c lib_mvwin.c lib_overlay.c lib_pad.c + lib_printw.c lib_redrawln.c lib_scanw.c lib_screen.c lib_scroll.c + lib_scrollok.c lib_scrreg.c lib_set_term.c lib_slk.c + lib_slkatr_set.c lib_slkatrof.c lib_slkatron.c lib_slkatrset.c + lib_slkattr.c lib_slkclear.c lib_slkcolor.c lib_slkinit.c + lib_slklab.c lib_slkrefr.c lib_slkset.c lib_slktouch.c lib_touch.c + lib_unctrl.c lib_vline.c lib_wattroff.c lib_wattron.c lib_window.c + + are all in this category. They are very unlikely to need change, + barring bugs or some fundamental reorganization in the underlying data + structures. + + These files are used only for debugging support: + + lib_trace.c lib_traceatr.c lib_tracebits.c lib_tracechr.c + lib_tracedmp.c lib_tracemse.c trace_buf.c + + It is rather unlikely you will ever need to change these, unless you + want to introduce a new debug trace level for some reasoon. + + There is another group of files that do direct I/O via tputs(), + computations on the terminal capabilities, or queries to the OS + environment, but nevertheless have only fairly low complexity. These + include: + + lib_acs.c lib_beep.c lib_color.c lib_endwin.c lib_initscr.c + lib_longname.c lib_newterm.c lib_options.c lib_termcap.c lib_ti.c + lib_tparm.c lib_tputs.c lib_vidattr.c read_entry.c. + + They are likely to need revision only if ncurses is being ported to an + environment without an underlying terminfo capability representation. + + These files have serious hooks into the tty driver and signal + facilities: + + lib_kernel.c lib_baudrate.c lib_raw.c lib_tstp.c lib_twait.c + + If you run into porting snafus moving the package to another UNIX, the + problem is likely to be in one of these files. The file lib_print.c + uses sleep(2) and also falls in this category. + + Almost all of the real work is done in the files + + hardscroll.c hashmap.c lib_addch.c lib_doupdate.c lib_getch.c + lib_mouse.c lib_mvcur.c lib_refresh.c lib_setup.c lib_vidattr.c + + Most of the algorithmic complexity in the library lives in these + files. If there is a real bug in ncurses itself, it's probably here. + We'll tour some of these files in detail below (see The Engine Room). + + Finally, there is a group of files that is actually most of the + terminfo compiler. The reason this code lives in the ncurses library + is to support fallback to /etc/termcap. These files include + + alloc_entry.c captoinfo.c comp_captab.c comp_error.c comp_hash.c + comp_parse.c comp_scan.c parse_entry.c read_termcap.c write_entry.c + + We'll discuss these in the compiler tour. + +The Engine Room + + Keyboard Input + + All ncurses input funnels through the function wgetch(), defined in + lib_getch.c. This function is tricky; it has to poll for keyboard and + mouse events and do a running match of incoming input against the set + of defined special keys. + + The central data structure in this module is a FIFO queue, used to + match multiple-character input sequences against special-key + capabilities; also to implement pushback via ungetch(). + + The wgetch() code distinguishes between function key sequences and the + same sequences typed manually by doing a timed wait after each input + character that could lead a function key sequence. If the entire + sequence takes less than 1 second, it is assumed to have been + generated by a function key press. + + Hackers bruised by previous encounters with variant select(2) calls + may find the code in lib_twait.c interesting. It deals with the + problem that some BSD selects don't return a reliable time-left value. + The function timed_wait() effectively simulates a System V select. + + Mouse Events + + If the mouse interface is active, wgetch() polls for mouse events each + call, before it goes to the keyboard for input. It is up to + lib_mouse.c how the polling is accomplished; it may vary for different + devices. + + Under xterm, however, mouse event notifications come in via the + keyboard input stream. They are recognized by having the kmous + capability as a prefix. This is kind of klugey, but trying to wire in + recognition of a mouse key prefix without going through the + function-key machinery would be just too painful, and this turns out + to imply having the prefix somewhere in the function-key capabilities + at terminal-type initialization. + + This kluge only works because kmous isn't actually used by any + historic terminal type or curses implementation we know of. Best guess + is it's a relic of some forgotten experiment in-house at Bell Labs + that didn't leave any traces in the publicly-distributed System V + terminfo files. If System V or XPG4 ever gets serious about using it + again, this kluge may have to change. + + Here are some more details about mouse event handling: + + The lib_mouse()code is logically split into a lower level that accepts + event reports in a device-dependent format and an upper level that + parses mouse gestures and filters events. The mediating data structure + is a circular queue of event structures. + + Functionally, the lower level's job is to pick up primitive events and + put them on the circular queue. This can happen in one of two ways: + either (a) _nc_mouse_event() detects a series of incoming mouse + reports and queues them, or (b) code in lib_getch.c detects the kmous + prefix in the keyboard input stream and calls _nc_mouse_inline to + queue up a series of adjacent mouse reports. + + In either case, _nc_mouse_parse() should be called after the series is + accepted to parse the digested mouse reports (low-level events) into a + gesture (a high-level or composite event). + + Output and Screen Updating + + With the single exception of character echoes during a wgetnstr() call + (which simulates cooked-mode line editing in an ncurses window), the + library normally does all its output at refresh time. + + The main job is to go from the current state of the screen (as + represented in the curscr window structure) to the desired new state + (as represented in the newscr window structure), while doing as little + I/O as possible. + + The brains of this operation are the modules hashmap.c, hardscroll.c + and lib_doupdate.c; the latter two use lib_mvcur.c. Essentially, what + happens looks like this: + + The hashmap.c module tries to detect vertical motion changes between + the real and virtual screens. This information is represented by the + oldindex members in the newscr structure. These are modified by + vertical-motion and clear operations, and both are re-initialized + after each update. To this change-journalling information, the hashmap + code adds deductions made using a modified Heckel algorithm on hash + values generated from the line contents. + + The hardscroll.c module computes an optimum set of scroll, insertion, + and deletion operations to make the indices match. It calls + _nc_mvcur_scrolln() in lib_mvcur.c to do those motions. + + Then lib_doupdate.c goes to work. Its job is to do line-by-line + transformations of curscr lines to newscr lines. Its main tool is the + routine mvcur() in lib_mvcur.c. This routine does cursor-movement + optimization, attempting to get from given screen location A to given + location B in the fewest output characters posible. + + If you want to work on screen optimizations, you should use the fact + that (in the trace-enabled version of the library) enabling the + TRACE_TIMES trace level causes a report to be emitted after each + screen update giving the elapsed time and a count of characters + emitted during the update. You can use this to tell when an update + optimization improves efficiency. + + In the trace-enabled version of the library, it is also possible to + disable and re-enable various optimizations at runtime by tweaking the + variable _nc_optimize_enable. See the file include/curses.h.in for + mask values, near the end. + + The Forms and Menu Libraries + + The forms and menu libraries should work reliably in any environment + you can port ncurses to. The only portability issue anywhere in them + is what flavor of regular expressions the built-in form field type + TYPE_REGEXP will recognize. + + The configuration code prefers the POSIX regex facility, modeled on + System V's, but will settle for BSD regexps if the former isn't + available. + + Historical note: the panels code was written primarily to assist in + porting u386mon 2.0 (comp.sources.misc v14i001-4) to systems lacking + panels support; u386mon 2.10 and beyond use it. This version has been + slightly cleaned up for ncurses. + + A Tour of the Terminfo Compiler + + The ncurses implementation of tic is rather complex internally; it has + to do a trying combination of missions. This starts with the fact + that, in addition to its normal duty of compiling terminfo sources + into loadable terminfo binaries, it has to be able to handle termcap + syntax and compile that too into terminfo entries. + + The implementation therefore starts with a table-driven, dual-mode + lexical analyzer (in comp_scan.c). The lexer chooses its mode (termcap + or terminfo) based on the first `,' or `:' it finds in each entry. The + lexer does all the work of recognizing capability names and values; + the grammar above it is trivial, just "parse entries till you run out + of file". + +Translation of Non-use Capabilities + + Translation of most things besides use capabilities is pretty + straightforward. The lexical analyzer's tokenizer hands each + capability name to a hash function, which drives a table lookup. The + table entry yields an index which is used to look up the token type in + another table, and controls interpretation of the value. + + One possibly interesting aspect of the implementation is the way the + compiler tables are initialized. All the tables are generated by + various awk/sed/sh scripts from a master table include/Caps; these + scripts actually write C initializers which are linked to the + compiler. Furthermore, the hash table is generated in the same way, so + it doesn't have to be generated at compiler startup time (another + benefit of this organization is that the hash table can be in + shareable text space). + + Thus, adding a new capability is usually pretty trivial, just a matter + of adding one line to the include/Caps file. We'll have more to say + about this in the section on Source-Form Translation. + +Use Capability Resolution + + The background problem that makes tic tricky isn't the capability + translation itself, it's the resolution of use capabilities. Older + versions would not handle forward use references for this reason (that + is, a using terminal always had to follow its use target in the source + file). By doing this, they got away with a simple implementation + tactic; compile everything as it blows by, then resolve uses from + compiled entries. + + This won't do for ncurses. The problem is that that the whole + compilation process has to be embeddable in the ncurses library so + that it can be called by the startup code to translate termcap entries + on the fly. The embedded version can't go promiscuously writing + everything it translates out to disk -- for one thing, it will + typically be running with non-root permissions. + + So our tic is designed to parse an entire terminfo file into a + doubly-linked circular list of entry structures in-core, and then do + use resolution in-memory before writing everything out. This design + has other advantages: it makes forward and back use-references equally + easy (so we get the latter for free), and it makes checking for name + collisions before they're written out easy to do. + + And this is exactly how the embedded version works. But the + stand-alone user-accessible version of tic partly reverts to the + historical strategy; it writes to disk (not keeping in core) any entry + with no use references. + + This is strictly a core-economy kluge, implemented because the + terminfo master file is large enough that some core-poor systems swap + like crazy when you compile it all in memory...there have been reports + of this process taking three hours, rather than the twenty seconds or + less typical on the author's development box. + + So. The executable tic passes the entry-parser a hook that immediately + writes out the referenced entry if it has no use capabilities. The + compiler main loop refrains from adding the entry to the in-core list + when this hook fires. If some other entry later needs to reference an + entry that got written immediately, that's OK; the resolution code + will fetch it off disk when it can't find it in core. + + Name collisions will still be detected, just not as cleanly. The + write_entry() code complains before overwriting an entry that + postdates the time of tic's first call to write_entry(), Thus it will + complain about overwriting entries newly made during the tic run, but + not about overwriting ones that predate it. + +Source-Form Translation + + Another use of tic is to do source translation between various termcap + and terminfo formats. There are more variants out there than you might + think; the ones we know about are described in the captoinfo(1) manual + page. + + The translation output code (dump_entry() in ncurses/dump_entry.c) is + shared with the infocmp(1) utility. It takes the same internal + representation used to generate the binary form and dumps it to + standard output in a specified format. + + The include/Caps file has a header comment describing ways you can + specify source translations for nonstandard capabilities just by + altering the master table. It's possible to set up capability aliasing + or tell the compiler to plain ignore a given capability without + writing any C code at all. + + For circumstances where you need to do algorithmic translation, there + are functions in parse_entry.c called after the parse of each entry + that are specifically intended to encapsulate such translations. This, + for example, is where the AIX box1 capability get translated to an + acsc string. + + Other Utilities + + The infocmp utility is just a wrapper around the same entry-dumping + code used by tic for source translation. Perhaps the one interesting + aspect of the code is the use of a predicate function passed in to + dump_entry() to control which capabilities are dumped. This is + necessary in order to handle both the ordinary De-compilation case and + entry difference reporting. + + The tput and clear utilities just do an entry load followed by a + tputs() of a selected capability. + + Style Tips for Developers + + See the TO-DO file in the top-level directory of the source + distribution for additions that would be particularly useful. + + The prefix _nc_ should be used on library public functions that are + not part of the curses API in order to prevent pollution of the + application namespace. If you have to add to or modify the function + prototypes in curses.h.in, read ncurses/MKlib_gen.sh first so you can + avoid breaking XSI conformance. Please join the ncurses mailing list. + See the INSTALL file in the top level of the distribution for details + on the list. + + Look for the string FIXME in source files to tag minor bugs and + potential problems that could use fixing. + + Don't try to auto-detect OS features in the main body of the C code. + That's the job of the configuration system. + + To hold down complexity, do make your code data-driven. Especially, if + you can drive logic from a table filtered out of include/Caps, do it. + If you find you need to augment the data in that file in order to + generate the proper table, that's still preferable to ad-hoc code -- + that's why the fifth field (flags) is there. + + Have fun! + + Porting Hints + + The following notes are intended to be a first step towards DOS and + Macintosh ports of the ncurses libraries. + + The following library modules are `pure curses'; they operate only on + the curses internal structures, do all output through other curses + calls (not including tputs() and putp()) and do not call any other + UNIX routines such as signal(2) or the stdio library. Thus, they + should not need to be modified for single-terminal ports. + + lib_addch.c lib_addstr.c lib_bkgd.c lib_box.c lib_clear.c + lib_clrbot.c lib_clreol.c lib_delch.c lib_delwin.c lib_erase.c + lib_inchstr.c lib_insch.c lib_insdel.c lib_insstr.c lib_keyname.c + lib_move.c lib_mvwin.c lib_newwin.c lib_overlay.c lib_pad.c + lib_printw.c lib_refresh.c lib_scanw.c lib_scroll.c lib_scrreg.c + lib_set_term.c lib_touch.c lib_tparm.c lib_tputs.c lib_unctrl.c + lib_window.c panel.c + + This module is pure curses, but calls outstr(): + + lib_getstr.c + + These modules are pure curses, except that they use tputs() and + putp(): + + lib_beep.c lib_color.c lib_endwin.c lib_options.c lib_slk.c + lib_vidattr.c + + This modules assist in POSIX emulation on non-POSIX systems: + + sigaction.c + signal calls + + The following source files will not be needed for a + single-terminal-type port. + + alloc_entry.c captoinfo.c clear.c comp_captab.c comp_error.c + comp_hash.c comp_main.c comp_parse.c comp_scan.c dump_entry.c + infocmp.c parse_entry.c read_entry.c tput.c write_entry.c + + The following modules will use open()/read()/write()/close()/lseek() + on files, but no other OS calls. + + lib_screen.c + used to read/write screen dumps + + lib_trace.c + used to write trace data to the logfile + + Modules that would have to be modified for a port start here: + + The following modules are `pure curses' but contain assumptions + inappropriate for a memory-mapped port. + + lib_longname.c + assumes there may be multiple terminals + + lib_acs.c + assumes acs_map as a double indirection + + lib_mvcur.c + assumes cursor moves have variable cost + + lib_termcap.c + assumes there may be multiple terminals + + lib_ti.c + assumes there may be multiple terminals + + The following modules use UNIX-specific calls: + + lib_doupdate.c + input checking + + lib_getch.c + read() + + lib_initscr.c + getenv() + + lib_newterm.c + lib_baudrate.c + lib_kernel.c + various tty-manipulation and system calls + + lib_raw.c + various tty-manipulation calls + + lib_setup.c + various tty-manipulation calls + + lib_restart.c + various tty-manipulation calls + + lib_tstp.c + signal-manipulation calls + + lib_twait.c + gettimeofday(), select(). + _________________________________________________________________ + + + Eric S. Raymond + + (Note: This is not the bug address!) diff --git a/ncurses-5.3/doc/html/Ada95.html b/ncurses-5.3/doc/html/Ada95.html new file mode 100644 index 0000000..c38e42c --- /dev/null +++ b/ncurses-5.3/doc/html/Ada95.html @@ -0,0 +1,168 @@ + + + + +Ada95 Binding for ncurses + + +

Ada95 Binding for ncurses

+The ncurses Ada95 binding is © 1996-2000 by +Jürgen Pfeifer. +

+ +Permission is hereby granted to reproduce and distribute this +binding by any means and for any fee, whether alone or as part +of a larger distribution, in source or in binary form, PROVIDED +this notice is included with any such distribution, and is not +removed from any of its header files. Mention of ncurses and the +author of this binding in any applications linked with it is +highly appreciated.
+ +This binding comes AS IS with no warranty, implied or expressed. +

+


+

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-2-one interface mapping. It is +close to one-2-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-2-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/ncurses-5.3/doc/html/ada/files.htm b/ncurses-5.3/doc/html/ada/files.htm new file mode 100644 index 0000000..682207c --- /dev/null +++ b/ncurses-5.3/doc/html/ada/files.htm @@ -0,0 +1,5 @@ + + +

Files

+[T] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/files/T.htm b/ncurses-5.3/doc/html/ada/files/T.htm new file mode 100644 index 0000000..8fcea4d --- /dev/null +++ b/ncurses-5.3/doc/html/ada/files/T.htm @@ -0,0 +1,77 @@ +T + +

Files - T

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs.htm b/ncurses-5.3/doc/html/ada/funcs.htm new file mode 100644 index 0000000..96e0b14 --- /dev/null +++ b/ncurses-5.3/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] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/A.htm b/ncurses-5.3/doc/html/ada/funcs/A.htm new file mode 100644 index 0000000..dd98d80 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/A.htm @@ -0,0 +1,19 @@ +A + +

Functions - A

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/B.htm b/ncurses-5.3/doc/html/ada/funcs/B.htm new file mode 100644 index 0000000..cd263b7 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/B.htm @@ -0,0 +1,10 @@ +B + +

Functions - B

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/C.htm b/ncurses-5.3/doc/html/ada/funcs/C.htm new file mode 100644 index 0000000..e5ab81f --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/C.htm @@ -0,0 +1,36 @@ +C + +

Functions - C

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/D.htm b/ncurses-5.3/doc/html/ada/funcs/D.htm new file mode 100644 index 0000000..705bd5c --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/D.htm @@ -0,0 +1,22 @@ +D + +

Functions - D

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/E.htm b/ncurses-5.3/doc/html/ada/funcs/E.htm new file mode 100644 index 0000000..b927c7b --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/E.htm @@ -0,0 +1,11 @@ +E + +

Functions - E

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/F.htm b/ncurses-5.3/doc/html/ada/funcs/F.htm new file mode 100644 index 0000000..21e6172 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/F.htm @@ -0,0 +1,46 @@ +F + +

Functions - F

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/G.htm b/ncurses-5.3/doc/html/ada/funcs/G.htm new file mode 100644 index 0000000..4b6367b --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/G.htm @@ -0,0 +1,32 @@ +G + +

Functions - G

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/H.htm b/ncurses-5.3/doc/html/ada/funcs/H.htm new file mode 100644 index 0000000..8dd6ecf --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/H.htm @@ -0,0 +1,13 @@ +H + +

Functions - H

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/I.htm b/ncurses-5.3/doc/html/ada/funcs/I.htm new file mode 100644 index 0000000..1ed76f9 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/I.htm @@ -0,0 +1,33 @@ +I + +

Functions - I

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/K.htm b/ncurses-5.3/doc/html/ada/funcs/K.htm new file mode 100644 index 0000000..0e8e47f --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/K.htm @@ -0,0 +1,10 @@ +K + +

Functions - K

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/L.htm b/ncurses-5.3/doc/html/ada/funcs/L.htm new file mode 100644 index 0000000..4bf37da --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/L.htm @@ -0,0 +1,14 @@ +L + +

Functions - L

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/M.htm b/ncurses-5.3/doc/html/ada/funcs/M.htm new file mode 100644 index 0000000..dda9154 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/M.htm @@ -0,0 +1,44 @@ +M + +

Functions - M

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/N.htm b/ncurses-5.3/doc/html/ada/funcs/N.htm new file mode 100644 index 0000000..ca30363 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/N.htm @@ -0,0 +1,28 @@ +N + +

Functions - N

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/O.htm b/ncurses-5.3/doc/html/ada/funcs/O.htm new file mode 100644 index 0000000..ec2e133 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/O.htm @@ -0,0 +1,9 @@ +O + +

Functions - O

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/P.htm b/ncurses-5.3/doc/html/ada/funcs/P.htm new file mode 100644 index 0000000..c0f4120 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/P.htm @@ -0,0 +1,44 @@ +P + +

Functions - P

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/Q.htm b/ncurses-5.3/doc/html/ada/funcs/Q.htm new file mode 100644 index 0000000..ae7d42c --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/Q.htm @@ -0,0 +1,7 @@ +Q + +

Functions - Q

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/R.htm b/ncurses-5.3/doc/html/ada/funcs/R.htm new file mode 100644 index 0000000..fd06682 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/R.htm @@ -0,0 +1,20 @@ +R + +

Functions - R

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/S.htm b/ncurses-5.3/doc/html/ada/funcs/S.htm new file mode 100644 index 0000000..b9850c9 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/S.htm @@ -0,0 +1,97 @@ +S + +

Functions - S

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/T.htm b/ncurses-5.3/doc/html/ada/funcs/T.htm new file mode 100644 index 0000000..a02ce1a --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/T.htm @@ -0,0 +1,34 @@ +T + +

Functions - T

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/U.htm b/ncurses-5.3/doc/html/ada/funcs/U.htm new file mode 100644 index 0000000..1c66bf8 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/U.htm @@ -0,0 +1,12 @@ +U + +

Functions - U

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/V.htm b/ncurses-5.3/doc/html/ada/funcs/V.htm new file mode 100644 index 0000000..f30d751 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/V.htm @@ -0,0 +1,7 @@ +V + +

Functions - V

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/funcs/W.htm b/ncurses-5.3/doc/html/ada/funcs/W.htm new file mode 100644 index 0000000..01a72e1 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/funcs/W.htm @@ -0,0 +1,54 @@ +W + +

Functions - W

+[index] + \ No newline at end of file diff --git a/ncurses-5.3/doc/html/ada/index.htm b/ncurses-5.3/doc/html/ada/index.htm new file mode 100644 index 0000000..79c9f4a --- /dev/null +++ b/ncurses-5.3/doc/html/ada/index.htm @@ -0,0 +1,41 @@ + +Source Browser + + +

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] + +
+ + + + + + + diff --git a/ncurses-5.3/doc/html/ada/main.htm b/ncurses-5.3/doc/html/ada/main.htm new file mode 100644 index 0000000..464a4f8 --- /dev/null +++ b/ncurses-5.3/doc/html/ada/main.htm @@ -0,0 +1,70 @@ + + +

[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: +