From 0eb88fc5281804773e2a0c7a488a4452463535ce Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 24 Oct 1999 00:32:42 -0400 Subject: [PATCH] ncurses 5.0 --- ANNOUNCE | 212 +- Ada95/Makefile.in | 13 +- Ada95/README | 14 +- Ada95/TODO | 8 +- Ada95/ada_include/Makefile.in | 546 --- Ada95/gen/Makefile.in | 102 +- Ada95/gen/gen.c | 435 ++- .../terminal_interface-curses-aux.ads.m4} | 74 +- ..._interface-curses-forms-field_types.ads.m4 | 20 +- ...erface-curses-forms-field_user_data.ads.m4 | 10 +- ...terface-curses-forms-form_user_data.ads.m4 | 10 +- .../terminal_interface-curses-forms.ads.m4 | 33 +- ...terface-curses-menus-item_user_data.ads.m4 | 10 +- ...terface-curses-menus-menu_user_data.ads.m4 | 10 +- .../terminal_interface-curses-menus.ads.m4 | 32 +- .../terminal_interface-curses-mouse.ads.m4 | 51 +- ...l_interface-curses-panels-user_data.ads.m4 | 10 +- .../terminal_interface-curses-panels.ads.m4 | 18 +- Ada95/gen/terminal_interface-curses.ads.m4 | 49 +- Ada95/html/ada/files.htm | 5 + Ada95/html/ada/files/T.htm | 36 + Ada95/html/ada/funcs.htm | 19 + Ada95/html/ada/funcs/A.htm | 6 + Ada95/html/ada/funcs/C.htm | 6 + Ada95/html/ada/funcs/E.htm | 6 + Ada95/html/ada/funcs/F.htm | 6 + Ada95/html/ada/funcs/G.htm | 6 + Ada95/html/ada/funcs/I.htm | 6 + Ada95/html/ada/funcs/L.htm | 6 + Ada95/html/ada/funcs/M.htm | 6 + Ada95/html/ada/funcs/N.htm | 6 + Ada95/html/ada/funcs/P.htm | 6 + Ada95/html/ada/funcs/R.htm | 6 + Ada95/html/ada/funcs/S.htm | 6 + Ada95/html/ada/funcs/T.htm | 6 + Ada95/html/ada/funcs/U.htm | 6 + Ada95/html/ada/funcs/V.htm | 6 + Ada95/html/ada/index.htm | 33 + Ada95/html/ada/main.htm | 23 + ...ce-curses-forms-field_types-alpha__ads.htm | 58 + ...es-forms-field_types-alphanumeric__ads.htm | 59 + ...forms-field_types-enumeration-ada__ads.htm | 64 + ...ses-forms-field_types-enumeration__ads.htm | 103 + ...curses-forms-field_types-intfield__ads.htm | 60 + ...es-forms-field_types-ipv4_address__ads.htm | 56 + ...-curses-forms-field_types-numeric__ads.htm | 60 + ...e-curses-forms-field_types-regexp__ads.htm | 60 + ...ses-forms-field_types-user-choice__ads.htm | 101 + ...ace-curses-forms-field_types-user__ads.htm | 102 + ...nterface-curses-forms-field_types__ads.htm | 245 ++ ...face-curses-forms-field_user_data__ads.htm | 75 + ...rface-curses-forms-form_user_data__ads.htm | 75 + .../terminal_interface-curses-forms__ads.htm | 785 ++++ ...rface-curses-menus-item_user_data__ads.htm | 80 + ...rface-curses-menus-menu_user_data__ads.htm | 75 + .../terminal_interface-curses-menus__ads.htm | 675 ++++ .../terminal_interface-curses-mouse__ads.htm | 225 ++ ...interface-curses-panels-user_data__ads.htm | 75 + .../terminal_interface-curses-panels__ads.htm | 153 + ...terface-curses-text_io-complex_io__ads.htm | 75 + ...terface-curses-text_io-decimal_io__ads.htm | 71 + ...ace-curses-text_io-enumeration_io__ads.htm | 68 + ...interface-curses-text_io-fixed_io__ads.htm | 71 + ...interface-curses-text_io-float_io__ads.htm | 71 + ...terface-curses-text_io-integer_io__ads.htm | 68 + ...terface-curses-text_io-modular_io__ads.htm | 68 + ...terminal_interface-curses-text_io__ads.htm | 141 + .../ada/terminal_interface-curses__ads.htm | 1743 +++++++++ Ada95/html/ada/terminal_interface__ads.htm | 53 + Ada95/html/curs_addch.3x.html | 176 - Ada95/html/curs_mouse.3x.html | 172 - Ada95/html/index.html | 71 +- Ada95/html/man/curs_addch.3x.html | 174 + Ada95/html/{ => man}/curs_addchstr.3x.html | 4 +- Ada95/html/{ => man}/curs_addstr.3x.html | 4 +- Ada95/html/{ => man}/curs_attr.3x.html | 78 +- Ada95/html/{ => man}/curs_beep.3x.html | 4 +- Ada95/html/{ => man}/curs_bkgd.3x.html | 4 +- Ada95/html/{ => man}/curs_border.3x.html | 6 +- Ada95/html/{ => man}/curs_clear.3x.html | 4 +- Ada95/html/{ => man}/curs_color.3x.html | 6 +- Ada95/html/{ => man}/curs_delch.3x.html | 4 +- Ada95/html/{ => man}/curs_deleteln.3x.html | 6 +- Ada95/html/{ => man}/curs_getch.3x.html | 14 +- Ada95/html/{ => man}/curs_getstr.3x.html | 4 +- Ada95/html/{ => man}/curs_getyx.3x.html | 6 +- Ada95/html/{ => man}/curs_inch.3x.html | 6 +- Ada95/html/{ => man}/curs_inchstr.3x.html | 8 +- Ada95/html/{ => man}/curs_initscr.3x.html | 4 +- Ada95/html/{ => man}/curs_inopts.3x.html | 6 +- Ada95/html/{ => man}/curs_insch.3x.html | 4 +- Ada95/html/{ => man}/curs_insstr.3x.html | 8 +- Ada95/html/{ => man}/curs_instr.3x.html | 4 +- Ada95/html/{ => man}/curs_kernel.3x.html | 16 +- Ada95/html/man/curs_mouse.3x.html | 224 ++ Ada95/html/{ => man}/curs_move.3x.html | 4 +- Ada95/html/{ => man}/curs_outopts.3x.html | 16 +- Ada95/html/{ => man}/curs_overlay.3x.html | 4 +- Ada95/html/{ => man}/curs_pad.3x.html | 4 +- Ada95/html/{ => man}/curs_print.3x.html | 4 +- Ada95/html/{ => man}/curs_printw.3x.html | 10 +- Ada95/html/{ => man}/curs_refresh.3x.html | 4 +- Ada95/html/{ => man}/curs_scanw.3x.html | 8 +- Ada95/html/{ => man}/curs_scr_dmp.3x.html | 4 +- Ada95/html/man/curs_scr_dump.3x.html | 122 + Ada95/html/{ => man}/curs_scroll.3x.html | 4 +- Ada95/html/{ => man}/curs_slk.3x.html | 88 +- Ada95/html/{ => man}/curs_termattrs.3x.html | 4 +- Ada95/html/{ => man}/curs_termcap.3x.html | 54 +- Ada95/html/{ => man}/curs_terminfo.3x.html | 48 +- Ada95/html/{ => man}/curs_touch.3x.html | 4 +- Ada95/html/{ => man}/curs_util.3x.html | 8 +- Ada95/html/{ => man}/curs_window.3x.html | 6 +- Ada95/html/{ => man}/define_key.3x.html | 10 +- Ada95/html/{ => man}/dft_fgbg.3x.html | 4 +- Ada95/html/{ => man}/form.3x.html | 8 +- Ada95/html/{ => man}/form_cursor.3x.html | 8 +- Ada95/html/{ => man}/form_data.3x.html | 10 +- Ada95/html/{ => man}/form_driver.3x.html | 8 +- Ada95/html/{ => man}/form_field.3x.html | 4 +- .../{ => man}/form_field_attributes.3x.html | 8 +- .../html/{ => man}/form_field_buffer.3x.html | 10 +- Ada95/html/{ => man}/form_field_info.3x.html | 8 +- Ada95/html/{ => man}/form_field_just.3x.html | 8 +- Ada95/html/{ => man}/form_field_new.3x.html | 8 +- Ada95/html/{ => man}/form_field_opts.3x.html | 8 +- .../html/{ => man}/form_field_userptr.3x.html | 8 +- .../{ => man}/form_field_validation.3x.html | 8 +- Ada95/html/{ => man}/form_fieldtype.3x.html | 8 +- Ada95/html/{ => man}/form_hook.3x.html | 10 +- Ada95/html/{ => man}/form_new.3x.html | 8 +- Ada95/html/{ => man}/form_new_page.3x.html | 8 +- Ada95/html/{ => man}/form_opts.3x.html | 8 +- Ada95/html/{ => man}/form_page.3x.html | 8 +- Ada95/html/{ => man}/form_post.3x.html | 8 +- Ada95/html/{ => man}/form_requestname.3x.html | 8 +- Ada95/html/{ => man}/form_userptr.3x.html | 8 +- Ada95/html/{ => man}/form_win.3x.html | 12 +- Ada95/html/{ => man}/keyok.3x.html | 4 +- Ada95/html/{ => man}/menu.3x.html | 8 +- Ada95/html/{ => man}/menu_attribs.3x.html | 8 +- Ada95/html/{ => man}/menu_cursor.3x.html | 8 +- Ada95/html/{ => man}/menu_driver.3x.html | 94 +- Ada95/html/{ => man}/menu_format.3x.html | 8 +- Ada95/html/{ => man}/menu_hook.3x.html | 4 +- Ada95/html/{ => man}/menu_items.3x.html | 8 +- Ada95/html/{ => man}/menu_mark.3x.html | 8 +- Ada95/html/{ => man}/menu_new.3x.html | 8 +- Ada95/html/{ => man}/menu_opts.3x.html | 8 +- Ada95/html/{ => man}/menu_pattern.3x.html | 8 +- Ada95/html/{ => man}/menu_post.3x.html | 4 +- Ada95/html/{ => man}/menu_requestname.3x.html | 8 +- Ada95/html/{ => man}/menu_spacing.3x.html | 8 +- Ada95/html/{ => man}/menu_userptr.3x.html | 8 +- Ada95/html/{ => man}/menu_win.3x.html | 8 +- Ada95/html/{ => man}/mitem_current.3x.html | 10 +- Ada95/html/{ => man}/mitem_name.3x.html | 8 +- Ada95/html/{ => man}/mitem_new.3x.html | 8 +- Ada95/html/{ => man}/mitem_opts.3x.html | 8 +- Ada95/html/{ => man}/mitem_userptr.3x.html | 8 +- Ada95/html/{ => man}/mitem_value.3x.html | 8 +- Ada95/html/{ => man}/mitem_visible.3x.html | 8 +- Ada95/html/man/ncurses.3x.html | 701 ++++ Ada95/html/{ => man}/panel.3x.html | 8 +- Ada95/html/{ => man}/resizeterm.3x.html | 4 +- Ada95/html/{ => man}/wresize.3x.html | 4 +- Ada95/html/ncurses.3x.html | 490 --- Ada95/html/table.html | 614 ++-- ...face-curses-forms-field_types-alpha_s.html | 68 - ...rses-forms-field_types-alphanumeric_s.html | 68 - ...s-forms-field_types-enumeration-ada_s.html | 74 - ...urses-forms-field_types-enumeration_s.html | 112 - ...e-curses-forms-field_types-intfield_s.html | 70 - ...rses-forms-field_types-ipv4_address_s.html | 65 - ...ce-curses-forms-field_types-numeric_s.html | 70 - ...ace-curses-forms-field_types-regexp_s.html | 70 - ...urses-forms-field_types-user-choice_s.html | 107 - ...rface-curses-forms-field_types-user_s.html | 110 - ..._interface-curses-forms-field_types_s.html | 250 -- ...erface-curses-forms-field_user_data_s.html | 81 - ...terface-curses-forms-form_user_data_s.html | 82 - .../terminal_interface-curses-forms_s.html | 742 ---- ...terface-curses-menus-item_user_data_s.html | 85 - ...terface-curses-menus-menu_user_data_s.html | 81 - .../terminal_interface-curses-menus_s.html | 634 ---- .../terminal_interface-curses-mouse_s.html | 173 - ...l_interface-curses-panels-user_data_s.html | 81 - .../terminal_interface-curses-panels_s.html | 152 - ...interface-curses-text_io-complex_io_s.html | 87 - ...interface-curses-text_io-decimal_io_s.html | 83 - ...rface-curses-text_io-enumeration_io_s.html | 80 - ...l_interface-curses-text_io-fixed_io_s.html | 83 - ...l_interface-curses-text_io-float_io_s.html | 83 - ...interface-curses-text_io-integer_io_s.html | 80 - ...interface-curses-text_io-modular_io_s.html | 80 - .../terminal_interface-curses-text_io_s.html | 155 - Ada95/html/terminal_interface-curses_s.html | 1573 -------- Ada95/html/terminal_interface_s.html | 62 - Ada95/samples/Makefile.in | 13 +- Ada95/samples/rain.adb | 4 +- Ada95/samples/rain.ads | 4 +- .../samples/sample-curses_demo-attributes.adb | 11 +- .../samples/sample-curses_demo-attributes.ads | 6 +- Ada95/samples/sample-curses_demo-mouse.adb | 9 +- Ada95/samples/sample-curses_demo-mouse.ads | 6 +- Ada95/samples/sample-curses_demo.adb | 9 +- Ada95/samples/sample-curses_demo.ads | 6 +- Ada95/samples/sample-explanation.adb | 7 +- Ada95/samples/sample-explanation.ads | 6 +- Ada95/samples/sample-form_demo-aux.adb | 6 +- Ada95/samples/sample-form_demo-aux.ads | 6 +- Ada95/samples/sample-form_demo-handler.adb | 8 +- Ada95/samples/sample-form_demo-handler.ads | 6 +- Ada95/samples/sample-form_demo.adb | 12 +- Ada95/samples/sample-form_demo.ads | 6 +- Ada95/samples/sample-function_key_setting.adb | 6 +- Ada95/samples/sample-function_key_setting.ads | 6 +- Ada95/samples/sample-header_handler.adb | 6 +- Ada95/samples/sample-header_handler.ads | 6 +- Ada95/samples/sample-helpers.adb | 6 +- Ada95/samples/sample-helpers.ads | 6 +- Ada95/samples/sample-keyboard_handler.adb | 6 +- Ada95/samples/sample-keyboard_handler.ads | 6 +- Ada95/samples/sample-manifest.ads | 6 +- Ada95/samples/sample-menu_demo-aux.adb | 6 +- Ada95/samples/sample-menu_demo-aux.ads | 6 +- Ada95/samples/sample-menu_demo-handler.adb | 22 +- Ada95/samples/sample-menu_demo-handler.ads | 6 +- Ada95/samples/sample-menu_demo.adb | 10 +- Ada95/samples/sample-menu_demo.ads | 6 +- Ada95/samples/sample-my_field_type.adb | 6 +- Ada95/samples/sample-my_field_type.ads | 6 +- Ada95/samples/sample-text_io_demo.adb | 7 +- Ada95/samples/sample-text_io_demo.ads | 6 +- Ada95/samples/sample.adb | 8 +- Ada95/samples/sample.ads | 6 +- Ada95/samples/status.adb | 6 +- Ada95/samples/status.ads | 10 +- Ada95/samples/tour.adb | 6 +- Ada95/samples/tour.ads | 6 +- Ada95/src/Makefile.in | 353 ++ .../terminal_interface-curses-aux.adb | 6 +- ...terface-curses-forms-field_types-alpha.adb | 8 +- ...terface-curses-forms-field_types-alpha.ads | 8 +- ...-curses-forms-field_types-alphanumeric.adb | 8 +- ...-curses-forms-field_types-alphanumeric.ads | 9 +- ...rses-forms-field_types-enumeration-ada.adb | 6 +- ...rses-forms-field_types-enumeration-ada.ads | 9 +- ...e-curses-forms-field_types-enumeration.adb | 6 +- ...e-curses-forms-field_types-enumeration.ads | 9 +- ...face-curses-forms-field_types-intfield.adb | 8 +- ...face-curses-forms-field_types-intfield.ads | 8 +- ...-curses-forms-field_types-ipv4_address.adb | 8 +- ...-curses-forms-field_types-ipv4_address.ads | 9 +- ...rface-curses-forms-field_types-numeric.adb | 26 +- ...rface-curses-forms-field_types-numeric.ads | 8 +- ...erface-curses-forms-field_types-regexp.adb | 8 +- ...erface-curses-forms-field_types-regexp.ads | 8 +- ...e-curses-forms-field_types-user-choice.adb | 9 +- ...e-curses-forms-field_types-user-choice.ads | 17 +- ...nterface-curses-forms-field_types-user.adb | 9 +- ...nterface-curses-forms-field_types-user.ads | 15 +- ...nal_interface-curses-forms-field_types.adb | 25 +- ...interface-curses-forms-field_user_data.adb | 8 +- ..._interface-curses-forms-form_user_data.adb | 8 +- .../terminal_interface-curses-forms.adb | 91 +- ..._interface-curses-menus-item_user_data.adb | 6 +- ..._interface-curses-menus-menu_user_data.adb | 8 +- .../terminal_interface-curses-menus.adb | 109 +- .../terminal_interface-curses-mouse.adb | 131 +- ...inal_interface-curses-panels-user_data.adb | 6 +- .../terminal_interface-curses-panels.adb | 6 +- .../terminal_interface-curses-text_io-aux.adb | 6 +- .../terminal_interface-curses-text_io-aux.ads | 6 +- ...al_interface-curses-text_io-complex_io.adb | 6 +- ...al_interface-curses-text_io-complex_io.ads | 6 +- ...al_interface-curses-text_io-decimal_io.adb | 6 +- ...al_interface-curses-text_io-decimal_io.ads | 6 +- ...nterface-curses-text_io-enumeration_io.adb | 6 +- ...nterface-curses-text_io-enumeration_io.ads | 6 +- ...inal_interface-curses-text_io-fixed_io.adb | 6 +- ...inal_interface-curses-text_io-fixed_io.ads | 6 +- ...inal_interface-curses-text_io-float_io.adb | 6 +- ...inal_interface-curses-text_io-float_io.ads | 6 +- ...al_interface-curses-text_io-integer_io.adb | 6 +- ...al_interface-curses-text_io-integer_io.ads | 6 +- ...al_interface-curses-text_io-modular_io.adb | 6 +- ...al_interface-curses-text_io-modular_io.ads | 6 +- .../terminal_interface-curses-text_io.adb | 8 +- .../terminal_interface-curses-text_io.ads | 10 +- .../terminal_interface-curses.adb | 453 +-- .../terminal_interface.ads | 6 +- INSTALL | 30 +- MANIFEST | 698 ++-- Makefile.glibc | 306 +- Makefile.in | 17 +- Makefile.os2 | 235 ++ NEWS | 1161 +++++- README | 6 +- README.emx | 48 + TO-DO | 5 +- aclocal.m4 | 993 ++++-- announce.html | 221 +- announce.html.in | 217 +- c++/Makefile.in | 33 +- c++/NEWS | 4 + c++/README-first | 2 +- c++/cursesapp.cc | 4 +- c++/cursesapp.h | 4 +- c++/cursesf.cc | 4 +- c++/cursesf.h | 8 +- c++/cursesm.cc | 10 +- c++/cursesm.h | 6 +- c++/cursesmain.cc | 4 +- c++/cursesp.cc | 5 +- c++/cursesp.h | 8 +- c++/cursespad.cc | 270 ++ c++/cursesw.cc | 70 +- c++/cursesw.h | 143 +- c++/cursslk.cc | 6 +- c++/cursslk.h | 9 +- c++/demo.cc | 86 +- c++/edit_cfg.sh | 7 +- c++/etip.h.in | 53 +- c++/internal.h | 4 +- c++/modules | 3 +- config.guess | 369 +- config.sub | 128 +- configure | 2324 +++++++++--- configure.in | 289 +- convert_configure.pl | 54 + dist.mk | 8 +- form/Makefile.in | 7 +- form/READ.ME | 2 +- form/fld_arg.c | 4 +- form/fld_attr.c | 4 +- form/fld_current.c | 4 +- form/fld_def.c | 4 +- form/fld_dup.c | 4 +- form/fld_ftchoice.c | 4 +- form/fld_ftlink.c | 4 +- form/fld_info.c | 4 +- form/fld_just.c | 4 +- form/fld_link.c | 4 +- form/fld_max.c | 4 +- form/fld_move.c | 4 +- form/fld_newftyp.c | 6 +- form/fld_opts.c | 7 +- form/fld_pad.c | 4 +- form/fld_page.c | 4 +- form/fld_stat.c | 4 +- form/fld_type.c | 4 +- form/fld_user.c | 4 +- form/form.h | 2 +- form/form.priv.h | 2 +- form/frm_cursor.c | 4 +- form/frm_data.c | 4 +- form/frm_def.c | 4 +- form/frm_driver.c | 6 +- form/frm_hook.c | 4 +- form/frm_opts.c | 7 +- form/frm_page.c | 4 +- form/frm_post.c | 4 +- form/frm_req_name.c | 4 +- form/frm_scale.c | 4 +- form/frm_sub.c | 4 +- form/frm_user.c | 4 +- form/frm_win.c | 4 +- form/fty_alnum.c | 4 +- form/fty_alpha.c | 4 +- form/fty_enum.c | 4 +- form/fty_int.c | 4 +- form/fty_num.c | 4 +- form/fty_regex.c | 34 +- form/llib-lform | 23 - form/modules | 3 +- include/Caps | 151 +- include/MKterm.h.awk.in | 483 +-- include/capdefaults.c | 8 +- include/curses.h.in | 250 +- include/nc_alloc.h | 14 +- include/term_entry.h | 72 +- include/termcap.h.in | 26 +- include/tic.h | 42 +- man/MKterminfo.sh | 67 +- man/captoinfo.1m | 37 +- man/clear.1 | 29 + man/curs_addch.3x | 112 +- man/curs_addchstr.3x | 29 + man/curs_addstr.3x | 29 + man/curs_attr.3x | 82 +- man/curs_beep.3x | 29 + man/curs_bkgd.3x | 43 +- man/curs_border.3x | 42 +- man/curs_clear.3x | 29 + man/curs_color.3x | 30 +- man/curs_delch.3x | 29 + man/curs_deleteln.3x | 31 +- man/curs_getch.3x | 30 +- man/curs_getstr.3x | 29 + man/curs_getyx.3x | 29 + man/curs_inch.3x | 30 +- man/curs_inchstr.3x | 29 + man/curs_initscr.3x | 34 + man/curs_inopts.3x | 30 +- man/curs_insch.3x | 29 + man/curs_insstr.3x | 31 +- man/curs_instr.3x | 30 +- man/curs_kernel.3x | 31 +- man/curs_mouse.3x | 102 +- man/curs_move.3x | 29 + man/curs_outopts.3x | 34 +- man/curs_overlay.3x | 35 +- man/curs_pad.3x | 41 +- man/curs_print.3x | 30 +- man/curs_printw.3x | 31 +- man/curs_refresh.3x | 30 +- man/curs_scanw.3x | 34 +- man/{curs_scr_dmp.3x => curs_scr_dump.3x} | 29 + man/curs_scroll.3x | 29 + man/curs_slk.3x | 43 +- man/curs_termattrs.3x | 29 + man/curs_termcap.3x | 43 +- man/curs_terminfo.3x | 76 +- man/curs_touch.3x | 29 + man/curs_util.3x | 29 + man/curs_window.3x | 39 +- man/define_key.3x | 17 +- man/dft_fgbg.3x | 17 +- man/form.3x | 35 +- man/form_cursor.3x | 29 + man/form_data.3x | 31 +- man/form_driver.3x | 32 +- man/form_field.3x | 29 + man/form_field_attributes.3x | 29 + man/form_field_buffer.3x | 42 +- man/form_field_info.3x | 29 + man/form_field_just.3x | 29 + man/form_field_new.3x | 34 +- man/form_field_opts.3x | 33 +- man/form_field_userptr.3x | 31 +- man/form_field_validation.3x | 30 +- man/form_fieldtype.3x | 37 +- man/form_hook.3x | 31 +- man/form_new.3x | 29 + man/form_new_page.3x | 31 +- man/form_opts.3x | 35 +- man/form_page.3x | 29 + man/form_post.3x | 29 + man/form_requestname.3x | 29 + man/form_userptr.3x | 29 + man/form_win.3x | 33 +- man/infocmp.1m | 168 +- man/keybound.3x | 67 + man/keyok.3x | 15 +- man/man_db.renames | 11 +- man/menu.3x | 34 +- man/menu_attribs.3x | 29 + man/menu_cursor.3x | 29 + man/menu_driver.3x | 58 +- man/menu_format.3x | 31 +- man/menu_hook.3x | 31 +- man/menu_items.3x | 29 + man/menu_mark.3x | 31 +- man/menu_new.3x | 29 + man/menu_opts.3x | 33 +- man/menu_pattern.3x | 30 +- man/menu_post.3x | 29 + man/menu_requestname.3x | 29 + man/menu_spacing.3x | 29 + man/menu_userptr.3x | 29 + man/menu_win.3x | 31 +- man/mitem_current.3x | 31 +- man/mitem_name.3x | 29 + man/mitem_new.3x | 29 + man/mitem_opts.3x | 31 +- man/mitem_userptr.3x | 29 + man/mitem_value.3x | 30 +- man/mitem_visible.3x | 29 + man/ncurses.3x | 523 ++- man/panel.3x | 30 +- man/resizeterm.3x | 17 +- man/term.5 | 29 + man/term.7 | 44 +- man/terminfo.head | 30 +- man/terminfo.tail | 366 +- man/tic.1m | 124 +- man/toe.1m | 30 +- man/tput.1 | 40 +- man/tset.1 | 31 +- man/wresize.3x | 15 +- menu/Makefile.in | 13 +- menu/READ.ME | 2 +- menu/eti.h | 2 +- menu/llib-lmenu | 32 +- menu/m_attribs.c | 4 +- menu/m_cursor.c | 71 +- menu/m_driver.c | 579 +-- menu/m_format.c | 4 +- menu/m_global.c | 4 +- menu/m_hook.c | 4 +- menu/m_item_cur.c | 4 +- menu/m_item_nam.c | 4 +- menu/m_item_new.c | 7 +- menu/m_item_opt.c | 11 +- menu/m_item_top.c | 4 +- menu/m_item_use.c | 4 +- menu/m_item_val.c | 4 +- menu/m_item_vis.c | 4 +- menu/m_items.c | 4 +- menu/m_new.c | 5 +- menu/m_opts.c | 8 +- menu/m_pad.c | 4 +- menu/m_pattern.c | 4 +- menu/m_post.c | 4 +- menu/m_req_name.c | 4 +- menu/m_scale.c | 4 +- menu/m_spacing.c | 4 +- menu/m_sub.c | 4 +- menu/m_userptr.c | 4 +- menu/m_win.c | 4 +- menu/menu.h | 2 +- menu/menu.priv.h | 14 +- menu/mf_common.h | 2 +- menu/modules | 3 +- misc/chkdef.cmd | 86 + misc/cleantic.cmd | 16 + misc/cmpdef.cmd | 106 + misc/emx.src | 14 +- misc/form.def | 101 + misc/form.ref | 106 + misc/hackguide.doc | 266 +- misc/hackguide.html | 356 +- misc/makedef.cmd | 151 + misc/menu.def | 81 + misc/menu.ref | 73 + misc/ncurses-intro.doc | 116 +- misc/ncurses-intro.html | 228 +- misc/ncurses.def | 452 +++ misc/ncurses.ref | 572 +++ misc/panel.def | 25 + misc/panel.ref | 18 + misc/run_tic.sh | 12 +- misc/shlib | 11 +- misc/terminfo.src | 3174 ++++++++++++++--- mk-1st.awk | 72 +- mk-2nd.awk | 11 +- ncurses/MKkeyname.awk | 54 - ncurses/Makefile.in | 85 +- ncurses/README | 17 - ncurses/SigAction.h | 10 +- ncurses/base/MKkeyname.awk | 74 + ncurses/{ => base}/MKlib_gen.sh | 0 ncurses/{ => base}/MKunctrl.awk | 8 +- ncurses/base/README | 7 + ncurses/{ => base}/define_key.c | 11 +- ncurses/base/keybound.c | 45 + ncurses/{ => base}/keyok.c | 9 +- ncurses/{ => base}/lib_addch.c | 13 +- ncurses/{ => base}/lib_addstr.c | 22 +- ncurses/{ => base}/lib_beep.c | 14 +- ncurses/{ => base}/lib_bkgd.c | 0 ncurses/{ => base}/lib_box.c | 0 ncurses/{ => base}/lib_chgat.c | 0 ncurses/{ => base}/lib_clear.c | 0 ncurses/{ => base}/lib_clearok.c | 0 ncurses/{ => base}/lib_clrbot.c | 46 +- ncurses/{ => base}/lib_clreol.c | 73 +- ncurses/{ => base}/lib_color.c | 213 +- ncurses/base/lib_colorset.c | 56 + ncurses/{ => base}/lib_delch.c | 36 +- ncurses/{ => base}/lib_delwin.c | 0 ncurses/{ => base}/lib_dft_fgbg.c | 0 ncurses/{ => base}/lib_echo.c | 3 +- ncurses/{ => base}/lib_endwin.c | 13 +- ncurses/{ => base}/lib_erase.c | 0 ncurses/{ => base}/lib_flash.c | 14 +- ncurses/{ => base}/lib_freeall.c | 25 +- ncurses/{ => base}/lib_getch.c | 59 +- ncurses/{ => base}/lib_getstr.c | 6 +- ncurses/{ => base}/lib_hline.c | 15 +- ncurses/{ => base}/lib_immedok.c | 0 ncurses/{ => base}/lib_inchstr.c | 0 ncurses/{ => base}/lib_initscr.c | 24 +- ncurses/{ => base}/lib_insch.c | 27 +- ncurses/{ => base}/lib_insdel.c | 0 ncurses/{ => base}/lib_insstr.c | 4 +- ncurses/{ => base}/lib_instr.c | 0 ncurses/{ => base}/lib_isendwin.c | 4 +- ncurses/{ => base}/lib_leaveok.c | 6 +- ncurses/{ => base}/lib_mouse.c | 274 +- ncurses/{ => base}/lib_move.c | 0 ncurses/{ => base}/lib_mvwin.c | 0 ncurses/{ => base}/lib_newterm.c | 67 +- ncurses/{ => base}/lib_newwin.c | 8 +- ncurses/{ => base}/lib_nl.c | 11 +- ncurses/{ => base}/lib_overlay.c | 0 ncurses/{ => base}/lib_pad.c | 10 +- ncurses/{ => base}/lib_printw.c | 12 +- ncurses/{ => base}/lib_redrawln.c | 34 +- ncurses/{ => base}/lib_refresh.c | 37 +- ncurses/{ => base}/lib_restart.c | 59 +- ncurses/{ => base}/lib_scanw.c | 12 +- ncurses/{ => base}/lib_screen.c | 19 +- ncurses/{ => base}/lib_scroll.c | 0 ncurses/{ => base}/lib_scrollok.c | 0 ncurses/{ => base}/lib_scrreg.c | 0 ncurses/{ => base}/lib_set_term.c | 93 +- ncurses/{ => base}/lib_slk.c | 31 +- .../base/lib_slkatr_set.c | 43 +- ncurses/{ => base}/lib_slkatrof.c | 4 +- ncurses/{ => base}/lib_slkatron.c | 4 +- ncurses/{ => base}/lib_slkatrset.c | 4 +- ncurses/{ => base}/lib_slkattr.c | 0 ncurses/{ => base}/lib_slkclear.c | 12 +- ncurses/base/lib_slkcolor.c | 54 + ncurses/{ => base}/lib_slkinit.c | 0 ncurses/{ => base}/lib_slklab.c | 0 ncurses/{ => base}/lib_slkrefr.c | 20 +- ncurses/{ => base}/lib_slkset.c | 0 ncurses/{ => base}/lib_slktouch.c | 0 ncurses/{ => base}/lib_touch.c | 6 +- ncurses/{ => base}/lib_ungetch.c | 0 ncurses/{ => base}/lib_vline.c | 12 +- ncurses/{ => base}/lib_wattroff.c | 4 +- ncurses/{ => base}/lib_wattron.c | 4 +- ncurses/base/lib_winch.c | 52 + ncurses/{ => base}/lib_window.c | 30 +- ncurses/base/memmove.c | 63 + ncurses/{ => base}/nc_panel.c | 0 ncurses/{ => base}/resizeterm.c | 7 +- ncurses/{ => base}/safe_sprintf.c | 32 +- ncurses/{ => base}/sigaction.c | 20 +- ncurses/base/tries.c | 138 + ncurses/base/version.c | 48 + ncurses/{ => base}/vsscanf.c | 0 ncurses/{ => base}/wresize.c | 14 +- ncurses/curses.priv.h | 160 +- ncurses/lib_adabind.c | 246 -- ncurses/llib-lncurses | 1216 ++++--- ncurses/modules | 262 +- ncurses/read_entry.c | 302 -- ncurses/softscroll.c | 257 -- ncurses/{ => tinfo}/MKcaptab.awk | 7 +- ncurses/{ => tinfo}/MKfallback.sh | 9 +- ncurses/{ => tinfo}/MKnames.awk | 6 +- ncurses/tinfo/README | 8 + ncurses/tinfo/access.c | 55 + ncurses/{tries.c => tinfo/add_tries.c} | 69 +- ncurses/{ => tinfo}/alloc_entry.c | 135 +- ncurses/tinfo/alloc_ttype.c | 461 +++ ncurses/{ => tinfo}/captoinfo.c | 22 +- ncurses/{ => tinfo}/comp_error.c | 12 +- ncurses/{ => tinfo}/comp_expand.c | 122 +- ncurses/{ => tinfo}/comp_hash.c | 27 +- ncurses/{ => tinfo}/comp_parse.c | 108 +- ncurses/{ => tinfo}/comp_scan.c | 47 +- ncurses/tinfo/doalloc.c | 74 + ncurses/tinfo/free_ttype.c | 72 + ncurses/tinfo/getenv_num.c | 56 + ncurses/tinfo/home_terminfo.c | 62 + ncurses/tinfo/init_keytry.c | 78 + ncurses/{ => tinfo}/keys.list | 0 ncurses/{ => tinfo}/lib_acs.c | 9 +- ncurses/{ => tinfo}/lib_baudrate.c | 76 +- ncurses/{ => tinfo}/lib_cur_term.c | 41 +- ncurses/{ => tinfo}/lib_data.c | 6 +- ncurses/{lib_ti.c => tinfo/lib_has_cap.c} | 57 +- ncurses/{ => tinfo}/lib_kernel.c | 56 +- ncurses/{ => tinfo}/lib_longname.c | 8 +- ncurses/{ => tinfo}/lib_napms.c | 10 +- ncurses/{ => tinfo}/lib_options.c | 63 +- ncurses/{ => tinfo}/lib_print.c | 6 +- ncurses/tinfo/lib_raw.c | 233 ++ ncurses/{ => tinfo}/lib_setup.c | 140 +- ncurses/{ => tinfo}/lib_termcap.c | 174 +- ncurses/tinfo/lib_termname.c | 46 + ncurses/tinfo/lib_ti.c | 101 + ncurses/{ => tinfo}/lib_tparm.c | 301 +- ncurses/{ => tinfo}/lib_tputs.c | 84 +- ncurses/tinfo/lib_ttyflags.c | 163 + ncurses/{ => tinfo}/make_keys.c | 12 +- ncurses/{ => tinfo}/name_match.c | 65 +- ncurses/{ => tinfo}/parse_entry.c | 166 +- ncurses/tinfo/read_entry.c | 482 +++ ncurses/{ => tinfo}/read_termcap.c | 117 +- ncurses/tinfo/setbuf.c | 144 + ncurses/{ => tinfo}/write_entry.c | 283 +- ncurses/trace/README | 5 + ncurses/{ => trace}/lib_trace.c | 25 +- ncurses/{ => trace}/lib_traceatr.c | 11 +- ncurses/{lib_raw.c => trace/lib_tracebits.c} | 195 +- ncurses/{ => trace}/lib_tracechr.c | 5 + ncurses/{ => trace}/lib_tracedmp.c | 11 +- ncurses/{ => trace}/lib_tracemse.c | 15 +- ncurses/{ => trace}/trace_buf.c | 31 +- ncurses/trace/trace_tries.c | 74 + ncurses/trace/trace_xnames.c | 74 + ncurses/{ => tty}/MKexpanded.sh | 8 +- ncurses/{ => tty}/hardscroll.c | 61 +- ncurses/{ => tty}/hashmap.c | 189 +- ncurses/{ => tty}/lib_mvcur.c | 89 +- ncurses/{ => tty}/lib_tstp.c | 70 +- ncurses/{ => tty}/lib_twait.c | 249 +- ncurses/{ => tty}/lib_vidattr.c | 53 +- ncurses/tty/tty_display.h | 146 + ncurses/tty/tty_input.h | 61 + ncurses/{lib_doupdate.c => tty/tty_update.c} | 226 +- panel/Makefile.in | 11 +- panel/p_above.c | 4 +- panel/p_below.c | 6 +- panel/p_bottom.c | 32 +- panel/p_hidden.c | 4 +- panel/p_hide.c | 7 +- panel/p_move.c | 9 +- panel/p_new.c | 12 +- panel/p_replace.c | 6 +- panel/p_show.c | 23 +- panel/p_update.c | 6 +- panel/panel.c | 188 +- panel/panel.h | 44 +- panel/panel.priv.h | 59 +- progs/Makefile.in | 6 +- progs/clear.c | 9 +- progs/dump_entry.c | 224 +- progs/dump_entry.h | 10 +- progs/infocmp.c | 379 +- progs/progs.priv.h | 25 +- progs/tic.c | 331 +- progs/toe.c | 8 +- progs/tput.c | 64 +- progs/tset.c | 32 +- sysdeps/unix/sysv/linux/configure | 42 +- sysdeps/unix/sysv/linux/edit_man.sh | 2 +- tack/COPYING | 340 ++ tack/HISTORY | 42 + tack/Makefile.in | 167 +- tack/README | 5 + tack/ansi.c | 889 +++++ tack/charset.c | 709 ++++ tack/color.c | 767 ++++ tack/control.c | 657 ++++ tack/crum.c | 426 +++ tack/edit.c | 977 +++++ tack/fun.c | 912 +++++ tack/init.c | 300 ++ tack/menu.c | 421 +++ tack/modes.c | 913 +++++ tack/modules | 65 +- tack/output.c | 818 +++++ tack/pad.c | 1955 ++++++++++ tack/scan.c | 261 ++ tack/sync.c | 424 +++ tack/sysdep.c | 469 +++ tack/tack.1 | 311 ++ tack/tack.c | 620 ++++ tack/tack.h | 403 +++ test/Makefile.in | 30 +- test/blue.c | 52 +- test/bs.c | 30 +- test/cardfile.c | 420 +++ test/cardfile.dat | 13 + test/configure | 1949 ++++++++++ test/configure.in | 9 +- form/frm_adabind.c => test/ditto.c | 149 +- test/dots.c | 143 + test/filter.c | 109 + test/firework.c | 272 +- test/hanoi.c | 7 +- test/hashtest.c | 12 +- test/keynames.c | 4 +- test/lrtest.c | 117 +- test/modules | 9 +- test/ncurses.c | 456 ++- test/rain.c | 16 +- test/tclock.c | 304 +- test/testcurs.c | 8 +- test/view.c | 6 +- test/worm.c | 423 ++- 779 files changed, 50496 insertions(+), 18221 deletions(-) delete mode 100644 Ada95/ada_include/Makefile.in rename Ada95/{ada_include/terminal_interface-curses-aux.ads => gen/terminal_interface-curses-aux.ads.m4} (70%) create mode 100644 Ada95/html/ada/files.htm create mode 100644 Ada95/html/ada/files/T.htm create mode 100644 Ada95/html/ada/funcs.htm create mode 100644 Ada95/html/ada/funcs/A.htm create mode 100644 Ada95/html/ada/funcs/C.htm create mode 100644 Ada95/html/ada/funcs/E.htm create mode 100644 Ada95/html/ada/funcs/F.htm create mode 100644 Ada95/html/ada/funcs/G.htm create mode 100644 Ada95/html/ada/funcs/I.htm create mode 100644 Ada95/html/ada/funcs/L.htm create mode 100644 Ada95/html/ada/funcs/M.htm create mode 100644 Ada95/html/ada/funcs/N.htm create mode 100644 Ada95/html/ada/funcs/P.htm create mode 100644 Ada95/html/ada/funcs/R.htm create mode 100644 Ada95/html/ada/funcs/S.htm create mode 100644 Ada95/html/ada/funcs/T.htm create mode 100644 Ada95/html/ada/funcs/U.htm create mode 100644 Ada95/html/ada/funcs/V.htm create mode 100644 Ada95/html/ada/index.htm create mode 100644 Ada95/html/ada/main.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_types__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-forms__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-menus__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-mouse__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-panels-user_data__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-panels__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-text_io-float_io__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses-text_io__ads.htm create mode 100644 Ada95/html/ada/terminal_interface-curses__ads.htm create mode 100644 Ada95/html/ada/terminal_interface__ads.htm delete mode 100644 Ada95/html/curs_addch.3x.html delete mode 100644 Ada95/html/curs_mouse.3x.html create mode 100644 Ada95/html/man/curs_addch.3x.html rename Ada95/html/{ => man}/curs_addchstr.3x.html (95%) rename Ada95/html/{ => man}/curs_addstr.3x.html (95%) rename Ada95/html/{ => man}/curs_attr.3x.html (72%) rename Ada95/html/{ => man}/curs_beep.3x.html (90%) rename Ada95/html/{ => man}/curs_bkgd.3x.html (95%) rename Ada95/html/{ => man}/curs_border.3x.html (95%) rename Ada95/html/{ => man}/curs_clear.3x.html (94%) rename Ada95/html/{ => man}/curs_color.3x.html (97%) rename Ada95/html/{ => man}/curs_delch.3x.html (92%) rename Ada95/html/{ => man}/curs_deleteln.3x.html (92%) rename Ada95/html/{ => man}/curs_getch.3x.html (96%) rename Ada95/html/{ => man}/curs_getstr.3x.html (96%) rename Ada95/html/{ => man}/curs_getyx.3x.html (89%) rename Ada95/html/{ => man}/curs_inch.3x.html (87%) rename Ada95/html/{ => man}/curs_inchstr.3x.html (91%) rename Ada95/html/{ => man}/curs_initscr.3x.html (97%) rename Ada95/html/{ => man}/curs_inopts.3x.html (98%) rename Ada95/html/{ => man}/curs_insch.3x.html (92%) rename Ada95/html/{ => man}/curs_insstr.3x.html (93%) rename Ada95/html/{ => man}/curs_instr.3x.html (95%) rename Ada95/html/{ => man}/curs_kernel.3x.html (92%) create mode 100644 Ada95/html/man/curs_mouse.3x.html rename Ada95/html/{ => man}/curs_move.3x.html (91%) rename Ada95/html/{ => man}/curs_outopts.3x.html (93%) rename Ada95/html/{ => man}/curs_overlay.3x.html (95%) rename Ada95/html/{ => man}/curs_pad.3x.html (97%) rename Ada95/html/{ => man}/curs_print.3x.html (93%) rename Ada95/html/{ => man}/curs_printw.3x.html (88%) rename Ada95/html/{ => man}/curs_refresh.3x.html (97%) rename Ada95/html/{ => man}/curs_scanw.3x.html (92%) rename Ada95/html/{ => man}/curs_scr_dmp.3x.html (95%) create mode 100644 Ada95/html/man/curs_scr_dump.3x.html rename Ada95/html/{ => man}/curs_scroll.3x.html (94%) rename Ada95/html/{ => man}/curs_slk.3x.html (50%) rename Ada95/html/{ => man}/curs_termattrs.3x.html (96%) rename Ada95/html/{ => man}/curs_termcap.3x.html (63%) rename Ada95/html/{ => man}/curs_terminfo.3x.html (86%) rename Ada95/html/{ => man}/curs_touch.3x.html (95%) rename Ada95/html/{ => man}/curs_util.3x.html (95%) rename Ada95/html/{ => man}/curs_window.3x.html (97%) rename Ada95/html/{ => man}/define_key.3x.html (84%) rename Ada95/html/{ => man}/dft_fgbg.3x.html (93%) rename Ada95/html/{ => man}/form.3x.html (96%) rename Ada95/html/{ => man}/form_cursor.3x.html (83%) rename Ada95/html/{ => man}/form_data.3x.html (75%) rename Ada95/html/{ => man}/form_driver.3x.html (95%) rename Ada95/html/{ => man}/form_field.3x.html (94%) rename Ada95/html/{ => man}/form_field_attributes.3x.html (88%) rename Ada95/html/{ => man}/form_field_buffer.3x.html (88%) rename Ada95/html/{ => man}/form_field_info.3x.html (87%) rename Ada95/html/{ => man}/form_field_just.3x.html (85%) rename Ada95/html/{ => man}/form_field_new.3x.html (90%) rename Ada95/html/{ => man}/form_field_opts.3x.html (89%) rename Ada95/html/{ => man}/form_field_userptr.3x.html (83%) rename Ada95/html/{ => man}/form_field_validation.3x.html (95%) rename Ada95/html/{ => man}/form_fieldtype.3x.html (93%) rename Ada95/html/{ => man}/form_hook.3x.html (87%) rename Ada95/html/{ => man}/form_new.3x.html (84%) rename Ada95/html/{ => man}/form_new_page.3x.html (84%) rename Ada95/html/{ => man}/form_opts.3x.html (87%) rename Ada95/html/{ => man}/form_page.3x.html (88%) rename Ada95/html/{ => man}/form_post.3x.html (87%) rename Ada95/html/{ => man}/form_requestname.3x.html (83%) rename Ada95/html/{ => man}/form_userptr.3x.html (83%) rename Ada95/html/{ => man}/form_win.3x.html (84%) rename Ada95/html/{ => man}/keyok.3x.html (89%) rename Ada95/html/{ => man}/menu.3x.html (96%) rename Ada95/html/{ => man}/menu_attribs.3x.html (90%) rename Ada95/html/{ => man}/menu_cursor.3x.html (83%) rename Ada95/html/{ => man}/menu_driver.3x.html (50%) rename Ada95/html/{ => man}/menu_format.3x.html (87%) rename Ada95/html/{ => man}/menu_hook.3x.html (95%) rename Ada95/html/{ => man}/menu_items.3x.html (88%) rename Ada95/html/{ => man}/menu_mark.3x.html (87%) rename Ada95/html/{ => man}/menu_new.3x.html (84%) rename Ada95/html/{ => man}/menu_opts.3x.html (89%) rename Ada95/html/{ => man}/menu_pattern.3x.html (87%) rename Ada95/html/{ => man}/menu_post.3x.html (93%) rename Ada95/html/{ => man}/menu_requestname.3x.html (83%) rename Ada95/html/{ => man}/menu_spacing.3x.html (89%) rename Ada95/html/{ => man}/menu_userptr.3x.html (83%) rename Ada95/html/{ => man}/menu_win.3x.html (89%) rename Ada95/html/{ => man}/mitem_current.3x.html (87%) rename Ada95/html/{ => man}/mitem_name.3x.html (78%) rename Ada95/html/{ => man}/mitem_new.3x.html (87%) rename Ada95/html/{ => man}/mitem_opts.3x.html (86%) rename Ada95/html/{ => man}/mitem_userptr.3x.html (83%) rename Ada95/html/{ => man}/mitem_value.3x.html (85%) rename Ada95/html/{ => man}/mitem_visible.3x.html (76%) create mode 100644 Ada95/html/man/ncurses.3x.html rename Ada95/html/{ => man}/panel.3x.html (96%) rename Ada95/html/{ => man}/resizeterm.3x.html (94%) rename Ada95/html/{ => man}/wresize.3x.html (91%) delete mode 100644 Ada95/html/ncurses.3x.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types-alpha_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types-alphanumeric_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types-enumeration-ada_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types-enumeration_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types-intfield_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types-ipv4_address_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types-numeric_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types-regexp_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types-user-choice_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types-user_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_types_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-field_user_data_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms-form_user_data_s.html delete mode 100644 Ada95/html/terminal_interface-curses-forms_s.html delete mode 100644 Ada95/html/terminal_interface-curses-menus-item_user_data_s.html delete mode 100644 Ada95/html/terminal_interface-curses-menus-menu_user_data_s.html delete mode 100644 Ada95/html/terminal_interface-curses-menus_s.html delete mode 100644 Ada95/html/terminal_interface-curses-mouse_s.html delete mode 100644 Ada95/html/terminal_interface-curses-panels-user_data_s.html delete mode 100644 Ada95/html/terminal_interface-curses-panels_s.html delete mode 100644 Ada95/html/terminal_interface-curses-text_io-complex_io_s.html delete mode 100644 Ada95/html/terminal_interface-curses-text_io-decimal_io_s.html delete mode 100644 Ada95/html/terminal_interface-curses-text_io-enumeration_io_s.html delete mode 100644 Ada95/html/terminal_interface-curses-text_io-fixed_io_s.html delete mode 100644 Ada95/html/terminal_interface-curses-text_io-float_io_s.html delete mode 100644 Ada95/html/terminal_interface-curses-text_io-integer_io_s.html delete mode 100644 Ada95/html/terminal_interface-curses-text_io-modular_io_s.html delete mode 100644 Ada95/html/terminal_interface-curses-text_io_s.html delete mode 100644 Ada95/html/terminal_interface-curses_s.html delete mode 100644 Ada95/html/terminal_interface_s.html create mode 100644 Ada95/src/Makefile.in rename Ada95/{ada_include => src}/terminal_interface-curses-aux.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-alpha.adb (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-alpha.ads (94%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-alphanumeric.adb (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-alphanumeric.ads (94%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-enumeration-ada.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-enumeration-ada.ads (94%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-enumeration.adb (98%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-enumeration.ads (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-intfield.adb (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-intfield.ads (94%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-ipv4_address.adb (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-ipv4_address.ads (94%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-numeric.adb (85%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-numeric.ads (94%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-regexp.adb (95%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-regexp.ads (94%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-user-choice.adb (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-user-choice.ads (93%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-user.adb (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types-user.ads (94%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_types.adb (92%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-field_user_data.adb (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms-form_user_data.adb (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-forms.adb (94%) rename Ada95/{ada_include => src}/terminal_interface-curses-menus-item_user_data.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-menus-menu_user_data.adb (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-menus.adb (92%) rename Ada95/{ada_include => src}/terminal_interface-curses-mouse.adb (63%) rename Ada95/{ada_include => src}/terminal_interface-curses-panels-user_data.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-panels.adb (98%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-aux.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-aux.ads (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-complex_io.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-complex_io.ads (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-decimal_io.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-decimal_io.ads (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-enumeration_io.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-enumeration_io.ads (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-fixed_io.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-fixed_io.ads (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-float_io.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-float_io.ads (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-integer_io.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-integer_io.ads (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-modular_io.adb (97%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io-modular_io.ads (96%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io.adb (98%) rename Ada95/{ada_include => src}/terminal_interface-curses-text_io.ads (96%) rename Ada95/{ada_include => src}/terminal_interface-curses.adb (85%) rename Ada95/{ada_include => src}/terminal_interface.ads (96%) create mode 100644 Makefile.os2 create mode 100644 README.emx create mode 100644 c++/cursespad.cc create mode 100644 convert_configure.pl rename man/{curs_scr_dmp.3x => curs_scr_dump.3x} (53%) create mode 100644 man/keybound.3x create mode 100644 misc/chkdef.cmd create mode 100644 misc/cleantic.cmd create mode 100644 misc/cmpdef.cmd create mode 100644 misc/form.def create mode 100644 misc/form.ref create mode 100644 misc/makedef.cmd create mode 100644 misc/menu.def create mode 100644 misc/menu.ref create mode 100644 misc/ncurses.def create mode 100644 misc/ncurses.ref create mode 100644 misc/panel.def create mode 100644 misc/panel.ref delete mode 100644 ncurses/MKkeyname.awk create mode 100644 ncurses/base/MKkeyname.awk rename ncurses/{ => base}/MKlib_gen.sh (100%) rename ncurses/{ => base}/MKunctrl.awk (97%) create mode 100644 ncurses/base/README rename ncurses/{ => base}/define_key.c (91%) create mode 100644 ncurses/base/keybound.c rename ncurses/{ => base}/keyok.c (93%) rename ncurses/{ => base}/lib_addch.c (96%) rename ncurses/{ => base}/lib_addstr.c (89%) rename ncurses/{ => base}/lib_beep.c (94%) rename ncurses/{ => base}/lib_bkgd.c (100%) rename ncurses/{ => base}/lib_box.c (100%) rename ncurses/{ => base}/lib_chgat.c (100%) rename ncurses/{ => base}/lib_clear.c (100%) rename ncurses/{ => base}/lib_clearok.c (100%) rename ncurses/{ => base}/lib_clrbot.c (78%) rename ncurses/{ => base}/lib_clreol.c (73%) rename ncurses/{ => base}/lib_color.c (77%) create mode 100644 ncurses/base/lib_colorset.c rename ncurses/{ => base}/lib_delch.c (81%) rename ncurses/{ => base}/lib_delwin.c (100%) rename ncurses/{ => base}/lib_dft_fgbg.c (100%) rename ncurses/{ => base}/lib_echo.c (96%) rename ncurses/{ => base}/lib_endwin.c (91%) rename ncurses/{ => base}/lib_erase.c (100%) rename ncurses/{ => base}/lib_flash.c (94%) rename ncurses/{ => base}/lib_freeall.c (91%) rename ncurses/{ => base}/lib_getch.c (90%) rename ncurses/{ => base}/lib_getstr.c (97%) rename ncurses/{ => base}/lib_hline.c (88%) rename ncurses/{ => base}/lib_immedok.c (100%) rename ncurses/{ => base}/lib_inchstr.c (100%) rename ncurses/{ => base}/lib_initscr.c (89%) rename ncurses/{ => base}/lib_insch.c (83%) rename ncurses/{ => base}/lib_insdel.c (100%) rename ncurses/{ => base}/lib_insstr.c (96%) rename ncurses/{ => base}/lib_instr.c (100%) rename ncurses/{ => base}/lib_isendwin.c (96%) rename ncurses/{ => base}/lib_leaveok.c (95%) rename ncurses/{ => base}/lib_mouse.c (78%) rename ncurses/{ => base}/lib_move.c (100%) rename ncurses/{ => base}/lib_mvwin.c (100%) rename ncurses/{ => base}/lib_newterm.c (87%) rename ncurses/{ => base}/lib_newwin.c (97%) rename ncurses/{ => base}/lib_nl.c (93%) rename ncurses/{ => base}/lib_overlay.c (100%) rename ncurses/{ => base}/lib_pad.c (97%) rename ncurses/{ => base}/lib_printw.c (90%) rename ncurses/{ => base}/lib_redrawln.c (80%) rename ncurses/{ => base}/lib_refresh.c (89%) rename ncurses/{ => base}/lib_restart.c (74%) rename ncurses/{ => base}/lib_scanw.c (90%) rename ncurses/{ => base}/lib_screen.c (94%) rename ncurses/{ => base}/lib_scroll.c (100%) rename ncurses/{ => base}/lib_scrollok.c (100%) rename ncurses/{ => base}/lib_scrreg.c (100%) rename ncurses/{ => base}/lib_set_term.c (76%) rename ncurses/{ => base}/lib_slk.c (88%) rename menu/m_adabind.c => ncurses/base/lib_slkatr_set.c (66%) rename ncurses/{ => base}/lib_slkatrof.c (96%) rename ncurses/{ => base}/lib_slkatron.c (96%) rename ncurses/{ => base}/lib_slkatrset.c (96%) rename ncurses/{ => base}/lib_slkattr.c (100%) rename ncurses/{ => base}/lib_slkclear.c (92%) create mode 100644 ncurses/base/lib_slkcolor.c rename ncurses/{ => base}/lib_slkinit.c (100%) rename ncurses/{ => base}/lib_slklab.c (100%) rename ncurses/{ => base}/lib_slkrefr.c (90%) rename ncurses/{ => base}/lib_slkset.c (100%) rename ncurses/{ => base}/lib_slktouch.c (100%) rename ncurses/{ => base}/lib_touch.c (96%) rename ncurses/{ => base}/lib_ungetch.c (100%) rename ncurses/{ => base}/lib_vline.c (89%) rename ncurses/{ => base}/lib_wattroff.c (95%) rename ncurses/{ => base}/lib_wattron.c (95%) create mode 100644 ncurses/base/lib_winch.c rename ncurses/{ => base}/lib_window.c (90%) create mode 100644 ncurses/base/memmove.c rename ncurses/{ => base}/nc_panel.c (100%) rename ncurses/{ => base}/resizeterm.c (94%) rename ncurses/{ => base}/safe_sprintf.c (92%) rename ncurses/{ => base}/sigaction.c (94%) create mode 100644 ncurses/base/tries.c create mode 100644 ncurses/base/version.c rename ncurses/{ => base}/vsscanf.c (100%) rename ncurses/{ => base}/wresize.c (95%) delete mode 100644 ncurses/lib_adabind.c delete mode 100644 ncurses/read_entry.c delete mode 100644 ncurses/softscroll.c rename ncurses/{ => tinfo}/MKcaptab.awk (83%) rename ncurses/{ => tinfo}/MKfallback.sh (89%) rename ncurses/{ => tinfo}/MKnames.awk (93%) create mode 100644 ncurses/tinfo/README create mode 100644 ncurses/tinfo/access.c rename ncurses/{tries.c => tinfo/add_tries.c} (71%) rename ncurses/{ => tinfo}/alloc_entry.c (63%) create mode 100644 ncurses/tinfo/alloc_ttype.c rename ncurses/{ => tinfo}/captoinfo.c (98%) rename ncurses/{ => tinfo}/comp_error.c (93%) rename ncurses/{ => tinfo}/comp_expand.c (63%) rename ncurses/{ => tinfo}/comp_hash.c (96%) rename ncurses/{ => tinfo}/comp_parse.c (84%) rename ncurses/{ => tinfo}/comp_scan.c (96%) create mode 100644 ncurses/tinfo/doalloc.c create mode 100644 ncurses/tinfo/free_ttype.c create mode 100644 ncurses/tinfo/getenv_num.c create mode 100644 ncurses/tinfo/home_terminfo.c create mode 100644 ncurses/tinfo/init_keytry.c rename ncurses/{ => tinfo}/keys.list (100%) rename ncurses/{ => tinfo}/lib_acs.c (97%) rename ncurses/{ => tinfo}/lib_baudrate.c (77%) rename ncurses/{ => tinfo}/lib_cur_term.c (81%) rename ncurses/{ => tinfo}/lib_data.c (94%) rename ncurses/{lib_ti.c => tinfo/lib_has_cap.c} (76%) rename ncurses/{ => tinfo}/lib_kernel.c (82%) rename ncurses/{ => tinfo}/lib_longname.c (95%) rename ncurses/{ => tinfo}/lib_napms.c (95%) rename ncurses/{ => tinfo}/lib_options.c (83%) rename ncurses/{ => tinfo}/lib_print.c (94%) create mode 100644 ncurses/tinfo/lib_raw.c rename ncurses/{ => tinfo}/lib_setup.c (72%) rename ncurses/{ => tinfo}/lib_termcap.c (68%) create mode 100644 ncurses/tinfo/lib_termname.c create mode 100644 ncurses/tinfo/lib_ti.c rename ncurses/{ => tinfo}/lib_tparm.c (72%) rename ncurses/{ => tinfo}/lib_tputs.c (84%) create mode 100644 ncurses/tinfo/lib_ttyflags.c rename ncurses/{ => tinfo}/make_keys.c (95%) rename ncurses/{ => tinfo}/name_match.c (74%) rename ncurses/{ => tinfo}/parse_entry.c (85%) create mode 100644 ncurses/tinfo/read_entry.c rename ncurses/{ => tinfo}/read_termcap.c (93%) create mode 100644 ncurses/tinfo/setbuf.c rename ncurses/{ => tinfo}/write_entry.c (61%) create mode 100644 ncurses/trace/README rename ncurses/{ => trace}/lib_trace.c (92%) rename ncurses/{ => trace}/lib_traceatr.c (97%) rename ncurses/{lib_raw.c => trace/lib_tracebits.c} (64%) rename ncurses/{ => trace}/lib_tracechr.c (97%) rename ncurses/{ => trace}/lib_tracedmp.c (96%) rename ncurses/{ => trace}/lib_tracemse.c (95%) rename ncurses/{ => trace}/trace_buf.c (85%) create mode 100644 ncurses/trace/trace_tries.c create mode 100644 ncurses/trace/trace_xnames.c rename ncurses/{ => tty}/MKexpanded.sh (95%) rename ncurses/{ => tty}/hardscroll.c (89%) rename ncurses/{ => tty}/hashmap.c (78%) rename ncurses/{ => tty}/lib_mvcur.c (94%) rename ncurses/{ => tty}/lib_tstp.c (85%) rename ncurses/{ => tty}/lib_twait.c (54%) rename ncurses/{ => tty}/lib_vidattr.c (90%) create mode 100644 ncurses/tty/tty_display.h create mode 100644 ncurses/tty/tty_input.h rename ncurses/{lib_doupdate.c => tty/tty_update.c} (92%) create mode 100644 tack/COPYING create mode 100644 tack/HISTORY create mode 100644 tack/README create mode 100644 tack/ansi.c create mode 100644 tack/charset.c create mode 100644 tack/color.c create mode 100644 tack/control.c create mode 100644 tack/crum.c create mode 100644 tack/edit.c create mode 100644 tack/fun.c create mode 100644 tack/init.c create mode 100644 tack/menu.c create mode 100644 tack/modes.c create mode 100644 tack/output.c create mode 100644 tack/pad.c create mode 100644 tack/scan.c create mode 100644 tack/sync.c create mode 100644 tack/sysdep.c create mode 100644 tack/tack.1 create mode 100644 tack/tack.c create mode 100644 tack/tack.h create mode 100644 test/cardfile.c create mode 100644 test/cardfile.dat create mode 100755 test/configure rename form/frm_adabind.c => test/ditto.c (50%) create mode 100644 test/dots.c create mode 100644 test/filter.c diff --git a/ANNOUNCE b/ANNOUNCE index 3383dedd..4707838f 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,18 +1,20 @@ - Announcing ncurses 4.2 + Announcing ncurses 5.0 - The ncurses (new curses) library is a freeware emulation of System V - Release 4.0 curses. It uses terminfo format, supports pads and color - and multiple highlights and forms characters and function-key mapping, - and has all the other SYSV-curses enhancements over BSD curses. + The ncurses (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 Linux. It should port easily to - any ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 Warp! + The ncurses code was developed under GNU/Linux. 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), @@ -20,14 +22,124 @@ manual pages are provided for the library and tools. The ncurses distribution is available via anonymous FTP at the GNU - distribution site [1]ftp://prep.ai.mit.edu/pub/gnu. It is also + distribution site [1]ftp://ftp.gnu.org/pub/gnu/ncurses. It is also available at [2]ftp://ftp.clark.net/pub/dickey/ncurses. - Features of ncurses + Release Notes + + We decided to release ncurses as a new whole number release (5.0) + because it incorporates several interface changes, including some that + would invalidate existing shared libraries. These are the highlights + from the change-log since ncurses 4.2 release. + + Interface changes: + * The principal source of changes to the interface comes from the + release of X/Open Curses in 1997. Earlier versions of ncurses (4.0 + and before) were based on a draft version of the specification. + The release version adds parameters to some functions to support + the evolving internationalization of curses. These summarize the + impact: + + modified several prototypes to correspond with 1997 version + of X/Open Curses (affects ABI since developers have used + attr_get). + + 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. + + 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. + + 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. + + reviewed/corrected macros in curses.h as per XSI document. + + add set_a_attributes and set_pglen_inch to terminfo + structure, as per XSI and Solaris 2.5. + * The newest version of the X/Open Curses is implemented on Solaris + and other vendor's systems. It adds new features to the terminfo + descriptions: + + implement tparm %l format. + + implement tparm printf-style width and precision for %s, %d, + %x, %o as per XSI. + * We made additional changes to reduce impact by future interface + changes: + + rename key_names[] array to _nc_key_names since it is not + part of the curses interface. + + move macro winch to a function, to hide details of struct + ldat + * modify configure script to embed ABI in shared libraries for HP-UX + 10.x (detailed request by Tim Mooney). + * 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). + + New features: + * enable sigwinch handler by default. + * turn on hashmap scrolling code by default + * improved support for termcap applications + + modify tput to accept termcap names as an alternative to + terminfo names. + + provide support for termcap PC variable by copying it from + terminfo data and using it as the padding character in tputs. + + 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. + + change name-comparisons in lib_termcap to compare no more + than 2 characters. + + add configure option --enable-tcap-names, which essentially + allows users to define new capabilities as in termcap. + * add mouse support to ncurses menus. + * add mouse and dll support for OS/2 EMX + * modify terminfo parsing to accept octal and hexadecimal constants + * 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. + * 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 -f option to infocmp and tic, which formats the terminfo + if/then/else/endif so that they are readable (with newlines and + tabs). + * modify tic to compile into %'char' form in preference to + %{number}, since that is a little more efficient. + + Major bug fixes: + * 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. + * 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. + * 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. + * modify setupterm so that cancelled strings are treated the same as + absent strings, cancelled and absent booleans false (does not + affect tic, infocmp). + * 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. + * 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. + * 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. + + 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, @@ -47,21 +159,19 @@ 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 + 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 SVr4 curses, ncurses can write to the rightmost-bottommost + * Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner of the screen if your terminal has an insert-character capability. - * (PC-clone boxes only) Support for access to the IBM PC ROM - characters 0-32 through the highlight A_ALTCHARSET. * Ada95 and C++ bindings. - * Support for mouse event reporting under xterm. + * 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. @@ -139,31 +249,39 @@ and arena corruption by the Purify memory-allocation tester. The ncurses code has been tested with a wide variety of applications - including: + including (versions starting with those noted): + cdk + Curses Development Kit [3]Curses Development Kit + [4]ftp://ftp.clark.net/pub/dickey/cdk. + ded - directory-editor [3]ftp://ftp.clark.net/pub/dickey/ded. + directory-editor [5]ftp://ftp.clark.net/pub/dickey/ded. dialog the underlying application used in Slackware's setup, and the - basis for similar applications on Linux. + basis for similar applications on GNU/Linux. - lynx-2.7 + lynx the character-screen WWW browser Midnight Commander 4.1 file manager - mutt 0.88 + mutt mail utility - ncftp 2.0 + ncftp file-transfer utility nvi New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. + tin + newsreader, supporting color, MIME + [6]ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff. + taper tape archive utility @@ -172,26 +290,22 @@ as well as some that use ncurses for the terminfo support alone: - minicom-1.75 + minicom terminal emulator - tin-unoff - tin 1.4 newsreader, supporting color, MIME - [4]ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff. - vile - vi-like-emacs [5]ftp://ftp.clark.net/pub/dickey/vile. + vi-like-emacs [7]ftp://ftp.clark.net/pub/dickey/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 [6]Zeyd Ben-Halim and [7]Eric - S. Raymond. Ongoing work is being done by [8]Thomas Dickey and - [9]Jürgen Pfeifer. [10]Florian La Roche acts as the maintainer for the + The original developers of ncurses are [8]Zeyd Ben-Halim and [9]Eric + S. Raymond. Ongoing work is being done by [10]Thomas Dickey and + [11]Jürgen Pfeifer. [12]Thomas Dickey acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. - Contact the current maintainers at [11]bug-ncurses@gnu.org. + Contact the current maintainers at [13]bug-ncurses@gnu.org. To join the ncurses mailing list, please write email to bug-ncurses-request@gnu.org containing the line: @@ -201,7 +315,7 @@ Who's Who and What's What and testing of this package. Beta versions of ncurses and patches to the current release are made - available at [12]ftp://ftp.clark.net/pub/dickey/ncurses. + available at [14]ftp://ftp.clark.net/pub/dickey/ncurses. Future Plans @@ -216,24 +330,26 @@ Other Related Resources The distribution includes and uses a version of the terminfo-format terminal description file maintained by Eric Raymond. - [13]http://earthspace.net/~esr/terminfo. + [15]http://earthspace.net/~esr/terminfo. You can find lots of information on terminal-related topics not - covered in the terminfo file at [14]Richard Shuford's archive. + covered in the terminfo file at [16]Richard Shuford's archive. References - 1. ftp://prep.ai.mit.edu/pub/gnu + 1. ftp://ftp.gnu.org/pub/gnu/ncurses 2. ftp://ftp.clark.net/pub/dickey/ncurses - 3. ftp://ftp.clark.net/pub/dickey/ded - 4. ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff - 5. ftp://ftp.clark.net/pub/dickey/vile - 6. mailto:zmbenhal@netcom.com - 7. http://www.ccil.org/~esr/home.html - 8. mailto:dickey@clark.net - 9. mailto:Juergen.Pfeifer@T-Online.de - 10. mailto:florian@gnu.org - 11. mailto:bug-ncurses@gnu.org - 12. ftp://ftp.clark.net/pub/dickey/ncurses - 13. http://earthspace.net/~esr/terminfo - 14. http://www.cs.utk.edu/~shuford/terminal_index.html + 3. http://www.vexus.ca/CDK.html + 4. ftp://ftp.clark.net/pub/dickey/cdk + 5. ftp://ftp.clark.net/pub/dickey/ded + 6. ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff + 7. ftp://ftp.clark.net/pub/dickey/vile + 8. mailto:zmbenhal@netcom.com + 9. http://www.ccil.org/~esr/home.html + 10. mailto:dickey@clark.net + 11. mailto:juergen.pfeifer@gmx.net + 12. mailto:dickey@clark.net + 13. mailto:bug-ncurses@gnu.org + 14. ftp://ftp.clark.net/pub/dickey/ncurses + 15. http://earthspace.net/~esr/terminfo + 16. http://www.cs.utk.edu/~shuford/terminal_index.html diff --git a/Ada95/Makefile.in b/Ada95/Makefile.in index 49bbb602..5ba9feec 100644 --- a/Ada95/Makefile.in +++ b/Ada95/Makefile.in @@ -26,16 +26,19 @@ # authorization. # ############################################################################## # -# Author: Juergen Pfeifer 1996 +# Author: Juergen Pfeifer 1996 # # Version Control -# $Revision: 1.10 $ +# $Revision: 1.12 $ # SHELL = /bin/sh THIS = Makefile SUBDIRS = @ADA_SUBDIRS@ +CF_MFLAGS = @cf_cv_makeflags@ +@SET_MAKE@ + all \ sources \ install \ @@ -43,19 +46,19 @@ install.libs \ uninstall \ uninstall.libs :: for d in $(SUBDIRS); do \ - (cd $$d ; $(MAKE) $@) ;\ + (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ done clean \ mostlyclean :: for d in $(SUBDIRS); do \ - (cd $$d ; $(MAKE) $@) ;\ + (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ done distclean \ realclean :: for d in $(SUBDIRS); do \ - (cd $$d ; $(MAKE) $@) ;\ + (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ done rm -f Makefile diff --git a/Ada95/README b/Ada95/README index 28836a2f..8a530611 100644 --- a/Ada95/README +++ b/Ada95/README @@ -26,19 +26,7 @@ -- authorization. -- ------------------------------------------------------------------------------- --- Author: Juergen Pfeifer 1996 -Caveats: - - This is the first delivery of this binding. It has not been - extensively tested. So I declare this as BETA level software, - although it is delivered with an official release of ncurses. - - You should install the ncurses distribution around this binding - first before you try to run the sample. - - This Binding is currently strictly for the GNAT compiler, because - in one place I use a GNAT specfic runtime module (see doc.) - +-- Author: Juergen Pfeifer 1996 The documentation is provided in HTML format in the ./html subdirectory. The main document is named index.html diff --git a/Ada95/TODO b/Ada95/TODO index 8516d227..12fef7b7 100644 --- a/Ada95/TODO +++ b/Ada95/TODO @@ -1,8 +1,10 @@ +-- $Id: TODO,v 1.4 1999/10/20 09:18:58 tom Exp $ + -- Intensive testing Perhaps the delivery of the Beta will help a bit. -- Documentation - Like most WEB pages: under continous construction + Like most WEB pages: under continuous construction -- Style cleanup @@ -10,9 +12,9 @@ Comfort purpose -- Sample program - Under continous construction (and it's not a WEB page!!!) + Under continuous construction (and it's not a WEB page!!!) --- Make the binding objects a shared libray +-- 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 diff --git a/Ada95/ada_include/Makefile.in b/Ada95/ada_include/Makefile.in deleted file mode 100644 index 3bc6c06f..00000000 --- a/Ada95/ada_include/Makefile.in +++ /dev/null @@ -1,546 +0,0 @@ -############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # -# # -# Permission is hereby granted, free of charge, to any person obtaining a # -# copy of this software and associated documentation files (the "Software"), # -# to deal in the Software without restriction, including without limitation # -# the rights to use, copy, modify, merge, publish, distribute, distribute # -# with modifications, sublicense, and/or sell copies of the Software, and to # -# permit persons to whom the Software is furnished to do so, subject to the # -# following conditions: # -# # -# The above copyright notice and this permission notice shall be included in # -# all copies or substantial portions of the Software. # -# # -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # -# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # -# DEALINGS IN THE SOFTWARE. # -# # -# Except as contained in this notice, the name(s) of the above copyright # -# holders shall not be used in advertising or otherwise to promote the sale, # -# use or other dealings in this Software without prior written # -# authorization. # -############################################################################## -# -# Author: Juergen Pfeifer 1996 -# -# Version Control -# $Revision: 1.13 $ -# -.SUFFIXES: - -SHELL = /bin/sh -THIS = Makefile - -MODEL = ../../@DFT_OBJ_SUBDIR@ -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -libdir = @libdir@ -includedir = @includedir@ -datadir = @datadir@ -ticdir = $(datadir)/terminfo -ADA_INCLUDE = @ADA_INCLUDE@ - -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 = @cf_ada_compiler@ -ADAFLAGS = @ADAFLAGS@ -I. -I$(srcdir) - -ADAMAKE = @cf_ada_make@ -ADAMAKEFLAGS = - -CARGS = -cargs $(ADAFLAGS) -LARGS = - -ALIB = @cf_ada_package@ -ABASE = $(ALIB)-curses - -ADA_OBJDIR = ../ada_objects -OBJDIR = ../objects - -LIBALIS=$(ADA_OBJDIR)/$(ALIB).ali \ - $(ADA_OBJDIR)/$(ABASE)-aux.ali \ - $(ADA_OBJDIR)/$(ABASE).ali \ - $(ADA_OBJDIR)/$(ABASE)-mouse.ali \ - $(ADA_OBJDIR)/$(ABASE)-panels.ali \ - $(ADA_OBJDIR)/$(ABASE)-menus.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-alpha.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-alphanumeric.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-intfield.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-numeric.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-regexp.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-enumeration.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-ipv4_address.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-user.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-user-choice.ali \ - $(ADA_OBJDIR)/$(ABASE)-text_io.ali \ - $(ADA_OBJDIR)/$(ABASE)-text_io-aux.ali - -# Ada Library files for generic packages. Since gnat 3.10 they are -# also compiled -GENALIS=$(ADA_OBJDIR)/$(ABASE)-menus-menu_user_data.ali \ - $(ADA_OBJDIR)/$(ABASE)-menus-item_user_data.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-form_user_data.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_user_data.ali \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-enumeration-ada.ali \ - $(ADA_OBJDIR)/$(ABASE)-panels-user_data.ali \ - $(ADA_OBJDIR)/$(ABASE)-text_io-integer_io.ali \ - $(ADA_OBJDIR)/$(ABASE)-text_io-float_io.ali \ - $(ADA_OBJDIR)/$(ABASE)-text_io-fixed_io.ali \ - $(ADA_OBJDIR)/$(ABASE)-text_io-decimal_io.ali \ - $(ADA_OBJDIR)/$(ABASE)-text_io-enumeration_io.ali \ - $(ADA_OBJDIR)/$(ABASE)-text_io-modular_io.ali \ - $(ADA_OBJDIR)/$(ABASE)-text_io-complex_io.ali - -LIBOBJS=$(ADA_OBJDIR)/$(ALIB).o \ - $(ADA_OBJDIR)/$(ABASE)-aux.o \ - $(ADA_OBJDIR)/$(ABASE).o \ - $(ADA_OBJDIR)/$(ABASE)-mouse.o \ - $(ADA_OBJDIR)/$(ABASE)-panels.o \ - $(ADA_OBJDIR)/$(ABASE)-menus.o \ - $(ADA_OBJDIR)/$(ABASE)-forms.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-alpha.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-alphanumeric.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-intfield.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-numeric.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-regexp.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-enumeration.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-ipv4_address.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-user.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-user-choice.o \ - $(ADA_OBJDIR)/$(ABASE)-text_io.o \ - $(ADA_OBJDIR)/$(ABASE)-text_io-aux.o - -# Ada object files for generic packages. Since gnat 3.10 they are -# also compiled -GENOBJS=$(ADA_OBJDIR)/$(ABASE)-menus-menu_user_data.o \ - $(ADA_OBJDIR)/$(ABASE)-menus-item_user_data.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-form_user_data.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_user_data.o \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-enumeration-ada.o \ - $(ADA_OBJDIR)/$(ABASE)-panels-user_data.o \ - $(ADA_OBJDIR)/$(ABASE)-text_io-integer_io.o \ - $(ADA_OBJDIR)/$(ABASE)-text_io-float_io.o \ - $(ADA_OBJDIR)/$(ABASE)-text_io-fixed_io.o \ - $(ADA_OBJDIR)/$(ABASE)-text_io-decimal_io.o \ - $(ADA_OBJDIR)/$(ABASE)-text_io-enumeration_io.o \ - $(ADA_OBJDIR)/$(ABASE)-text_io-modular_io.o \ - $(ADA_OBJDIR)/$(ABASE)-text_io-complex_io.o - - -all :: $(LIBALIS) @cf_compile_generics@ - @echo done - -sources : - @ - -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) $(LIBOBJS) - -distclean :: clean - rm -f Makefile - -realclean :: distclean - -BASEDEPS=$(ABASE).ads $(srcdir)/$(ABASE)-aux.ads - -$(ADA_OBJDIR)/$(ALIB).o: $(srcdir)/$(ALIB).ads - $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ALIB).ads - -$(ADA_OBJDIR)/$(ALIB).ali: $(ADA_OBJDIR)/$(ALIB).o - if [ -f $(ALIB).ali ]; then \ - ln -f $(ALIB).ali $@ ;\ - rm -f $(ALIB).ali ;\ - fi - -$(ADA_OBJDIR)/$(ABASE)-aux.o: $(srcdir)/$(ABASE)-aux.adb $(BASEDEPS) - $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-aux.adb - -$(ADA_OBJDIR)/$(ABASE)-aux.ali: $(ADA_OBJDIR)/$(ABASE)-aux.o - if [ -f $(ABASE)-aux.ali ]; then \ - ln -f $(ABASE)-aux.ali $@ ;\ - rm -f $(ABASE)-aux.ali ;\ - fi - -$(ADA_OBJDIR)/$(ABASE).o: $(srcdir)/$(ABASE).adb $(BASEDEPS) - $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE).adb - -$(ADA_OBJDIR)/$(ABASE).ali: $(ADA_OBJDIR)/$(ABASE).o - if [ -f $(ABASE).ali ]; then \ - ln -f $(ABASE).ali $@ ;\ - rm -f $(ABASE).ali ;\ - fi - -$(ADA_OBJDIR)/$(ABASE)-mouse.o: \ - $(ABASE)-mouse.ads \ - $(srcdir)/$(ABASE)-mouse.adb $(BASEDEPS) - $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-mouse.adb - -$(ADA_OBJDIR)/$(ABASE)-mouse.ali: $(ADA_OBJDIR)/$(ABASE)-mouse.o - if [ -f $(ABASE)-mouse.ali ]; then \ - ln -f $(ABASE)-mouse.ali $@ ;\ - rm -f $(ABASE)-mouse.ali ;\ - fi - -$(ADA_OBJDIR)/$(ABASE)-panels.o: \ - $(ABASE)-panels.ads \ - $(srcdir)/$(ABASE)-panels.adb $(BASEDEPS) - $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-panels.adb - -$(ADA_OBJDIR)/$(ABASE)-panels.ali: $(ADA_OBJDIR)/$(ABASE)-panels.o - if [ -f $(ABASE)-panels.ali ]; then \ - ln -f $(ABASE)-panels.ali $@ ;\ - rm -f $(ABASE)-panels.ali ;\ - fi - -$(ADA_OBJDIR)/$(ABASE)-menus.o: \ - $(ABASE)-menus.ads \ - $(srcdir)/$(ABASE)-menus.adb $(BASEDEPS) - $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus.adb - -$(ADA_OBJDIR)/$(ABASE)-menus.ali: $(ADA_OBJDIR)/$(ABASE)-menus.o - if [ -f $(ABASE)-menus.ali ]; then \ - ln -f $(ABASE)-menus.ali $@ ;\ - rm -f $(ABASE)-menus.ali ;\ - fi - -$(ADA_OBJDIR)/$(ABASE)-forms.o: \ - $(ABASE)-forms.ads \ - $(srcdir)/$(ABASE)-forms.adb $(BASEDEPS) - $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms.adb - -$(ADA_OBJDIR)/$(ABASE)-forms.ali: $(ADA_OBJDIR)/$(ABASE)-forms.o - if [ -f $(ABASE)-forms.ali ]; then \ - ln -f $(ABASE)-forms.ali $@ ;\ - rm -f $(ABASE)-forms.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types.ali: $(ADA_OBJDIR)/$(ABASE)-forms-field_types.o - if [ -f $(ABASE)-forms-field_types.ali ]; then \ - ln -f $(ABASE)-forms-field_types.ali $@ ;\ - rm -f $(ABASE)-forms-field_types.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types-alpha.ali: $(ADA_OBJDIR)/$(ABASE)-forms-field_types-alpha.o - if [ -f $(ABASE)-forms-field_types-alpha.ali ]; then \ - ln -f $(ABASE)-forms-field_types-alpha.ali $@ ;\ - rm -f $(ABASE)-forms-field_types-alpha.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types-alphanumeric.ali: $(ADA_OBJDIR)/$(ABASE)-forms-field_types-alphanumeric.o - if [ -f $(ABASE)-forms-field_types-alphanumeric.ali ]; then \ - ln -f $(ABASE)-forms-field_types-alphanumeric.ali $@ ;\ - rm -f $(ABASE)-forms-field_types-alphanumeric.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types-intfield.ali: $(ADA_OBJDIR)/$(ABASE)-forms-field_types-intfield.o - if [ -f $(ABASE)-forms-field_types-intfield.ali ]; then \ - ln -f $(ABASE)-forms-field_types-intfield.ali $@ ;\ - rm -f $(ABASE)-forms-field_types-intfield.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types-numeric.ali: $(ADA_OBJDIR)/$(ABASE)-forms-field_types-numeric.o - if [ -f $(ABASE)-forms-field_types-numeric.ali ]; then \ - ln -f $(ABASE)-forms-field_types-numeric.ali $@ ;\ - rm -f $(ABASE)-forms-field_types-numeric.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types-regexp.ali: $(ADA_OBJDIR)/$(ABASE)-forms-field_types-regexp.o - if [ -f $(ABASE)-forms-field_types-regexp.ali ]; then \ - ln -f $(ABASE)-forms-field_types-regexp.ali $@ ;\ - rm -f $(ABASE)-forms-field_types-regexp.ali ;\ - fi -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types-enumeration.ali: $(ADA_OBJDIR)/$(ABASE)-forms-field_types-enumeration.o - if [ -f $(ABASE)-forms-field_types-enumeration.ali ]; then \ - ln -f $(ABASE)-forms-field_types-enumeration.ali $@ ;\ - rm -f $(ABASE)-forms-field_types-enumeration.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types-ipv4_address.ali: $(ADA_OBJDIR)/$(ABASE)-forms-field_types-ipv4_address.o - if [ -f $(ABASE)-forms-field_types-ipv4_address.ali ]; then \ - ln -f $(ABASE)-forms-field_types-ipv4_address.ali $@ ;\ - rm -f $(ABASE)-forms-field_types-ipv4_address.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types-user.ali: $(ADA_OBJDIR)/$(ABASE)-forms-field_types-user.o - if [ -f $(ABASE)-forms-field_types-user.ali ]; then \ - ln -f $(ABASE)-forms-field_types-user.ali $@ ;\ - rm -f $(ABASE)-forms-field_types-user.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types-user-choice.ali: $(ADA_OBJDIR)/$(ABASE)-forms-field_types-user-choice.o - if [ -f $(ABASE)-forms-field_types-user-choice.ali ]; then \ - ln -f $(ABASE)-forms-field_types-user-choice.ali $@ ;\ - rm -f $(ABASE)-forms-field_types-user-choice.ali ;\ - fi - -$(ADA_OBJDIR)/$(ABASE)-text_io.o: \ - $(srcdir)/$(ABASE)-text_io.ads \ - $(srcdir)/$(ABASE)-text_io.adb $(BASEDEPS) - $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io.adb - -$(ADA_OBJDIR)/$(ABASE)-text_io.ali: $(ADA_OBJDIR)/$(ABASE)-text_io.o - if [ -f $(ABASE)-text_io.ali ]; then \ - ln -f $(ABASE)-text_io.ali $@ ;\ - rm -f $(ABASE)-text_io.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-text_io-aux.ali: $(ADA_OBJDIR)/$(ABASE)-text_io-aux.o - if [ -f $(ABASE)-text_io-aux.ali ]; then \ - ln -f $(ABASE)-text_io-aux.ali $@ ;\ - rm -f $(ABASE)-text_io-aux.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-menus-menu_user_data.ali: \ - $(ADA_OBJDIR)/$(ABASE)-menus-menu_user_data.o - if [ -f $(ABASE)-menus-menu_user_data.ali ]; then \ - ln -f $(ABASE)-menus-menu_user_data.ali $@ ;\ - rm -f $(ABASE)-menus-menu_user_data.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-menus-item_user_data.ali: \ - $(ADA_OBJDIR)/$(ABASE)-menus-item_user_data.o - if [ -f $(ABASE)-menus-item_user_data.ali ]; then \ - ln -f $(ABASE)-menus-item_user_data.ali $@ ;\ - rm -f $(ABASE)-menus-item_user_data.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-form_user_data.ali: \ - $(ADA_OBJDIR)/$(ABASE)-forms-form_user_data.o - if [ -f $(ABASE)-forms-form_user_data.ali ]; then \ - ln -f $(ABASE)-forms-form_user_data.ali $@ ;\ - rm -f $(ABASE)-forms-form_user_data.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_user_data.ali: \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_user_data.o - if [ -f $(ABASE)-forms-field_user_data.ali ]; then \ - ln -f $(ABASE)-forms-field_user_data.ali $@ ;\ - rm -f $(ABASE)-forms-field_user_data.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-forms-field_types-enumeration-ada.ali: \ - $(ADA_OBJDIR)/$(ABASE)-forms-field_types-enumeration-ada.o - if [ -f $(ABASE)-forms-field_types-enumeration-ada.ali ]; then \ - ln -f $(ABASE)-forms-field_types-enumeration-ada.ali $@ ;\ - rm -f $(ABASE)-forms-field_types-enumeration-ada.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-panels-user_data.ali: \ - $(ADA_OBJDIR)/$(ABASE)-panels-user_data.o - if [ -f $(ABASE)-panels-user_data.ali ]; then \ - ln -f $(ABASE)-panels-user_data.ali $@ ;\ - rm -f $(ABASE)-panels-user_data.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-text_io-integer_io.ali: \ - $(ADA_OBJDIR)/$(ABASE)-text_io-integer_io.o - if [ -f $(ABASE)-text_io-integer_io.ali ]; then \ - ln -f $(ABASE)-text_io-integer_io.ali $@ ;\ - rm -f $(ABASE)-text_io-integer_io.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-text_io-float_io.ali: \ - $(ADA_OBJDIR)/$(ABASE)-text_io-float_io.o - if [ -f $(ABASE)-text_io-float_io.ali ]; then \ - ln -f $(ABASE)-text_io-float_io.ali $@ ;\ - rm -f $(ABASE)-text_io-float_io.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-text_io-fixed_io.ali: \ - $(ADA_OBJDIR)/$(ABASE)-text_io-fixed_io.o - if [ -f $(ABASE)-text_io-fixed_io.ali ]; then \ - ln -f $(ABASE)-text_io-fixed_io.ali $@ ;\ - rm -f $(ABASE)-text_io-fixed_io.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-text_io-decimal_io.ali: \ - $(ADA_OBJDIR)/$(ABASE)-text_io-decimal_io.o - if [ -f $(ABASE)-text_io-decimal_io.ali ]; then \ - ln -f $(ABASE)-text_io-decimal_io.ali $@ ;\ - rm -f $(ABASE)-text_io-decimal_io.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-text_io-enumeration_io.ali: \ - $(ADA_OBJDIR)/$(ABASE)-text_io-enumeration_io.o - if [ -f $(ABASE)-text_io-enumeration_io.ali ]; then \ - ln -f $(ABASE)-text_io-enumeration_io.ali $@ ;\ - rm -f $(ABASE)-text_io-enumeration_io.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-text_io-modular_io.ali: \ - $(ADA_OBJDIR)/$(ABASE)-text_io-modular_io.o - if [ -f $(ABASE)-text_io-modular_io.ali ]; then \ - ln -f $(ABASE)-text_io-modular_io.ali $@ ;\ - rm -f $(ABASE)-text_io-modular_io.ali ;\ - fi - -$(ADA_OBJDIR)/$(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 - -$(ADA_OBJDIR)/$(ABASE)-text_io-complex_io.ali: \ - $(ADA_OBJDIR)/$(ABASE)-text_io-complex_io.o - if [ -f $(ABASE)-text_io-complex_io.ali ]; then \ - ln -f $(ABASE)-text_io-complex_io.ali $@ ;\ - rm -f $(ABASE)-text_io-complex_io.ali ;\ - fi diff --git a/Ada95/gen/Makefile.in b/Ada95/gen/Makefile.in index 6ebf0c5e..32c660a3 100644 --- a/Ada95/gen/Makefile.in +++ b/Ada95/gen/Makefile.in @@ -26,10 +26,10 @@ # authorization. # ############################################################################## # -# Author: Juergen Pfeifer 1996 +# Author: Juergen Pfeifer 1996 # # Version Control -# $Revision: 1.18 $ +# $Revision: 1.27 $ # .SUFFIXES: @@ -60,7 +60,6 @@ CPPFLAGS = @ACPPFLAGS@ \ -DHAVE_CONFIG_H -I$(srcdir) CCFLAGS = $(CPPFLAGS) $(CFLAGS) - CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg @@ -73,19 +72,19 @@ LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) RANLIB = @RANLIB@ -LIB_CURSES = -L ../../lib -lncurses +LIB_CURSES = -L../../lib -lncurses M4 = m4 M4FLAGS = +GENERATE = ./gen '@DFT_ARG_SUFFIX@' DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d' ################################################################################ ALIB = @cf_ada_package@ ABASE = $(ALIB)-curses -ADA_SRCDIR = ../ada_include -ADA_OBJDIR = ../ada_objects +ADA_SRCDIR = ../src GEN_FILES0 = Base_Defs @@ -97,6 +96,7 @@ GEN_FILES1 = Key_Definitions \ ACS_Map \ Linker_Options \ Base_Defs \ + Window_Offsets \ Version_Info GEN_FILES2 = Menu_Opt_Rep \ @@ -111,9 +111,14 @@ GEN_FILES3 = Form_Opt_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)-menus.ads \ $(ADA_SRCDIR)/$(ABASE)-forms.ads \ $(ADA_SRCDIR)/$(ABASE)-mouse.ads \ @@ -126,6 +131,7 @@ GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \ $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads GEN_SRC = $(srcdir)/$(ABASE).ads.m4 \ + $(srcdir)/$(ABASE)-aux.ads.m4 \ $(srcdir)/$(ABASE)-menus.ads.m4 \ $(srcdir)/$(ABASE)-forms.ads.m4 \ $(srcdir)/$(ABASE)-mouse.ads.m4 \ @@ -138,36 +144,37 @@ GEN_SRC = $(srcdir)/$(ABASE).ads.m4 \ $(srcdir)/$(ABASE)-panels-user_data.ads.m4 -all: $(ADA_OBJDIR) $(GEN_TARGETS) +all: $(GEN_TARGETS) @ sources: -$(ADA_OBJDIR) \ $(ADA_INCLUDE) \ $(ADA_OBJECTS) : - $(top_srcdir)/mkinstalldirs $@ + $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$@ install \ install.libs :: $(ADA_INCLUDE) - @echo installing package $(ABASE) in $(ADA_INCLUDE) - @$(top_srcdir)/tar-copy.sh '$(ABASE)[-.]*' $(ADA_SRCDIR) $(ADA_INCLUDE) - @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ABASE)[-.]*' $(srcdir)/../ada_include $(ADA_INCLUDE) + @echo installing package $(ALIB) in $(INSTALL_PREFIX)$(ADA_INCLUDE) + @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(ADA_SRCDIR) $(INSTALL_PREFIX)$(ADA_INCLUDE) + @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(srcdir)/../src $(INSTALL_PREFIX)$(ADA_INCLUDE) install \ install.libs :: $(ADA_OBJECTS) - @echo installing package $(ABASE) in $(ADA_OBJECTS) - @$(top_srcdir)/tar-copy.sh '$(ABASE)[-.]*' $(ADA_OBJDIR) $(ADA_OBJECTS) + @echo installing package $(ALIB) in $(INSTALL_PREFIX)$(ADA_OBJECTS) + @chmod a-wx $(ADA_SRCDIR)/*.ali + @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ali' $(ADA_SRCDIR) $(INSTALL_PREFIX)$(ADA_OBJECTS) + @chmod u+x $(ADA_SRCDIR)/*.ali uninstall \ uninstall.libs :: - @echo removing package $(ABASE) from $(ADA_INCLUDE) - -@cd $(ADA_INCLUDE) && rm -f $(ABASE)[-.]* + @echo removing package $(ALIB) from $(INSTALL_PREFIX)$(ADA_INCLUDE) + -@cd $(INSTALL_PREFIX)$(ADA_INCLUDE) && rm -f $(ALIB)[-.]* uninstall \ uninstall.libs :: - @echo removing package $(ABASE) from $(ADA_OBJECTS) - -@cd $(ADA_OBJECTS) && rm -f $(ABASE)[-.]* + @echo removing package $(ALIB) from $(INSTALL_PREFIX)$(ADA_OBJECTS) + -@cd $(INSTALL_PREFIX)$(ADA_OBJECTS) && rm -f $(ALIB)[-.]* gen: gen.o @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@ $(LIB_CURSES) @@ -176,64 +183,76 @@ gen.o: $(srcdir)/gen.c $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c Character_Attribute_Set_Rep: gen - ./gen B A >$@ + $(GENERATE) B A >$@ Base_Defs: gen - ./gen B B >$@ + $(GENERATE) B B >$@ Color_Defs: gen - ./gen B C >$@ + $(GENERATE) B C >$@ Key_Definitions: gen - ./gen B K >$@ + $(GENERATE) B K >$@ Old_Keys: gen - ./gen B O >$@ + $(GENERATE) B O >$@ ACS_Map: gen - ./gen B M >$@ + $(GENERATE) B M >$@ AC_Rep: gen - ./gen B R >$@ + $(GENERATE) B R >$@ Linker_Options: gen - ./gen B L >$@ + $(GENERATE) B L >$@ Version_Info: gen - ./gen B V >$@ + $(GENERATE) B V >$@ + +Window_Offsets: gen + $(GENERATE) B D >$@ Menu_Opt_Rep: gen - ./gen M R >$@ + $(GENERATE) M R >$@ Menu_Base_Defs: gen - ./gen M B >$@ + $(GENERATE) M B >$@ Menu_Linker_Options: gen - ./gen M L >$@ + $(GENERATE) M L >$@ Item_Rep: gen - ./gen M I >$@ + $(GENERATE) M I >$@ Form_Opt_Rep: gen - ./gen F R >$@ + $(GENERATE) F R >$@ Form_Base_Defs: gen - ./gen F B >$@ + $(GENERATE) F B >$@ Form_Linker_Options: gen - ./gen F L >$@ + $(GENERATE) F L >$@ Field_Rep: gen - ./gen F I >$@ + $(GENERATE) F I >$@ Mouse_Base_Defs: gen - ./gen P B >$@ + $(GENERATE) P B >$@ Mouse_Event_Rep: gen - ./gen P M >$@ + $(GENERATE) P M >$@ + +Mouse_Events: gen + $(GENERATE) B E >$@ Panel_Linker_Options: gen - ./gen P L >$@ + $(GENERATE) P L >$@ + +Chtype_Def: gen + $(GENERATE) E C >$@ + +Eti_Defs: gen + $(GENERATE) E E >$@ $(ADA_SRCDIR)/$(ABASE).ads: $(srcdir)/$(ABASE).ads.m4 \ $(GEN_FILES1) $(srcdir)/normal.m4 @@ -241,6 +260,12 @@ $(ADA_SRCDIR)/$(ABASE).ads: $(srcdir)/$(ABASE).ads.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)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \ $(GEN_FILES2) $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ @@ -321,6 +346,7 @@ mostlyclean :: -rm -f $(GEN_FILES2) -rm -f $(GEN_FILES3) -rm -f $(GEN_FILES4) + -rm -f $(GEN_FILES5) clean :: mostlyclean -rm -f $(GEN_TARGETS) diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c index 48532947..0a093cf8 100644 --- a/Ada95/gen/gen.c +++ b/Ada95/gen/gen.c @@ -27,12 +27,12 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1996 * + * Author: Juergen Pfeifer 1996 * ****************************************************************************/ /* Version Control - $Revision: 1.14 $ + $Revision: 1.29 $ --------------------------------------------------------------------------*/ /* This program generates various record structures and constants from the @@ -41,6 +41,8 @@ to produce the real source. */ +#include +#include #include #include #include @@ -50,16 +52,17 @@ #define RES_NAME "Reserved" +static const char *model = ""; static int little_endian = 0; typedef struct { const char *name; - unsigned int attr; + unsigned long attr; } name_attribute_pair; static int find_pos (char *s, unsigned len, int *low, int *high) { - unsigned int i,j; + unsigned int i,j; int l = 0; *high = -1; @@ -98,30 +101,19 @@ static int find_pos (char *s, unsigned len, int *low, int *high) * 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 +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 len, /* size of the record in bytes */ + int bias) { - int i,l,cnt = 0,low,high; - int width = strlen(RES_NAME); - int bias = 0; - unsigned int a; - unsigned int mask = 0; - char *suffix; + int i,n,l,cnt = 0,low,high; + int width = strlen(RES_NAME) + 3; + unsigned long a; + unsigned long mask = 0; - assert (nap); - - if (len == sizeof(int)/2) - { - bias = little_endian ? 8 * len : 0; - suffix = " / 2"; - } - else - { - assert(len==sizeof(int)); - suffix = ""; - } + assert (nap!=NULL); for (i=0; nap[i].name != (char *)0; i++) { @@ -137,10 +129,6 @@ static void gen_reps for (i=0; nap[i].name != (char *)0; i++) { printf(" %-*s : Boolean;\n",width,nap[i].name); - } - if (cnt != 8*len) - { - printf(" %-*s : Boolean;\n",width,RES_NAME); } printf(" end record;\n"); printf(" pragma Pack (%s);\n",name); @@ -155,33 +143,25 @@ static void gen_reps mask |= a; l = find_pos( (char *)&a,sizeof(a),&low,&high ); if (l>=0) - printf(" %-*s at 0 range %2d .. %2d;\n",width,nap[i].name,low-bias,high-bias); - } - if (cnt != 8*len) - { - mask = ~mask; - assert(mask); - if (little_endian) - l = 8*len - 1; - else - l = 0; - printf(" %-*s at 0 range %2d .. %2d;\n",width,RES_NAME,l,l); + 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 Interfaces.C.int'Size%s;\n", name, suffix); + 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, int mask) +static void chtype_rep (const char *name, attr_t mask) { - int x = -1; - int t = x & 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); + printf(" %-5s at 0 range %2d .. %2d;\n",name,low,high); } static void gen_chtype_rep(const char *name) @@ -190,7 +170,7 @@ static void gen_chtype_rep(const char *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 Interfaces.C.int'Size;\n",name); + printf(" end record;\n for %s'Size use %d;\n",name,8*sizeof(chtype)); printf(" -- Please note: this rep. clause is generated and may be\n"); printf(" -- different on your system.\n"); } @@ -201,7 +181,7 @@ 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); + printf(" %-7s at 0 range %3d .. %3d;\n",name,low,high); } @@ -286,7 +266,20 @@ static void gen_attr_set( const char *name ) #endif {(char *)0, 0} }; - gen_reps (nap, name, sizeof(int)/2); + 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_menu_opt_rep(const char *name) @@ -312,7 +305,7 @@ static void gen_menu_opt_rep(const char *name) #endif {(char *)0, 0} }; - gen_reps (nap, name, sizeof(int)); + gen_reps (nap, name, sizeof(int),0); } static void gen_item_opt_rep(const char *name) @@ -322,8 +315,8 @@ static void gen_item_opt_rep(const char *name) {"Selectable", O_SELECTABLE}, #endif {(char *)0 , 0} - }; - gen_reps (nap, name, sizeof(int)); + }; + gen_reps (nap, name, sizeof(int),0); } static void gen_form_opt_rep(const char *name) @@ -337,7 +330,7 @@ static void gen_form_opt_rep(const char *name) #endif {(char *)0 , 0} }; - gen_reps (nap, name, sizeof(int)); + gen_reps (nap, name, sizeof(int),0); } /* @@ -378,7 +371,7 @@ static void gen_field_opt_rep(const char *name) #endif {(char *)0, 0} }; - gen_reps (nap, name, sizeof(int)); + gen_reps (nap, name, sizeof(int),0); } /* @@ -398,7 +391,7 @@ static void keydef(const char *name, const char *old_name, int value, int mode) 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 @@ -695,10 +688,10 @@ static void gen_keydefs (int mode) #endif #ifdef KEY_MOUSE keydef("Key_Mouse","KEY_MOUSE",KEY_MOUSE,mode); -#endif +#endif #ifdef KEY_RESIZE keydef("Key_Resize","KEY_RESIZE",KEY_RESIZE,mode); -#endif +#endif } /* @@ -819,6 +812,138 @@ static void gen_acs (void) #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 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 @@ -830,7 +955,8 @@ static void prologue(const char *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"); + printf("define(`M4_BIT_ORDER',`%s_Order_First')", + little_endian ? "Low":"High"); } /* @@ -922,7 +1048,8 @@ static void gen_color (void) */ static void gen_linkopts (void) { - printf(" pragma Linker_Options (\"-lncurses\");\n"); + printf(" pragma Linker_Options (\"-lAdaCurses%s\");\n", model); + printf(" pragma Linker_Options (\"-lncurses%s\");\n", model); } /* @@ -930,7 +1057,7 @@ static void gen_linkopts (void) */ static void gen_menu_linkopts (void) { - printf(" pragma Linker_Options (\"-lmenu\");\n"); + printf(" pragma Linker_Options (\"-lmenu%s\");\n", model); } /* @@ -938,7 +1065,7 @@ static void gen_menu_linkopts (void) */ static void gen_form_linkopts (void) { - printf(" pragma Linker_Options (\"-lform\");\n"); + printf(" pragma Linker_Options (\"-lform%s\");\n", model); } /* @@ -946,14 +1073,77 @@ static void gen_form_linkopts (void) */ static void gen_panel_linkopts (void) { - printf(" pragma Linker_Options (\"-lpanel\");\n"); + printf(" pragma Linker_Options (\"-lpanel%s\");\n", model); } static void gen_version_info (void) { - printf(" NC_Major_Version : constant := %d; -- Major version of ncurses library\n", NCURSES_VERSION_MAJOR); - printf(" NC_Minor_Version : constant := %d; -- Minor version of ncurses library\n", NCURSES_VERSION_MINOR); - printf(" NC_Version : constant String := %c%d.%d%c; -- Version of ncurses library\n", '"',NCURSES_VERSION_MAJOR,NCURSES_VERSION_MINOR,'"'); + 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 := %2d; -- %s\n", \ + 8, #member, o/sizeof(itype),#itype); \ + } \ + } + +static void +gen_offsets(void) +{ + int 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(_scroll,char); + s_bool = "char"; + } else if (sizeof(bool) == sizeof(short)) { + GEN_OFFSET(_scroll,short); + s_bool = "short"; + } else if (sizeof(bool) == sizeof(int)) { + GEN_OFFSET(_scroll,int); + s_bool = "int"; + } + printf(" Sizeof%-*s : constant Natural := %2d; -- %s\n", + 8, "_bool",sizeof(bool),"bool"); + /* In ncurses _maxy and _maxx needs an offset for the "public" + * value + */ + printf(" Offset%-*s : constant Natural := %2d; -- %s\n", + 8, "_XY",1,"int"); + printf("\n"); + printf(" type Curses_Bool is mod 2 ** Interfaces.C.%s'Size;\n",s_bool); } /* @@ -964,6 +1154,7 @@ static void gen_version_info (void) * 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. @@ -976,11 +1167,13 @@ int main(int argc, char *argv[]) if (*s == 0x78) little_endian = 1; - if (argc!=3) + if (argc!=4) exit(1); + model = *++argv; switch(argv[1][0]) { + /* ---------------------------------------------------------------*/ case 'B': /* The Base facility */ switch(argv[2][0]) { @@ -996,6 +1189,12 @@ int main(int argc, char *argv[]) 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; @@ -1015,6 +1214,7 @@ int main(int argc, char *argv[]) break; } break; + /* ---------------------------------------------------------------*/ case 'M': /* The Menu facility */ switch(argv[2][0]) { @@ -1034,6 +1234,7 @@ int main(int argc, char *argv[]) break; } break; + /* ---------------------------------------------------------------*/ case 'F': /* The Form facility */ switch(argv[2][0]) { @@ -1053,9 +1254,9 @@ int main(int argc, char *argv[]) break; } break; + /* ---------------------------------------------------------------*/ case 'P': /* The Pointer(=Mouse) facility */ - switch(argv[2][0]) - { + switch(argv[2][0]) { case 'B': /* write some initial comment lines */ mouse_basedefs(); break; @@ -1069,8 +1270,110 @@ int main(int argc, char *argv[]) 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/Ada95/ada_include/terminal_interface-curses-aux.ads b/Ada95/gen/terminal_interface-curses-aux.ads.m4 similarity index 70% rename from Ada95/ada_include/terminal_interface-curses-aux.ads rename to Ada95/gen/terminal_interface-curses-aux.ads.m4 index 1221b2e5..71e4872b 100644 --- a/Ada95/ada_include/terminal_interface-curses-aux.ads +++ b/Ada95/gen/terminal_interface-curses-aux.ads.m4 @@ -1,4 +1,6 @@ ------------------------------------------------------------------------------- +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-aux__ads.htm')dnl +include(M4MACRO)------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- @@ -33,69 +35,63 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.8 $ --- Binding Version 00.93 +-- $Revision: 1.13 $ +-- 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 (Aux); + pragma Preelaborate (Terminal_Interface.Curses.Aux); - use type Interfaces.C.Int; + 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_Char_Ptr is Interfaces.C.Strings.Chars_Ptr; + 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 := 0; - Curses_Err : constant C_Int := -1; - - Curses_True : constant C_Int := 1; - Curses_False : constant C_Int := 0; - - subtype Eti_Error is C_Int range -14 .. 0; - -- Type for error codes returned by the menu and forms subsystem + Curses_Ok : constant C_Int := CF_CURSES_OK; + Curses_Err : constant C_Int := CF_CURSES_ERR; - E_Ok : constant Eti_Error := 0; - E_System_Error : constant Eti_Error := -1; - E_Bad_Argument : constant Eti_Error := -2; - E_Posted : constant Eti_Error := -3; - E_Connected : constant Eti_Error := -4; - E_Bad_State : constant Eti_Error := -5; - E_No_Room : constant Eti_Error := -6; - E_Not_Posted : constant Eti_Error := -7; - E_Unknown_Command : constant Eti_Error := -8; - E_No_Match : constant Eti_Error := -9; - E_Not_Selectable : constant Eti_Error := -10; - E_Not_Connected : constant Eti_Error := -11; - E_Request_Denied : constant Eti_Error := -12; - E_Invalid_Field : constant Eti_Error := -13; - E_Current : constant Eti_Error := -14; + 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 CInt_To_Chtype is new - Unchecked_Conversion (Source => C_Int, + function Chtype_To_AttrChar is new + Unchecked_Conversion (Source => C_Chtype, Target => Attributed_Character); - function Chtype_To_CInt is new + function AttrChar_To_Chtype is new Unchecked_Conversion (Source => Attributed_Character, - Target => C_Int); + 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); diff --git a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 index 79e185a1..ff7882f7 100644 --- a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,15 +36,17 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.12 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -with Terminal_Interface.Curses.Aux; +with Interfaces.C; package Terminal_Interface.Curses.Forms.Field_Types is - pragma Preelaborate (Field_Types); + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types); + use type Interfaces.C.int; + subtype C_Int is Interfaces.C.int; -- MANPAGE(`form_fieldtype.3x') @@ -86,8 +88,6 @@ package Terminal_Interface.Curses.Forms.Field_Types is -- | Most of this is used by the implementations of the child packages. -- | private - use Terminal_Interface.Curses.Aux; - type Makearg_Function is access function (Args : System.Address) return System.Address; pragma Convention (C, Makearg_Function); @@ -117,8 +117,8 @@ private -- | type Low_Level_Field_Type is record - Status : C_Short; - Ref_Count : C_Long_Int; + Status : Interfaces.C.short; + Ref_Count : Interfaces.C.long; Left, Right : System.Address; Makearg : Makearg_Function; Copyarg : Copyarg_Function; diff --git a/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 index 8059f184..aedd01ba 100644 --- a/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,17 +36,17 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.8 $ --- Binding Version 00.93 +-- $Revision: 1.13 $ +-- 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 (Field_User_Data); + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_User_Data); -- MANPAGE(`form_field_userptr.3x') diff --git a/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 index acc0f247..cddc1d1e 100644 --- a/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-forms-form_user_data_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-forms-form_user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,17 +36,17 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.8 $ --- Binding Version 00.93 +-- $Revision: 1.12 $ +-- 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 (Form_User_Data); + pragma Preelaborate (Terminal_Interface.Curses.Forms.Form_User_Data); -- MANPAGE(`form_userptr.3x') diff --git a/Ada95/gen/terminal_interface-curses-forms.ads.m4 b/Ada95/gen/terminal_interface-curses-forms.ads.m4 index bb4ebfd4..840c5f18 100644 --- a/Ada95/gen/terminal_interface-curses-forms.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-forms_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-forms__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,10 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.14 $ --- Binding Version 00.93 +-- $Revision: 1.23 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Form_Base_Defs') with System; @@ -47,9 +47,9 @@ with Ada.Characters.Latin_1; with Interfaces.C; package Terminal_Interface.Curses.Forms is - pragma Preelaborate (Forms); -include(`Form_Linker_Options') - + 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; @@ -63,13 +63,19 @@ include(`Form_Linker_Options') Center, Right); -include(`Field_Rep') + 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); -include(`Form_Opt_Rep') + 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. @@ -682,11 +688,10 @@ include(`Form_Opt_Rep') ------------------------------------------------------------------------------ private + type Field is new System.Storage_Elements.Integer_Address; + type Form is new System.Storage_Elements.Integer_Address; - type Field is new System.Address; - type Form is new System.Address; - - Null_Field : constant Field := Field (System.Null_Address); - Null_Form : constant Form := Form (System.Null_Address); + Null_Field : constant Field := 0; + Null_Form : constant Form := 0; end Terminal_Interface.Curses.Forms; diff --git a/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 index 957e4437..8d601d80 100644 --- a/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-menus-item_user_data_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-menus-item_user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,17 +36,17 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.12 $ +-- 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 (Item_User_Data); + 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 diff --git a/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 index f7815da7..2f26f08a 100644 --- a/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-menus-menu_user_data_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-menus-menu_user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,17 +36,17 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.12 $ +-- 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 (Menu_User_Data); + pragma Preelaborate (Terminal_Interface.Curses.Menus.Menu_User_Data); -- MANPAGE(`menu_userptr.3x') diff --git a/Ada95/gen/terminal_interface-curses-menus.ads.m4 b/Ada95/gen/terminal_interface-curses-menus.ads.m4 index d3e45920..81a4935c 100644 --- a/Ada95/gen/terminal_interface-curses-menus.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-menus.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-menus_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-menus__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,10 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.12 $ --- Binding Version 00.93 +-- $Revision: 1.20 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Menu_Base_Defs') with System; @@ -47,10 +47,9 @@ with Interfaces.C; with Ada.Characters.Latin_1; package Terminal_Interface.Curses.Menus is - pragma Preelaborate (Menus); -include(`Menu_Linker_Options') - - + 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; @@ -117,8 +116,10 @@ include(`Menu_Linker_Options') -- -- Menu options -- + pragma Warnings (Off); +include(`Menu_Opt_Rep')dnl -include(`Menu_Opt_Rep') + pragma Warnings (On); function Default_Menu_Options return Menu_Option_Set; -- Initial default options for a menu. @@ -126,7 +127,10 @@ include(`Menu_Opt_Rep') -- -- Item options -- -include(`Item_Rep') + pragma Warnings (Off); +include(`Item_Rep')dnl + + pragma Warnings (On); function Default_Item_Options return Item_Option_Set; -- Initial default options for an item. @@ -582,10 +586,10 @@ include(`Item_Rep') ------------------------------------------------------------------------------- private - type Item is new System.Address; - type Menu is new System.Address; + type Item is new System.Storage_Elements.Integer_Address; + type Menu is new System.Storage_Elements.Integer_Address; - Null_Item : constant Item := Item (System.Null_Address); - Null_Menu : constant Menu := Menu (System.Null_Address); + Null_Item : constant Item := 0; + Null_Menu : constant Menu := 0; end Terminal_Interface.Curses.Menus; diff --git a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 index 21f88e44..0db4ffbb 100644 --- a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-mouse_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-mouse__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,16 +36,16 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.12 $ --- Binding Version 00.93 +-- $Revision: 1.19 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Mouse_Base_Defs') with System; package Terminal_Interface.Curses.Mouse is - pragma Preelaborate (Mouse); + pragma Preelaborate (Terminal_Interface.Curses.Mouse); -- MANPAGE(`curs_mouse.3x') -- Please note, that in ncurses-1.9.9e documentation mouse support @@ -64,12 +64,22 @@ package Terminal_Interface.Curses.Mouse is 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') @@ -78,22 +88,32 @@ package Terminal_Interface.Curses.Mouse is -- Return true if a mouse device is supported, false otherwise. procedure Register_Reportable_Event - (B : in Mouse_Button; - S : in Button_State; - Mask : in out Event_Mask); + (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. function Start_Mouse (Mask : Event_Mask := All_Events) return Event_Mask; -- AKA pragma Inline (Start_Mouse); - procedure End_Mouse; - -- Terminates the 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') @@ -128,14 +148,12 @@ package Terminal_Interface.Curses.Mouse is pragma Inline (Mouse_Interval); private - type Event_Mask is new Interfaces.C.int; - No_Events : constant Event_Mask := 0; - All_Events : constant Event_Mask := -1; + 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); + Integer (Interfaces.C.short'Last); X, Y, Z : Integer range Integer (Interfaces.C.int'First) .. Integer (Interfaces.C.int'Last); Bstate : Event_Mask; @@ -147,4 +165,9 @@ include(`Mouse_Event_Rep') Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER; -- This constant may be different on your system. +include(`Mouse_Events') + + No_Events : constant Event_Mask := 0; + All_Events : constant Event_Mask := ALL_MOUSE_EVENTS; + end Terminal_Interface.Curses.Mouse; diff --git a/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 index 3dd3dd41..1369cfd7 100644 --- a/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-panels-user_data_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-panels-user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,17 +36,17 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.12 $ +-- 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 (User_Data); + pragma Preelaborate (Terminal_Interface.Curses.Panels.User_Data); -- MANPAGE(`panel.3x') diff --git a/Ada95/gen/terminal_interface-curses-panels.ads.m4 b/Ada95/gen/terminal_interface-curses-panels.ads.m4 index f9bfb2e0..e309404d 100644 --- a/Ada95/gen/terminal_interface-curses-panels.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-panels.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-panels_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-panels__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,17 +36,17 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.14 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with System; package Terminal_Interface.Curses.Panels is - pragma Preelaborate (Panels); -include(`Panel_Linker_Options') - + pragma Preelaborate (Terminal_Interface.Curses.Panels); +include(`Panel_Linker_Options')dnl +include(`Linker_Options') type Panel is private; --------------------------- @@ -140,7 +140,7 @@ include(`Panel_Linker_Options') pragma Inline (Delete); private - type Panel is new System.Address; - Null_Panel : constant Panel := Panel (System.Null_Address); + type Panel is new System.Storage_Elements.Integer_Address; + Null_Panel : constant Panel := 0; end Terminal_Interface.Curses.Panels; diff --git a/Ada95/gen/terminal_interface-curses.ads.m4 b/Ada95/gen/terminal_interface-curses.ads.m4 index 65bbbd75..893bd6cb 100644 --- a/Ada95/gen/terminal_interface-curses.ads.m4 +++ b/Ada95/gen/terminal_interface-curses.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses__ads.htm')dnl include(M4MACRO)------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- @@ -35,17 +35,17 @@ include(M4MACRO)---------------------------------------------------------------- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.15 $ --- Binding Version 00.93 +-- $Revision: 1.26 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Base_Defs') -with System; +with System.Storage_Elements; with Interfaces.C; -- We need this for some assertions. package Terminal_Interface.Curses is - pragma Preelaborate (Curses); + pragma Preelaborate (Terminal_Interface.Curses); include(`Linker_Options') include(`Version_Info') type Window is private; @@ -91,7 +91,7 @@ include(`Key_Definitions') -- 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') +include(`Old_Keys')dnl ------------------------------------------------------------------------------ @@ -103,7 +103,7 @@ include(`Old_Keys') -- predefined (see below), although they may not really exist. include(`Color_Defs') - type RGB_Value is range 0 .. Integer (Interfaces.C.Short'Last); + 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. @@ -116,15 +116,15 @@ include(`Color_Defs') -- the other for the background include(`Character_Attribute_Set_Rep') - -- (n)curses uses half of an integer for attributes. + -- (n)curses uses all but the lowes 16 Bits for Attributes. Normal_Video : constant Character_Attribute_Set := (others => False); type Attributed_Character is record - Attr : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := 0; - Ch : Character := ' '; + 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. @@ -133,7 +133,7 @@ include(`AC_Rep') Default_Character : constant Attributed_Character := (Ch => Character'First, Color => Color_Pair'First, - Attr => Normal_Video); + Attr => (others => False)); -- preelaboratable Normal_Video type Attributed_String is array (Positive range <>) of Attributed_Character; pragma Pack (Attributed_String); @@ -195,7 +195,7 @@ include(`AC_Rep') -- You must use this constants as indices into the ACS_Map array -- to get the corresponding attributed character at runtime. -- -include(`ACS_Map') +include(`ACS_Map')dnl -- MANPAGE(`curs_initscr.3x') -- | Not implemented: newterm, set_term, delscreen @@ -503,6 +503,12 @@ include(`ACS_Map') -- AKA pragma Inline (Get_Character_Attribute); + -- ANCHOR(`wcolor_set()',`Set_Color') + procedure Set_Color (Win : in Window := Standard_Window; + Pair : in Color_Pair); + -- AKA + pragma Inline (Set_Color); + -- ANCHOR(`wchgat()',`Change_Attributes') procedure Change_Attributes (Win : in Window := Standard_Window; @@ -1138,6 +1144,11 @@ include(`ACS_Map') -- 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(`keyok.3x') -- ANCHOR(`keyok()',`Enable_Key') @@ -1365,7 +1376,13 @@ include(`ACS_Map') -- We don't inline this procedure private - type Window is new System.Address; - Null_Window : constant Window := Window (System.Null_Address); + type Window is new System.Storage_Elements.Integer_Address; + Null_Window : constant Window := 0; + + -- The next constants are generated and may be different on your + -- architecture. + -- +include(`Window_Offsets')dnl + Curses_Bool_False : constant Curses_Bool := 0; end Terminal_Interface.Curses; diff --git a/Ada95/html/ada/files.htm b/Ada95/html/ada/files.htm new file mode 100644 index 00000000..047f9ab7 --- /dev/null +++ b/Ada95/html/ada/files.htm @@ -0,0 +1,5 @@ + + +

Files

+[T] + \ No newline at end of file diff --git a/Ada95/html/ada/files/T.htm b/Ada95/html/ada/files/T.htm new file mode 100644 index 00000000..b6223a0f --- /dev/null +++ b/Ada95/html/ada/files/T.htm @@ -0,0 +1,36 @@ +T + +

Files - T

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs.htm b/Ada95/html/ada/funcs.htm new file mode 100644 index 00000000..77f7b705 --- /dev/null +++ b/Ada95/html/ada/funcs.htm @@ -0,0 +1,19 @@ + + +

Functions/Procedures

+[A] +[C] +[E] +[F] +[G] +[I] +[L] +[M] +[N] +[P] +[R] +[S] +[T] +[U] +[V] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/A.htm b/Ada95/html/ada/funcs/A.htm new file mode 100644 index 00000000..c276f990 --- /dev/null +++ b/Ada95/html/ada/funcs/A.htm @@ -0,0 +1,6 @@ +A + +

Functions - A

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/C.htm b/Ada95/html/ada/funcs/C.htm new file mode 100644 index 00000000..16b475ed --- /dev/null +++ b/Ada95/html/ada/funcs/C.htm @@ -0,0 +1,6 @@ +C + +

Functions - C

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/E.htm b/Ada95/html/ada/funcs/E.htm new file mode 100644 index 00000000..088d54c4 --- /dev/null +++ b/Ada95/html/ada/funcs/E.htm @@ -0,0 +1,6 @@ +E + +

Functions - E

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/F.htm b/Ada95/html/ada/funcs/F.htm new file mode 100644 index 00000000..bf89dbf3 --- /dev/null +++ b/Ada95/html/ada/funcs/F.htm @@ -0,0 +1,6 @@ +F + +

Functions - F

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/G.htm b/Ada95/html/ada/funcs/G.htm new file mode 100644 index 00000000..9fb627ca --- /dev/null +++ b/Ada95/html/ada/funcs/G.htm @@ -0,0 +1,6 @@ +G + +

Functions - G

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/I.htm b/Ada95/html/ada/funcs/I.htm new file mode 100644 index 00000000..4830d584 --- /dev/null +++ b/Ada95/html/ada/funcs/I.htm @@ -0,0 +1,6 @@ +I + +

Functions - I

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/L.htm b/Ada95/html/ada/funcs/L.htm new file mode 100644 index 00000000..a95c86d5 --- /dev/null +++ b/Ada95/html/ada/funcs/L.htm @@ -0,0 +1,6 @@ +L + +

Functions - L

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/M.htm b/Ada95/html/ada/funcs/M.htm new file mode 100644 index 00000000..af0cdaea --- /dev/null +++ b/Ada95/html/ada/funcs/M.htm @@ -0,0 +1,6 @@ +M + +

Functions - M

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/N.htm b/Ada95/html/ada/funcs/N.htm new file mode 100644 index 00000000..54eb7892 --- /dev/null +++ b/Ada95/html/ada/funcs/N.htm @@ -0,0 +1,6 @@ +N + +

Functions - N

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/P.htm b/Ada95/html/ada/funcs/P.htm new file mode 100644 index 00000000..88cb4472 --- /dev/null +++ b/Ada95/html/ada/funcs/P.htm @@ -0,0 +1,6 @@ +P + +

Functions - P

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/R.htm b/Ada95/html/ada/funcs/R.htm new file mode 100644 index 00000000..f6e0b21e --- /dev/null +++ b/Ada95/html/ada/funcs/R.htm @@ -0,0 +1,6 @@ +R + +

Functions - R

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/S.htm b/Ada95/html/ada/funcs/S.htm new file mode 100644 index 00000000..e77c6d1e --- /dev/null +++ b/Ada95/html/ada/funcs/S.htm @@ -0,0 +1,6 @@ +S + +

Functions - S

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/T.htm b/Ada95/html/ada/funcs/T.htm new file mode 100644 index 00000000..0ee81e0d --- /dev/null +++ b/Ada95/html/ada/funcs/T.htm @@ -0,0 +1,6 @@ +T + +

Functions - T

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/U.htm b/Ada95/html/ada/funcs/U.htm new file mode 100644 index 00000000..20af351a --- /dev/null +++ b/Ada95/html/ada/funcs/U.htm @@ -0,0 +1,6 @@ +U + +

Functions - U

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/funcs/V.htm b/Ada95/html/ada/funcs/V.htm new file mode 100644 index 00000000..7c493c82 --- /dev/null +++ b/Ada95/html/ada/funcs/V.htm @@ -0,0 +1,6 @@ +V + +

Functions - V

+[index] + \ No newline at end of file diff --git a/Ada95/html/ada/index.htm b/Ada95/html/ada/index.htm new file mode 100644 index 00000000..80af5f9a --- /dev/null +++ b/Ada95/html/ada/index.htm @@ -0,0 +1,33 @@ + +Source Browser + + +

Files

+[T] + +
+

Functions/Procedures

+[A] +[C] +[E] +[F] +[G] +[I] +[L] +[M] +[N] +[P] +[R] +[S] +[T] +[U] +[V] + +
+ + + + + + + diff --git a/Ada95/html/ada/main.htm b/Ada95/html/ada/main.htm new file mode 100644 index 00000000..06a05f0c --- /dev/null +++ b/Ada95/html/ada/main.htm @@ -0,0 +1,23 @@ + + +

[No frame version is here]

Files

+[T] + +

Functions/Procedures

+[A] +[C] +[E] +[F] +[G] +[I] +[L] +[M] +[N] +[P] +[R] +[S] +[T] +[U] +[V] + + \ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm new file mode 100644 index 00000000..a3a090f9 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm @@ -0,0 +1,58 @@ +terminal_interface-curses-forms-field_types-alpha.ads + +

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


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--              Terminal_Interface.Curses.Forms.Field_Types.Alpha           --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm new file mode 100644 index 00000000..ab299784 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm @@ -0,0 +1,59 @@ +terminal_interface-curses-forms-field_types-alphanumeric.ads + +

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


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--          Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric        --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm new file mode 100644 index 00000000..4a855470 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm @@ -0,0 +1,64 @@ +terminal_interface-curses-forms-field_types-enumeration-ada.ads + +

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


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--         Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada      --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.8 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm new file mode 100644 index 00000000..47b73130 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm @@ -0,0 +1,103 @@ +terminal_interface-curses-forms-field_types-enumeration.ads + +

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


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--           Terminal_Interface.Curses.Forms.Field_Types.Enumeration        --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm new file mode 100644 index 00000000..6de61deb --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm @@ -0,0 +1,60 @@ +terminal_interface-curses-forms-field_types-intfield.ads + +

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


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--            Terminal_Interface.Curses.Forms.Field_Types.IntField          --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm new file mode 100644 index 00000000..ec45a062 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm @@ -0,0 +1,56 @@ +terminal_interface-curses-forms-field_types-ipv4_address.ads + +

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


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--          Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address        --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm new file mode 100644 index 00000000..e92389e1 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm @@ -0,0 +1,60 @@ +terminal_interface-curses-forms-field_types-numeric.ads + +

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


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--             Terminal_Interface.Curses.Forms.Field_Types.Numeric          --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm new file mode 100644 index 00000000..4c90c841 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm @@ -0,0 +1,60 @@ +terminal_interface-curses-forms-field_types-regexp.ads + +

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


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--              Terminal_Interface.Curses.Forms.Field_Types.RegExp          --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm new file mode 100644 index 00000000..57bdc250 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm @@ -0,0 +1,101 @@ +terminal_interface-curses-forms-field_types-user-choice.ads + +

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


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--           Terminal_Interface.Curses.Forms.Field_Types.User.Choice        --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm new file mode 100644 index 00000000..508b3e64 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm @@ -0,0 +1,102 @@ +terminal_interface-curses-forms-field_types-user.ads + +

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


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Forms.Field_Types.User           --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_types__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_types__ads.htm new file mode 100644 index 00000000..9e086cac --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_types__ads.htm @@ -0,0 +1,245 @@ +terminal_interface-curses-forms-field_types.ads + +

File : terminal_interface-curses-forms-field_types.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                 Terminal_Interface.Curses.Forms.Field_Types              --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+with Interfaces.C;
+
+package Terminal_Interface.Curses.Forms.Field_Types is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types);
+   use type Interfaces.C.int;
+   subtype C_Int is Interfaces.C.int;
+
+  --  |=====================================================================
+  --  | Man page form_fieldtype.3x
+  --  |=====================================================================
+
+   type Field_Type is abstract tagged null record;
+  --  Abstract base type for all field types. A concrete field type
+  --  is an extension that adds some data elements describing formats or
+  --  boundary values for the type and validation routines.
+  --  For the builtin low-level fieldtypes, the validation routines are
+  --  already defined by the low-level C library.
+  --  The builtin types like Alpha or AlphaNumeric etc. are defined in
+  --  child packages of this package. You may use one of them as example
+  --  how to create you own child packages for low-level field types that
+  --  you may have already written in C.
+
+   type Field_Type_Access is access all Field_Type'Class;
+
+  --  |
+   procedure Set_Field_Type (Fld      : in Field;
+                             Fld_Type : in Field_Type) is abstract;
+  --  AKA: set_field_type()
+  --  But: we hide the vararg mechanism of the C interface. You always
+  --       have to pass a single Field_Type parameter.
+
+  --  ---------------------------------------------------------------------
+
+  --  |=====================================================================
+  --  | Man page form_field_validation.3x
+  --  |=====================================================================
+
+  --  |
+   function Get_Type (Fld : in Field) return Field_Type_Access;
+  --  AKA: field_type()
+  --  AKA: field_arg()
+  --  In Ada95 we can combine these. If you try to retrieve the field type
+  --  that is not defined as extension of the abstract tagged type above,
+  --  you will raise a Form_Exception.
+  --  This is not inlined
+
+  --  +----------------------------------------------------------------------
+  --  | Private Part.
+  --  | Most of this is used by the implementations of the child packages.
+  --  |
+private
+   type Makearg_Function is access
+     function (Args : System.Address) return System.Address;
+   pragma Convention (C, Makearg_Function);
+
+   type Copyarg_Function is access
+     function (Usr : System.Address) return System.Address;
+   pragma Convention (C, Copyarg_Function);
+
+   type Freearg_Function is access
+     procedure (Usr : System.Address);
+   pragma Convention (C, Freearg_Function);
+
+   type Field_Check_Function is access
+     function (Fld : Field; Usr : System.Address) return C_Int;
+   pragma Convention (C, Field_Check_Function);
+
+   type Char_Check_Function is access
+     function (Ch : C_Int; Usr : System.Address) return C_Int;
+   pragma Convention (C, Char_Check_Function);
+
+   type Choice_Function is access
+     function (Fld : Field; Usr : System.Address) return C_Int;
+   pragma Convention (C, Choice_Function);
+
+  --  +----------------------------------------------------------------------
+  --  | This must be in sync with the FIELDTYPE structure in form.h
+  --  |
+   type Low_Level_Field_Type is
+      record
+         Status :              Interfaces.C.short;
+         Ref_Count :           Interfaces.C.long;
+         Left, Right :         System.Address;
+         Makearg :             Makearg_Function;
+         Copyarg :             Copyarg_Function;
+         Freearg :             Freearg_Function;
+         Fcheck :              Field_Check_Function;
+         Ccheck :              Char_Check_Function;
+         Next, Prev :          Choice_Function;
+      end record;
+   pragma Convention (C, Low_Level_Field_Type);
+   type C_Field_Type is access all Low_Level_Field_Type;
+
+   Null_Field_Type   : constant C_Field_Type := null;
+
+  --  +----------------------------------------------------------------------
+  --  | This four low-level fieldtypes are the ones associated with
+  --  | fieldtypes handled by this binding. Any other low-level fieldtype
+  --  | will result in a Form_Exception is function Get_Type.
+  --  |
+   M_Generic_Type   : C_Field_Type := null;
+   M_Generic_Choice : C_Field_Type := null;
+   M_Builtin_Router : C_Field_Type := null;
+   M_Choice_Router  : C_Field_Type := null;
+
+  --  Two wrapper functions to access those low-level fieldtypes defined
+  --  in this package.
+   function C_Builtin_Router return C_Field_Type;
+   function C_Choice_Router  return C_Field_Type;
+
+   procedure Wrap_Builtin (Fld : Field;
+                           Typ : Field_Type'Class;
+                           Cft : C_Field_Type := C_Builtin_Router);
+  --  This procedure has to be called by the Set_Field_Type implementation
+  --  for builtin low-level fieldtypes to replace it by an Ada95
+  --  conformant Field_Type object.
+  --  The parameter Cft must be C_Builtin_Router for regular low-level
+  --  fieldtypes (like TYP_ALPHA or TYP_ALNUM) and C_Choice_Router for
+  --  low-level fieldtypes witch choice functions (like TYP_ENUM).
+  --  Any other value will raise a Form_Exception.
+
+   function Make_Arg (Args : System.Address) return System.Address;
+   pragma Convention (C, Make_Arg);
+  --  This is the Makearg_Function for the internal low-level types
+  --  introduced by this binding.
+
+   function Copy_Arg (Usr : System.Address) return System.Address;
+   pragma Convention (C, Copy_Arg);
+  --  This is the Copyarg_Function for the internal low-level types
+  --  introduced by this binding.
+
+   procedure Free_Arg (Usr : System.Address);
+   pragma Convention (C, Free_Arg);
+  --  This is the Freearg_Function for the internal low-level types
+  --  introduced by this binding.
+
+   function Field_Check_Router (Fld : Field;
+                                Usr : System.Address) return C_Int;
+   pragma Convention (C, Field_Check_Router);
+  --  This is the Field_Check_Function for the internal low-level types
+  --  introduced to wrap the low-level types by a Field_Type derived
+  --  type. It routes the call to the corresponding low-level validation
+  --  function.
+
+   function Char_Check_Router (Ch : C_Int;
+                               Usr : System.Address) return C_Int;
+   pragma Convention (C, Char_Check_Router);
+  --  This is the Char_Check_Function for the internal low-level types
+  --  introduced to wrap the low-level types by a Field_Type derived
+  --  type. It routes the call to the corresponding low-level validation
+  --  function.
+
+   function Next_Router (Fld : Field;
+                         Usr : System.Address) return C_Int;
+   pragma Convention (C, Next_Router);
+  --  This is the Choice_Function for the internal low-level types
+  --  introduced to wrap the low-level types by a Field_Type derived
+  --  type. It routes the call to the corresponding low-level next_choice
+  --  function.
+
+   function Prev_Router (Fld : Field;
+                         Usr : System.Address) return C_Int;
+   pragma Convention (C, Prev_Router);
+  --  This is the Choice_Function for the internal low-level types
+  --  introduced to wrap the low-level types by a Field_Type derived
+  --  type. It routes the call to the corresponding low-level prev_choice
+  --  function.
+
+  --  This is the Argument structure maintained by all low-level field types
+  --  introduced by this binding.
+   type Argument is record
+      Typ : Field_Type_Access;  --  the Field_Type creating this record
+      Usr : System.Address;     --  original arg for builtin low-level types
+      Cft : C_Field_Type;       --  the original low-level type
+   end record;
+   type Argument_Access is access all Argument;
+
+  --  +----------------------------------------------------------------------
+  --  |
+  --  | Some Imports of libform routines to deal with low-level fieldtypes.
+  --  |
+   function New_Fieldtype (Fcheck : Field_Check_Function;
+                           Ccheck : Char_Check_Function)
+     return C_Field_Type;
+   pragma Import (C, New_Fieldtype, "new_fieldtype");
+
+   function Set_Fieldtype_Arg (Cft : C_Field_Type;
+                               Mak : Makearg_Function := Make_Arg'Access;
+                               Cop : Copyarg_Function := Copy_Arg'Access;
+                               Fre : Freearg_Function := Free_Arg'Access)
+     return C_Int;
+   pragma Import (C, Set_Fieldtype_Arg, "set_fieldtype_arg");
+
+   function Set_Fieldtype_Choice (Cft : C_Field_Type;
+                                  Next, Prev : Choice_Function)
+     return C_Int;
+   pragma Import (C, Set_Fieldtype_Choice, "set_fieldtype_choice");
+
+end Terminal_Interface.Curses.Forms.Field_Types;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm new file mode 100644 index 00000000..0c554af9 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm @@ -0,0 +1,75 @@ +terminal_interface-curses-forms-field_user_data.ads + +

File : terminal_interface-curses-forms-field_user_data.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Forms.Field_User_Data            --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access User;
+package Terminal_Interface.Curses.Forms.Field_User_Data is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_User_Data);
+
+  --  |=====================================================================
+  --  | Man page form_field_userptr.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_User_Data (Fld  : in Field;
+                            Data : in User_Access);
+  --  AKA: set_field_userptr
+   pragma Inline (Set_User_Data);
+
+  --  |
+   procedure Get_User_Data (Fld  : in  Field;
+                            Data : out User_Access);
+  --  AKA: field_userptr
+
+  --  |
+   function Get_User_Data (Fld  : in  Field) return User_Access;
+  --  AKA: field_userptr
+  --  Sama as function
+   pragma Inline (Get_User_Data);
+
+end Terminal_Interface.Curses.Forms.Field_User_Data;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm new file mode 100644 index 00000000..21453c8c --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm @@ -0,0 +1,75 @@ +terminal_interface-curses-forms-form_user_data.ads + +

File : terminal_interface-curses-forms-form_user_data.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                Terminal_Interface.Curses.Forms.Form_User_Data            --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access User;
+package Terminal_Interface.Curses.Forms.Form_User_Data is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Form_User_Data);
+
+  --  |=====================================================================
+  --  | Man page form_userptr.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_User_Data (Frm  : in Form;
+                            Data : in User_Access);
+  --  AKA: set_form_userptr
+   pragma Inline (Set_User_Data);
+
+  --  |
+   procedure Get_User_Data (Frm  : in  Form;
+                            Data : out User_Access);
+  --  AKA: form_userptr
+
+  --  |
+   function Get_User_Data (Frm  : in  Form) return User_Access;
+  --  AKA: form_userptr
+  --  Same as function
+   pragma Inline (Get_User_Data);
+
+end Terminal_Interface.Curses.Forms.Form_User_Data;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-forms__ads.htm b/Ada95/html/ada/terminal_interface-curses-forms__ads.htm new file mode 100644 index 00000000..6390aee0 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-forms__ads.htm @@ -0,0 +1,785 @@ +terminal_interface-curses-forms.ads + +

File : terminal_interface-curses-forms.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Form                      --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.20 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+--  form binding.
+--  This module is generated. Please don't change it manually!
+--  Run the generator instead.
+--  |
+with System;
+with Ada.Characters.Latin_1;
+with Interfaces.C;
+
+package Terminal_Interface.Curses.Forms is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms);
+   pragma Linker_Options ("-lform");
+   pragma Linker_Options ("-lAdaCurses");
+   pragma Linker_Options ("-lncurses");
+
+   Space : Character renames Ada.Characters.Latin_1.Space;
+
+   type Field        is private;
+   type Form         is private;
+
+   Null_Field        : constant Field;
+   Null_Form         : constant Form;
+
+   type Field_Justification is (None,
+                                Left,
+                                Center,
+                                Right);
+
+   pragma Warnings (Off);
+   type Field_Option_Set is
+      record
+         Visible     : Boolean;
+         Active      : Boolean;
+         Public      : Boolean;
+         Edit        : Boolean;
+         Wrap        : Boolean;
+         Blank       : Boolean;
+         Auto_Skip   : Boolean;
+         Null_Ok     : Boolean;
+         Pass_Ok     : Boolean;
+         Static      : Boolean;
+      end record;
+   pragma Pack (Field_Option_Set);
+   pragma Convention (C, Field_Option_Set);
+
+   for Field_Option_Set use
+      record
+         Visible     at 0 range  0 ..  0;
+         Active      at 0 range  1 ..  1;
+         Public      at 0 range  2 ..  2;
+         Edit        at 0 range  3 ..  3;
+         Wrap        at 0 range  4 ..  4;
+         Blank       at 0 range  5 ..  5;
+         Auto_Skip   at 0 range  6 ..  6;
+         Null_Ok     at 0 range  7 ..  7;
+         Pass_Ok     at 0 range  8 ..  8;
+         Static      at 0 range  9 ..  9;
+      end record;
+   for Field_Option_Set'Size use 32;
+  --  Please note: this rep. clause is generated and may be
+  --               different on your system.Dnl
+
+   pragma Warnings (On);
+
+   function Default_Field_Options return Field_Option_Set;
+  --  The initial defaults for the field options.
+   pragma Inline (Default_Field_Options);
+
+   pragma Warnings (Off);
+   type Form_Option_Set is
+      record
+         NL_Overload : Boolean;
+         BS_Overload : Boolean;
+      end record;
+   pragma Pack (Form_Option_Set);
+   pragma Convention (C, Form_Option_Set);
+
+   for Form_Option_Set use
+      record
+         NL_Overload at 0 range  0 ..  0;
+         BS_Overload at 0 range  1 ..  1;
+      end record;
+   for Form_Option_Set'Size use 32;
+  --  Please note: this rep. clause is generated and may be
+  --               different on your system.Dnl
+
+   pragma Warnings (On);
+
+   function Default_Form_Options return Form_Option_Set;
+  --  The initial defaults for the form options.
+   pragma Inline (Default_Form_Options);
+
+   type Buffer_Number is new Natural;
+
+   type Field_Array is array (Positive range <>) of aliased Field;
+   pragma Convention (C, Field_Array);
+
+   type Field_Array_Access is access Field_Array;
+
+   procedure Free (FA          : in out Field_Array_Access;
+                   Free_Fields : 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;
+
+  --  |=====================================================================
+  --  | 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;
+  --  AKA: new_field()
+  --  An overloaded Create is defined later. Pragma Inline appears there.
+
+  --  |
+   function New_Field (Height       : Line_Count;
+                       Width        : Column_Count;
+                       Top          : Line_Position;
+                       Left         : Column_Position;
+                       Off_Screen   : Natural := 0;
+                       More_Buffers : Buffer_Number := Buffer_Number'First)
+                       return Field renames Create;
+  --  AKA: new_field()
+   pragma Inline (New_Field);
+
+  --  |
+   procedure Delete (Fld : in out Field);
+  --  AKA: free_field()
+  --  Reset Fld to Null_Field
+  --  An overloaded Delete is defined later. Pragma Inline appears there.
+
+  --  |
+   function Duplicate (Fld  : Field;
+                       Top  : Line_Position;
+                       Left : Column_Position) return Field;
+  --  AKA: dup_field()
+   pragma Inline (Duplicate);
+
+  --  |
+   function Link (Fld  : Field;
+                  Top  : Line_Position;
+                  Left : Column_Position) return Field;
+  --  AKA: link_field()
+   pragma Inline (Link);
+
+  --  |=====================================================================
+  --  | Man page form_field_just.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Justification (Fld  : in Field;
+                                Just : in Field_Justification := None);
+  --  AKA: set_field_just()
+   pragma Inline (Set_Justification);
+
+  --  |
+   function Get_Justification (Fld : Field) return Field_Justification;
+  --  AKA: field_just()
+   pragma Inline (Get_Justification);
+
+  --  |=====================================================================
+  --  | Man page form_field_buffer.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Buffer
+     (Fld    : in Field;
+      Buffer : in Buffer_Number := Buffer_Number'First;
+      Str    : in String);
+  --  AKA: set_field_buffer()
+  --  Not inlined
+
+  --  |
+   procedure Get_Buffer
+     (Fld    : in Field;
+      Buffer : in Buffer_Number := Buffer_Number'First;
+      Str    : out String);
+  --  AKA: field_buffer()
+
+   function Get_Buffer
+     (Fld    : in Field;
+      Buffer : in Buffer_Number := Buffer_Number'First) return String;
+  --  AKA: field_buffer()
+  --  Same but as function
+   pragma Inline (Get_Buffer);
+
+  --  |
+   procedure Set_Status (Fld    : in Field;
+                         Status : in Boolean := True);
+  --  AKA: set_field_status()
+   pragma Inline (Set_Status);
+
+  --  |
+   function Changed (Fld : Field) return Boolean;
+  --  AKA: field_status()
+   pragma Inline (Changed);
+
+  --  |
+   procedure Set_Maximum_Size (Fld : in Field;
+                               Max : in Natural := 0);
+  --  AKA: set_field_max()
+   pragma Inline (Set_Maximum_Size);
+
+  --  |=====================================================================
+  --  | Man page form_field_opts.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Options (Fld     : in Field;
+                          Options : in Field_Option_Set);
+  --  AKA: set_field_opts()
+  --  An overloaded version is defined later. Pragma Inline appears there
+
+  --  |
+   procedure Switch_Options (Fld     : in Field;
+                             Options : in Field_Option_Set;
+                             On      : Boolean := True);
+  --  AKA: field_opts_on()
+  --  AKA: field_opts_off()
+  --  An overloaded version is defined later. Pragma Inline appears there
+
+  --  |
+   procedure Get_Options (Fld     : in  Field;
+                          Options : out Field_Option_Set);
+  --  AKA: field_opts()
+
+  --  |
+   function Get_Options (Fld : Field := Null_Field)
+                         return Field_Option_Set;
+  --  AKA: field_opts()
+  --  An overloaded version is defined later. Pragma Inline appears there
+
+  --  |=====================================================================
+  --  | Man page form_field_attributes.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Foreground
+     (Fld   : in Field;
+      Fore  : in Character_Attribute_Set := Normal_Video;
+      Color : in Color_Pair := Color_Pair'First);
+  --  AKA: set_field_fore()
+   pragma Inline (Set_Foreground);
+
+  --  |
+   procedure Foreground (Fld  : in  Field;
+                         Fore : out Character_Attribute_Set);
+  --  AKA: field_fore()
+
+  --  |
+   procedure Foreground (Fld   : in  Field;
+                         Fore  : out Character_Attribute_Set;
+                         Color : out Color_Pair);
+  --  AKA: field_fore()
+   pragma Inline (Foreground);
+
+  --  |
+   procedure Set_Background
+     (Fld   : in Field;
+      Back  : in Character_Attribute_Set := Normal_Video;
+      Color : in Color_Pair := Color_Pair'First);
+  --  AKA: set_field_back()
+   pragma Inline (Set_Background);
+
+  --  |
+   procedure Background (Fld  : in  Field;
+                         Back : out Character_Attribute_Set);
+  --  AKA: field_back()
+
+  --  |
+   procedure Background (Fld   : in  Field;
+                         Back  : out Character_Attribute_Set;
+                         Color : out Color_Pair);
+  --  AKA: field_back()
+   pragma Inline (Background);
+
+  --  |
+   procedure Set_Pad_Character (Fld : in Field;
+                                Pad : in Character := Space);
+  --  AKA: set_field_pad()
+   pragma Inline (Set_Pad_Character);
+
+  --  |
+   procedure Pad_Character (Fld : in  Field;
+                            Pad : out Character);
+  --  AKA: field_pad()
+   pragma Inline (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);
+  --  AKA: field_info()
+   pragma Inline (Info);
+
+  --  |
+   procedure Dynamic_Info (Fld     : in Field;
+                           Lines   : out Line_Count;
+                           Columns : out Column_Count;
+                           Max     : out Natural);
+  --  AKA: dynamic_field_info()
+   pragma Inline (Dynamic_Info);
+
+  --  |=====================================================================
+  --  | Man page form_win.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Window (Frm : in Form;
+                         Win : in Window);
+  --  AKA: set_form_win()
+   pragma Inline (Set_Window);
+
+  --  |
+   function Get_Window (Frm : Form) return Window;
+  --  AKA: form_win()
+   pragma Inline (Get_Window);
+
+  --  |
+   procedure Set_Sub_Window (Frm : in Form;
+                             Win : in Window);
+  --  AKA: set_form_sub()
+   pragma Inline (Set_Sub_Window);
+
+  --  |
+   function Get_Sub_Window (Frm : Form) return Window;
+  --  AKA: form_sub()
+   pragma Inline (Get_Sub_Window);
+
+  --  |
+   procedure Scale (Frm     : in Form;
+                    Lines   : out Line_Count;
+                    Columns : out Column_Count);
+  --  AKA: scale_form()
+   pragma Inline (Scale);
+
+  --  |=====================================================================
+  --  | Man page form_hook.3x
+  --  |=====================================================================
+
+   type Form_Hook_Function is access procedure (Frm : in Form);
+   pragma Convention (C, Form_Hook_Function);
+
+  --  |
+   procedure Set_Field_Init_Hook (Frm  : in Form;
+                                  Proc : in Form_Hook_Function);
+  --  AKA: set_field_init()
+   pragma Inline (Set_Field_Init_Hook);
+
+  --  |
+   procedure Set_Field_Term_Hook (Frm  : in Form;
+                                  Proc : in Form_Hook_Function);
+  --  AKA: set_field_term()
+   pragma Inline (Set_Field_Term_Hook);
+
+  --  |
+   procedure Set_Form_Init_Hook (Frm  : in Form;
+                                 Proc : in Form_Hook_Function);
+  --  AKA: set_form_init()
+   pragma Inline (Set_Form_Init_Hook);
+
+  --  |
+   procedure Set_Form_Term_Hook (Frm  : in Form;
+                                 Proc : in Form_Hook_Function);
+  --  AKA: set_form_term()
+   pragma Inline (Set_Form_Term_Hook);
+
+  --  |
+   function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function;
+  --  AKA: field_init()
+   pragma Import (C, Get_Field_Init_Hook, "field_init");
+
+  --  |
+   function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function;
+  --  AKA: field_term()
+   pragma Import (C, Get_Field_Term_Hook, "field_term");
+
+  --  |
+   function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function;
+  --  AKA: form_init()
+   pragma Import (C, Get_Form_Init_Hook, "form_init");
+
+  --  |
+   function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function;
+  --  AKA: form_term()
+   pragma Import (C, Get_Form_Term_Hook, "form_term");
+
+  --  |=====================================================================
+  --  | Man page form_field.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Redefine (Frm  : in Form;
+                       Flds : in Field_Array_Access);
+  --  AKA: set_form_fields()
+   pragma Inline (Redefine);
+
+  --  |
+   procedure Set_Fields (Frm  : in Form;
+                         Flds : in Field_Array_Access) renames Redefine;
+  --  AKA: set_form_fields()
+   pragma Inline (Set_Fields);
+
+  --  |
+   function Fields (Frm   : Form;
+                    Index : Positive) return Field;
+  --  AKA: form_fields()
+   pragma Inline (Fields);
+
+  --  |
+   function Field_Count (Frm : Form) return Natural;
+  --  AKA: field_count()
+   pragma Inline (Field_Count);
+
+  --  |
+   procedure Move (Fld    : in Field;
+                   Line   : in Line_Position;
+                   Column : in Column_Position);
+  --  AKA: move_field()
+   pragma Inline (Move);
+
+  --  |=====================================================================
+  --  | Man page form_new.3x
+  --  |=====================================================================
+
+  --  |
+   function Create (Fields : Field_Array_Access) return Form;
+  --  AKA: new_form()
+   pragma Inline (Create);
+
+  --  |
+   function New_Form (Fields : Field_Array_Access) return Form
+     renames Create;
+  --  AKA: new_form()
+   pragma Inline (New_Form);
+
+  --  |
+   procedure Delete (Frm : in out Form);
+  --  AKA: free_form()
+  --  Reset Frm to Null_Form
+   pragma Inline (Delete);
+
+  --  |=====================================================================
+  --  | Man page form_opts.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Options (Frm     : in Form;
+                          Options : in Form_Option_Set);
+  --  AKA: set_form_opts()
+   pragma Inline (Set_Options);
+
+  --  |
+   procedure Switch_Options (Frm     : in Form;
+                             Options : in Form_Option_Set;
+                             On      : Boolean := True);
+  --  AKA: form_opts_on()
+  --  AKA: form_opts_off()
+   pragma Inline (Switch_Options);
+
+  --  |
+   procedure Get_Options (Frm     : in  Form;
+                          Options : out Form_Option_Set);
+  --  AKA: form_opts()
+
+  --  |
+   function Get_Options (Frm : Form := Null_Form) return Form_Option_Set;
+  --  AKA: form_opts()
+   pragma Inline (Get_Options);
+
+  --  |=====================================================================
+  --  | Man page form_post.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Post (Frm  : in Form;
+                   Post : in Boolean := True);
+  --  AKA: post_form()
+  --  AKA: unpost_form()
+   pragma Inline (Post);
+
+  --  |=====================================================================
+  --  | Man page form_cursor.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Position_Cursor (Frm : Form);
+  --  AKA: pos_form_cursor()
+   pragma Inline (Position_Cursor);
+
+  --  |=====================================================================
+  --  | Man page form_data.3x
+  --  |=====================================================================
+
+  --  |
+   function Data_Ahead (Frm : Form) return Boolean;
+  --  AKA: data_ahead()
+   pragma Inline (Data_Ahead);
+
+  --  |
+   function Data_Behind (Frm : Form) return Boolean;
+  --  AKA: data_behind()
+   pragma Inline (Data_Behind);
+
+  --  |=====================================================================
+  --  | Man page form_driver.3x
+  --  |=====================================================================
+
+   type Driver_Result is (Form_Ok,
+                          Request_Denied,
+                          Unknown_Request,
+                          Invalid_Field);
+
+  --  |
+   function Driver (Frm : Form;
+                    Key : Key_Code) return Driver_Result;
+  --  AKA: form_driver()
+  --  Driver not inlined
+
+  --  |=====================================================================
+  --  | Man page form_page.3x
+  --  |=====================================================================
+
+   type Page_Number is new Natural;
+
+  --  |
+   procedure Set_Current (Frm : in Form;
+                          Fld : in Field);
+  --  AKA: set_current_field()
+   pragma Inline (Set_Current);
+
+  --  |
+   function Current (Frm : in Form) return Field;
+  --  AKA: current_field()
+   pragma Inline (Current);
+
+  --  |
+   procedure Set_Page (Frm  : in Form;
+                       Page : in Page_Number := Page_Number'First);
+  --  AKA: set_form_page()
+   pragma Inline (Set_Page);
+
+  --  |
+   function Page (Frm : Form) return Page_Number;
+  --  AKA: form_page()
+   pragma Inline (Page);
+
+  --  |
+   function Get_Index (Fld : Field) return Positive;
+  --  AKA: field_index()
+  --  Please note that in this binding we start the numbering of fields
+  --  with 1. So this is number is one more than you get from the low
+  --  level call.
+   pragma Inline (Get_Index);
+
+  --  |=====================================================================
+  --  | Man page form_new_page.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_New_Page (Fld      : in Field;
+                           New_Page : in Boolean := True);
+  --  AKA: set_new_page()
+   pragma Inline (Set_New_Page);
+
+  --  |
+   function Is_New_Page (Fld : Field) return Boolean;
+  --  AKA: new_page()
+   pragma Inline (Is_New_Page);
+
+------------------------------------------------------------------------------
+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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm b/Ada95/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm new file mode 100644 index 00000000..fb485736 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm @@ -0,0 +1,80 @@ +terminal_interface-curses-menus-item_user_data.ads + +

File : terminal_interface-curses-menus-item_user_data.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Menus.Item_User_Data             --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access User;
+package Terminal_Interface.Curses.Menus.Item_User_Data is
+   pragma Preelaborate (Terminal_Interface.Curses.Menus.Item_User_Data);
+
+  --  The binding uses the same user pointer for menu items
+  --  as the low level C implementation. So you can safely
+  --  read or write the user pointer also with the C routines
+  --
+  --  |=====================================================================
+  --  | Man page mitem_userptr.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_User_Data (Itm  : in Item;
+                            Data : in User_Access);
+  --  AKA: set_item_userptr
+   pragma Inline (Set_User_Data);
+
+  --  |
+   procedure Get_User_Data (Itm  : in  Item;
+                            Data : out User_Access);
+  --  AKA: item_userptr
+
+  --  |
+   function Get_User_Data (Itm  : in  Item) return User_Access;
+  --  AKA: item_userptr
+  --  Same as function
+   pragma Inline (Get_User_Data);
+
+end Terminal_Interface.Curses.Menus.Item_User_Data;
+
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm b/Ada95/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm new file mode 100644 index 00000000..b1dc8a0b --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm @@ -0,0 +1,75 @@ +terminal_interface-curses-menus-menu_user_data.ads + +

File : terminal_interface-curses-menus-menu_user_data.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Menus.Menu_User_Data             --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access User;
+package Terminal_Interface.Curses.Menus.Menu_User_Data is
+   pragma Preelaborate (Terminal_Interface.Curses.Menus.Menu_User_Data);
+
+  --  |=====================================================================
+  --  | Man page menu_userptr.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_User_Data (Men  : in Menu;
+                            Data : in User_Access);
+  --  AKA: set_menu_userptr
+   pragma Inline (Set_User_Data);
+
+  --  |
+   procedure Get_User_Data (Men  : in  Menu;
+                            Data : out User_Access);
+  --  AKA: menu_userptr
+
+  --  |
+   function Get_User_Data (Men  : in  Menu) return User_Access;
+  --  AKA: menu_userptr
+  --  Same as function
+   pragma Inline (Get_User_Data);
+
+end Terminal_Interface.Curses.Menus.Menu_User_Data;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-menus__ads.htm b/Ada95/html/ada/terminal_interface-curses-menus__ads.htm new file mode 100644 index 00000000..13256b4f --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-menus__ads.htm @@ -0,0 +1,675 @@ +terminal_interface-curses-menus.ads + +

File : terminal_interface-curses-menus.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Menu                      --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.19 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+--  menu binding.
+--  This module is generated. Please don't change it manually!
+--  Run the generator instead.
+--  |
+with System;
+with Interfaces.C;
+with Ada.Characters.Latin_1;
+
+package Terminal_Interface.Curses.Menus is
+   pragma Preelaborate (Terminal_Interface.Curses.Menus);
+   pragma Linker_Options ("-lmenu");
+   pragma Linker_Options ("-lAdaCurses");
+   pragma Linker_Options ("-lncurses");
+
+   Space : Character renames Ada.Characters.Latin_1.Space;
+
+   type Item is private;
+   type Menu is private;
+
+  ---------------------------
+  --  Interface constants  --
+  ---------------------------
+   Null_Item : constant Item;
+   Null_Menu : constant Menu;
+
+   subtype Menu_Request_Code is Key_Code
+     range (Key_Max + 1) .. (Key_Max + 17);
+
+  --  The prefix M_ stands for "Menu Request"
+   M_Left_Item       : constant Menu_Request_Code := Key_Max + 1;
+   M_Right_Item      : constant Menu_Request_Code := Key_Max + 2;
+   M_Up_Item         : constant Menu_Request_Code := Key_Max + 3;
+   M_Down_Item       : constant Menu_Request_Code := Key_Max + 4;
+   M_ScrollUp_Line   : constant Menu_Request_Code := Key_Max + 5;
+   M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6;
+   M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7;
+   M_ScrollUp_Page   : constant Menu_Request_Code := Key_Max + 8;
+   M_First_Item      : constant Menu_Request_Code := Key_Max + 9;
+   M_Last_Item       : constant Menu_Request_Code := Key_Max + 10;
+   M_Next_Item       : constant Menu_Request_Code := Key_Max + 11;
+   M_Previous_Item   : constant Menu_Request_Code := Key_Max + 12;
+   M_Toggle_Item     : constant Menu_Request_Code := Key_Max + 13;
+   M_Clear_Pattern   : constant Menu_Request_Code := Key_Max + 14;
+   M_Back_Pattern    : constant Menu_Request_Code := Key_Max + 15;
+   M_Next_Match      : constant Menu_Request_Code := Key_Max + 16;
+   M_Previous_Match  : constant Menu_Request_Code := Key_Max + 17;
+
+  --  For those who like the old 'C' names for the request codes
+   REQ_LEFT_ITEM     : Menu_Request_Code renames M_Left_Item;
+   REQ_RIGHT_ITEM    : Menu_Request_Code renames M_Right_Item;
+   REQ_UP_ITEM       : Menu_Request_Code renames M_Up_Item;
+   REQ_DOWN_ITEM     : Menu_Request_Code renames M_Down_Item;
+   REQ_SCR_ULINE     : Menu_Request_Code renames M_ScrollUp_Line;
+   REQ_SCR_DLINE     : Menu_Request_Code renames M_ScrollDown_Line;
+   REQ_SCR_DPAGE     : Menu_Request_Code renames M_ScrollDown_Page;
+   REQ_SCR_UPAGE     : Menu_Request_Code renames M_ScrollUp_Page;
+   REQ_FIRST_ITEM    : Menu_Request_Code renames M_First_Item;
+   REQ_LAST_ITEM     : Menu_Request_Code renames M_Last_Item;
+   REQ_NEXT_ITEM     : Menu_Request_Code renames M_Next_Item;
+   REQ_PREV_ITEM     : Menu_Request_Code renames M_Previous_Item;
+   REQ_TOGGLE_ITEM   : Menu_Request_Code renames M_Toggle_Item;
+   REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern;
+   REQ_BACK_PATTERN  : Menu_Request_Code renames M_Back_Pattern;
+   REQ_NEXT_MATCH    : Menu_Request_Code renames M_Next_Match;
+   REQ_PREV_MATCH    : Menu_Request_Code renames M_Previous_Match;
+
+   procedure Request_Name (Key  : 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);
+   type Menu_Option_Set is
+      record
+         One_Valued        : Boolean;
+         Show_Descriptions : Boolean;
+         Row_Major_Order   : Boolean;
+         Ignore_Case       : Boolean;
+         Show_Matches      : Boolean;
+         Non_Cyclic        : Boolean;
+      end record;
+   pragma Pack (Menu_Option_Set);
+   pragma Convention (C, Menu_Option_Set);
+
+   for Menu_Option_Set use
+      record
+         One_Valued        at 0 range  0 ..  0;
+         Show_Descriptions at 0 range  1 ..  1;
+         Row_Major_Order   at 0 range  2 ..  2;
+         Ignore_Case       at 0 range  3 ..  3;
+         Show_Matches      at 0 range  4 ..  4;
+         Non_Cyclic        at 0 range  5 ..  5;
+      end record;
+   for Menu_Option_Set'Size use 32;
+  --  Please note: this rep. clause is generated and may be
+  --               different on your system.
+   pragma Warnings (On);
+
+   function Default_Menu_Options return Menu_Option_Set;
+  --  Initial default options for a menu.
+   pragma Inline (Default_Menu_Options);
+  --
+  --  Item options
+  --
+   pragma Warnings (Off);
+   type Item_Option_Set is
+      record
+         Selectable  : Boolean;
+      end record;
+   pragma Pack (Item_Option_Set);
+   pragma Convention (C, Item_Option_Set);
+
+   for Item_Option_Set use
+      record
+         Selectable  at 0 range  0 ..  0;
+      end record;
+   for Item_Option_Set'Size use 32;
+  --  Please note: this rep. clause is generated and may be
+  --               different on your system.
+   pragma Warnings (On);
+
+   function Default_Item_Options return Item_Option_Set;
+  --  Initial default options for an item.
+   pragma Inline (Default_Item_Options);
+
+  --
+  --  Item Array
+  --
+   type Item_Array is array (Positive range <>) of aliased Item;
+   pragma Convention (C, Item_Array);
+
+   type Item_Array_Access is access Item_Array;
+
+   procedure Free (IA         : in out Item_Array_Access;
+                   Free_Items : Boolean := False);
+  --  Release the memory for an allocated item array
+  --  If Free_Items is True, call Delete() for all the items in
+  --  the array.
+
+  --  |=====================================================================
+  --  | Man page mitem_new.3x
+  --  |=====================================================================
+
+  --  |
+   function Create (Name        : String;
+                    Description : String := "") return Item;
+  --  AKA: new_item()
+  --  Not inlined.
+
+  --  |
+   function New_Item (Name        : String;
+                      Description : String := "") return Item
+     renames Create;
+  --  AKA: new_item()
+
+  --  |
+   procedure Delete (Itm : in out Item);
+  --  AKA: free_item()
+  --  Resets Itm to Null_Item
+
+  --  |=====================================================================
+  --  | Man page mitem_value.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Value (Itm   : in Item;
+                        Value : in Boolean := True);
+  --  AKA: set_item_value()
+   pragma Inline (Set_Value);
+
+  --  |
+   function Value (Itm : Item) return Boolean;
+  --  AKA: item_value()
+   pragma Inline (Value);
+
+  --  |=====================================================================
+  --  | Man page mitem_visible.3x
+  --  |=====================================================================
+
+  --  |
+   function Visible (Itm : Item) return Boolean;
+  --  AKA: item_visible()
+   pragma Inline (Visible);
+
+  --  |=====================================================================
+  --  | Man page mitem_opts.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Options (Itm     : in Item;
+                          Options : in Item_Option_Set);
+  --  AKA: set_item_opts()
+  --  An overloaded Set_Options is defined later. Pragma Inline appears there
+
+  --  |
+   procedure Switch_Options (Itm     : in Item;
+                             Options : in Item_Option_Set;
+                             On      : Boolean := True);
+  --  AKA: item_opts_on()
+  --  AKA: item_opts_off()
+  --  An overloaded Switch_Options is defined later.
+  --  Pragma Inline appears there
+
+  --  |
+   procedure Get_Options (Itm     : in  Item;
+                          Options : out Item_Option_Set);
+  --  AKA: item_opts()
+
+  --  |
+   function Get_Options (Itm : Item := Null_Item) return Item_Option_Set;
+  --  AKA: item_opts()
+  --  An overloaded Get_Options is defined later. Pragma Inline appears there
+
+  --  |=====================================================================
+  --  | Man page mitem_name.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Name (Itm  : in Item;
+                   Name : out String);
+  --  AKA: item_name()
+   function  Name (Itm : Item) return String;
+  --  AKA: item_name()
+  --  Implemented as function
+   pragma Inline (Name);
+
+  --  |
+   procedure Description (Itm         : in Item;
+                          Description : out String);
+  --  AKA: item_description();
+
+   function  Description (Itm : Item) return String;
+  --  AKA: item_description();
+  --  Implemented as function
+   pragma Inline (Description);
+
+  --  |=====================================================================
+  --  | Man page mitem_current.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Current (Men : in Menu;
+                          Itm : in Item);
+  --  AKA: set_current_item()
+   pragma Inline (Set_Current);
+
+  --  |
+   function Current (Men : Menu) return Item;
+  --  AKA: current_item()
+   pragma Inline (Current);
+
+  --  |
+   procedure Set_Top_Row (Men  : in Menu;
+                          Line : in Line_Position);
+  --  AKA: set_top_row()
+   pragma Inline (Set_Top_Row);
+
+  --  |
+   function Top_Row (Men : Menu) return Line_Position;
+  --  AKA: top_row()
+   pragma Inline (Top_Row);
+
+  --  |
+   function Get_Index (Itm : Item) return Positive;
+  --  AKA: item_index()
+  --  Please note that in this binding we start the numbering of items
+  --  with 1. So this is number is one more than you get from the low
+  --  level call.
+   pragma Inline (Get_Index);
+
+  --  |=====================================================================
+  --  | Man page menu_post.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Post (Men  : in Menu;
+                   Post : in Boolean := True);
+  --  AKA: post_menu()
+  --  AKA: unpost_menu()
+   pragma Inline (Post);
+
+  --  |=====================================================================
+  --  | Man page menu_opts.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Options (Men     : in Menu;
+                          Options : in Menu_Option_Set);
+  --  AKA: set_menu_opts()
+   pragma Inline (Set_Options);
+
+  --  |
+   procedure Switch_Options (Men     : in Menu;
+                             Options : in Menu_Option_Set;
+                             On      : Boolean := True);
+  --  AKA: menu_opts_on()
+  --  AKA: menu_opts_off()
+   pragma Inline (Switch_Options);
+
+  --  |
+   procedure Get_Options (Men     : in  Menu;
+                          Options : out Menu_Option_Set);
+  --  AKA: menu_opts()
+
+  --  |
+   function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set;
+  --  AKA: menu_opts()
+   pragma Inline (Get_Options);
+
+  --  |=====================================================================
+  --  | Man page menu_win.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Window (Men : in Menu;
+                         Win : in Window);
+  --  AKA: set_menu_win()
+   pragma Inline (Set_Window);
+
+  --  |
+   function Get_Window (Men : Menu) return Window;
+  --  AKA: menu_win()
+   pragma Inline (Get_Window);
+
+  --  |
+   procedure Set_Sub_Window (Men : in Menu;
+                             Win : in Window);
+  --  AKA: set_menu_sub()
+   pragma Inline (Set_Sub_Window);
+
+  --  |
+   function Get_Sub_Window (Men : Menu) return Window;
+  --  AKA: menu_sub()
+   pragma Inline (Get_Sub_Window);
+
+  --  |
+   procedure Scale (Men     : in Menu;
+                    Lines   : out Line_Count;
+                    Columns : out Column_Count);
+  --  AKA: scale_menu()
+   pragma Inline (Scale);
+
+  --  |=====================================================================
+  --  | Man page menu_cursor.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Position_Cursor (Men : Menu);
+  --  AKA: pos_menu_cursor()
+   pragma Inline (Position_Cursor);
+
+  --  |=====================================================================
+  --  | Man page menu_mark.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Mark (Men  : in Menu;
+                       Mark : in String);
+  --  AKA: set_menu_mark()
+   pragma Inline (Set_Mark);
+
+  --  |
+   procedure Mark (Men  : in  Menu;
+                   Mark : out String);
+  --  AKA: menu_mark()
+
+   function  Mark (Men : Menu) return String;
+  --  AKA: menu_mark()
+  --  Implemented as function
+   pragma Inline (Mark);
+
+  --  |=====================================================================
+  --  | Man page menu_attribs.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Foreground
+     (Men   : in Menu;
+      Fore  : in Character_Attribute_Set := Normal_Video;
+      Color : in Color_Pair := Color_Pair'First);
+  --  AKA: set_menu_fore()
+   pragma Inline (Set_Foreground);
+
+  --  |
+   procedure Foreground (Men   : in  Menu;
+                         Fore  : out Character_Attribute_Set);
+  --  AKA: menu_fore()
+
+  --  |
+   procedure Foreground (Men   : in  Menu;
+                         Fore  : out Character_Attribute_Set;
+                         Color : out Color_Pair);
+  --  AKA: menu_fore()
+   pragma Inline (Foreground);
+
+  --  |
+   procedure Set_Background
+     (Men   : in Menu;
+      Back  : in Character_Attribute_Set := Normal_Video;
+      Color : in Color_Pair := Color_Pair'First);
+  --  AKA: set_menu_back()
+   pragma Inline (Set_Background);
+
+  --  |
+   procedure Background (Men  : in  Menu;
+                         Back : out Character_Attribute_Set);
+  --  AKA: menu_back()
+  --  |
+
+   procedure Background (Men   : in  Menu;
+                         Back  : out Character_Attribute_Set;
+                         Color : out Color_Pair);
+  --  AKA: menu_back()
+   pragma Inline (Background);
+
+  --  |
+   procedure Set_Grey
+     (Men   : in Menu;
+      Grey  : in Character_Attribute_Set := Normal_Video;
+      Color : in Color_Pair := Color_Pair'First);
+  --  AKA: set_menu_grey()
+   pragma Inline (Set_Grey);
+
+  --  |
+   procedure Grey (Men  : in  Menu;
+                   Grey : out Character_Attribute_Set);
+  --  AKA: menu_grey()
+
+  --  |
+   procedure Grey
+     (Men   : in  Menu;
+      Grey  : out Character_Attribute_Set;
+      Color : out Color_Pair);
+  --  AKA: menu_grey()
+   pragma Inline (Grey);
+
+  --  |
+   procedure Set_Pad_Character (Men : in Menu;
+                                Pad : in Character := Space);
+  --  AKA: set_menu_pad()
+   pragma Inline (Set_Pad_Character);
+
+  --  |
+   procedure Pad_Character (Men : in  Menu;
+                            Pad : out Character);
+  --  AKA: menu_pad()
+   pragma Inline (Pad_Character);
+
+  --  |=====================================================================
+  --  | Man page menu_spacing.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Spacing (Men   : in Menu;
+                          Descr : in Column_Position := 0;
+                          Row   : in Line_Position   := 0;
+                          Col   : in Column_Position := 0);
+  --  AKA: set_menu_spacing()
+   pragma Inline (Set_Spacing);
+
+  --  |
+   procedure Spacing (Men   : in Menu;
+                      Descr : out Column_Position;
+                      Row   : out Line_Position;
+                      Col   : out Column_Position);
+  --  AKA: menu_spacing()
+   pragma Inline (Spacing);
+
+  --  |=====================================================================
+  --  | Man page menu_pattern.3x
+  --  |=====================================================================
+
+  --  |
+   function Set_Pattern (Men  : Menu;
+                         Text : String) return Boolean;
+  --  AKA: set_menu_pattern()
+  --  Return TRUE if the pattern matches, FALSE otherwise
+   pragma Inline (Set_Pattern);
+
+  --  |
+   procedure Pattern (Men  : in  Menu;
+                      Text : out String);
+  --  AKA: menu_pattern()
+   pragma Inline (Pattern);
+
+  --  |=====================================================================
+  --  | Man page menu_format.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Format (Men     : in Menu;
+                         Lines   : in Line_Count;
+                         Columns : in Column_Count);
+  --  AKA: set_menu_format()
+   pragma Inline (Set_Format);
+
+  --  |
+   procedure Format (Men     : in  Menu;
+                     Lines   : out Line_Count;
+                     Columns : out Column_Count);
+  --  AKA: menu_format()
+   pragma Inline (Format);
+
+  --  |=====================================================================
+  --  | Man page menu_hook.3x
+  --  |=====================================================================
+
+   type Menu_Hook_Function is access procedure (Men : in Menu);
+   pragma Convention (C, Menu_Hook_Function);
+
+  --  |
+   procedure Set_Item_Init_Hook (Men  : in Menu;
+                                 Proc : in Menu_Hook_Function);
+  --  AKA: set_item_init()
+   pragma Inline (Set_Item_Init_Hook);
+
+  --  |
+   procedure Set_Item_Term_Hook (Men  : in Menu;
+                                 Proc : in Menu_Hook_Function);
+  --  AKA: set_item_term()
+   pragma Inline (Set_Item_Term_Hook);
+
+  --  |
+   procedure Set_Menu_Init_Hook (Men  : in Menu;
+                                 Proc : in Menu_Hook_Function);
+  --  AKA: set_menu_init()
+   pragma Inline (Set_Menu_Init_Hook);
+
+  --  |
+   procedure Set_Menu_Term_Hook (Men  : in Menu;
+                                 Proc : in Menu_Hook_Function);
+  --  AKA: set_menu_term()
+   pragma Inline (Set_Menu_Term_Hook);
+
+  --  |
+   function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function;
+  --  AKA: item_init()
+   pragma Inline (Get_Item_Init_Hook);
+
+  --  |
+   function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function;
+  --  AKA: item_term()
+   pragma Inline (Get_Item_Term_Hook);
+
+  --  |
+   function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function;
+  --  AKA: menu_init()
+   pragma Inline (Get_Menu_Init_Hook);
+
+  --  |
+   function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function;
+  --  AKA: menu_term()
+   pragma Inline (Get_Menu_Term_Hook);
+
+  --  |=====================================================================
+  --  | Man page menu_items.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Redefine (Men   : in Menu;
+                       Items : in Item_Array_Access);
+  --  AKA: set_menu_items()
+   pragma Inline (Redefine);
+
+   procedure Set_Items (Men   : in Menu;
+                        Items : in Item_Array_Access) renames Redefine;
+   pragma Inline (Set_Items);
+
+  --  |
+   function Items (Men   : Menu;
+                   Index : Positive) return Item;
+  --  AKA: menu_items()
+   pragma Inline (Items);
+
+  --  |
+   function Item_Count (Men : Menu) return Natural;
+  --  AKA: item_count()
+   pragma Inline (Item_Count);
+
+  --  |=====================================================================
+  --  | Man page menu_new.3x
+  --  |=====================================================================
+
+  --  |
+   function Create (Items : Item_Array_Access) return Menu;
+  --  AKA: new_menu()
+  --  Not inlined
+
+   function New_Menu (Items : Item_Array_Access) return Menu renames Create;
+
+  --  |
+   procedure Delete (Men : in out Menu);
+  --  AKA: free_menu()
+  --  Reset Men to Null_Menu
+  --  Not inlined
+
+  --  |=====================================================================
+  --  | Man page menu_new.3x
+  --  |=====================================================================
+
+   type Driver_Result is (Menu_Ok,
+                          Request_Denied,
+                          Unknown_Request,
+                          No_Match);
+
+  --  |
+   function Driver (Men : Menu;
+                    Key : Key_Code) return Driver_Result;
+  --  AKA: menu_driver()
+  --  Driver is not inlined
+
+-------------------------------------------------------------------------------
+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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-mouse__ads.htm b/Ada95/html/ada/terminal_interface-curses-mouse__ads.htm new file mode 100644 index 00000000..4ebdcd8c --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-mouse__ads.htm @@ -0,0 +1,225 @@ +terminal_interface-curses-mouse.ads + +

File : terminal_interface-curses-mouse.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Mouse                     --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.18 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+--  mouse binding.
+--  This module is generated. Please don't change it manually!
+--  Run the generator instead.
+--  |
+with System;
+
+package Terminal_Interface.Curses.Mouse is
+   pragma Preelaborate (Terminal_Interface.Curses.Mouse);
+
+  --  |=====================================================================
+  --  | Man page curs_mouse.3x
+  --  |=====================================================================
+  --  Please note, that in ncurses-1.9.9e documentation mouse support
+  --  is still marked as experimental. So also this binding will change
+  --  if the ncurses methods change.
+  --
+   type Event_Mask is private;
+   No_Events  : constant Event_Mask;
+   All_Events : constant Event_Mask;
+
+   type Mouse_Button is (Left,    -- aka: Button 1
+                         Middle,  -- aka: Button 2
+                         Right,   -- aka: Button 3
+                         Button4, -- aka: Button 4
+                         Control, -- Control Key
+                         Shift,   -- Shift Key
+                         Alt);    -- ALT Key
+
+   subtype Real_Buttons  is Mouse_Button range Left .. Button4;
+   subtype Modifier_Keys is Mouse_Button range Control .. Alt;
+
+   type Button_State is (Released,
+                         Pressed,
+                         Clicked,
+                         Double_Clicked,
+                         Triple_Clicked);
+
+   type Button_States is array (Button_State) of Boolean;
+   pragma Pack (Button_States);
+
+   All_Clicks : constant Button_States := (Clicked .. Triple_Clicked => True,
+                                           others => False);
+   All_States : constant Button_States := (others => True);
+
+   type Mouse_Event is private;
+
+  --  |=====================================================================
+  --  | Man page curs_mouse.3x
+  --  |=====================================================================
+
+   function Has_Mouse return Boolean;
+  --  Return true if a mouse device is supported, false otherwise.
+
+   procedure Register_Reportable_Event
+     (Button : 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
+
+  --  |
+  --  There is one difference to mousmask(): we return the value of the
+  --  old mask, that means the event mask value before this call.
+   function Start_Mouse (Mask : Event_Mask := All_Events)
+                         return Event_Mask;
+  --  AKA: mousemask()
+   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);
+
+  --  |
+   function Get_Mouse return Mouse_Event;
+  --  AKA: getmouse()
+   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.
+   pragma Inline (Get_Event);
+
+  --  |
+   procedure Unget_Mouse (Event : in Mouse_Event);
+  --  AKA: ungetmouse()
+   pragma Inline (Unget_Mouse);
+
+  --  |
+   function Enclosed_In_Window (Win    : Window := Standard_Window;
+                                Event  : Mouse_Event) return Boolean;
+  --  AKA: wenclose()
+  --  But : use event instead of screen coordinates.
+   pragma Inline (Enclosed_In_Window);
+
+  --  |
+   function Mouse_Interval (Msec : Natural := 200) return Natural;
+  --  AKA: mouseinterval()
+   pragma Inline (Mouse_Interval);
+
+private
+   type Event_Mask is new Interfaces.C.unsigned_long;
+
+   type Mouse_Event is
+      record
+         Id      : Integer range Integer (Interfaces.C.short'First) ..
+                                 Integer (Interfaces.C.short'Last);
+         X, Y, Z : Integer range Integer (Interfaces.C.int'First) ..
+                                 Integer (Interfaces.C.int'Last);
+         Bstate  : Event_Mask;
+      end record;
+   pragma Convention (C, Mouse_Event);
+   pragma Pack (Mouse_Event);
+
+   for Mouse_Event use
+      record
+         Id      at 0 range   0 ..  15;
+         X       at 0 range  32 ..  63;
+         Y       at 0 range  64 ..  95;
+         Z       at 0 range  96 .. 127;
+         Bstate  at 0 range 128 .. 159;
+      end record;
+     --  Please note: this rep. clause is generated and may be
+     --               different on your system.
+
+   Generation_Bit_Order : constant System.Bit_Order := System.Low_Order_First;
+  --  This constant may be different on your system.
+
+   BUTTON1_RELEASED          : constant Event_Mask := 8#00000000001#;
+   BUTTON1_PRESSED           : constant Event_Mask := 8#00000000002#;
+   BUTTON1_CLICKED           : constant Event_Mask := 8#00000000004#;
+   BUTTON1_DOUBLE_CLICKED    : constant Event_Mask := 8#00000000010#;
+   BUTTON1_TRIPLE_CLICKED    : constant Event_Mask := 8#00000000020#;
+   BUTTON1_RESERVED_EVENT    : constant Event_Mask := 8#00000000040#;
+   BUTTON2_RELEASED          : constant Event_Mask := 8#00000000100#;
+   BUTTON2_PRESSED           : constant Event_Mask := 8#00000000200#;
+   BUTTON2_CLICKED           : constant Event_Mask := 8#00000000400#;
+   BUTTON2_DOUBLE_CLICKED    : constant Event_Mask := 8#00000001000#;
+   BUTTON2_TRIPLE_CLICKED    : constant Event_Mask := 8#00000002000#;
+   BUTTON2_RESERVED_EVENT    : constant Event_Mask := 8#00000004000#;
+   BUTTON3_RELEASED          : constant Event_Mask := 8#00000010000#;
+   BUTTON3_PRESSED           : constant Event_Mask := 8#00000020000#;
+   BUTTON3_CLICKED           : constant Event_Mask := 8#00000040000#;
+   BUTTON3_DOUBLE_CLICKED    : constant Event_Mask := 8#00000100000#;
+   BUTTON3_TRIPLE_CLICKED    : constant Event_Mask := 8#00000200000#;
+   BUTTON3_RESERVED_EVENT    : constant Event_Mask := 8#00000400000#;
+   BUTTON4_RELEASED          : constant Event_Mask := 8#00001000000#;
+   BUTTON4_PRESSED           : constant Event_Mask := 8#00002000000#;
+   BUTTON4_CLICKED           : constant Event_Mask := 8#00004000000#;
+   BUTTON4_DOUBLE_CLICKED    : constant Event_Mask := 8#00010000000#;
+   BUTTON4_TRIPLE_CLICKED    : constant Event_Mask := 8#00020000000#;
+   BUTTON4_RESERVED_EVENT    : constant Event_Mask := 8#00040000000#;
+   BUTTON_CTRL               : constant Event_Mask := 8#00100000000#;
+   BUTTON_SHIFT              : constant Event_Mask := 8#00200000000#;
+   BUTTON_ALT                : constant Event_Mask := 8#00400000000#;
+   ALL_MOUSE_EVENTS          : constant Event_Mask := 8#00777777777#;
+   BUTTON1_EVENTS            : constant Event_Mask := 8#00000000077#;
+   BUTTON2_EVENTS            : constant Event_Mask := 8#00000007700#;
+   BUTTON3_EVENTS            : constant Event_Mask := 8#00000770000#;
+   BUTTON4_EVENTS            : constant Event_Mask := 8#00077000000#;
+
+
+   No_Events  : constant Event_Mask := 0;
+   All_Events : constant Event_Mask := ALL_MOUSE_EVENTS;
+
+end Terminal_Interface.Curses.Mouse;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-panels-user_data__ads.htm b/Ada95/html/ada/terminal_interface-curses-panels-user_data__ads.htm new file mode 100644 index 00000000..e5f370c4 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-panels-user_data__ads.htm @@ -0,0 +1,75 @@ +terminal_interface-curses-panels-user_data.ads + +

File : terminal_interface-curses-panels-user_data.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                 Terminal_Interface.Curses.Panels.User_Data               --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access all User;
+package Terminal_Interface.Curses.Panels.User_Data is
+   pragma Preelaborate (Terminal_Interface.Curses.Panels.User_Data);
+
+  --  |=====================================================================
+  --  | Man page panel.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_User_Data (Pan  : in Panel;
+                            Data : in User_Access);
+  --  AKA: set_panel_userptr
+   pragma Inline (Set_User_Data);
+
+  --  |
+   procedure Get_User_Data (Pan  : in  Panel;
+                            Data : out User_Access);
+  --  AKA: panel_userptr
+
+  --  |
+   function Get_User_Data (Pan  : in  Panel) return User_Access;
+  --  AKA: panel_userptr
+  --  Same as function
+   pragma Inline (Get_User_Data);
+
+end Terminal_Interface.Curses.Panels.User_Data;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-panels__ads.htm b/Ada95/html/ada/terminal_interface-curses-panels__ads.htm new file mode 100644 index 00000000..2896c401 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-panels__ads.htm @@ -0,0 +1,153 @@ +terminal_interface-curses-panels.ads + +

File : terminal_interface-curses-panels.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Panels                    --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.13 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+with System;
+
+package Terminal_Interface.Curses.Panels is
+   pragma Preelaborate (Terminal_Interface.Curses.Panels);
+   pragma Linker_Options ("-lpanel");
+   pragma Linker_Options ("-lAdaCurses");
+   pragma Linker_Options ("-lncurses");
+
+   type Panel is private;
+
+  ---------------------------
+  --  Interface constants  --
+  ---------------------------
+   Null_Panel : constant Panel;
+
+  -------------------
+  --  Exceptions   --
+  -------------------
+
+   Panel_Exception : exception;
+
+  --  |=====================================================================
+  --  | Man page panel.3x
+  --  |=====================================================================
+
+  --  |
+   function Create (Win : Window) return Panel;
+  --  AKA: new_panel()
+   pragma Inline (Create);
+
+  --  |
+   function New_Panel (Win : Window) return Panel renames Create;
+  --  AKA: new_panel()
+   pragma Inline (New_Panel);
+
+  --  |
+   procedure Bottom (Pan : in Panel);
+  --  AKA: bottom_panel()
+   pragma Inline (Bottom);
+
+  --  |
+   procedure Top (Pan : in Panel);
+  --  AKA: top_panel()
+   pragma Inline (Top);
+
+  --  |
+   procedure Show (Pan : in Panel);
+  --  AKA: show_panel()
+   pragma Inline (Show);
+
+  --  |
+   procedure Update_Panels;
+  --  AKA: update_panels()
+   pragma Import (C, Update_Panels, "update_panels");
+
+  --  |
+   procedure Hide (Pan : in Panel);
+  --  AKA: hide_panel()
+   pragma Inline (Hide);
+
+  --  |
+   function Get_Window (Pan : Panel) return Window;
+  --  AKA: panel_window()
+   pragma Inline (Get_Window);
+
+  --  |
+   function Panel_Window (Pan : Panel) return Window renames Get_Window;
+   pragma Inline (Panel_Window);
+
+  --  |
+   procedure Replace (Pan : in Panel;
+                      Win : in Window);
+  --  AKA: replace_panel()
+   pragma Inline (Replace);
+
+  --  |
+   procedure Move (Pan    : in Panel;
+                   Line   : in Line_Position;
+                   Column : in Column_Position);
+  --  AKA: move_panel()
+   pragma Inline (Move);
+
+  --  |
+   function Is_Hidden (Pan : Panel) return Boolean;
+  --  AKA: panel_hidden()
+   pragma Inline (Is_Hidden);
+
+  --  |
+   function Above (Pan : Panel) return Panel;
+  --  AKA: panel_above()
+   pragma Import (C, Above, "panel_above");
+
+  --  |
+   function Below (Pan : Panel) return Panel;
+  --  AKA: panel_below()
+   pragma Import (C, Below, "panel_below");
+
+  --  |
+   procedure Delete (Pan : in out Panel);
+  --  AKA: del_panel()
+   pragma Inline (Delete);
+
+   private
+      type Panel is new System.Storage_Elements.Integer_Address;
+      Null_Panel : constant Panel := 0;
+
+end Terminal_Interface.Curses.Panels;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm b/Ada95/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm new file mode 100644 index 00000000..43ed85d6 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm @@ -0,0 +1,75 @@ +terminal_interface-curses-text_io-complex_io.ads + +

File : terminal_interface-curses-text_io-complex_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Complex_IO               --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.8 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm b/Ada95/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm new file mode 100644 index 00000000..1092bcf2 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm @@ -0,0 +1,71 @@ +terminal_interface-curses-text_io-decimal_io.ads + +

File : terminal_interface-curses-text_io-decimal_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Decimal_IO               --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm b/Ada95/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm new file mode 100644 index 00000000..7bb5955f --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm @@ -0,0 +1,68 @@ +terminal_interface-curses-text_io-enumeration_io.ads + +

File : terminal_interface-curses-text_io-enumeration_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--             Terminal_Interface.Curses.Text_IO.Enumeration_IO             --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm b/Ada95/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm new file mode 100644 index 00000000..550a3ffe --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm @@ -0,0 +1,71 @@ +terminal_interface-curses-text_io-fixed_io.ads + +

File : terminal_interface-curses-text_io-fixed_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                Terminal_Interface.Curses.Text_IO.Fixed_IO                --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-text_io-float_io__ads.htm b/Ada95/html/ada/terminal_interface-curses-text_io-float_io__ads.htm new file mode 100644 index 00000000..e6e7e215 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-text_io-float_io__ads.htm @@ -0,0 +1,71 @@ +terminal_interface-curses-text_io-float_io.ads + +

File : terminal_interface-curses-text_io-float_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                Terminal_Interface.Curses.Text_IO.Float_IO                --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm b/Ada95/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm new file mode 100644 index 00000000..4d927675 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm @@ -0,0 +1,68 @@ +terminal_interface-curses-text_io-integer_io.ads + +

File : terminal_interface-curses-text_io-integer_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Integer_IO               --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm b/Ada95/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm new file mode 100644 index 00000000..b652c1bc --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm @@ -0,0 +1,68 @@ +terminal_interface-curses-text_io-modular_io.ads + +

File : terminal_interface-curses-text_io-modular_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Modular_IO               --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.9 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses-text_io__ads.htm b/Ada95/html/ada/terminal_interface-curses-text_io__ads.htm new file mode 100644 index 00000000..6e6d9630 --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses-text_io__ads.htm @@ -0,0 +1,141 @@ +terminal_interface-curses-text_io.ads + +

File : terminal_interface-curses-text_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                     Terminal_Interface.Curses.Text_IO                    --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.11 @
+--  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;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface-curses__ads.htm b/Ada95/html/ada/terminal_interface-curses__ads.htm new file mode 100644 index 00000000..bbdf734e --- /dev/null +++ b/Ada95/html/ada/terminal_interface-curses__ads.htm @@ -0,0 +1,1743 @@ +terminal_interface-curses.ads + +

File : terminal_interface-curses.ads


+
+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           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.                                                           --
+------------------------------------------------------------------------------
+--  Jürgen Pfeifer (juergen.pfeifer@gmx.net) 1996                          --
+--  Version Control:
+--  @Revision: 1.24 @
+--  Binding Version 00.93
+------------------------------------------------------------------------------
+--  curses binding.
+--  This module is generated. Please don't change it manually!
+--  Run the generator instead.
+--  |
+with System.Storage_Elements;
+with Interfaces.C;  --  We need this for some assertions.
+
+package Terminal_Interface.Curses is
+   pragma Preelaborate (Terminal_Interface.Curses);
+   pragma Linker_Options ("-lAdaCurses");
+   pragma Linker_Options ("-lncurses");
+
+   NC_Major_Version : constant := 5;--  Major version of the library
+   NC_Minor_Version : constant := 0;--  Minor version of the library
+   NC_Version : constant String := "5.0"; --  Version of library
+
+   type Window is private;
+   Null_Window : constant Window;
+
+   type Line_Position   is new Natural;--  line coordinate
+   type Column_Position is new Natural;--  column coordinate
+
+   subtype Line_Count   is Line_Position   range 1 .. Line_Position'Last;
+  --  Type to count lines. We do not allow null windows, so must be positive
+   subtype Column_Count is Column_Position range 1 .. Column_Position'Last;
+  --  Type to count columns. We do not allow null windows, so must be positive
+
+   type Key_Code is new Natural;
+  --  That is anything including real characters, special keys and logical
+  --  request codes.
+
+   subtype Real_Key_Code is Key_Code range 0 .. 8#777#;
+  --  This are the codes that potentially represent a real keystroke.
+  --  Not all codes may be possible on a specific terminal. To check the
+  --  availability of a special key, the Has_Key function is provided.
+
+   subtype Special_Key_Code is Real_Key_Code
+     range 8#400# .. Real_Key_Code'Last;
+  --  Type for a function- or special key number
+
+   subtype Normal_Key_Code is Real_Key_Code range
+     Character'Pos (Character'First) .. Character'Pos (Character'Last);
+  --  This are the codes for regular (incl. non-graphical) characters.
+
+  --  Constants for function- and special keys
+  --
+   Key_None                       : constant Special_Key_Code := 8#400#;
+   Key_Code_Yes                   : constant Special_Key_Code := 8#400#;
+   Key_Min                        : constant Special_Key_Code := 8#401#;
+   Key_Break                      : constant Special_Key_Code := 8#401#;
+   Key_Cursor_Down                : constant Special_Key_Code := 8#402#;
+   Key_Cursor_Up                  : constant Special_Key_Code := 8#403#;
+   Key_Cursor_Left                : constant Special_Key_Code := 8#404#;
+   Key_Cursor_Right               : constant Special_Key_Code := 8#405#;
+   Key_Home                       : constant Special_Key_Code := 8#406#;
+   Key_Backspace                  : constant Special_Key_Code := 8#407#;
+   Key_F0                         : constant Special_Key_Code := 8#410#;
+   Key_F1                         : constant Special_Key_Code := 8#411#;
+   Key_F2                         : constant Special_Key_Code := 8#412#;
+   Key_F3                         : constant Special_Key_Code := 8#413#;
+   Key_F4                         : constant Special_Key_Code := 8#414#;
+   Key_F5                         : constant Special_Key_Code := 8#415#;
+   Key_F6                         : constant Special_Key_Code := 8#416#;
+   Key_F7                         : constant Special_Key_Code := 8#417#;
+   Key_F8                         : constant Special_Key_Code := 8#420#;
+   Key_F9                         : constant Special_Key_Code := 8#421#;
+   Key_F10                        : constant Special_Key_Code := 8#422#;
+   Key_F11                        : constant Special_Key_Code := 8#423#;
+   Key_F12                        : constant Special_Key_Code := 8#424#;
+   Key_F13                        : constant Special_Key_Code := 8#425#;
+   Key_F14                        : constant Special_Key_Code := 8#426#;
+   Key_F15                        : constant Special_Key_Code := 8#427#;
+   Key_F16                        : constant Special_Key_Code := 8#430#;
+   Key_F17                        : constant Special_Key_Code := 8#431#;
+   Key_F18                        : constant Special_Key_Code := 8#432#;
+   Key_F19                        : constant Special_Key_Code := 8#433#;
+   Key_F20                        : constant Special_Key_Code := 8#434#;
+   Key_F21                        : constant Special_Key_Code := 8#435#;
+   Key_F22                        : constant Special_Key_Code := 8#436#;
+   Key_F23                        : constant Special_Key_Code := 8#437#;
+   Key_F24                        : constant Special_Key_Code := 8#440#;
+   Key_Delete_Line                : constant Special_Key_Code := 8#510#;
+   Key_Insert_Line                : constant Special_Key_Code := 8#511#;
+   Key_Delete_Char                : constant Special_Key_Code := 8#512#;
+   Key_Insert_Char                : constant Special_Key_Code := 8#513#;
+   Key_Exit_Insert_Mode           : constant Special_Key_Code := 8#514#;
+   Key_Clear_Screen               : constant Special_Key_Code := 8#515#;
+   Key_Clear_End_Of_Screen        : constant Special_Key_Code := 8#516#;
+   Key_Clear_End_Of_Line          : constant Special_Key_Code := 8#517#;
+   Key_Scroll_1_Forward           : constant Special_Key_Code := 8#520#;
+   Key_Scroll_1_Backward          : constant Special_Key_Code := 8#521#;
+   Key_Next_Page                  : constant Special_Key_Code := 8#522#;
+   Key_Previous_Page              : constant Special_Key_Code := 8#523#;
+   Key_Set_Tab                    : constant Special_Key_Code := 8#524#;
+   Key_Clear_Tab                  : constant Special_Key_Code := 8#525#;
+   Key_Clear_All_Tabs             : constant Special_Key_Code := 8#526#;
+   Key_Enter_Or_Send              : constant Special_Key_Code := 8#527#;
+   Key_Soft_Reset                 : constant Special_Key_Code := 8#530#;
+   Key_Reset                      : constant Special_Key_Code := 8#531#;
+   Key_Print                      : constant Special_Key_Code := 8#532#;
+   Key_Bottom                     : constant Special_Key_Code := 8#533#;
+   Key_Upper_Left_Of_Keypad       : constant Special_Key_Code := 8#534#;
+   Key_Upper_Right_Of_Keypad      : constant Special_Key_Code := 8#535#;
+   Key_Center_Of_Keypad           : constant Special_Key_Code := 8#536#;
+   Key_Lower_Left_Of_Keypad       : constant Special_Key_Code := 8#537#;
+   Key_Lower_Right_Of_Keypad      : constant Special_Key_Code := 8#540#;
+   Key_Back_Tab                   : constant Special_Key_Code := 8#541#;
+   Key_Beginning                  : constant Special_Key_Code := 8#542#;
+   Key_Cancel                     : constant Special_Key_Code := 8#543#;
+   Key_Close                      : constant Special_Key_Code := 8#544#;
+   Key_Command                    : constant Special_Key_Code := 8#545#;
+   Key_Copy                       : constant Special_Key_Code := 8#546#;
+   Key_Create                     : constant Special_Key_Code := 8#547#;
+   Key_End                        : constant Special_Key_Code := 8#550#;
+   Key_Exit                       : constant Special_Key_Code := 8#551#;
+   Key_Find                       : constant Special_Key_Code := 8#552#;
+   Key_Help                       : constant Special_Key_Code := 8#553#;
+   Key_Mark                       : constant Special_Key_Code := 8#554#;
+   Key_Message                    : constant Special_Key_Code := 8#555#;
+   Key_Move                       : constant Special_Key_Code := 8#556#;
+   Key_Next                       : constant Special_Key_Code := 8#557#;
+   Key_Open                       : constant Special_Key_Code := 8#560#;
+   Key_Options                    : constant Special_Key_Code := 8#561#;
+   Key_Previous                   : constant Special_Key_Code := 8#562#;
+   Key_Redo                       : constant Special_Key_Code := 8#563#;
+   Key_Reference                  : constant Special_Key_Code := 8#564#;
+   Key_Refresh                    : constant Special_Key_Code := 8#565#;
+   Key_Replace                    : constant Special_Key_Code := 8#566#;
+   Key_Restart                    : constant Special_Key_Code := 8#567#;
+   Key_Resume                     : constant Special_Key_Code := 8#570#;
+   Key_Save                       : constant Special_Key_Code := 8#571#;
+   Key_Shift_Begin                : constant Special_Key_Code := 8#572#;
+   Key_Shift_Cancel               : constant Special_Key_Code := 8#573#;
+   Key_Shift_Command              : constant Special_Key_Code := 8#574#;
+   Key_Shift_Copy                 : constant Special_Key_Code := 8#575#;
+   Key_Shift_Create               : constant Special_Key_Code := 8#576#;
+   Key_Shift_Delete_Char          : constant Special_Key_Code := 8#577#;
+   Key_Shift_Delete_Line          : constant Special_Key_Code := 8#600#;
+   Key_Select                     : constant Special_Key_Code := 8#601#;
+   Key_Shift_End                  : constant Special_Key_Code := 8#602#;
+   Key_Shift_Clear_End_Of_Line    : constant Special_Key_Code := 8#603#;
+   Key_Shift_Exit                 : constant Special_Key_Code := 8#604#;
+   Key_Shift_Find                 : constant Special_Key_Code := 8#605#;
+   Key_Shift_Help                 : constant Special_Key_Code := 8#606#;
+   Key_Shift_Home                 : constant Special_Key_Code := 8#607#;
+   Key_Shift_Insert_Char          : constant Special_Key_Code := 8#610#;
+   Key_Shift_Cursor_Left          : constant Special_Key_Code := 8#611#;
+   Key_Shift_Message              : constant Special_Key_Code := 8#612#;
+   Key_Shift_Move                 : constant Special_Key_Code := 8#613#;
+   Key_Shift_Next_Page            : constant Special_Key_Code := 8#614#;
+   Key_Shift_Options              : constant Special_Key_Code := 8#615#;
+   Key_Shift_Previous_Page        : constant Special_Key_Code := 8#616#;
+   Key_Shift_Print                : constant Special_Key_Code := 8#617#;
+   Key_Shift_Redo                 : constant Special_Key_Code := 8#620#;
+   Key_Shift_Replace              : constant Special_Key_Code := 8#621#;
+   Key_Shift_Cursor_Right         : constant Special_Key_Code := 8#622#;
+   Key_Shift_Resume               : constant Special_Key_Code := 8#623#;
+   Key_Shift_Save                 : constant Special_Key_Code := 8#624#;
+   Key_Shift_Suspend              : constant Special_Key_Code := 8#625#;
+   Key_Shift_Undo                 : constant Special_Key_Code := 8#626#;
+   Key_Suspend                    : constant Special_Key_Code := 8#627#;
+   Key_Undo                       : constant Special_Key_Code := 8#630#;
+   Key_Mouse                      : constant Special_Key_Code := 8#631#;
+   Key_Resize                     : constant Special_Key_Code := 8#632#;
+
+   Key_Max                        : constant Special_Key_Code
+     := Special_Key_Code'Last;
+
+   subtype User_Key_Code is Key_Code
+     range (Key_Max + 129) .. Key_Code'Last;
+  --  This is reserved for user defined key codes. The range between Key_Max
+  --  and the first user code is reserved for subsystems like menu and forms.
+
+  --  For those who like to use the original key names we produce them were
+  --  they differ from the original. Please note that they may differ in
+  --  lower/upper case.
+   KEY_DOWN         : Special_Key_Code renames Key_Cursor_Down;
+   KEY_UP           : Special_Key_Code renames Key_Cursor_Up;
+   KEY_LEFT         : Special_Key_Code renames Key_Cursor_Left;
+   KEY_RIGHT        : Special_Key_Code renames Key_Cursor_Right;
+   KEY_DL           : Special_Key_Code renames Key_Delete_Line;
+   KEY_IL           : Special_Key_Code renames Key_Insert_Line;
+   KEY_DC           : Special_Key_Code renames Key_Delete_Char;
+   KEY_IC           : Special_Key_Code renames Key_Insert_Char;
+   KEY_EIC          : Special_Key_Code renames Key_Exit_Insert_Mode;
+   KEY_CLEAR        : Special_Key_Code renames Key_Clear_Screen;
+   KEY_EOS          : Special_Key_Code renames Key_Clear_End_Of_Screen;
+   KEY_EOL          : Special_Key_Code renames Key_Clear_End_Of_Line;
+   KEY_SF           : Special_Key_Code renames Key_Scroll_1_Forward;
+   KEY_SR           : Special_Key_Code renames Key_Scroll_1_Backward;
+   KEY_NPAGE        : Special_Key_Code renames Key_Next_Page;
+   KEY_PPAGE        : Special_Key_Code renames Key_Previous_Page;
+   KEY_STAB         : Special_Key_Code renames Key_Set_Tab;
+   KEY_CTAB         : Special_Key_Code renames Key_Clear_Tab;
+   KEY_CATAB        : Special_Key_Code renames Key_Clear_All_Tabs;
+   KEY_ENTER        : Special_Key_Code renames Key_Enter_Or_Send;
+   KEY_SRESET       : Special_Key_Code renames Key_Soft_Reset;
+   KEY_LL           : Special_Key_Code renames Key_Bottom;
+   KEY_A1           : Special_Key_Code renames Key_Upper_Left_Of_Keypad;
+   KEY_A3           : Special_Key_Code renames Key_Upper_Right_Of_Keypad;
+   KEY_B2           : Special_Key_Code renames Key_Center_Of_Keypad;
+   KEY_C1           : Special_Key_Code renames Key_Lower_Left_Of_Keypad;
+   KEY_C3           : Special_Key_Code renames Key_Lower_Right_Of_Keypad;
+   KEY_BTAB         : Special_Key_Code renames Key_Back_Tab;
+   KEY_BEG          : Special_Key_Code renames Key_Beginning;
+   KEY_SBEG         : Special_Key_Code renames Key_Shift_Begin;
+   KEY_SCANCEL      : Special_Key_Code renames Key_Shift_Cancel;
+   KEY_SCOMMAND     : Special_Key_Code renames Key_Shift_Command;
+   KEY_SCOPY        : Special_Key_Code renames Key_Shift_Copy;
+   KEY_SCREATE      : Special_Key_Code renames Key_Shift_Create;
+   KEY_SDC          : Special_Key_Code renames Key_Shift_Delete_Char;
+   KEY_SDL          : Special_Key_Code renames Key_Shift_Delete_Line;
+   KEY_SEND         : Special_Key_Code renames Key_Shift_End;
+   KEY_SEOL         : Special_Key_Code renames Key_Shift_Clear_End_Of_Line;
+   KEY_SEXIT        : Special_Key_Code renames Key_Shift_Exit;
+   KEY_SFIND        : Special_Key_Code renames Key_Shift_Find;
+   KEY_SHELP        : Special_Key_Code renames Key_Shift_Help;
+   KEY_SHOME        : Special_Key_Code renames Key_Shift_Home;
+   KEY_SIC          : Special_Key_Code renames Key_Shift_Insert_Char;
+   KEY_SLEFT        : Special_Key_Code renames Key_Shift_Cursor_Left;
+   KEY_SMESSAGE     : Special_Key_Code renames Key_Shift_Message;
+   KEY_SMOVE        : Special_Key_Code renames Key_Shift_Move;
+   KEY_SNEXT        : Special_Key_Code renames Key_Shift_Next_Page;
+   KEY_SOPTIONS     : Special_Key_Code renames Key_Shift_Options;
+   KEY_SPREVIOUS    : Special_Key_Code renames Key_Shift_Previous_Page;
+   KEY_SPRINT       : Special_Key_Code renames Key_Shift_Print;
+   KEY_SREDO        : Special_Key_Code renames Key_Shift_Redo;
+   KEY_SREPLACE     : Special_Key_Code renames Key_Shift_Replace;
+   KEY_SRIGHT       : Special_Key_Code renames Key_Shift_Cursor_Right;
+   KEY_SRSUME       : Special_Key_Code renames Key_Shift_Resume;
+   KEY_SSAVE        : Special_Key_Code renames Key_Shift_Save;
+   KEY_SSUSPEND     : Special_Key_Code renames Key_Shift_Suspend;
+   KEY_SUNDO        : Special_Key_Code renames Key_Shift_Undo;
+
+------------------------------------------------------------------------------
+
+   type Color_Number is range 0 .. 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.
+
+   Black    : constant Color_Number := 0;
+   Red      : constant Color_Number := 1;
+   Green    : constant Color_Number := 2;
+   Yellow   : constant Color_Number := 3;
+   Blue     : constant Color_Number := 4;
+   Magenta  : constant Color_Number := 5;
+   Cyan     : constant Color_Number := 6;
+   White    : constant Color_Number := 7;
+
+   type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last);
+   for RGB_Value'Size use Interfaces.C.short'Size;
+  --  Some system may allow to redefine a color by setting RGB values.
+
+   type Color_Pair is range 0 .. 255;
+   for Color_Pair'Size use 8;
+   subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255;
+  --  (n)curses reserves 1 Byte for the color-pair number. Color Pair 0
+  --  is fixed (Black & White). A color pair is simply a combination of
+  --  two colors described by Color_Numbers, one for the foreground and
+  --  the other for the background
+
+   type Character_Attribute_Set is
+      record
+         Stand_Out               : Boolean;
+         Under_Line              : Boolean;
+         Reverse_Video           : Boolean;
+         Blink                   : Boolean;
+         Dim_Character           : Boolean;
+         Bold_Character          : Boolean;
+         Alternate_Character_Set : Boolean;
+         Invisible_Character     : Boolean;
+         Protected_Character     : Boolean;
+         Horizontal              : Boolean;
+         Left                    : Boolean;
+         Low                     : Boolean;
+         Right                   : Boolean;
+         Top                     : Boolean;
+         Vertical                : Boolean;
+      end record;
+   pragma Pack (Character_Attribute_Set);
+   pragma Convention (C, Character_Attribute_Set);
+
+   for Character_Attribute_Set use
+      record
+         Stand_Out               at 0 range  0 ..  0;
+         Under_Line              at 0 range  1 ..  1;
+         Reverse_Video           at 0 range  2 ..  2;
+         Blink                   at 0 range  3 ..  3;
+         Dim_Character           at 0 range  4 ..  4;
+         Bold_Character          at 0 range  5 ..  5;
+         Alternate_Character_Set at 0 range  6 ..  6;
+         Invisible_Character     at 0 range  7 ..  7;
+         Protected_Character     at 0 range  8 ..  8;
+         Horizontal              at 0 range  9 ..  9;
+         Left                    at 0 range 10 .. 10;
+         Low                     at 0 range 11 .. 11;
+         Right                   at 0 range 12 .. 12;
+         Top                     at 0 range 13 .. 13;
+         Vertical                at 0 range 14 .. 14;
+      end record;
+   for Character_Attribute_Set'Size use 16;
+  --  Please note: this rep. clause is generated and may be
+  --               different on your system.
+  --  (n)curses uses all but the lowes 16 Bits for Attributes.
+
+   Normal_Video : constant Character_Attribute_Set := (others => False);
+
+   type Attributed_Character is
+      record
+         Attr  : Character_Attribute_Set;
+         Color : Color_Pair;
+         Ch    : Character;
+      end record;
+   pragma Convention (C, Attributed_Character);
+  --  This is the counterpart for the chtype in C.
+
+   for Attributed_Character use
+      record
+         Ch    at 0 range  0 ..  7;
+         Color at 0 range  8 .. 15;
+         Attr  at 0 range 16 .. 31;
+      end record;
+   for Attributed_Character'Size use 32;
+     --  Please note: this rep. clause is generated and may be
+     --               different on your system.
+
+   Default_Character : constant Attributed_Character
+     := (Ch    => Character'First,
+         Color => Color_Pair'First,
+         Attr  => (others => False)); --  preelaboratable Normal_Video
+
+   type Attributed_String is array (Positive range <>) of Attributed_Character;
+   pragma Pack (Attributed_String);
+  --  In this binding we allow strings of attributed characters.
+
+  ------------------
+  --  Exceptions  --
+  ------------------
+   Curses_Exception     : exception;
+   Wrong_Curses_Version : exception;
+
+  --  Those exceptions are raised by the ETI (Extended Terminal Interface)
+  --  subpackets for Menu and Forms handling.
+  --
+   Eti_System_Error    : exception;
+   Eti_Bad_Argument    : exception;
+   Eti_Posted          : exception;
+   Eti_Connected       : exception;
+   Eti_Bad_State       : exception;
+   Eti_No_Room         : exception;
+   Eti_Not_Posted      : exception;
+   Eti_Unknown_Command : exception;
+   Eti_No_Match        : exception;
+   Eti_Not_Selectable  : exception;
+   Eti_Not_Connected   : exception;
+   Eti_Request_Denied  : exception;
+   Eti_Invalid_Field   : exception;
+   Eti_Current         : exception;
+
+  --------------------------------------------------------------------------
+  --  External C variables
+  --  Conceptually even in C this are kind of constants, but they are
+  --  initialized and sometimes changed by the library routines at runtime
+  --  depending on the type of terminal. I believe the best way to model
+  --  this is to use functions.
+  --------------------------------------------------------------------------
+
+   function Lines            return Line_Count;
+   pragma Inline (Lines);
+
+   function Columns          return Column_Count;
+   pragma Inline (Columns);
+
+   function Tab_Size         return Natural;
+   pragma Inline (Tab_Size);
+
+   function Number_Of_Colors return Natural;
+   pragma Inline (Number_Of_Colors);
+
+   function Number_Of_Color_Pairs return Natural;
+   pragma Inline (Number_Of_Color_Pairs);
+
+   ACS_Map : array (Character'Val (0) .. Character'Val (127)) of
+     Attributed_Character;
+   pragma Import (C, ACS_Map, "acs_map");
+  --
+  --
+  --  Constants for several symbols 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.
+  --
+   ACS_Upper_Left_Corner    : constant Character := 'l';
+   ACS_Lower_Left_Corner    : constant Character := 'm';
+   ACS_Upper_Right_Corner   : constant Character := 'k';
+   ACS_Lower_Right_Corner   : constant Character := 'j';
+   ACS_Left_Tee             : constant Character := 't';
+   ACS_Right_Tee            : constant Character := 'u';
+   ACS_Bottom_Tee           : constant Character := 'v';
+   ACS_Top_Tee              : constant Character := 'w';
+   ACS_Horizontal_Line      : constant Character := 'q';
+   ACS_Vertical_Line        : constant Character := 'x';
+   ACS_Plus_Symbol          : constant Character := 'n';
+   ACS_Scan_Line_1          : constant Character := 'o';
+   ACS_Scan_Line_9          : constant Character := 's';
+   ACS_Diamond              : constant Character := Character'Val (96);
+   ACS_Checker_Board        : constant Character := 'a';
+   ACS_Degree               : constant Character := 'f';
+   ACS_Plus_Minus           : constant Character := 'g';
+   ACS_Bullet               : constant Character := '~';
+   ACS_Left_Arrow           : constant Character := ',';
+   ACS_Right_Arrow          : constant Character := '+';
+   ACS_Down_Arrow           : constant Character := '.';
+   ACS_Up_Arrow             : constant Character := '-';
+   ACS_Board_Of_Squares     : constant Character := 'h';
+   ACS_Lantern              : constant Character := 'i';
+   ACS_Solid_Block          : constant Character := '0';
+   ACS_Scan_Line_3          : constant Character := 'p';
+   ACS_Scan_Line_7          : constant Character := 'r';
+   ACS_Less_Or_Equal        : constant Character := 'y';
+   ACS_Greater_Or_Equal     : constant Character := 'z';
+   ACS_PI                   : constant Character := '{';
+   ACS_Not_Equal            : constant Character := '|';
+   ACS_Sterling             : constant Character := '}';
+
+  --  |=====================================================================
+  --  | Man page curs_initscr.3x
+  --  |=====================================================================
+  --  | Not implemented: newterm, set_term, delscreen
+
+  --  |
+   function Standard_Window return Window;
+  --  AKA: stdscr
+   pragma Inline (Standard_Window);
+
+  --  |
+   procedure Init_Screen;
+
+  --  |
+   procedure Init_Windows renames Init_Screen;
+  --  AKA: initscr()
+   pragma Inline (Init_Screen);
+   pragma Inline (Init_Windows);
+
+  --  |
+   procedure End_Windows;
+  --  AKA: endwin()
+   procedure End_Screen renames End_Windows;
+   pragma Inline (End_Windows);
+   pragma Inline (End_Screen);
+
+  --  |
+   function Is_End_Window return Boolean;
+  --  AKA: isendwin()
+   pragma Inline (Is_End_Window);
+
+  --  |=====================================================================
+  --  | Man page curs_move.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Move_Cursor (Win    : in Window := Standard_Window;
+                          Line   : in Line_Position;
+                          Column : in Column_Position);
+  --  AKA: wmove()
+   pragma Inline (Move_Cursor);
+
+  --  |=====================================================================
+  --  | Man page curs_addch.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Add (Win :  in Window := Standard_Window;
+                  Ch  :  in Attributed_Character);
+  --  AKA: waddch()
+
+   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.
+
+  --  |
+   procedure Add
+     (Win    : in Window := Standard_Window;
+      Line   : in Line_Position;
+      Column : in Column_Position;
+      Ch     : in Attributed_Character);
+  --  AKA: mvwaddch()
+
+   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
+
+  --  |
+   procedure Add_With_Immediate_Echo
+     (Win : in Window := Standard_Window;
+      Ch  : in Attributed_Character);
+  --  AKA: wechochar()
+
+   procedure Add_With_Immediate_Echo
+     (Win : in Window := Standard_Window;
+      Ch  : in Character);
+  --  Add a character and do an immediate resfresh of the screen.
+   pragma Inline (Add_With_Immediate_Echo);
+
+  --  |=====================================================================
+  --  | Man page curs_window.3x
+  --  |=====================================================================
+
+  --  |
+   function Create
+     (Number_Of_Lines       : Line_Count;
+      Number_Of_Columns     : Column_Count;
+      First_Line_Position   : Line_Position;
+      First_Column_Position : Column_Position) return Window;
+  --  AKA: newwin()
+   pragma Inline (Create);
+
+   function New_Window
+     (Number_Of_Lines       : Line_Count;
+      Number_Of_Columns     : Column_Count;
+      First_Line_Position   : Line_Position;
+      First_Column_Position : Column_Position) return Window
+     renames Create;
+   pragma Inline (New_Window);
+
+  --  |
+   procedure Delete (Win : in out Window);
+  --  AKA: delwin()
+  --  Reset Win to Null_Window
+   pragma Inline (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;
+  --  AKA: subwin()
+   pragma Inline (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;
+  --  AKA: derwin()
+   pragma Inline (Derived_Window);
+
+  --  |
+   function Duplicate (Win : Window) return Window;
+  --  AKA: dupwin()
+   pragma Inline (Duplicate);
+
+  --  |
+   procedure Move_Window (Win    : in Window;
+                          Line   : in Line_Position;
+                          Column : in Column_Position);
+  --  AKA: mvwin()
+   pragma Inline (Move_Window);
+
+  --  |
+   procedure Move_Derived_Window (Win    : in Window;
+                                  Line   : in Line_Position;
+                                  Column : in Column_Position);
+  --  AKA: mvderwin()
+   pragma Inline (Move_Derived_Window);
+
+  --  |
+   procedure Synchronize_Upwards (Win : in Window);
+  --  AKA: wsyncup()
+   pragma Import (C, Synchronize_Upwards, "wsyncup");
+
+  --  |
+   procedure Synchronize_Downwards (Win : in Window);
+  --  AKA: wsyncdown()
+   pragma Import (C, Synchronize_Downwards, "wsyncdown");
+
+  --  |
+   procedure Set_Synch_Mode (Win  : in Window := Standard_Window;
+                             Mode : in Boolean := False);
+  --  AKA: syncok()
+   pragma Inline (Set_Synch_Mode);
+
+  --  |=====================================================================
+  --  | Man page curs_addstr.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Add (Win : in Window := Standard_Window;
+                  Str : in String;
+                  Len : in Integer := -1);
+  --  AKA: waddnstr()
+  --  AKA: waddstr()
+
+  --  |
+   procedure Add (Win    : in Window := Standard_Window;
+                  Line   : in Line_Position;
+                  Column : in Column_Position;
+                  Str    : in String;
+                  Len    : in Integer := -1);
+  --  AKA: mvwaddnstr()
+  --  AKA: mvwaddstr()
+
+  --  |=====================================================================
+  --  | Man page curs_addchstr.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Add (Win : in Window := Standard_Window;
+                  Str : in Attributed_String;
+                  Len : in Integer := -1);
+  --  AKA: waddchnstr()
+  --  AKA: waddchstr()
+
+  --  |
+   procedure Add (Win    : in Window := Standard_Window;
+                  Line   : in Line_Position;
+                  Column : in Column_Position;
+                  Str    : in Attributed_String;
+                  Len    : in Integer := -1);
+  --  AKA: mvwaddchnstr()
+  --  AKA: mvwaddchstr()
+   pragma Inline (Add);
+
+  --  |=====================================================================
+  --  | Man page curs_border.3x
+  --  |=====================================================================
+
+  --  |
+   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: wborder()
+   pragma Inline (Border);
+
+  --  |
+   procedure Box
+     (Win               : in Window := Standard_Window;
+      Vertical_Symbol   : in Attributed_Character := Default_Character;
+      Horizontal_Symbol : in Attributed_Character := Default_Character);
+  --  AKA: box()
+   pragma Inline (Box);
+
+  --  |
+   procedure Horizontal_Line
+     (Win         : in Window := Standard_Window;
+      Line_Size   : in Natural;
+      Line_Symbol : in Attributed_Character := Default_Character);
+  --  AKA: whline()
+   pragma Inline (Horizontal_Line);
+
+  --  |
+   procedure Vertical_Line
+     (Win         : in Window := Standard_Window;
+      Line_Size   : in Natural;
+      Line_Symbol : in Attributed_Character := Default_Character);
+  --  AKA: wvline()
+   pragma Inline (Vertical_Line);
+
+  --  |=====================================================================
+  --  | Man page curs_getch.3x
+  --  |=====================================================================
+
+  --  |
+   function Get_Keystroke (Win : Window := Standard_Window)
+                           return Real_Key_Code;
+  --  AKA: wgetch()
+  --  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);
+
+  --  |
+   procedure Undo_Keystroke (Key : in Real_Key_Code);
+  --  AKA: ungetch()
+   pragma Inline (Undo_Keystroke);
+
+  --  |
+   function Has_Key (Key : Special_Key_Code) return Boolean;
+  --  AKA: has_key()
+   pragma Inline (Has_Key);
+
+  --  |
+  --  | Some helper functions
+  --  |
+   function Is_Function_Key (Key : Special_Key_Code) return Boolean;
+  --  Return True if the Key is a function key (i.e. one of F0 .. F63)
+   pragma Inline (Is_Function_Key);
+
+   subtype Function_Key_Number is Integer range 0 .. 63;
+  --  (n)curses allows for 64 function keys.
+
+   function Function_Key (Key : Real_Key_Code) return Function_Key_Number;
+  --  Return the number of the function key. If the code is not a
+  --  function key, a CONSTRAINT_ERROR will be raised.
+   pragma Inline (Function_Key);
+
+   function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
+  --  Return the key code for a given functionkey number.
+   pragma Inline (Function_Key_Code);
+
+  --  |=====================================================================
+  --  | Man page curs_attr.3x
+  --  |=====================================================================
+
+  --  |
+   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.
+  --  AKA: wattron()
+  --  AKA: wattroff()
+
+  --  |
+   procedure Set_Character_Attributes
+     (Win   : in Window := Standard_Window;
+      Attr  : in Character_Attribute_Set := Normal_Video;
+      Color : in Color_Pair := Color_Pair'First);
+  --  AKA: wattrset()
+   pragma Inline (Set_Character_Attributes);
+
+  --  |
+   function Get_Character_Attribute
+     (Win : in Window := Standard_Window) return Character_Attribute_Set;
+  --  AKA: wattr_get()
+
+  --  |
+   function Get_Character_Attribute
+     (Win : in Window := Standard_Window) return Color_Pair;
+  --  AKA: wattr_get()
+   pragma Inline (Get_Character_Attribute);
+
+  --  |
+   procedure Set_Color (Win  : in Window := Standard_Window;
+                        Pair : in Color_Pair);
+  --  AKA: wcolor_set()
+   pragma Inline (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);
+  --  AKA: wchgat()
+
+  --  |
+   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: mvwchgat()
+   pragma Inline (Change_Attributes);
+
+  --  |=====================================================================
+  --  | Man page curs_beep.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Beep;
+  --  AKA: beep()
+   pragma Inline (Beep);
+
+  --  |
+   procedure Flash_Screen;
+  --  AKA: flash()
+   pragma Inline (Flash_Screen);
+
+  --  |=====================================================================
+  --  | Man page curs_inopts.3x
+  --  |=====================================================================
+
+  --  | Not implemented : typeahead
+  --
+  --  |
+   procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True);
+  --  AKA: cbreak()
+  --  AKA: nocbreak()
+   pragma Inline (Set_Cbreak_Mode);
+
+  --  |
+   procedure Set_Raw_Mode (SwitchOn : in Boolean := True);
+  --  AKA: raw()
+  --  AKA: noraw()
+   pragma Inline (Set_Raw_Mode);
+
+  --  |
+   procedure Set_Echo_Mode (SwitchOn : in Boolean := True);
+  --  AKA: echo()
+  --  AKA: noecho()
+   pragma Inline (Set_Echo_Mode);
+
+  --  |
+   procedure Set_Meta_Mode (Win      : in Window := Standard_Window;
+                            SwitchOn : in Boolean := True);
+  --  AKA: meta()
+   pragma Inline (Set_Meta_Mode);
+
+  --  |
+   procedure Set_KeyPad_Mode (Win      : in Window := Standard_Window;
+                              SwitchOn : in Boolean := True);
+  --  AKA: keypad()
+   pragma Inline (Set_KeyPad_Mode);
+
+   type Half_Delay_Amount is range 1 .. 255;
+
+  --  |
+   procedure Half_Delay (Amount : in Half_Delay_Amount);
+  --  AKA: halfdelay()
+   pragma Inline (Half_Delay);
+
+  --  |
+   procedure Set_Flush_On_Interrupt_Mode
+     (Win  : in Window := Standard_Window;
+      Mode : in Boolean := True);
+  --  AKA: intrflush()
+   pragma Inline (Set_Flush_On_Interrupt_Mode);
+
+  --  |
+   procedure Set_Queue_Interrupt_Mode
+     (Win   : in Window := Standard_Window;
+      Flush : in Boolean := True);
+  --  AKA: qiflush()
+  --  AKA: noqiflush()
+   pragma Inline (Set_Queue_Interrupt_Mode);
+
+  --  |
+   procedure Set_NoDelay_Mode
+     (Win  : in Window := Standard_Window;
+      Mode : in Boolean := False);
+  --  AKA: nodelay()
+   pragma Inline (Set_NoDelay_Mode);
+
+   type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
+
+  --  |
+   procedure Set_Timeout_Mode (Win    : in Window := Standard_Window;
+                               Mode   : in Timeout_Mode;
+                               Amount : in Natural);--  in Miliseconds
+  --  AKA: wtimeout()
+  --  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.
+
+  --  |
+   procedure Set_Escape_Timer_Mode
+     (Win       : in Window := Standard_Window;
+      Timer_Off : in Boolean := False);
+  --  AKA: notimeout()
+   pragma Inline (Set_Escape_Timer_Mode);
+
+  --  |=====================================================================
+  --  | Man page curs_outopts.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_NL_Mode (SwitchOn : in Boolean := True);
+  --  AKA: nl()
+  --  AKA: nonl()
+   pragma Inline (Set_NL_Mode);
+
+  --  |
+   procedure Clear_On_Next_Update
+     (Win      : in Window := Standard_Window;
+      Do_Clear : in Boolean := True);
+  --  AKA: clearok()
+   pragma Inline (Clear_On_Next_Update);
+
+  --  |
+   procedure Use_Insert_Delete_Line
+     (Win    : in Window := Standard_Window;
+      Do_Idl : in Boolean := True);
+  --  AKA: idlok()
+   pragma Inline (Use_Insert_Delete_Line);
+
+  --  |
+   procedure Use_Insert_Delete_Character
+     (Win    : in Window := Standard_Window;
+      Do_Idc : in Boolean := True);
+  --  AKA: idcok()
+   pragma Inline (Use_Insert_Delete_Character);
+
+  --  |
+   procedure Leave_Cursor_After_Update
+     (Win      : in Window := Standard_Window;
+      Do_Leave : in Boolean := True);
+  --  AKA: leaveok()
+   pragma Inline (Leave_Cursor_After_Update);
+
+  --  |
+   procedure Immediate_Update_Mode
+     (Win  : in Window := Standard_Window;
+      Mode : in Boolean := False);
+  --  AKA: immedok()
+   pragma Inline (Immediate_Update_Mode);
+
+  --  |
+   procedure Allow_Scrolling
+     (Win  : in Window := Standard_Window;
+      Mode : in Boolean := False);
+  --  AKA: scrollok()
+   pragma Inline (Allow_Scrolling);
+
+   function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
+  --  There is no such function in the C interface.
+   pragma Inline (Scrolling_Allowed);
+
+  --  |
+   procedure Set_Scroll_Region
+     (Win         : in Window := Standard_Window;
+      Top_Line    : in Line_Position;
+      Bottom_Line : in Line_Position);
+  --  AKA: wsetscrreg()
+   pragma Inline (Set_Scroll_Region);
+
+  --  |=====================================================================
+  --  | Man page curs_refresh.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Update_Screen;
+  --  AKA: doupdate()
+   pragma Inline (Update_Screen);
+
+  --  |
+   procedure Refresh (Win : in Window := Standard_Window);
+  --  AKA: wrefresh()
+  --  There is an overloaded Refresh for Pads.
+  --  The Inline pragma appears there
+
+  --  |
+   procedure Refresh_Without_Update
+     (Win : in Window := Standard_Window);
+  --  AKA: wnoutrefresh()
+  --  There is an overloaded Refresh_Without_Update for Pads.
+  --  The Inline pragma appears there
+
+  --  |
+   procedure Redraw (Win : in Window := Standard_Window);
+  --  AKA: redrawwin()
+
+  --  |
+   procedure Redraw (Win        : in Window := Standard_Window;
+                     Begin_Line : in Line_Position;
+                     Line_Count : in Positive);
+  --  AKA: wredrawln()
+   pragma Inline (Redraw);
+
+  --  |=====================================================================
+  --  | Man page curs_clear.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Erase (Win : in Window := Standard_Window);
+  --  AKA: werase()
+   pragma Inline (Erase);
+
+  --  |
+   procedure Clear
+     (Win : in Window := Standard_Window);
+  --  AKA: wclear()
+   pragma Inline (Clear);
+
+  --  |
+   procedure Clear_To_End_Of_Screen
+     (Win : in Window := Standard_Window);
+  --  AKA: wclrtobot()
+   pragma Inline (Clear_To_End_Of_Screen);
+
+  --  |
+   procedure Clear_To_End_Of_Line
+     (Win : in Window := Standard_Window);
+  --  AKA: wclrtoeol()
+   pragma Inline (Clear_To_End_Of_Line);
+
+  --  |=====================================================================
+  --  | Man page curs_bkgd.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Set_Background
+     (Win : in Window := Standard_Window;
+      Ch  : in Attributed_Character);
+  --  AKA: wbkgdset()
+   pragma Inline (Set_Background);
+
+  --  |
+   procedure Change_Background
+     (Win : in Window := Standard_Window;
+      Ch  : in Attributed_Character);
+  --  AKA: wbkgd()
+   pragma Inline (Change_Background);
+
+  --  |
+   function Get_Background (Win : Window := Standard_Window)
+     return Attributed_Character;
+  --  AKA: wbkgdget()
+   pragma Inline (Get_Background);
+
+  --  |=====================================================================
+  --  | Man page curs_touch.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Untouch (Win : in Window := Standard_Window);
+  --  AKA: untouchwin()
+   pragma Inline (Untouch);
+
+  --  |
+   procedure Touch (Win : in Window := Standard_Window);
+  --  AKA: touchwin()
+
+  --  |
+   procedure Touch (Win   : in Window := Standard_Window;
+                    Start : in Line_Position;
+                    Count : in Positive);
+  --  AKA: touchline()
+   pragma Inline (Touch);
+
+  --  |
+   procedure Change_Lines_Status (Win   : in Window := Standard_Window;
+                                  Start : in Line_Position;
+                                  Count : in Positive;
+                                  State : in Boolean);
+  --  AKA: wtouchln()
+   pragma Inline (Change_Lines_Status);
+
+  --  |
+   function Is_Touched (Win  : Window := Standard_Window;
+                        Line : Line_Position) return Boolean;
+  --  AKA: is_linetouched()
+
+  --  |
+   function Is_Touched (Win : Window := Standard_Window) return Boolean;
+  --  AKA: is_wintouched()
+   pragma Inline (Is_Touched);
+
+  --  |=====================================================================
+  --  | Man page curs_overlay.3x
+  --  |=====================================================================
+
+  --  |
+   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: copywin()
+   pragma Inline (Copy);
+
+  --  |
+   procedure Overwrite (Source_Window      : in Window;
+                        Destination_Window : in Window);
+  --  AKA: overwrite()
+   pragma Inline (Overwrite);
+
+  --  |
+   procedure Overlay (Source_Window      : in Window;
+                      Destination_Window : in Window);
+  --  AKA: overlay()
+   pragma Inline (Overlay);
+
+  --  |=====================================================================
+  --  | Man page curs_deleteln.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Insert_Delete_Lines
+     (Win   : in Window  := Standard_Window;
+      Lines : in Integer := 1);--  default is to insert one line above
+  --  AKA: winsdelln()
+   pragma Inline (Insert_Delete_Lines);
+
+  --  |
+   procedure Delete_Line (Win : in Window := Standard_Window);
+  --  AKA: wdeleteln()
+   pragma Inline (Delete_Line);
+
+  --  |
+   procedure Insert_Line (Win : in Window := Standard_Window);
+  --  AKA: winsertln()
+   pragma Inline (Insert_Line);
+
+  --  |=====================================================================
+  --  | Man page curs_getyx.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Get_Size
+     (Win               : in Window := Standard_Window;
+      Number_Of_Lines   : out Line_Count;
+      Number_Of_Columns : out Column_Count);
+  --  AKA: getmaxyx()
+   pragma Inline (Get_Size);
+
+  --  |
+   procedure Get_Window_Position
+     (Win             : in Window := Standard_Window;
+      Top_Left_Line   : out Line_Position;
+      Top_Left_Column : out Column_Position);
+  --  AKA: getbegyx()
+   pragma Inline (Get_Window_Position);
+
+  --  |
+   procedure Get_Cursor_Position
+     (Win    : in  Window := Standard_Window;
+      Line   : out Line_Position;
+      Column : out Column_Position);
+  --  AKA: getyx()
+   pragma Inline (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);
+  --  AKA: getparyx()
+  --  Instead of placing -1 in the coordinates as return, we use a boolean
+  --  to return the info that the window has no parent.
+   pragma Inline (Get_Origin_Relative_To_Parent);
+
+  --  |=====================================================================
+  --  | Man page curs_pad.3x
+  --  |=====================================================================
+
+  --  |
+   function New_Pad (Lines   : Line_Count;
+                     Columns : Column_Count) return Window;
+  --  AKA: newpad()
+   pragma Inline (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;
+  --  AKA: subpad()
+   pragma Inline (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);
+  --  AKA: prefresh()
+   pragma Inline (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);
+  --  AKA: pnoutrefresh()
+   pragma Inline (Refresh_Without_Update);
+
+  --  |
+   procedure Add_Character_To_Pad_And_Echo_It
+     (Pad : in Window;
+      Ch  : in Attributed_Character);
+  --  AKA: pechochar()
+
+   procedure Add_Character_To_Pad_And_Echo_It
+     (Pad : in Window;
+      Ch  : in Character);
+   pragma Inline (Add_Character_To_Pad_And_Echo_It);
+
+  --  |=====================================================================
+  --  | Man page curs_scroll.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Scroll (Win    : in Window  := Standard_Window;
+                     Amount : in Integer := 1);
+  --  AKA: wscrl()
+   pragma Inline (Scroll);
+
+  --  |=====================================================================
+  --  | Man page curs_delch.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Delete_Character (Win : in Window := Standard_Window);
+  --  AKA: wdelch()
+
+  --  |
+   procedure Delete_Character
+     (Win    : in Window := Standard_Window;
+      Line   : in Line_Position;
+      Column : in Column_Position);
+  --  AKA: mvwdelch()
+   pragma Inline (Delete_Character);
+
+  --  |=====================================================================
+  --  | Man page curs_inch.3x
+  --  |=====================================================================
+
+  --  |
+   function Peek (Win : Window := Standard_Window)
+     return Attributed_Character;
+  --  AKA: winch()
+
+  --  |
+   function Peek
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position) return Attributed_Character;
+  --  AKA: mvwinch()
+  --  More Peek's follow, pragma Inline appears later.
+
+  --  |=====================================================================
+  --  | Man page curs_winch.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Insert (Win : in Window := Standard_Window;
+                     Ch  : in Attributed_Character);
+  --  AKA: winsch()
+
+  --  |
+   procedure Insert (Win    : in Window := Standard_Window;
+                     Line   : in Line_Position;
+                     Column : in Column_Position;
+                     Ch     : in Attributed_Character);
+  --  AKA: mvwinsch()
+
+  --  |=====================================================================
+  --  | Man page curs_winch.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Insert (Win : in Window := Standard_Window;
+                     Str : in String;
+                     Len : in Integer := -1);
+  --  AKA: winsnstr()
+  --  AKA: winsstr()
+
+  --  |
+   procedure Insert (Win    : in Window := Standard_Window;
+                     Line   : in Line_Position;
+                     Column : in Column_Position;
+                     Str    : in String;
+                     Len    : in Integer := -1);
+  --  AKA: mvwinsnstr()
+  --  AKA: mvwinsstr()
+   pragma Inline (Insert);
+
+  --  |=====================================================================
+  --  | Man page curs_instr.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Peek (Win : in  Window := Standard_Window;
+                   Str : out String;
+                   Len : in  Integer := -1);
+  --  AKA: winnstr()
+  --  AKA: winstr()
+
+  --  |
+   procedure Peek (Win    : in  Window := Standard_Window;
+                   Line   : in  Line_Position;
+                   Column : in  Column_Position;
+                   Str    : out String;
+                   Len    : in  Integer := -1);
+  --  AKA: mvwinnstr()
+  --  AKA: mvwinstr()
+
+  --  |=====================================================================
+  --  | Man page curs_inchstr.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Peek (Win : in  Window := Standard_Window;
+                   Str : out Attributed_String;
+                   Len : in  Integer := -1);
+  --  AKA: winchnstr()
+  --  AKA: winchstr()
+
+  --  |
+   procedure Peek (Win    : in  Window := Standard_Window;
+                   Line   : in  Line_Position;
+                   Column : in  Column_Position;
+                   Str    : out Attributed_String;
+                   Len    : in  Integer := -1);
+  --  AKA: mvwinchnstr()
+  --  AKA: mvwinchstr()
+  --  We don't inline the Peek procedures
+
+  --  |=====================================================================
+  --  | Man page curs_getstr.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Get (Win : in  Window := Standard_Window;
+                  Str : out String;
+                  Len : in  Integer := -1);
+  --  AKA: wgetnstr()
+  --  AKA: wgetstr()
+
+   procedure Get (Win    : in  Window := Standard_Window;
+                  Line   : in  Line_Position;
+                  Column : in  Column_Position;
+                  Str    : out String;
+                  Len    : in  Integer := -1);
+  --  AKA: wgetnstr()
+  --  not specified in ncurses, should be: mvwgetnstr()
+  --       and mvwgetstr() (which exists)
+  --  Get is not inlined
+
+  --  |=====================================================================
+  --  | Man page curs_slk.3x
+  --  |=====================================================================
+
+   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);
+
+  --  |
+   procedure Init_Soft_Label_Keys
+     (Format : in Soft_Label_Key_Format := Three_Two_Three);
+  --  AKA: slk_init()
+   pragma Inline (Init_Soft_Label_Keys);
+
+  --  |
+   procedure Set_Soft_Label_Key (Label : in Label_Number;
+                                 Text  : in String;
+                                 Fmt   : in Label_Justification := Left);
+  --  AKA: slk_set()
+  --  We don't inline this procedure
+
+  --  |
+   procedure Refresh_Soft_Label_Keys;
+  --  AKA: slk_refresh()
+   pragma Inline (Refresh_Soft_Label_Keys);
+
+  --  |
+   procedure Refresh_Soft_Label_Keys_Without_Update;
+  --  AKA: slk_noutrefresh()
+   pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
+
+  --  |
+   procedure Get_Soft_Label_Key (Label : in Label_Number;
+                                 Text  : out String);
+  --  AKA: slk_label()
+
+  --  |
+   function Get_Soft_Label_Key (Label : in Label_Number) return String;
+  --  AKA: slk_label()
+  --  Same as function
+   pragma Inline (Get_Soft_Label_Key);
+
+  --  |
+   procedure Clear_Soft_Label_Keys;
+  --  AKA: slk_clear()
+   pragma Inline (Clear_Soft_Label_Keys);
+
+  --  |
+   procedure Restore_Soft_Label_Keys;
+  --  AKA: slk_restore()
+   pragma Inline (Restore_Soft_Label_Keys);
+
+  --  |
+   procedure Touch_Soft_Label_Keys;
+  --  AKA: slk_touch()
+   pragma Inline (Touch_Soft_Label_Keys);
+
+  --  |
+   procedure Switch_Soft_Label_Key_Attributes
+     (Attr : in Character_Attribute_Set;
+      On   : in Boolean := True);
+  --  AKA: slk_attron()
+  --  AKA: slk_attroff()
+   pragma Inline (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);
+  --  AKA: slk_attrset()
+   pragma Inline (Set_Soft_Label_Key_Attributes);
+
+  --  |
+   function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
+  --  AKA: slk_attr()
+
+  --  |
+   function Get_Soft_Label_Key_Attributes return Color_Pair;
+  --  AKA: slk_attr()
+   pragma Inline (Get_Soft_Label_Key_Attributes);
+
+  --  |
+   procedure Set_Soft_Label_Key_Color (Pair : in Color_Pair);
+  --  AKA: slk_color()
+   pragma Inline (Set_Soft_Label_Key_Color);
+
+  --  |=====================================================================
+  --  | Man page keyok.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Enable_Key (Key    : in Special_Key_Code;
+                         Enable : in Boolean := True);
+  --  AKA: keyok()
+   pragma Inline (Enable_Key);
+
+  --  |=====================================================================
+  --  | Man page define_key.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Define_Key (Definition : in String;
+                         Key        : in Special_Key_Code);
+  --  AKA: define_key()
+   pragma Inline (Define_Key);
+
+  --  |=====================================================================
+  --  | Man page curs_util.3x
+  --  |=====================================================================
+
+  --  | Not implemented : filter, use_env, putwin, getwin
+  --
+  --  |
+   procedure Key_Name (Key  : in  Real_Key_Code;
+                       Name : out String);
+  --  AKA: keyname()
+  --  The external name for a real keystroke.
+
+  --  |
+   function Key_Name (Key  : in  Real_Key_Code) return String;
+  --  AKA: keyname()
+  --  Same as function
+  --  We don't inline this routine
+
+  --  |
+   procedure Un_Control (Ch  : in Attributed_Character;
+                         Str : out String);
+  --  AKA: unctrl()
+
+  --  |
+   function Un_Control (Ch  : in Attributed_Character) return String;
+  --  AKA: unctrl()
+  --  Same as function
+   pragma Inline (Un_Control);
+
+  --  |
+   procedure Delay_Output (Msecs : in Natural);
+  --  AKA: delay_output()
+   pragma Inline (Delay_Output);
+
+  --  |
+   procedure Flush_Input;
+  --  AKA: flushinp()
+   pragma Inline (Flush_Input);
+
+  --  |=====================================================================
+  --  | Man page curs_termattrs.3x
+  --  |=====================================================================
+
+  --  |
+   function Baudrate return Natural;
+  --  AKA: baudrate()
+   pragma Inline (Baudrate);
+
+  --  |
+   function Erase_Character return Character;
+  --  AKA: erasechar()
+   pragma Inline (Erase_Character);
+
+  --  |
+   function Kill_Character return Character;
+  --  AKA: killchar()
+   pragma Inline (Kill_Character);
+
+  --  |
+   function Has_Insert_Character return Boolean;
+  --  AKA: has_ic()
+   pragma Inline (Has_Insert_Character);
+
+  --  |
+   function Has_Insert_Line return Boolean;
+  --  AKA: has_il()
+   pragma Inline (Has_Insert_Line);
+
+  --  |
+   function Supported_Attributes return Character_Attribute_Set;
+  --  AKA: termattrs()
+   pragma Inline (Supported_Attributes);
+
+  --  |
+   procedure Long_Name (Name : out String);
+  --  AKA: longname()
+
+  --  |
+   function Long_Name return String;
+  --  AKA: longname()
+  --  Same as function
+   pragma Inline (Long_Name);
+
+  --  |
+   procedure Terminal_Name (Name : out String);
+  --  AKA: termname()
+
+  --  |
+   function Terminal_Name return String;
+  --  AKA: termname()
+  --  Same as function
+   pragma Inline (Terminal_Name);
+
+  --  |=====================================================================
+  --  | Man page curs_color.3x
+  --  |=====================================================================
+
+  --  |
+   procedure Start_Color;
+  --  AKA: start_clolor()
+   pragma Import (C, Start_Color, "start_color");
+
+  --  |
+   procedure Init_Pair (Pair : in Redefinable_Color_Pair;
+                        Fore : in Color_Number;
+                        Back : in Color_Number);
+  --  AKA: init_pair()
+   pragma Inline (Init_Pair);
+
+  --  |
+   procedure Pair_Content (Pair : in Color_Pair;
+                           Fore : out Color_Number;
+                           Back : out Color_Number);
+  --  AKA: pair_content()
+   pragma Inline (Pair_Content);
+
+  --  |
+   function Has_Colors return Boolean;
+  --  AKA: has_colors()
+   pragma Inline (Has_Colors);
+
+  --  |
+   procedure Init_Color (Color : in Color_Number;
+                         Red   : in RGB_Value;
+                         Green : in RGB_Value;
+                         Blue  : in RGB_Value);
+  --  AKA: init_color()
+   pragma Inline (Init_Color);
+
+  --  |
+   function Can_Change_Color return Boolean;
+  --  AKA: can_change_color()
+   pragma Inline (Can_Change_Color);
+
+  --  |
+   procedure Color_Content (Color : in  Color_Number;
+                            Red   : out RGB_Value;
+                            Green : out RGB_Value;
+                            Blue  : out RGB_Value);
+  --  AKA: color_content()
+   pragma Inline (Color_Content);
+
+  --  |=====================================================================
+  --  | Man page curs_kernel.3x
+  --  |=====================================================================
+
+  --  | Not implemented: getsyx, setsyx
+  --
+   type Curses_Mode is (Curses, Shell);
+
+  --  |
+   procedure Save_Curses_Mode (Mode : in Curses_Mode);
+  --  AKA: def_prog_mode()
+  --  AKA: def_shell_mode()
+   pragma Inline (Save_Curses_Mode);
+
+  --  |
+   procedure Reset_Curses_Mode (Mode : in Curses_Mode);
+  --  AKA: reset_prog_mode()
+  --  AKA: reset_shell_mode()
+   pragma Inline (Reset_Curses_Mode);
+
+  --  |
+   procedure Save_Terminal_State;
+  --  AKA: savetty()
+   pragma Inline (Save_Terminal_State);
+
+  --  |
+   procedure Reset_Terminal_State;
+  --  AKA: resetty();
+   pragma Inline (Reset_Terminal_State);
+
+   type Stdscr_Init_Proc is access
+      function (Win     : Window;
+                Columns : Column_Count) return Integer;
+   pragma Convention (C, Stdscr_Init_Proc);
+  --  N.B.: the return value is actually ignored, but it seems to be
+  --        a good practice to return 0 if you think all went fine
+  --        and -1 otherwise.
+
+  --  |
+   procedure Rip_Off_Lines (Lines : in Integer;
+                            Proc  : in Stdscr_Init_Proc);
+  --  AKA: ripoffline()
+  --  N.B.: to be more precise, this uses a ncurses specific enhancement of
+  --        ripoffline(), in which the Lines argument absolute value is the
+  --        number of lines to be ripped of. The official ripoffline() only
+  --        uses the sign of Lines to rip of a single line from bottom or top.
+   pragma Inline (Rip_Off_Lines);
+
+   type Cursor_Visibility is (Invisible, Normal, Very_Visible);
+
+  --  |
+   procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
+  --  AKA: curs_set()
+   pragma Inline (Set_Cursor_Visibility);
+
+  --  |
+   procedure Nap_Milli_Seconds (Ms : in Natural);
+  --  AKA: napms()
+   pragma Inline (Nap_Milli_Seconds);
+
+  --  |=====================================================================
+  --  | Some usefull 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 parmeter.
+  --  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
+
+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.
+  --
+   Offset_maxy    : constant Natural :=  2;--  short
+   Offset_maxx    : constant Natural :=  3;--  short
+   Offset_begy    : constant Natural :=  4;--  short
+   Offset_begx    : constant Natural :=  5;--  short
+   Offset_cury    : constant Natural :=  0;--  short
+   Offset_curx    : constant Natural :=  1;--  short
+   Offset_yoffset : constant Natural := 36;--  short
+   Offset_pary    : constant Natural := 13;--  int
+   Offset_parx    : constant Natural := 12;--  int
+   Offset_scroll  : constant Natural := 27;--  char
+   Sizeof_bool    : constant Natural :=  1;--  bool
+   Offset_XY      : constant Natural :=  1;--  int
+
+
+end Terminal_Interface.Curses;
+
\ No newline at end of file diff --git a/Ada95/html/ada/terminal_interface__ads.htm b/Ada95/html/ada/terminal_interface__ads.htm new file mode 100644 index 00000000..10165564 --- /dev/null +++ b/Ada95/html/ada/terminal_interface__ads.htm @@ -0,0 +1,53 @@ +terminal_interface.ads + +

File : terminal_interface.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                            Terminal_Interface                            --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), to deal in the Software without restriction, including      --
+-- without limitation the rights to use, copy, modify, merge, publish,      --
+-- distribute, distribute with modifications, sublicense, and/or sell       --
+-- copies of the Software, and to permit persons to whom the Software is    --
+-- furnished to do so, subject to the following conditions:                 --
+--                                                                          --
+-- The above copyright notice and this permission notice shall be included  --
+-- in all copies or substantial portions of the Software.                   --
+--                                                                          --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
+-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
+-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
+--                                                                          --
+-- Except as contained in this notice, the name(s) of the above copyright   --
+-- holders shall not be used in advertising or otherwise to promote the     --
+-- sale, use or other dealings in this Software without prior written       --
+-- authorization.                                                           --
+------------------------------------------------------------------------------
+--  Author: Juergen Pfeifer  1996
+--  Version Control:
+--  $Revision: 1.10 $
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package Terminal_Interface is
+   pragma Pure (Terminal_Interface);
+--
+--  Everything is in the child units
+--
+end Terminal_Interface;
+
+
+
\ No newline at end of file diff --git a/Ada95/html/curs_addch.3x.html b/Ada95/html/curs_addch.3x.html deleted file mode 100644 index 5903801e..00000000 --- a/Ada95/html/curs_addch.3x.html +++ /dev/null @@ -1,176 +0,0 @@ - - -
-       addch,  waddch,  mvaddch,  mvwaddch, echochar, wechochar -
-       add a character (with attributes) to a curses window, then
-       advance the cursor
-
-
-
-

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

-       All routines return the integer ERR upon failure and OK on
-       success  (the  SVr4 manuals specify only "an integer value
-       other than ERR") upon successful completion, unless other-
-       wise noted in the preceding routine descriptions.
-
-
-
-

NOTES

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

EXTENSIONS

-       The following extended curses features are available  only
-       on  PC-clone consoles and compatible terminals obeying the
-       ANSI.SYS de-facto standard for terminal control sequences.
-       They are not part of XSI curses.
-
-       The attribute A_ALTCHARSET actually forces literal display
-       of PC ROM characters  including  the  high-half  graphics.
-       the card-suit characters, up and down-arrow, and most oth-
-       ers in the range 0-32.  (In a terminfo entry designed  for
-       use  with  ncurses,  the high-half characters are obtained
-       using this attribute with an acsc string in which the sec-
-       ond of each pair is a high-half character.)
-
-       Giving  wechochar  an  argument with its high bit set will
-       produce the corresponding high-half  ASCII  graphic  (SVr4
-       curses also has this feature but does not document it).  A
-       control-character argument, however,  will  not  typically
-       produce  the corresponding graphic; characters such as CR,
-       NL, FF and TAB are typically interpreted  by  the  console
-       driver  itself,  and ESC will be interpreted as the leader
-       of a control sequence.
-
-
-
-

PORTABILITY

-       All these functions are described in the XSI Curses  stan-
-       dard,  Issue  4.  The defaults specified for forms-drawing
-       characters apply in the POSIX locale.
-
-       The seven ACS symbols starting with ACS_S3 were not  docu-
-       mented  in  any publicly released System V.  However, many
-       publicly available terminfos include acsc strings in which
-       their key characters (pryz{|}) are embedded, and a second-
-       hand list of their  character  descriptions  has  come  to
-       light.   The ACS-prefixed names for them were invented for
-       ncurses(3X).
-
-
-
-

SEE ALSO

-       curses(3X), curs_attr(3X), curs_clear(3X),  curs_inch(3X),
-       curs_outopts(3X), curs_refresh(3X), putc(3S).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/Ada95/html/curs_mouse.3x.html b/Ada95/html/curs_mouse.3x.html deleted file mode 100644 index 82622ed8..00000000 --- a/Ada95/html/curs_mouse.3x.html +++ /dev/null @@ -1,172 +0,0 @@ - - -
-       getmouse,  ungetmouse, mousemask - mouse interface through
-       curses
-
-
-
-

SYNOPSIS

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

DESCRIPTION

-       These functions provide an interface to mouse events  from
-       ncurses(3X).   Mouse  events  are represented by KEY_MOUSE
-       pseudo-key values in the wgetch input stream.
-
-       To make mouse events visible, use the mousemask  function.
-       This  will  set  the  mouse  events  to  be  reported.  By
-       default, no mouse events are reported.  The function  will
-       return  a  mask  to  indicate which of the specified mouse
-       events can be reported; on complete failure it returns  0.
-       If  oldmask is non-NULL, this function fills the indicated
-       location with the previous value  of  the  given  window's
-       mouse event mask.
-
-       As  a  side  effect, setting a zero mousemask may turn off
-       the mouse pointer; setting a nonzero mask may turn it  on.
-       Whether this happens is device-dependent.
-
-       Here are the mouse event type masks:
-
-       l  l  _ _ l l.  Name Description BUTTON1_PRESSED     mouse
-       button  1  down  BUTTON1_RELEASED    mouse  button  1   up
-       BUTTON1_CLICKED     mouse       button      1      clicked
-       BUTTON1_DOUBLE_CLICKED   mouse  button  1  double  clicked
-       BUTTON1_TRIPLE_CLICKED   mouse  button  1  triple  clicked
-       BUTTON2_PRESSED     mouse       button       2        down
-       BUTTON2_RELEASED    mouse        button        2        up
-       BUTTON2_CLICKED     mouse      button      2       clicked
-       BUTTON2_DOUBLE_CLICKED   mouse  button  2  double  clicked
-       BUTTON2_TRIPLE_CLICKED   mouse  button  2  triple  clicked
-       BUTTON3_PRESSED     mouse        button       3       down
-       BUTTON3_DOUBLE_CLICKED   mouse  button  3  double  clicked
-       BUTTON3_TRIPLE_CLICKED   mouse  button  3  triple  clicked
-       BUTTON4_PRESSED     mouse       button       4        down
-       BUTTON4_RELEASED    mouse        button        4        up
-       BUTTON4_CLICKED     mouse      button      4       clicked
-       BUTTON4_DOUBLE_CLICKED   mouse  button  4  double  clicked
-       BUTTON4_TRIPLE_CLICKED   mouse  button  4  triple  clicked
-       BUTTON_SHIFT   shift  was  down during button state change
-       BUTTON_CTRL    control was down during button state change
-       BUTTON_ALT     alt  was  down  during  button state change
-       ALL_MOUSE_EVENTS    report  all   button   state   changes
-       REPORT_MOUSE_POSITION    report mouse movement
-
-       Once  a  class of mouse events have been made visible in a
-       window, calling the wgetch function  on  that  window  may
-       return  KEY_MOUSE  as  an indicator that a mouse event has
-       been queued.  To read the event data and pop the event off
-       the queue, call getmouse.  This function will return OK if
-       a mouse event is actually visible in the given window, ERR
-       otherwise.   When  getmouse returns OK, the data deposited
-       as y and x in the  event  structure  coordinates  will  be
-       screen-relative  character-cell coordinates.  The returned
-       state mask will have exactly one bit set to  indicate  the
-       event type.
-
-       The  ungetmouse  function  behaves analogously to ungetch.
-       It pushes a KEY_MOUSE event  onto  the  input  queue,  and
-       associates  with  that  event  the  given  state  data and
-       screen-relative character-cell coordinates.
-
-       The wenclose  function  tests  whether  a  given  pair  of
-       screen-relative  character-cell coordinates is enclosed by
-       a given window, returning TRUE if it is and  FALSE  other-
-       wise.   It  is  useful  for determining what subset of the
-       screen windows enclose the location of a mouse event.
-
-       The mouseinterval function sets the maximum time (in thou-
-       sands  of  a  second)  that  can  elapse between press and
-       release events in order for them to  be  recognized  as  a
-       click.  This function returns the previous interval value.
-       The default is one fifth of a second.
-
-       Note that mouse events will be ignored when  input  is  in
-       cooked mode, and will cause an error beep when cooked mode
-       is being simulated in a window by a function such as  get-
-       str that expects a linefeed for input-loop termination.
-
-
-
-
-

RETURN VALUE

-       All  routines  return  the  integer ERR upon failure or OK
-       upon successful completion.
-
-       These calls were designed for  ncurses(3X),  and  are  not
-       found in SVr4 curses, 4.4BSD curses, or any other previous
-       version of curses.
-
-       The feature macro NCURSES_MOUSE_VERSION is provided so the
-       preprocessor  can  be  used to test whether these features
-       are present (its value is 1).   NOTE:  THIS  INTERFACE  IS
-       EXPERIMENTAL  AND IS SUBJECT TO CHANGE WITHOUT NOTICE!  If
-       the interface is changed, the value of  NCURSES_MOUSE_VER-
-       SION will be incremented.
-
-       The  order  of the MEVENT structure members is not guaran-
-       teed.  Additional fields may be added to the structure  in
-       the future.
-
-       Under  ncurses(3X),  these  calls  are  implemented  using
-       either xterm's built-in mouse-tracking API  or  Alessandro
-       Rubini's  gpm  server.   If  you are using something other
-       than xterm there is no gpm daemon running on your machine,
-       mouse  events  will not be visible to ncurses(3X) (and the
-       wmousemask function will always return 0).
-
-       The z member in the event structure is not presently used.
-       It  is  intended  for use with touch screens (which may be
-       pressure-sensitive)   or   with   3D-mice/trackballs/power
-       gloves.
-
-
-
-

BUGS

-       Mouse  events under xterm will not in fact be ignored dur-
-       ing cooked mode, if they have been enabled by  wmousemask.
-       Instead,  the  xterm  mouse report sequence will appear in
-       the string read.
-
-       Mouse events under xterm will not be detected correctly in
-       a window with its keypad bit off.
-
-
-
-

SEE ALSO

-       curses(3X).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/Ada95/html/index.html b/Ada95/html/index.html index 50ec3abc..333c1321 100644 --- a/Ada95/html/index.html +++ b/Ada95/html/index.html @@ -7,8 +7,8 @@

Ada95 Binding for ncurses

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

Permission is hereby granted to reproduce and distribute this @@ -24,14 +24,14 @@ This binding comes AS IS with no warranty, implied or expressed.


General Remarks

    -
  • This document describes Version 00.93 of the binding.
  • +
  • This document describes Version 01.00 of the binding.
  • The functionality is modelled to be compatible with the ncurses package, a clone of the SVr4 curses model.
    I did the development on an Intel box running -Linux 1.3.x and 2.0, +Linux 1.3.x, 2.0, 2.2 ncurses-4.x and the GNU Ada Translator -gnat-3.09. For any older versions of ncurses and gnat +gnat versions 3.10p to 3.11p. 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 @@ -83,46 +83,47 @@ forms subsystem.
  • Hierarchy of packages

      -
    • Terminal_Interface -
      • Curses -
        • Mouse -
        • Panels -
          • User_Data +
          • Terminal_Interface +
            • Curses +
              • Mouse +
              • Panels + -
              • Menus -
                • Menu_User_Data -
                • Item_User_Data +
                • Menus + -
                • Forms -
                  • Form_User_Data -
                  • Field_User_Data -
                  • Field_Types -
                    • Alpha -
                    • AlphaNumeric -
                    • IntField -
                    • Numeric -
                    • RegExp -
                    • IPV4_Address -
                    • Enumeration - +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, diff --git a/Ada95/html/man/curs_addch.3x.html b/Ada95/html/man/curs_addch.3x.html new file mode 100644 index 00000000..1fc72618 --- /dev/null +++ b/Ada95/html/man/curs_addch.3x.html @@ -0,0 +1,174 @@ + + +
                      +       addch,  waddch,  mvaddch,  mvwaddch, echochar, wechochar -
                      +       add a character (with attributes) to a curses window, then
                      +       advance the cursor
                      +
                      +
                      +
                      +

                      SYNOPSIS

                      +       #include 
                      +
                      +       int addch(chtype ch);
                      +       int waddch(WINDOW *win, chtype ch);
                      +       int mvaddch(int y, int x, chtype ch);
                      +       int mvwaddch(WINDOW *win, int y, int x, chtype ch);
                      +       int echochar(chtype ch);
                      +       int wechochar(WINDOW *win, chtype ch);
                      +
                      +
                      +
                      +

                      DESCRIPTION

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

                      RETURN VALUE

                      +       All routines return the integer ERR upon failure and OK on
                      +       success (the SVr4 manuals specify only "an  integer  value
                      +       other than ERR") upon successful completion, unless other-
                      +       wise noted in the preceding routine descriptions.
                      +
                      +
                      +
                      +

                      NOTES

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

                      PORTABILITY

                      +       All  these functions are described in the XSI Curses stan-
                      +       dard, Issue 4.  The defaults specified  for  forms-drawing
                      +       characters apply in the POSIX locale.
                      +
                      +       Some  ACS symbols (ACS_S3, ACS_S7, ACS_LEQUAL, ACS_GEQUAL,
                      +       ACS_PI, ACS_NEQUAL, ACS_STERLING) were not  documented  in
                      +       any  publicly  released  System V.  However, many publicly
                      +       available terminfos include acsc strings  in  which  their
                      +       key  characters  (pryz{|}) are embedded, and a second-hand
                      +       ncurses(3X).
                      +
                      +
                      +
                      +

                      SEE ALSO

                      +       curses(3X), curs_attr(3X), curs_clear(3X),  curs_inch(3X),
                      +       curs_outopts(3X), curs_refresh(3X), putc(3S).
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      + + diff --git a/Ada95/html/curs_addchstr.3x.html b/Ada95/html/man/curs_addchstr.3x.html similarity index 95% rename from Ada95/html/curs_addchstr.3x.html rename to Ada95/html/man/curs_addchstr.3x.html index 3572b8c3..67f565d4 100644 --- a/Ada95/html/curs_addchstr.3x.html +++ b/Ada95/html/man/curs_addchstr.3x.html @@ -1,5 +1,5 @@ - +
                              addchstr,  addchnstr,  waddchstr,  waddchnstr, mvaddchstr,
                              mvaddchnstr, mvwaddchstr, mvwaddchnstr - add a  string  of
                      @@ -8,7 +8,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int addchstr(const chtype *chstr);
                              int addchnstr(const chtype *chstr, int n);
                      diff --git a/Ada95/html/curs_addstr.3x.html b/Ada95/html/man/curs_addstr.3x.html
                      similarity index 95%
                      rename from Ada95/html/curs_addstr.3x.html
                      rename to Ada95/html/man/curs_addstr.3x.html
                      index 916aafb9..6ca3cc77 100644
                      --- a/Ada95/html/curs_addstr.3x.html
                      +++ b/Ada95/html/man/curs_addstr.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              addstr,  addnstr,  waddstr, waddnstr, mvaddstr, mvaddnstr,
                              mvwaddstr, mvwaddnstr - add a string of  characters  to  a
                      @@ -8,7 +8,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int addstr(const char *str);
                              int addnstr(const char *str, int n);
                      diff --git a/Ada95/html/curs_attr.3x.html b/Ada95/html/man/curs_attr.3x.html
                      similarity index 72%
                      rename from Ada95/html/curs_attr.3x.html
                      rename to Ada95/html/man/curs_attr.3x.html
                      index dd64b5b4..5891268f 100644
                      --- a/Ada95/html/curs_attr.3x.html
                      +++ b/Ada95/html/man/curs_attr.3x.html
                      @@ -1,40 +1,45 @@
                       
                      -
                      +
                       
                              attroff,  wattroff,  attron,  wattron,  attrset, wattrset,
                      -       standend, wstandend, standout, wstandout - curses  charac-
                      -       ter and window attribute control routines
                      +       color_set,  wcolor_set,  standend,  wstandend,   standout,
                      +       wstandout  - curses character and window attribute control
                      +       routines
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                              int attroff(int attrs);
                              int wattroff(WINDOW *win, int attrs);
                              int attron(int attrs);
                              int wattron(WINDOW *win, int attrs);
                              int attrset(int attrs);
                              int wattrset(WINDOW *win, int attrs);
                      +       int color_set(short color_pair_number, void* opts);
                      +       int wcolor_set(WINDOW *win, short color_pair_number,
                      +             void* opts);
                              int standend(void);
                              int wstandend(WINDOW *win);
                              int standout(void);
                              int wstandout(WINDOW *win);
                      -       attr_t attr_get(void);
                      -       attr_t wattr_get(WINDOW *);
                      -       int attr_off(attr_t attrs);
                      -       int wattr_off(WINDOW *, attr_t attrs);
                      -       int attr_on(attr_t attrs);
                      -       int wattr_on(WINDOW *, attr_t attrs);
                      -       int attr_set(attr_t attrs);
                      -       int wattr_set(WINDOW *, attr_t attrs);
                      -       int  chgat(int  n,  attr_t  attr,  short color, const void
                      -       *opts)
                      -       int wchgat(WINDOW *, int n, attr_t attr,
                      +       int attr_get(attr_t *attrs, short *pair, void *opts);
                      +       int wattr_get(WINDOW *win, attr_t *attrs, short *pair,
                      +              void *opts);
                      +       int attr_off(attr_t attrs, void *opts);
                      +       int wattr_off(WINDOW *win, attr_t attrs, void *opts);
                      +       int attr_on(attr_t attrs, void *opts);
                      +       int wattr_on(WINDOW *win, attr_t attrs, void *opts);
                      +       int attr_set(attr_t attrs, void *opts);
                      +       int wattr_set(WINDOW *win, attr_t attrs, void *opts);
                      +       int chgat(int n, attr_t attr, short color,
                      +             const void *opts)
                      +       int wchgat(WINDOW *win, int n, attr_t attr,
                                    short color, const void *opts)
                              int mvchgat(int y, int x, int n, attr_t attr,
                                    short color, const void *opts)
                      -       int mvwchgat(WINDOW *, int y, int x, int n, attr_t attr,
                      -             short color, const void *opts)
                      +       int mvwchgat(WINDOW *win, int y, int x, int n,
                      +             attr_t attr, short color, const void *opts)
                       
                       
                       
                      @@ -52,15 +57,21 @@ The routine attrset sets the current attributes of the given window to attrs. The routine attroff turns off the named attributes without turning any other attributes on - or off. The routine attron turns on the named attributes - without affecting any others. The routine standout is the same as attron(A_STANDOUT). The routine standend is the same as attrset(A_NORMAL) or attrset(0), that is, it turns off all attributes. - the given window; attr_get returns the current attribute - for stdscr. The remaining attr_* functions operate - exactly like the corresponding attr* functions, except - that they take arguments of type attr_t rather than int. + + The routine color_set sets the current color of the given + window to the foreground/background combination described + by the color_pair_number. The parameter opts is reserved + for future use, applications must supply a null pointer. + + The routine wattr_get returns the current attribute and + color pair for the given window; attr_get returns the cur- + rent attribute and color pair for stdscr. The remaining + attr_* functions operate exactly like the corresponding + attr* functions, except that they take arguments of type + attr_t rather than int. The routine chgat changes the attributes of a given number of characters starting at the current cursor location of @@ -76,7 +87,7 @@ future (leave it NULL). Attributes - The following video attributes, defined in <curses.h>, can + The following video attributes, defined in , can be passed to the routines attron, attroff, and attrset, or OR'ed with the characters passed to addch. @@ -98,11 +109,6 @@ ingful (they are implemented as macro-expanded assignments and simply return their argument). The SVr4 manual page claims (falsely) that these routines always return 1. - - - -
                      -

                      NOTES

                              Note that attroff,  wattroff,  attron,  wattron,  attrset,
                              wattrset, standend and standout may be macros.
                       
                      @@ -113,6 +119,9 @@
                              dard, Issue 4.  The standard defined  the  dedicated  type
                              for  highlights,  attr_t,  which  is  not  defined in SVr4
                              curses. The functions taking attr_t arguments are not sup-
                      +       ported under SVr4.
                      +
                      +       The  XSI  Curses  standard  states that whether the tradi-
                              tional  functions  attron/attroff/attrset  can  manipulate
                              attributes  other  than A_BLINK, A_BOLD, A_DIM, A_REVERSE,
                              A_STANDOUT, or A_UNDERLINE is "unspecified".   Under  this
                      @@ -154,17 +163,6 @@
                       
                       
                       
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                       
                       
                       
                      diff --git a/Ada95/html/curs_beep.3x.html b/Ada95/html/man/curs_beep.3x.html similarity index 90% rename from Ada95/html/curs_beep.3x.html rename to Ada95/html/man/curs_beep.3x.html index 1abad227..930780ae 100644 --- a/Ada95/html/curs_beep.3x.html +++ b/Ada95/html/man/curs_beep.3x.html @@ -1,12 +1,12 @@ - +
                              beep, flash - curses bell and screen flash routines
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int beep(void);
                              int flash(void);
                      diff --git a/Ada95/html/curs_bkgd.3x.html b/Ada95/html/man/curs_bkgd.3x.html
                      similarity index 95%
                      rename from Ada95/html/curs_bkgd.3x.html
                      rename to Ada95/html/man/curs_bkgd.3x.html
                      index 6a3396ca..f84ee449 100644
                      --- a/Ada95/html/curs_bkgd.3x.html
                      +++ b/Ada95/html/man/curs_bkgd.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              bkgdset,  wbkgdset, bkgd, wbkgd - curses window background
                              manipulation routines
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              void bkgdset(const chtype ch);
                              void wbkgdset(WINDOW *win, const chtype ch);
                      diff --git a/Ada95/html/curs_border.3x.html b/Ada95/html/man/curs_border.3x.html
                      similarity index 95%
                      rename from Ada95/html/curs_border.3x.html
                      rename to Ada95/html/man/curs_border.3x.html
                      index 1d45fa20..dd4c0ca6 100644
                      --- a/Ada95/html/curs_border.3x.html
                      +++ b/Ada95/html/man/curs_border.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              border,  wborder, box, hline, whline, vline, wvline - cre-
                              ate curses borders, horizontal and vertical lines
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                              int border(chtype ls, chtype rs, chtype ts, chtype bs,
                                 chtype tl, chtype tr, chtype bl, chtype br);
                              int wborder(WINDOW *win, chtype ls, chtype rs,
                      @@ -35,7 +35,7 @@
                              any of these arguments is zero, then the following default
                              values  (defined in curses.h) are used instead: ACS_VLINE,
                              ACS_VLINE,     ACS_HLINE,     ACS_HLINE,     ACS_ULCORNER,
                      -       ACS_URCORNER, ACS_BLCORNER, ACS_BRCORNER.
                      +       ACS_URCORNER, ACS_LLCORNER, ACS_LRCORNER.
                       
                              box(win,  verch,  horch)  is a shorthand for the following
                              call: wborder(win, verch, verch, horch, horch,  0,  0,  0,
                      diff --git a/Ada95/html/curs_clear.3x.html b/Ada95/html/man/curs_clear.3x.html
                      similarity index 94%
                      rename from Ada95/html/curs_clear.3x.html
                      rename to Ada95/html/man/curs_clear.3x.html
                      index f2f3edf3..be7651bd 100644
                      --- a/Ada95/html/curs_clear.3x.html
                      +++ b/Ada95/html/man/curs_clear.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              erase,  werase,  clear,  wclear, clrtobot, wclrtobot, clr-
                              toeol, wclrtoeol - clear all or part of a curses window
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       # include <curses.h>
                      +       # include 
                       
                              int erase(void);
                              int werase(WINDOW *win);
                      diff --git a/Ada95/html/curs_color.3x.html b/Ada95/html/man/curs_color.3x.html
                      similarity index 97%
                      rename from Ada95/html/curs_color.3x.html
                      rename to Ada95/html/man/curs_color.3x.html
                      index dab8b2fe..a360965e 100644
                      --- a/Ada95/html/curs_color.3x.html
                      +++ b/Ada95/html/man/curs_color.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              start_color,     init_pair,     init_color,    has_colors,
                              can_change_color,  color_content,  pair_content  -  curses
                      @@ -8,7 +8,7 @@
                       
                       

                      SYNOPSIS

                      -       # include <curses.h>
                      +       # include 
                              int start_color(void);
                              int init_pair(short pair, short f, short b);
                              int init_color(short color, short r, short g, short b);
                      @@ -30,7 +30,7 @@
                              background color (for the blank field on which the charac-
                              ters are displayed).  A programmer  initializes  a  color-
                              pair  with  the routine init_pair.  After it has been ini-
                      -       tialized, COLOR_PAIR(n), a macro  defined  in  <curses.h>,
                      +       tialized, COLOR_PAIR(n), a macro  defined  in  ,
                              can be used as a new video attribute.
                       
                              If  a  terminal  is capable of redefining colors, the pro-
                      diff --git a/Ada95/html/curs_delch.3x.html b/Ada95/html/man/curs_delch.3x.html
                      similarity index 92%
                      rename from Ada95/html/curs_delch.3x.html
                      rename to Ada95/html/man/curs_delch.3x.html
                      index ebc85781..38b9946c 100644
                      --- a/Ada95/html/curs_delch.3x.html
                      +++ b/Ada95/html/man/curs_delch.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              delch,  wdelch, mvdelch, mvwdelch - delete character under
                              the cursor in a curses window
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int delch(void);
                              int wdelch(WINDOW *win);
                      diff --git a/Ada95/html/curs_deleteln.3x.html b/Ada95/html/man/curs_deleteln.3x.html
                      similarity index 92%
                      rename from Ada95/html/curs_deleteln.3x.html
                      rename to Ada95/html/man/curs_deleteln.3x.html
                      index b0a74abf..f177ee27 100644
                      --- a/Ada95/html/curs_deleteln.3x.html
                      +++ b/Ada95/html/man/curs_deleteln.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              deleteln,  wdeleteln,  insdelln, winsdelln, insertln, win-
                              sertln - delete and insert lines in a curses window
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int deleteln(void);
                              int wdeleteln(WINDOW *win);
                      @@ -51,7 +51,7 @@
                       
                       

                      NOTES

                      -       Note that all but winsdelln may be a macros.
                      +       Note that all but winsdelln may be macros.
                       
                              These  routines  do  not require a hardware line delete or
                              insert feature in the terminal.  In fact, they  won't  use
                      diff --git a/Ada95/html/curs_getch.3x.html b/Ada95/html/man/curs_getch.3x.html
                      similarity index 96%
                      rename from Ada95/html/curs_getch.3x.html
                      rename to Ada95/html/man/curs_getch.3x.html
                      index 52d23976..376dd599 100644
                      --- a/Ada95/html/curs_getch.3x.html
                      +++ b/Ada95/html/man/curs_getch.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              getch,  wgetch,  mvgetch, mvwgetch, ungetch - get (or push
                              back) characters from curses terminal keyboard
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int getch(void);
                              int wgetch(WINDOW *win);
                      @@ -45,7 +45,7 @@
                              If  keypad  is  TRUE,  and  a function key is pressed, the
                              token for that function key is returned instead of the raw
                              characters.    Possible   function  keys  are  defined  in
                      -       <curses.h> as macros with  values  outside  the  range  of
                      +        as macros with  values  outside  the  range  of
                              8-bit  characters  whose  names  begin  with KEY_. Thus, a
                              variable intended to hold the return value of  a  function
                              key must be of short size or larger.
                      @@ -64,7 +64,7 @@
                       
                       
                          Function Keys
                      -       The  following function keys, defined in <curses.h>, might
                      +       The  following function keys, defined in , might
                              be returned by getch if keypad  has  been  enabled.   Note
                              that  not  all  of  these are necessarily supported on any
                              particular terminal.
                      @@ -74,8 +74,8 @@
                              KEY_BREAK/Break  key  KEY_DOWN/The  four  arrow  keys  ...
                              KEY_UP  KEY_LEFT  KEY_RIGHT KEY_HOME/Home key (upward+left
                              arrow) KEY_BACKSPACE/Backspace  KEY_F0/T{  Function  keys;
                      -       space  for 64 keys is reserved.  T} KEY_F(n)/T{ For 0 <= n
                      -       <=   63   T}   KEY_DL/Delete   line   KEY_IL/Insert   line
                      +       space  for 64 keys is reserved.  T} KEY_F(n)/T{ For 0 <= n
                      +       <=   63   T}   KEY_DL/Delete   line   KEY_IL/Insert   line
                              KEY_DC/Delete character KEY_IC/Insert char or enter insert
                              mode KEY_EIC/Exit insert char mode KEY_CLEAR/Clear  screen
                              KEY_EOS/Clear  to  end  of  screen KEY_EOL/Clear to end of
                      @@ -149,7 +149,7 @@
                              Note that getch, mvgetch, and mvwgetch may be macros.
                       
                              Historically, the set of keypad macros was largely defined
                      -       by  the  extremely  function-key-rich keyboard of the AT&T
                      +       by  the  extremely  function-key-rich keyboard of the AT&T
                              7300, aka 3B1, aka Safari 4.   Modern  personal  computers
                              usually  have  only a small subset of these.  IBM PC-style
                              consoles  typically  support  little  more  than   KEY_UP,
                      diff --git a/Ada95/html/curs_getstr.3x.html b/Ada95/html/man/curs_getstr.3x.html
                      similarity index 96%
                      rename from Ada95/html/curs_getstr.3x.html
                      rename to Ada95/html/man/curs_getstr.3x.html
                      index 9d14eb7c..384545e0 100644
                      --- a/Ada95/html/curs_getstr.3x.html
                      +++ b/Ada95/html/man/curs_getstr.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              getstr,  wgetstr,  mvgetstr,  mvwgetstr, wgetnstr - accept
                              character strings from curses terminal keyboard
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int getstr(char *str);
                              int getnstr(char *str, int n);
                      diff --git a/Ada95/html/curs_getyx.3x.html b/Ada95/html/man/curs_getyx.3x.html
                      similarity index 89%
                      rename from Ada95/html/curs_getyx.3x.html
                      rename to Ada95/html/man/curs_getyx.3x.html
                      index 89231567..1c1b5e77 100644
                      --- a/Ada95/html/curs_getyx.3x.html
                      +++ b/Ada95/html/man/curs_getyx.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              getyx,  getparyx,  getbegyx,  getmaxyx - get curses cursor
                              and window coordinates
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              void getyx(WINDOW *win, int y, int x);
                              void getparyx(WINDOW *win, int y, int x);
                      @@ -39,7 +39,7 @@
                       
                       

                      NOTES

                      -       All of these interfaces are macros and  that  "&"  is  not
                      +       All of these interfaces are macros and  that  "&"  is  not
                              necessary before the variables y and x.
                       
                       
                      diff --git a/Ada95/html/curs_inch.3x.html b/Ada95/html/man/curs_inch.3x.html
                      similarity index 87%
                      rename from Ada95/html/curs_inch.3x.html
                      rename to Ada95/html/man/curs_inch.3x.html
                      index cb7dd9be..a6310540 100644
                      --- a/Ada95/html/curs_inch.3x.html
                      +++ b/Ada95/html/man/curs_inch.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              inch,  winch,  mvinch,  mvwinch  -  get  a  character  and
                              attributes from a curses window
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              chtype inch(void);
                              chtype winch(WINDOW *win);
                      @@ -21,7 +21,7 @@
                              the   current  position  in  the  named  window.   If  any
                              attributes are set for that  position,  their  values  are
                              OR'ed  into  the  value  returned.   Constants  defined in
                      -       <curses.h> can be used with the & (logical  AND)  operator
                      +        can be used with the & (logical  AND)  operator
                              to extract the character or attributes alone.
                       
                       
                      diff --git a/Ada95/html/curs_inchstr.3x.html b/Ada95/html/man/curs_inchstr.3x.html
                      similarity index 91%
                      rename from Ada95/html/curs_inchstr.3x.html
                      rename to Ada95/html/man/curs_inchstr.3x.html
                      index c8b5fde8..9a14c855 100644
                      --- a/Ada95/html/curs_inchstr.3x.html
                      +++ b/Ada95/html/man/curs_inchstr.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              inchstr,   inchnstr,   winchstr,   winchnstr,   mvinchstr,
                              mvinchnstr, mvwinchstr, mvwinchnstr  -  get  a  string  of
                      @@ -8,7 +8,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int inchstr(chtype *chstr);
                              int inchnstr(chtype *chstr, int n);
                      @@ -28,8 +28,8 @@
                              named window and ending at the right margin of the window.
                              The  four  functions with n as the last argument, return a
                              leading substring at most n characters long (exclusive  of
                      -       the  trailing (chtype)0).  Constants defined in <curses.h>
                      -       can be used with the & (logical AND) operator  to  extract
                      +       the  trailing (chtype)0).  Constants defined in 
                      +       can be used with the & (logical AND) operator  to  extract
                              the  character or the attribute alone from any position in
                              the chstr [see curs_inch(3X)].
                       
                      diff --git a/Ada95/html/curs_initscr.3x.html b/Ada95/html/man/curs_initscr.3x.html
                      similarity index 97%
                      rename from Ada95/html/curs_initscr.3x.html
                      rename to Ada95/html/man/curs_initscr.3x.html
                      index 78d883ab..38e367ba 100644
                      --- a/Ada95/html/curs_initscr.3x.html
                      +++ b/Ada95/html/man/curs_initscr.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              initscr,  newterm, endwin, isendwin, set_term, delscreen -
                              curses screen initialization and manipulation routines
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              WINDOW *initscr(void);
                              int endwin(void);
                      diff --git a/Ada95/html/curs_inopts.3x.html b/Ada95/html/man/curs_inopts.3x.html
                      similarity index 98%
                      rename from Ada95/html/curs_inopts.3x.html
                      rename to Ada95/html/man/curs_inopts.3x.html
                      index 47eab78c..4f82389b 100644
                      --- a/Ada95/html/curs_inopts.3x.html
                      +++ b/Ada95/html/man/curs_inopts.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              cbreak, nocbreak, echo, noecho, halfdelay, intrflush, key-
                              pad, meta,  nodelay,  notimeout,  raw,  noraw,  noqiflush,
                      @@ -9,7 +9,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int cbreak(void);
                              int nocbreak(void);
                      @@ -162,7 +162,7 @@
                              Issue 4.
                       
                              The  ncurses  library obeys the XPG4 standard and the his-
                      -       torical practice of the AT&T  curses  implementations,  in
                      +       torical practice of the AT&T  curses  implementations,  in
                              that  the  echo bit is cleared when curses initializes the
                              terminal state.  BSD curses differed from  this  slightly;
                              ity,  set echo or noecho explicitly just after initializa-
                      diff --git a/Ada95/html/curs_insch.3x.html b/Ada95/html/man/curs_insch.3x.html
                      similarity index 92%
                      rename from Ada95/html/curs_insch.3x.html
                      rename to Ada95/html/man/curs_insch.3x.html
                      index 36b7f32b..1281ca92 100644
                      --- a/Ada95/html/curs_insch.3x.html
                      +++ b/Ada95/html/man/curs_insch.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              insch,  winsch,  mvinsch,  mvwinsch  -  insert a character
                              before cursor in a curses window
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int insch(chtype ch);
                              int winsch(WINDOW *win, chtype ch);
                      diff --git a/Ada95/html/curs_insstr.3x.html b/Ada95/html/man/curs_insstr.3x.html
                      similarity index 93%
                      rename from Ada95/html/curs_insstr.3x.html
                      rename to Ada95/html/man/curs_insstr.3x.html
                      index a6fe2b45..b33902a0 100644
                      --- a/Ada95/html/curs_insstr.3x.html
                      +++ b/Ada95/html/man/curs_insstr.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              insstr,  insnstr,  winsstr, winsnstr, mvinsstr, mvinsnstr,
                              mvwinsstr, mvwinsnstr - insert string before cursor  in  a
                      @@ -8,7 +8,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                              int insstr(const char *str);
                              int insnstr(const char *str, int n);
                              int winsstr(WINDOW *win, const char *str);
                      @@ -29,7 +29,7 @@
                              acters  on  the line being lost.  The cursor position does
                              not change (after moving to y, x, if specified). The  four
                              routines with n as the last argument insert a leading sub-
                      -       string of at most n characters.  If n<=0, then the  entire
                      +       string of at most n characters.  If n<=0, then the  entire
                              string is inserted.
                       
                              If  a  character in str is a tab, newline, carriage return
                      @@ -40,7 +40,7 @@
                              in the ^X notation.  Calling winch after adding a  control
                              character (and moving to it, if necessary) does not return
                              the control character, but instead returns a character  in
                      -       the the ^-representation of the control character.
                      +       the ^-representation of the control character.
                       
                       
                       
                      diff --git a/Ada95/html/curs_instr.3x.html b/Ada95/html/man/curs_instr.3x.html similarity index 95% rename from Ada95/html/curs_instr.3x.html rename to Ada95/html/man/curs_instr.3x.html index 487bd07c..863bc616 100644 --- a/Ada95/html/curs_instr.3x.html +++ b/Ada95/html/man/curs_instr.3x.html @@ -1,5 +1,5 @@ - +
                              instr,  innstr, winstr, winnstr, mvinstr, mvinnstr, mvwin-
                              str, mvwinnstr - get a string of characters from a  curses
                      @@ -8,7 +8,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int instr(char *str);
                              int innstr(char *str, int n);
                      diff --git a/Ada95/html/curs_kernel.3x.html b/Ada95/html/man/curs_kernel.3x.html
                      similarity index 92%
                      rename from Ada95/html/curs_kernel.3x.html
                      rename to Ada95/html/man/curs_kernel.3x.html
                      index fe706d52..9e88ccaa 100644
                      --- a/Ada95/html/curs_kernel.3x.html
                      +++ b/Ada95/html/man/curs_kernel.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              def_prog_mode,       def_shell_mode,      reset_prog_mode,
                              reset_shell_mode, resetty, savetty, getsyx, setsyx, ripof-
                      @@ -8,7 +8,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int def_prog_mode(void);
                              int def_shell_mode(void);
                      @@ -73,7 +73,7 @@
                              dow that has been allocated and an integer with the number
                              of columns in the window.  Inside this initialization rou-
                              tine, the integer variables LINES  and  COLS  (defined  in
                      -       <curses.h>) are not guaranteed to be accurate and wrefresh
                      +       ) are not guaranteed to be accurate and wrefresh
                              or doupdate must not be called.  It is allowable  to  call
                              wnoutrefresh during the initialization routine.
                       
                      @@ -98,13 +98,13 @@
                       
                       

                      NOTES

                      -       Note that getsyx is a macro, so & is not necessary  before
                      +       Note that getsyx is a macro, so & is not necessary  before
                              the variables y and x.
                       
                      -       The  SVr4 man pages warn that the return value of curs_set
                      -       "is currently incorrect".   This  implementation  gets  it
                      -       right, but it may be unwise to count on the correctness of
                      -       the return value anywhere else.
                      +       Older  SVr4  man  pages  warn  that  the  return  value of
                      +       curs_set "is currently  incorrect".   This  implementation
                      +       gets  it  right, but it may be unwise to count on the cor-
                      +       rectness of the return value anywhere else.
                       
                       
                       
                      diff --git a/Ada95/html/man/curs_mouse.3x.html b/Ada95/html/man/curs_mouse.3x.html new file mode 100644 index 00000000..57b93a5a --- /dev/null +++ b/Ada95/html/man/curs_mouse.3x.html @@ -0,0 +1,224 @@ + + +
                      +       getmouse,  ungetmouse,  mousemask, wenclose, wmouse_trafo,
                      +       mouseinterval - mouse interface through curses
                      +
                      +
                      +
                      +

                      SYNOPSIS

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

                      DESCRIPTION

                      +       These  functions provide an interface to mouse events from
                      +       ncurses(3X).  Mouse events are  represented  by  KEY_MOUSE
                      +       pseudo-key values in the wgetch input stream.
                      +
                      +       To  make mouse events visible, use the mousemask function.
                      +       This will  set  the  mouse  events  to  be  reported.   By
                      +       default,  no mouse events are reported.  The function will
                      +       return a mask to indicate which  of  the  specified  mouse
                      +       events  can be reported; on complete failure it returns 0.
                      +       If oldmask is non-NULL, this function fills the  indicated
                      +       location  with  the  previous  value of the given window's
                      +       mouse event mask.
                      +
                      +       As a side effect, setting a zero mousemask  may  turn  off
                      +       the  mouse pointer; setting a nonzero mask may turn it on.
                      +       Whether this happens is device-dependent.
                      +
                      +       Here are the mouse event type masks:
                      +
                      +       l l _ _ l l.   Name Description  BUTTON1_PRESSED     mouse
                      +       button   1  down  BUTTON1_RELEASED    mouse  button  1  up
                      +       BUTTON1_CLICKED     mouse      button      1       clicked
                      +       BUTTON1_DOUBLE_CLICKED   mouse  button  1  double  clicked
                      +       BUTTON1_TRIPLE_CLICKED   mouse  button  1  triple  clicked
                      +       BUTTON2_PRESSED     mouse        button       2       down
                      +       BUTTON2_RELEASED    mouse        button        2        up
                      +       BUTTON2_CLICKED     mouse       button      2      clicked
                      +       BUTTON2_DOUBLE_CLICKED   mouse  button  2  double  clicked
                      +       BUTTON3_RELEASED    mouse        button        3        up
                      +       BUTTON3_CLICKED     mouse      button      3       clicked
                      +       BUTTON3_DOUBLE_CLICKED   mouse  button  3  double  clicked
                      +       BUTTON3_TRIPLE_CLICKED   mouse  button  3  triple  clicked
                      +       BUTTON4_PRESSED     mouse        button       4       down
                      +       BUTTON4_RELEASED    mouse        button        4        up
                      +       BUTTON4_CLICKED     mouse       button      4      clicked
                      +       BUTTON4_DOUBLE_CLICKED   mouse  button  4  double  clicked
                      +       BUTTON4_TRIPLE_CLICKED   mouse  button  4  triple  clicked
                      +       BUTTON_SHIFT   shift was down during button  state  change
                      +       BUTTON_CTRL    control was down during button state change
                      +       BUTTON_ALT     alt was down  during  button  state  change
                      +       ALL_MOUSE_EVENTS    report   all   button   state  changes
                      +       REPORT_MOUSE_POSITION    report mouse movement
                      +
                      +       Once a class of mouse events have been made visible  in  a
                      +       window,  calling  the  wgetch  function on that window may
                      +       return KEY_MOUSE as an indicator that a  mouse  event  has
                      +       been queued.  To read the event data and pop the event off
                      +       the queue, call getmouse.  This function will return OK if
                      +       a mouse event is actually visible in the given window, ERR
                      +       otherwise.  When getmouse returns OK, the  data  deposited
                      +       as  y  and  x  in  the event structure coordinates will be
                      +       screen-relative character-cell coordinates.  The  returned
                      +       state  mask  will have exactly one bit set to indicate the
                      +       event type.
                      +
                      +       The ungetmouse function behaves  analogously  to  ungetch.
                      +       It  pushes  a  KEY_MOUSE  event  onto the input queue, and
                      +       associates with  that  event  the  given  state  data  and
                      +       screen-relative character-cell coordinates.
                      +
                      +       The  wenclose  function  tests  whether  a  given  pair of
                      +       screen-relative character-cell coordinates is enclosed  by
                      +       a  given  window, returning TRUE if it is and FALSE other-
                      +       wise.  It is useful for determining  what  subset  of  the
                      +       screen windows enclose the location of a mouse event.
                      +
                      +       The wmouse_trafo function transforms a given pair of coor-
                      +       dinates from stdscr-relative coordinates  to  screen-rela-
                      +       tive  coordinates  or  vice  versa.  Please remember, that
                      +       stdscr-relative coordinates are not  always  identical  to
                      +       screen-relative   coordinates  due  to  the  mechanism  to
                      +       reserve lines on top or bottom of  the  screen  for  other
                      +       purposes  (ripoff() call, see also slk_...  functions). If
                      +       the parameter to_screen is TRUE, the pointers pY, pX  must
                      +       reference  the coordinates of a location inside the window
                      +       win. They are converted to screen-relative coordinates and
                      +       returned  through the pointers. If the conversion was suc-
                      +       cessful, the function returns TRUE. If one of the  parame-
                      +       ters  was  NULL  or the location is not inside the window,
                      +       FALSE is returned. If to_screen is FALSE, the pointers pY,
                      +       encloses  this  point.  In  this case the function returns
                      +       TRUE. If one of the parameters is NULL or the point is not
                      +       inside  the window, FALSE is returned. Please notice, that
                      +       the referenced coordinates are only replaced by  the  con-
                      +       verted coordinates if the transformation was successful.
                      +
                      +       The mouseinterval function sets the maximum time (in thou-
                      +       sands of a second)  that  can  elapse  between  press  and
                      +       release  events  in  order  for them to be recognized as a
                      +       click.  This function returns the previous interval value.
                      +       The default is one fifth of a second.
                      +
                      +       Note  that  mouse  events will be ignored when input is in
                      +       cooked mode, and will cause an error beep when cooked mode
                      +       is  being simulated in a window by a function such as get-
                      +       str that expects a linefeed for input-loop termination.
                      +
                      +
                      +
                      +
                      +

                      RETURN VALUE

                      +       getmouse, ungetmouse and mouseinterval return the  integer
                      +       ERR  upon failure or OK upon successful completion. mouse-
                      +       mask returns the mask of reportable events.  wenclose  and
                      +       wmouse_trafo are boolean functions returning TRUE or FALSE
                      +       depending on their test result.
                      +
                      +
                      +
                      +

                      PORTABILITY

                      +       These calls were designed for  ncurses(3X),  and  are  not
                      +       found in SVr4 curses, 4.4BSD curses, or any other previous
                      +       version of curses.
                      +
                      +       The feature macro NCURSES_MOUSE_VERSION is provided so the
                      +       preprocessor  can  be  used to test whether these features
                      +       are present (its value is 1).   NOTE:  THIS  INTERFACE  IS
                      +       EXPERIMENTAL  AND IS SUBJECT TO CHANGE WITHOUT NOTICE!  If
                      +       the interface is changed, the value of  NCURSES_MOUSE_VER-
                      +       SION will be incremented.
                      +
                      +       The  order  of the MEVENT structure members is not guaran-
                      +       teed.  Additional fields may be added to the structure  in
                      +       the future.
                      +
                      +       Under  ncurses(3X),  these  calls  are  implemented  using
                      +       either xterm's built-in mouse-tracking API  or  Alessandro
                      +       Rubini's  gpm  server.   If  you are using something other
                      +       than xterm there is no gpm daemon running on your machine,
                      +       mouse  events  will not be visible to ncurses(3X) (and the
                      +       wmousemask function will always return 0).
                      +
                      +       The z member in the event structure is not presently used.
                      +       It  is  intended  for use with touch screens (which may be
                      +       pressure-sensitive)   or   with   3D-mice/trackballs/power
                      +       gloves.
                      +       Mouse  events under xterm will not in fact be ignored dur-
                      +       ing cooked mode, if they have been enabled by  wmousemask.
                      +       Instead,  the  xterm  mouse report sequence will appear in
                      +       the string read.
                      +
                      +       Mouse events under xterm will not be detected correctly in
                      +       a window with its keypad bit off.
                      +
                      +
                      +
                      +

                      SEE ALSO

                      +       curses(3X).
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      + + diff --git a/Ada95/html/curs_move.3x.html b/Ada95/html/man/curs_move.3x.html similarity index 91% rename from Ada95/html/curs_move.3x.html rename to Ada95/html/man/curs_move.3x.html index 4edbae80..0fdf84b2 100644 --- a/Ada95/html/curs_move.3x.html +++ b/Ada95/html/man/curs_move.3x.html @@ -1,12 +1,12 @@ - +
                              move, wmove - move curses window cursor
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int move(int y, int x);
                              int wmove(WINDOW *win, int y, int x);
                      diff --git a/Ada95/html/curs_outopts.3x.html b/Ada95/html/man/curs_outopts.3x.html
                      similarity index 93%
                      rename from Ada95/html/curs_outopts.3x.html
                      rename to Ada95/html/man/curs_outopts.3x.html
                      index 7c5ec4bb..72401f5d 100644
                      --- a/Ada95/html/curs_outopts.3x.html
                      +++ b/Ada95/html/man/curs_outopts.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              clearok,   idlok,   idcok   immedok,  leaveok,  setscrreg,
                              wsetscrreg, scrollok, nl, nonl - curses output options
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int clearok(WINDOW *win, bool bf);
                              int idlok(WINDOW *win, bool bf);
                      @@ -97,7 +97,7 @@
                              The  nl  and  nonl routines control whether the underlying
                              display device translates the return key into  newline  on
                              input,  and  whether it translates newline into return and
                      -       line-feed on output (in either case,  the  call  addch('0)
                      +       line-feed on output (in either case, the call  addch('\n')
                              does the equivalent of return and line feed on the virtual
                              screen).  Initially, these translations do occur.  If  you
                              disable  them using nonl, curses will be able to make bet-
                      @@ -117,7 +117,7 @@
                              The  XSI  Curses  standard is ambiguous on the question of
                              whether raw() should disable the  CRLF  translations  con-
                              trolled by nl() and nonl().  BSD curses did turn off these
                      -       translations; AT&T curses (at least as late as  SVr1)  did
                      +       translations; AT&T curses (at least as late as  SVr1)  did
                              not.   We choose to do so, on the theory that a programmer
                              requesting raw input wants a clean (ideally  8-bit  clean)
                              connection that the operating system does not mess with.
                      @@ -136,12 +136,13 @@
                       
                              The  XSI  Curses standard does not mention that the cursor
                              should be made invisible  as  a  side-effect  of  leaveok.
                      -       SVr4 curses does this.
                      +       SVr4  curses  documentation  does  this, but the code does
                      +       not.
                       
                       
                       

                      NOTES

                      -       Note  that clearok, leaveok, scrollok, idcok, nl, nonl and
                      +       Note that clearok, leaveok, scrollok, idcok, nl, nonl  and
                              setscrreg may be macros.
                       
                              The immedok routine is useful for windows that are used as
                      @@ -150,7 +151,7 @@
                       
                       

                      SEE ALSO

                      -       curses(3X),         curs_addch(3X),        curs_clear(3X),
                      +       curses(3X),        curs_addch(3X),         curs_clear(3X),
                              curs_initscr(3X), curs_scroll(3X), curs_refresh(3X)
                       
                       
                      @@ -166,7 +167,6 @@
                       
                       
                       
                      -
                       
                      diff --git a/Ada95/html/curs_overlay.3x.html b/Ada95/html/man/curs_overlay.3x.html similarity index 95% rename from Ada95/html/curs_overlay.3x.html rename to Ada95/html/man/curs_overlay.3x.html index 4c892d66..e9c155e1 100644 --- a/Ada95/html/curs_overlay.3x.html +++ b/Ada95/html/man/curs_overlay.3x.html @@ -1,5 +1,5 @@ - +
                              overlay, overwrite, copywin - overlay and manipulate over-
                              lapped curses windows
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int overlay(const WINDOW *srcwin, WINDOW *dstwin);
                              int overwrite(const WINDOW *srcwin, WINDOW *dstwin);
                      diff --git a/Ada95/html/curs_pad.3x.html b/Ada95/html/man/curs_pad.3x.html
                      similarity index 97%
                      rename from Ada95/html/curs_pad.3x.html
                      rename to Ada95/html/man/curs_pad.3x.html
                      index 721b8ed9..d8eccd6b 100644
                      --- a/Ada95/html/curs_pad.3x.html
                      +++ b/Ada95/html/man/curs_pad.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              newpad, subpad, prefresh, pnoutrefresh, pechochar - create
                              and display curses pads
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              WINDOW *newpad(int nlines, int ncols);
                              WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
                      diff --git a/Ada95/html/curs_print.3x.html b/Ada95/html/man/curs_print.3x.html
                      similarity index 93%
                      rename from Ada95/html/curs_print.3x.html
                      rename to Ada95/html/man/curs_print.3x.html
                      index 9848edf9..e3dc345a 100644
                      --- a/Ada95/html/curs_print.3x.html
                      +++ b/Ada95/html/man/curs_print.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              mcprint - ship binary data to printer
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int mcprint(char *data, int len);
                       
                      diff --git a/Ada95/html/curs_printw.3x.html b/Ada95/html/man/curs_printw.3x.html
                      similarity index 88%
                      rename from Ada95/html/curs_printw.3x.html
                      rename to Ada95/html/man/curs_printw.3x.html
                      index 899d9741..a50bad36 100644
                      --- a/Ada95/html/curs_printw.3x.html
                      +++ b/Ada95/html/man/curs_printw.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              printw,  wprintw,  mvprintw,  mvwprintw,  vwprintw - print
                              formatted output in curses windows
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int printw(char *fmt [, arg] ...);
                              int wprintw(WINDOW *win, char *fmt [, arg] ...);
                      @@ -15,7 +15,7 @@
                              int mvwprintw(WINDOW *win, int y, int x,
                                    char *fmt [, arg] ...);
                       
                      -       #include <varargs.h>
                      +       #include 
                              int vwprintw(WINDOW *win, char *fmt, varglist);
                       
                       
                      @@ -29,7 +29,7 @@
                              The   vwprintw   routine  is  analogous  to  vprintf  [see
                              printf(3S)] and performs a wprintw using a variable  argu-
                              ment  list.  The third argument is a va_list, a pointer to
                      -       a list of arguments, as defined in <varargs.h>.
                      +       a list of arguments, as defined in .
                       
                       
                       
                      @@ -44,7 +44,7 @@ The XSI Curses standard, Issue 4 describes these func- tions. The function vwprintw is marked TO BE WITHDRAWN, and is to be replaced by a function vw_printw using the - <stdarg.h> interface. + interface.
                      diff --git a/Ada95/html/curs_refresh.3x.html b/Ada95/html/man/curs_refresh.3x.html similarity index 97% rename from Ada95/html/curs_refresh.3x.html rename to Ada95/html/man/curs_refresh.3x.html index 9e44730f..51a6a3b2 100644 --- a/Ada95/html/curs_refresh.3x.html +++ b/Ada95/html/man/curs_refresh.3x.html @@ -1,5 +1,5 @@ - +
                              refresh, wrefresh, wnoutrefresh, doupdate, redrawwin, wre-
                              drawln - refresh curses windows and lines
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int refresh(void);
                              int wrefresh(WINDOW *win);
                      diff --git a/Ada95/html/curs_scanw.3x.html b/Ada95/html/man/curs_scanw.3x.html
                      similarity index 92%
                      rename from Ada95/html/curs_scanw.3x.html
                      rename to Ada95/html/man/curs_scanw.3x.html
                      index 5dfe2078..521d3c29 100644
                      --- a/Ada95/html/curs_scanw.3x.html
                      +++ b/Ada95/html/man/curs_scanw.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              scanw,  wscanw,  mvscanw, mvwscanw, vwscanw - convert for-
                              matted input from a curses widow
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int scanw(char *fmt [, arg] ...);
                              int wscanw(WINDOW *win, char *fmt [, arg] ...);
                      @@ -28,7 +28,7 @@
                              The vwscanw routine is similar to vwprintw in that it per-
                              forms  a wscanw using a variable argument list.  The third
                              argument is a va_list, a pointer to a list  of  arguments,
                      -       as defined in <varargs.h>.
                      +       as defined in .
                       
                       
                       
                      @@ -46,7 +46,7 @@ The XSI Curses standard, Issue 4 describes these func- tions. The function vwscanw is marked TO BE WITHDRAWN, and is to be replaced by a function vw_scanw using the - <stdarg.h> interface. + interface.
                      diff --git a/Ada95/html/curs_scr_dmp.3x.html b/Ada95/html/man/curs_scr_dmp.3x.html similarity index 95% rename from Ada95/html/curs_scr_dmp.3x.html rename to Ada95/html/man/curs_scr_dmp.3x.html index 5565d235..5c613394 100644 --- a/Ada95/html/curs_scr_dmp.3x.html +++ b/Ada95/html/man/curs_scr_dmp.3x.html @@ -1,5 +1,5 @@ - +
                              scr_dump,  scr_restore, scr_init, scr_set - read (write) a
                              curses screen from (to) a file
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int scr_dump(const char *filename);
                              int scr_restore(const char *filename);
                      diff --git a/Ada95/html/man/curs_scr_dump.3x.html b/Ada95/html/man/curs_scr_dump.3x.html
                      new file mode 100644
                      index 00000000..5c613394
                      --- /dev/null
                      +++ b/Ada95/html/man/curs_scr_dump.3x.html
                      @@ -0,0 +1,122 @@
                      +
                      +
                      +
                      +       scr_dump,  scr_restore, scr_init, scr_set - read (write) a
                      +       curses screen from (to) a file
                      +
                      +
                      +
                      +

                      SYNOPSIS

                      +       #include 
                      +
                      +       int scr_dump(const char *filename);
                      +       int scr_restore(const char *filename);
                      +       int scr_init(const char *filename);
                      +       int scr_set(const char *filename);
                      +
                      +
                      +
                      +

                      DESCRIPTION

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

                      RETURN VALUE

                      +       All routines return the integer ERR upon  failure  and  OK
                      +       upon success.
                      +
                      +
                      +
                      +

                      NOTES

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

                      PORTABILITY

                      +       The XSI Curses standard, Issue 4,  describes  these  func-
                      +       is also considered invalid "if the time-stamp of  the  tty
                      +       is old" but don't define "old".
                      +
                      +
                      +
                      +

                      SEE ALSO

                      +       curses(3X),       curs_initscr(3X),      curs_refresh(3X),
                      +       curs_util(3X), system(3S)
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      + + diff --git a/Ada95/html/curs_scroll.3x.html b/Ada95/html/man/curs_scroll.3x.html similarity index 94% rename from Ada95/html/curs_scroll.3x.html rename to Ada95/html/man/curs_scroll.3x.html index 9c3ebe7f..c8908a56 100644 --- a/Ada95/html/curs_scroll.3x.html +++ b/Ada95/html/man/curs_scroll.3x.html @@ -1,12 +1,12 @@ - +
                              scroll, srcl, wscrl - scroll a curses window
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int scroll(WINDOW *win);
                              int scrl(int n);
                      diff --git a/Ada95/html/curs_slk.3x.html b/Ada95/html/man/curs_slk.3x.html
                      similarity index 50%
                      rename from Ada95/html/curs_slk.3x.html
                      rename to Ada95/html/man/curs_slk.3x.html
                      index ea4a16af..d76728a9 100644
                      --- a/Ada95/html/curs_slk.3x.html
                      +++ b/Ada95/html/man/curs_slk.3x.html
                      @@ -1,14 +1,15 @@
                       
                      -
                      +
                       
                              slk_init,     slk_set,    slk_refresh,    slk_noutrefresh,
                              slk_label, slk_clear, slk_restore, slk_touch,  slk_attron,
                      -       slk_attrset, slk_attroff - curses soft label routines
                      +       slk_attrset,  slk_attroff,  slk_color  - curses soft label
                      +       routines
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int slk_init(int fmt);
                              int slk_set(int labnum, const char *label, int fmt);
                      @@ -18,71 +19,76 @@
                              int slk_clear(void);
                              int slk_restore(void);
                              int slk_touch(void);
                      -       int slk_attron(attr_t attrs);
                      -       int slk_attrset(attr_t attrs);
                      +       int slk_attron(const chtype attrs);
                      +       int slk_attrset(const chtype attrs);
                              attr_t slk_attr(void);
                      -       int slk_attroff(attr_t attrs);
                      +       int slk_attroff(const chtype attrs);
                      +       int slk_color(short color_pair_number);
                       
                       
                       

                      DESCRIPTION

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

                      RETURN VALUE

                              These routines return ERR upon failure and OK (SVr4 speci-
                              fies only "an integer value other than ERR") upon success-
                      -       ful  completion.  slk_attr  returns the attribute used for
                      +       ful completion. slk_attr returns the  attribute  used  for
                              the soft keys.
                       
                              slk_label returns NULL on error.
                      @@ -96,11 +102,11 @@
                       
                       

                      PORTABILITY

                      -       The  XSI  Curses  standard, Issue 4, describes these func-
                      -       tions.  It changes the argument  type  of  the  attribute-
                      -       manipulation     functions     slk_attron,    slk_attroff,
                      -       slk_attrset to be attr_t, and adds const  qualifiers.  The
                      -       format  codes  2  and  3  for  slk_init() and the function
                      +       The XSI Curses standard, Issue 4,  describes  these  func-
                      +       tions.   It  changes  the  argument type of the attribute-
                      +       manipulation    functions     slk_attron,     slk_attroff,
                      +       slk_attrset  to  be attr_t, and adds const qualifiers. The
                      +       format codes 2 and  3  for  slk_init()  and  the  function
                              slk_attr are specific to ncurses.
                       
                       
                      @@ -111,12 +117,6 @@
                       
                       
                       
                      -
                      -
                      -
                      -
                      -
                      -
                       
                      diff --git a/Ada95/html/curs_termattrs.3x.html b/Ada95/html/man/curs_termattrs.3x.html similarity index 96% rename from Ada95/html/curs_termattrs.3x.html rename to Ada95/html/man/curs_termattrs.3x.html index d0a17431..fcc417a2 100644 --- a/Ada95/html/curs_termattrs.3x.html +++ b/Ada95/html/man/curs_termattrs.3x.html @@ -1,5 +1,5 @@ - +
                              baudrate,  erasechar,  has_ic, has_il, killchar, longname,
                              termattrs, termname - curses environment query routines
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int baudrate(void);
                              char erasechar(void);
                      diff --git a/Ada95/html/curs_termcap.3x.html b/Ada95/html/man/curs_termcap.3x.html
                      similarity index 63%
                      rename from Ada95/html/curs_termcap.3x.html
                      rename to Ada95/html/man/curs_termcap.3x.html
                      index 5f448c49..62830ae9 100644
                      --- a/Ada95/html/curs_termcap.3x.html
                      +++ b/Ada95/html/man/curs_termcap.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              tgetent, tgetflag, tgetnum, tgetstr, tgoto, tputs - direct
                              curses interface to the terminfo capability database
                      @@ -7,8 +7,8 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      -       #include <term.h>
                      +       #include 
                      +       #include 
                              int tgetent(const char *bp, char *name);
                              int tgetflag(const char *id);
                              int tgetnum(const char *id);
                      @@ -31,18 +31,21 @@
                              terminfo  database  could  not  be  found.   The emulation
                              ignores the buffer pointer bp.
                       
                      -       The tgetflag routine gets the boolean entry for id.
                      +       The tgetflag routine gets the boolean  entry  for  id,  or
                      +       zero if it is not available.
                       
                      -       The tgetnum routine gets the numeric entry for id.
                      +       The  tgetnum  routine gets the numeric entry for id, or -1
                      +       if it is not available.
                       
                      -       The tgetstr routine returns the string entry for id.   Use
                      -       tputs to output the returned string.
                      +       The tgetstr routine returns the string entry  for  id,  or
                      +       zero  if  it  is  not  available.  Use tputs to output the
                      +       returned string.
                       
                      -       The  tgoto  routine  instantiates  the parameters into the
                      -       given capability.  The output from this routine is  to  be
                      +       The tgoto routine instantiates  the  parameters  into  the
                      +       given  capability.   The output from this routine is to be
                              passed to tputs.
                       
                      -       The  tputs  routine  is described on the curs_terminfo(3X)
                      +       The tputs routine is described  on  the  curs_terminfo(3X)
                              manual page.  It can retrieve capabilities by either term-
                              cap or terminfo name.
                       
                      @@ -50,34 +53,32 @@
                       
                       

                      RETURN VALUE

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

                      BUGS

                              If you call tgetstr to fetch ca or any other parameterized
                      +       string, be aware that it  will  be  returned  in  terminfo
                      +       notation,  not  the older and not-quite-compatible termcap
                              notation.  This won't cause problems if all you do with it
                      -       is call tgoto or tparm, which both expand  terminfo-style.
                      +       is  call tgoto or tparm, which both expand terminfo-style.
                       
                      -       Because  terminfo  conventions for representing padding in
                      -       string capabilities differ  from  termcap's,  tputs("50");
                      -       will  put  out a literal "50" rather than busy-waiting for
                      +       Because terminfo conventions for representing  padding  in
                      +       string  capabilities  differ  from termcap's, tputs("50");
                      +       will put out a literal "50" rather than  busy-waiting  for
                              50 milliseconds.  Cope with it.
                       
                       
                       

                      PORTABILITY

                      -       The XSI Curses standard, Issue  4  describes  these  func-
                      -       tions.   However,  they are marked TO BE WITHDRAWN and may
                      +       The  XSI  Curses  standard,  Issue 4 describes these func-
                      +       tions.  However, they are marked TO BE WITHDRAWN  and  may
                              be removed in future versions.
                       
                      -       Neither the XSI Curses standard nor  the  SVr4  man  pages
                      -       documented  the return values of tgetent correctly, though
                      +       Neither  the  XSI  Curses  standard nor the SVr4 man pages
                      +       documented the return values of tgetent correctly,  though
                              all three were in fact returned ever since SVr1.
                       
                       
                      @@ -110,9 +111,6 @@
                       
                       
                       
                      -
                      -
                      -
                       
                       
                       
                      diff --git a/Ada95/html/curs_terminfo.3x.html b/Ada95/html/man/curs_terminfo.3x.html
                      similarity index 86%
                      rename from Ada95/html/curs_terminfo.3x.html
                      rename to Ada95/html/man/curs_terminfo.3x.html
                      index 85d536f4..2f90578c 100644
                      --- a/Ada95/html/curs_terminfo.3x.html
                      +++ b/Ada95/html/man/curs_terminfo.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              setupterm, setterm, set_curterm, del_curterm, restartterm,
                              tparm, tputs, putp, vidputs,  vidattr,  mvcur,  tigetflag,
                      @@ -9,8 +9,8 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      -       #include <term.h>
                      +       #include 
                      +       #include 
                       
                              int setupterm(const char *term, int fildes, int *errret);
                              int setterm(const char *term);
                      @@ -144,32 +144,34 @@
                              name passed to them, such as xenl.
                       
                              The tigetflag routine returns the value -1 if  capname  is
                      -       not a boolean capability.
                      +       not  a  boolean  capability,  or  0  if it is cancelled or
                      +       absent from the terminal description.
                       
                      -       The  tigetnum  routine  returns the value -2 if capname is
                      -       not a numeric capability.
                      +       The tigetnum routine returns the value -2  if  capname  is
                      +       not  a  numeric  capability,  or  -1 if it is cancelled or
                      +       absent from the terminal description.
                       
                              The tigetstr routine returns the value (char *)-1 if  cap-
                      -       name is not a string capability.
                      +       name  is  not a string capability, or 0 if it is cancelled
                      +       or absent from the terminal description.
                       
                              The capname for each capability is given in the table col-
                      -       umn entitled capname code in the capabilities  section  of
                      +       umn  entitled  capname code in the capabilities section of
                              terminfo(5).
                       
                              char *boolnames, *boolcodes, *boolfnames
                       
                      -       char *numnames, *numcodes, *numfnames
                       
                      -       char *strnames, *strcodes, *strfnames
                      -       termcap codes, and the full C names, for each of the  ter-
                      +       These null-terminated arrays  contain  the  capnames,  the
                      +       termcap  codes, and the full C names, for each of the ter-
                              minfo variables.
                       
                       
                       

                      RETURN VALUE

                      -       Routines  that  return  an integer return ERR upon failure
                      -       and OK (SVr4 only specifies "an integer value  other  than
                      -       ERR")  upon  successful completion, unless otherwise noted
                      +       Routines that return an integer return  ERR  upon  failure
                      +       and  OK  (SVr4 only specifies "an integer value other than
                      +       ERR") upon successful completion, unless  otherwise  noted
                              in the preceding routine descriptions.
                       
                              Routines that return pointers always return NULL on error.
                      @@ -177,9 +179,9 @@
                       
                       

                      NOTES

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

                      PORTABILITY

                      -       The function setterm is not described in  the  XSI  Curses
                      -       standard  and  must be considered non-portable.  All other
                      +       The  function  setterm  is not described in the XSI Curses
                      +       standard and must be considered non-portable.   All  other
                              functions are as described in the XSI curses standard.
                       
                      -       In System V Release 4, set_curterm has an int return  type
                      -       and  returns  OK  or ERR.  We have chosen to implement the
                      +       In  System V Release 4, set_curterm has an int return type
                      +       and returns OK or ERR.  We have chosen  to  implement  the
                              XSI Curses semantics.
                       
                              In System V Release 4, the third argument of tputs has the
                      @@ -204,7 +206,7 @@
                       
                       

                      SEE ALSO

                      -       curses(3X), curs_initscr(3X), curs_kernel(3X),  curs_term-
                      +       curses(3X),  curs_initscr(3X), curs_kernel(3X), curs_term-
                              cap(3X), putc(3S), terminfo(5)
                       
                       
                      @@ -219,8 +221,6 @@
                       
                       
                       
                      -
                      -
                       
                      diff --git a/Ada95/html/curs_touch.3x.html b/Ada95/html/man/curs_touch.3x.html similarity index 95% rename from Ada95/html/curs_touch.3x.html rename to Ada95/html/man/curs_touch.3x.html index b38a2566..1f558bf8 100644 --- a/Ada95/html/curs_touch.3x.html +++ b/Ada95/html/man/curs_touch.3x.html @@ -1,5 +1,5 @@ - +
                              touchwin, touchline, untouchwin, wtouchln, is_linetouched,
                              is_wintouched - curses refresh control routines
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                              int touchwin(WINDOW *win);
                              int touchline(WINDOW *win, int start, int count);
                              int untouchwin(WINDOW *win);
                      diff --git a/Ada95/html/curs_util.3x.html b/Ada95/html/man/curs_util.3x.html
                      similarity index 95%
                      rename from Ada95/html/curs_util.3x.html
                      rename to Ada95/html/man/curs_util.3x.html
                      index 34d167d1..e6d8f742 100644
                      --- a/Ada95/html/curs_util.3x.html
                      +++ b/Ada95/html/man/curs_util.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              unctrl,   keyname,   filter,   use_env,   putwin,  getwin,
                              delay_output, flushinp - miscellaneous curses utility rou-
                      @@ -8,7 +8,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              char *unctrl(chtype c);
                              char *keyname(int c);
                      @@ -85,8 +85,8 @@
                       
                       

                      NOTES

                      -       Note  that  unctrl  is  a macro, which is defined in <unc-
                      -       trl.h>.
                      +       Note  that  unctrl  is  a macro, which is defined in <unc-
                      +       trl.h>.
                       
                       
                       
                      diff --git a/Ada95/html/curs_window.3x.html b/Ada95/html/man/curs_window.3x.html similarity index 97% rename from Ada95/html/curs_window.3x.html rename to Ada95/html/man/curs_window.3x.html index 70a2236c..c4e2738d 100644 --- a/Ada95/html/curs_window.3x.html +++ b/Ada95/html/man/curs_window.3x.html @@ -1,5 +1,5 @@ - +
                              newwin,  delwin,  mvwin, subwin, derwin, mvderwin, dupwin,
                              wsyncup, syncok, wcursyncup,  wsyncdown  -  create  curses
                      @@ -8,10 +8,10 @@
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              WINDOW *newwin(int nlines, int ncols, int begin_y,
                      -             intbegin_x);
                      +             int begin_x);
                              int delwin(WINDOW *win);
                              int mvwin(WINDOW *win, int y, int x);
                              WINDOW *subwin(WINDOW *orig, int nlines, int ncols,
                      diff --git a/Ada95/html/define_key.3x.html b/Ada95/html/man/define_key.3x.html
                      similarity index 84%
                      rename from Ada95/html/define_key.3x.html
                      rename to Ada95/html/man/define_key.3x.html
                      index 585285cd..2e18202b 100644
                      --- a/Ada95/html/define_key.3x.html
                      +++ b/Ada95/html/man/define_key.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              define_key - define a keycode
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int define_key(char *definition, int keycode);
                       
                      @@ -20,7 +20,9 @@
                              terminfo database.
                       
                              If  the  given string is null, any existing definition for
                      -       the keycode is removed.
                      +       the keycode is removed.  Similarly, if the  given  keycode
                      +       is  negative  or  zero,  any existing string for the given
                      +       definition is removed.
                       
                       
                       
                      @@ -63,8 +65,6 @@ - -
                      diff --git a/Ada95/html/dft_fgbg.3x.html b/Ada95/html/man/dft_fgbg.3x.html similarity index 93% rename from Ada95/html/dft_fgbg.3x.html rename to Ada95/html/man/dft_fgbg.3x.html index b13ea12d..a19446f7 100644 --- a/Ada95/html/dft_fgbg.3x.html +++ b/Ada95/html/man/dft_fgbg.3x.html @@ -1,12 +1,12 @@ - +
                              dft_fgbg - use terminal's default colors
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int use_default_colors(void);
                       
                      diff --git a/Ada95/html/form.3x.html b/Ada95/html/man/form.3x.html
                      similarity index 96%
                      rename from Ada95/html/form.3x.html
                      rename to Ada95/html/man/form.3x.html
                      index 39b9e4f3..ef414e32 100644
                      --- a/Ada95/html/form.3x.html
                      +++ b/Ada95/html/man/form.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              form - curses extension for programming forms
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                       
                       
                       
                      @@ -148,8 +148,8 @@

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       files <curses.h> and <eti.h>.
                      +       The header file  automatically includes the header
                      +       files  and .
                       
                              In your library list, libform.a  should  be  before  libn-
                              curses.a; that is, you want to say `-lform -lncurses', not
                      diff --git a/Ada95/html/form_cursor.3x.html b/Ada95/html/man/form_cursor.3x.html
                      similarity index 83%
                      rename from Ada95/html/form_cursor.3x.html
                      rename to Ada95/html/man/form_cursor.3x.html
                      index 6afc48ca..fbfbac86 100644
                      --- a/Ada95/html/form_cursor.3x.html
                      +++ b/Ada95/html/man/form_cursor.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              form_cursor - position a form window cursor
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int pos_form_cursor(FORM *form);
                       
                       
                      @@ -43,8 +43,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_data.3x.html b/Ada95/html/man/form_data.3x.html similarity index 75% rename from Ada95/html/form_data.3x.html rename to Ada95/html/man/form_data.3x.html index 72eef44e..d07992cc 100644 --- a/Ada95/html/form_data.3x.html +++ b/Ada95/html/man/form_data.3x.html @@ -1,12 +1,12 @@ - +
                      -       form_data -
                      +       form_data - test for off-screen data in given forms
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              bool data_ahead(const FORM *form);
                              bool data_behind(const FORM *form);
                       
                      @@ -29,8 +29,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_driver.3x.html b/Ada95/html/man/form_driver.3x.html similarity index 95% rename from Ada95/html/form_driver.3x.html rename to Ada95/html/man/form_driver.3x.html index c4d122c8..c3c2a623 100644 --- a/Ada95/html/form_driver.3x.html +++ b/Ada95/html/man/form_driver.3x.html @@ -1,12 +1,12 @@ - +
                              form_driver - command-processing loop of the form system
                       
                       
                       

                      SYNOPSIS

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

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       files <curses.h>.
                      +       The header file  automatically includes the header
                      +       files .
                       
                       
                       
                      diff --git a/Ada95/html/form_field.3x.html b/Ada95/html/man/form_field.3x.html similarity index 94% rename from Ada95/html/form_field.3x.html rename to Ada95/html/man/form_field.3x.html index df9822f9..470f01df 100644 --- a/Ada95/html/form_field.3x.html +++ b/Ada95/html/man/form_field.3x.html @@ -1,5 +1,5 @@ - +
                              form_field - make and break connections between fields and
                              forms
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_form_fields(FORM *form, FIELD **fields);
                              FIELD **form_fields(const FORM *form);
                              int field_count(const FORM *form);
                      diff --git a/Ada95/html/form_field_attributes.3x.html b/Ada95/html/man/form_field_attributes.3x.html
                      similarity index 88%
                      rename from Ada95/html/form_field_attributes.3x.html
                      rename to Ada95/html/man/form_field_attributes.3x.html
                      index 3cef5851..2408cbcb 100644
                      --- a/Ada95/html/form_field_attributes.3x.html
                      +++ b/Ada95/html/man/form_field_attributes.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              form_field_attributes  -  color  and attribute control for
                              form fields
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_field_fore(FIELD *field, chtype attr);
                              chtype field_fore(const FIELD *field);
                              int set_field_back(FIELD *field, chtype attr);
                      @@ -55,8 +55,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_field_buffer.3x.html b/Ada95/html/man/form_field_buffer.3x.html similarity index 88% rename from Ada95/html/form_field_buffer.3x.html rename to Ada95/html/man/form_field_buffer.3x.html index 5fca7372..5586ab10 100644 --- a/Ada95/html/form_field_buffer.3x.html +++ b/Ada95/html/man/form_field_buffer.3x.html @@ -1,12 +1,12 @@ - +
                              form_field_buffer - field buffer control
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int  set_field_buffer(FIELD  *field,  int  buf, const char
                              *value);
                              char *field_buffer(const FIELD *field, int buffer);
                      @@ -23,7 +23,7 @@
                              may be allocated by applications through the nbuf argument
                              of (see form_field_new(3X)) but are not manipulated by the
                              forms  library.   The  function  field_buffer  returns the
                      -       foreground attribute.
                      +       address of the buffer.
                       
                              The function set_field_status sets the  associated  status
                              flag  of  field; field_status gets the current value.  The
                      @@ -61,8 +61,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                              These routines emulate the System V forms  library.   They
                              were not supported on Version 7 or BSD versions.
                       
                      diff --git a/Ada95/html/form_field_info.3x.html b/Ada95/html/man/form_field_info.3x.html
                      similarity index 87%
                      rename from Ada95/html/form_field_info.3x.html
                      rename to Ada95/html/man/form_field_info.3x.html
                      index 334f0588..a13d3ada 100644
                      --- a/Ada95/html/form_field_info.3x.html
                      +++ b/Ada95/html/man/form_field_info.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              form_field_info - retrieve field characteristics
                       
                       
                       

                      SYNOPSIS

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

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_field_just.3x.html b/Ada95/html/man/form_field_just.3x.html similarity index 85% rename from Ada95/html/form_field_just.3x.html rename to Ada95/html/man/form_field_just.3x.html index c95657ef..36917070 100644 --- a/Ada95/html/form_field_just.3x.html +++ b/Ada95/html/man/form_field_just.3x.html @@ -1,12 +1,12 @@ - +
                              form_field_just - retrieve field characteristics
                       
                       
                       

                      SYNOPSIS

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

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_field_new.3x.html b/Ada95/html/man/form_field_new.3x.html similarity index 90% rename from Ada95/html/form_field_new.3x.html rename to Ada95/html/man/form_field_new.3x.html index 9860310b..f581e77c 100644 --- a/Ada95/html/form_field_new.3x.html +++ b/Ada95/html/man/form_field_new.3x.html @@ -1,12 +1,12 @@ - +
                              form_field_new - create and destroy form fields
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              FIELD *new_field(int height, int width,
                                               int toprow, int leftcol,
                                               int offscreen, int nbuffers);
                      @@ -61,8 +61,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                              These routines emulate the System V forms  library.   They
                              were not supported on Version 7 or BSD versions.
                       
                      diff --git a/Ada95/html/form_field_opts.3x.html b/Ada95/html/man/form_field_opts.3x.html
                      similarity index 89%
                      rename from Ada95/html/form_field_opts.3x.html
                      rename to Ada95/html/man/form_field_opts.3x.html
                      index d1be72bc..5eabb112 100644
                      --- a/Ada95/html/form_field_opts.3x.html
                      +++ b/Ada95/html/man/form_field_opts.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              form_field_opts - set and get field options
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_field_opts(FIELD *field, OPTIONS opts);
                              int field_opts_on(FIELD *field, OPTIONS opts);
                              int field_opts_off(FIELD *field, OPTIONS opts);
                      @@ -85,8 +85,8 @@
                              curses(3X), form(3X).
                       
                       
                      -       NOTES  The header file <form.h> automatically includes the
                      -              header file <curses.h>.
                      +       NOTES  The header file  automatically includes the
                      +              header file .
                       
                       
                       
                      diff --git a/Ada95/html/form_field_userptr.3x.html b/Ada95/html/man/form_field_userptr.3x.html similarity index 83% rename from Ada95/html/form_field_userptr.3x.html rename to Ada95/html/man/form_field_userptr.3x.html index dc61c29c..5c626dd7 100644 --- a/Ada95/html/form_field_userptr.3x.html +++ b/Ada95/html/man/form_field_userptr.3x.html @@ -1,5 +1,5 @@ - +
                              form_field_userptr  -  associate  application  data with a
                              form field
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_field_userptr(FIELD *field, void*userptr);
                              void *field_userptr(const FIELD *field);
                       
                      @@ -37,8 +37,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_field_validation.3x.html b/Ada95/html/man/form_field_validation.3x.html similarity index 95% rename from Ada95/html/form_field_validation.3x.html rename to Ada95/html/man/form_field_validation.3x.html index a8b5671a..34f39b45 100644 --- a/Ada95/html/form_field_validation.3x.html +++ b/Ada95/html/man/form_field_validation.3x.html @@ -1,12 +1,12 @@ - +
                              form_field_validation - data type validation for fields
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_field_type(FIELD *field, FIELDTYPE *type, ...);
                              FIELDTYPE *field_type(const FIELD *field);
                              void *field_arg(const FIELD *field);
                      @@ -111,8 +111,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_fieldtype.3x.html b/Ada95/html/man/form_fieldtype.3x.html similarity index 93% rename from Ada95/html/form_fieldtype.3x.html rename to Ada95/html/man/form_fieldtype.3x.html index d56915ef..f70a9400 100644 --- a/Ada95/html/form_fieldtype.3x.html +++ b/Ada95/html/man/form_fieldtype.3x.html @@ -1,12 +1,12 @@ - +
                              form_fieldtype - define validation-field types
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              FIELDTYPE *new_fieldtype(
                                  bool (* const field_check)(FIELD *, const void *),
                                  bool (* const char_check)(int, const void *));
                      @@ -92,8 +92,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                              All of the (char *) arguments of  these  functions  should
                              actually  be (void *).  The type has been left uncorrected
                      diff --git a/Ada95/html/form_hook.3x.html b/Ada95/html/man/form_hook.3x.html
                      similarity index 87%
                      rename from Ada95/html/form_hook.3x.html
                      rename to Ada95/html/man/form_hook.3x.html
                      index d010b959..698c07f8 100644
                      --- a/Ada95/html/form_hook.3x.html
                      +++ b/Ada95/html/man/form_hook.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              form_hook - set hooks for automatic invocation by applica-
                              tions
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_field_init(FORM *form, void (*func)(FORM *));
                              void (*)(FORM *) field_init(const FORM *form);
                              int set_field_term(FORM *form, void (*func)(FORM *));
                      @@ -40,9 +40,9 @@
                              any (NULL if there is no such hook).
                       
                              The  function  set_form_term  sets  a hook to be called at
                      -       form-unpost time and just before a page change change once
                      -       it  is  posted.   form_init  returns the current form term
                      -       hook, if any (NULL if there is no such hook).
                      +       form-unpost time and just before a page change once it  is
                      +       posted.   form_init returns the current form term hook, if
                      +       any (NULL if there is no such hook).
                       
                       
                       
                      diff --git a/Ada95/html/form_new.3x.html b/Ada95/html/man/form_new.3x.html similarity index 84% rename from Ada95/html/form_new.3x.html rename to Ada95/html/man/form_new.3x.html index 7527ca97..98dfd326 100644 --- a/Ada95/html/form_new.3x.html +++ b/Ada95/html/man/form_new.3x.html @@ -1,12 +1,12 @@ - +
                              form_new - create and destroy forms
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              FORM *new_form(FIELD **fields);
                              int free_form(FORM *form);
                       
                      @@ -47,8 +47,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_new_page.3x.html b/Ada95/html/man/form_new_page.3x.html similarity index 84% rename from Ada95/html/form_new_page.3x.html rename to Ada95/html/man/form_new_page.3x.html index b2f5deb4..ef7cffca 100644 --- a/Ada95/html/form_new_page.3x.html +++ b/Ada95/html/man/form_new_page.3x.html @@ -1,12 +1,12 @@ - +
                              form_new_page - form pagination functions
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_new_page(FIELD *field, bool new_page_flag);
                              bool new_page(const FIELD *field);
                       
                      @@ -44,8 +44,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_opts.3x.html b/Ada95/html/man/form_opts.3x.html similarity index 87% rename from Ada95/html/form_opts.3x.html rename to Ada95/html/man/form_opts.3x.html index 839facd1..f4e6ce31 100644 --- a/Ada95/html/form_opts.3x.html +++ b/Ada95/html/man/form_opts.3x.html @@ -1,12 +1,12 @@ - +
                              form_opts - set and get form options
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_form_opts(FORM *form, OPTIONS opts);
                              int form_opts_on(FORM *form, OPTIONS opts);
                              int form_opts_off(FORM *form, OPTIONS opts);
                      @@ -59,8 +59,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_page.3x.html b/Ada95/html/man/form_page.3x.html similarity index 88% rename from Ada95/html/form_page.3x.html rename to Ada95/html/man/form_page.3x.html index 7715748f..700f8e07 100644 --- a/Ada95/html/form_page.3x.html +++ b/Ada95/html/man/form_page.3x.html @@ -1,12 +1,12 @@ - +
                              form_page - set and get form page number
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_current_field(FORM *form, FIELD *field);
                              FIELD *current_field(const FORM *);
                              int set_form_page(FORM *form, int n);
                      @@ -61,8 +61,8 @@
                       

                      SEE ALSO

                              curses(3X), form(3X).
                       
                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_post.3x.html b/Ada95/html/man/form_post.3x.html similarity index 87% rename from Ada95/html/form_post.3x.html rename to Ada95/html/man/form_post.3x.html index 6ca86909..cec8b245 100644 --- a/Ada95/html/form_post.3x.html +++ b/Ada95/html/man/form_post.3x.html @@ -1,5 +1,5 @@ - +
                              form_post  -  write or erase forms from associated subwin-
                              dows
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int post_form(FORM *form);
                              int unpost_form(FORM *form);
                       
                      @@ -61,8 +61,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                              These routines emulate the System V forms  library.   They
                              were not supported on Version 7 or BSD versions.
                       
                      diff --git a/Ada95/html/form_requestname.3x.html b/Ada95/html/man/form_requestname.3x.html
                      similarity index 83%
                      rename from Ada95/html/form_requestname.3x.html
                      rename to Ada95/html/man/form_requestname.3x.html
                      index ac1a5f3c..f37efdc4 100644
                      --- a/Ada95/html/form_requestname.3x.html
                      +++ b/Ada95/html/man/form_requestname.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              form_requestname - handle printable form request names
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              const char *form_request_name(int request);
                              int form_request_by_name(const char *name);
                       
                      @@ -34,8 +34,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_userptr.3x.html b/Ada95/html/man/form_userptr.3x.html similarity index 83% rename from Ada95/html/form_userptr.3x.html rename to Ada95/html/man/form_userptr.3x.html index 5eac8966..49dbc78c 100644 --- a/Ada95/html/form_userptr.3x.html +++ b/Ada95/html/man/form_userptr.3x.html @@ -1,12 +1,12 @@ - +
                              form_userptr - associate application data with a form item
                       
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_form_userptr(FORM *form, void *userptr);
                              void* form_userptr(const FORM *form);
                       
                      @@ -37,8 +37,8 @@
                       
                       

                      NOTES

                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/form_win.3x.html b/Ada95/html/man/form_win.3x.html similarity index 84% rename from Ada95/html/form_win.3x.html rename to Ada95/html/man/form_win.3x.html index 3d5e94b1..fdb60b7c 100644 --- a/Ada95/html/form_win.3x.html +++ b/Ada95/html/man/form_win.3x.html @@ -1,5 +1,5 @@ - +
                              form_win  - make and break form window and subwindow asso-
                              ciations
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <form.h>
                      +       #include 
                              int set_form_win(FORM *form, WINDOW *win);
                              WINDOW *form_win(const FORM *form);
                              int set_form_sub(FORM *form, WINDOW *sub);
                      @@ -31,8 +31,8 @@
                              treated as a request to change  the  system  default  form
                              window or subwindow.
                       
                      -       The   function   scale_window  returns  the  minimum  size
                      -       required for the subwindow of form.
                      +       The  function scale_form returns the minimum size required
                      +       for the subwindow of form.
                       
                       
                       
                      @@ -61,8 +61,8 @@

                      SEE ALSO

                              curses(3X), form(3X).
                       
                      -       The header file <form.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/keyok.3x.html b/Ada95/html/man/keyok.3x.html similarity index 89% rename from Ada95/html/keyok.3x.html rename to Ada95/html/man/keyok.3x.html index 3cf442dc..ba188ece 100644 --- a/Ada95/html/keyok.3x.html +++ b/Ada95/html/man/keyok.3x.html @@ -1,12 +1,12 @@ - +
                              keyok - enable or disable a keycode
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int keyok(int keycode, bool enable);
                       
                      diff --git a/Ada95/html/menu.3x.html b/Ada95/html/man/menu.3x.html
                      similarity index 96%
                      rename from Ada95/html/menu.3x.html
                      rename to Ada95/html/man/menu.3x.html
                      index 68d79251..eee145d1 100644
                      --- a/Ada95/html/menu.3x.html
                      +++ b/Ada95/html/man/menu.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              menu - curses extension for programming menus
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                       
                       
                       
                      @@ -134,8 +134,8 @@

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       files <curses.h> and <eti.h>.
                      +       The header file  automatically includes the header
                      +       files  and .
                       
                              In your library list, libmenu.a  should  be  before  libn-
                              curses.a; that is, you want to say `-lmenu -lncurses', not
                      diff --git a/Ada95/html/menu_attribs.3x.html b/Ada95/html/man/menu_attribs.3x.html
                      similarity index 90%
                      rename from Ada95/html/menu_attribs.3x.html
                      rename to Ada95/html/man/menu_attribs.3x.html
                      index 3bb11d64..a9110c00 100644
                      --- a/Ada95/html/menu_attribs.3x.html
                      +++ b/Ada95/html/man/menu_attribs.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              menu_attributes - color and attribute control for menus
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_menu_fore(MENU *menu, chtype attr);
                              chtype menu_fore(const MENU *menu);
                              int set_menu_back(MENU *menu, chtype attr);
                      @@ -61,8 +61,8 @@
                              curses(3X) and 3X pages  whose  names  begin  "menu_"  for
                              detailed descriptions of the entry points.
                       
                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_cursor.3x.html b/Ada95/html/man/menu_cursor.3x.html similarity index 83% rename from Ada95/html/menu_cursor.3x.html rename to Ada95/html/man/menu_cursor.3x.html index e65f687e..71bd279e 100644 --- a/Ada95/html/menu_cursor.3x.html +++ b/Ada95/html/man/menu_cursor.3x.html @@ -1,12 +1,12 @@ - +
                              menu_cursor - position a menu's cursor
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int pos_menu_cursor(const MENU *menu);
                       
                       
                      @@ -42,8 +42,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_driver.3x.html b/Ada95/html/man/menu_driver.3x.html similarity index 50% rename from Ada95/html/menu_driver.3x.html rename to Ada95/html/man/menu_driver.3x.html index 53babc77..40c11f8a 100644 --- a/Ada95/html/menu_driver.3x.html +++ b/Ada95/html/man/menu_driver.3x.html @@ -1,12 +1,12 @@ - +
                              menu_driver - command-processing loop of the menu system
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int menu_driver(MENU *menu, int c);
                       
                       
                      @@ -14,9 +14,10 @@
                       

                      DESCRIPTION

                              Once a menu has been posted (displayed), you should funnel
                              input events to it through menu_driver.  This routine  has
                      -       two  major input cases; either the input is a menu naviga-
                      -       tion request or it's a  printable  ASCII  character.   The
                      -       menu driver requests are as follows:
                      +       three  major input cases; either the input is a menu navi-
                      +       gation request, it's a printable ASCII character or it  is
                      +       the  KEY_MOUSE special key associated with an mouse event.
                      +       The menu driver requests are as follows:
                       
                              REQ_LEFT_ITEM
                                   Move left to an item.
                      @@ -56,11 +57,10 @@
                       
                              REQ_TOGGLE_ITEM
                                   Select/deselect an item.
                      -
                                   Clear the menu pattern buffer.
                       
                              REQ_BACK_PATTERN
                      -            Delete   the  previous  character  from  the  pattern
                      +            Delete  the  previous  character  from  the   pattern
                                   buffer.
                       
                              REQ_NEXT_MATCH
                      @@ -75,19 +75,40 @@
                              such match, menu_driver returns E_NO_MATCH and deletes the
                              appended character from the buffer.
                       
                      -       If  the  second  argument  is one of the above pre-defined
                      +       If the second argument is one  of  the  above  pre-defined
                              requests, the corresponding action is performed.
                       
                      -       If the second argument is neither printable ASCII nor  one
                      -       of  the above pre-defined menu requests, the drive assumes
                      -       it  is  an  application-specific   command   and   returns
                      -       E_UNKNOWN_COMMAND.  Application-defined commands should be
                      -       defined relative to  MAX_COMMAND,  the  maximum  value  of
                      -       these pre-defined requests.
                      -
                      +       If  the  second argument is the KEY_MOUSE special key, the
                      +       associated mouse event is translated into one of the above
                      +       pre-defined  requests.   Currently only clicks in the user
                      +       window (e.g. inside the menu display area or  the  decora-
                      +       tion  window)  are handled. If you click above the display
                      +       region of the menu, a REQ_SCR_ULINE is generated,  if  you
                      +       doubleclick  a  REQ_SCR_UPAGE  is  generated  and  if  you
                      +       tripleclick a REQ_FIRST_ITEM is generated.  If  you  click
                      +       below  the  display region of the menu, a REQ_SCR_DLINE is
                      +       generated, if you doubleclick a REQ_SCR_DPAGE is generated
                      +       and  if  you  tripleclick a REQ_LAST_ITEM is generated. If
                      +       you click at an item inside the display area of the  menu,
                      +       the menu cursor is positioned to that item. If you double-
                      +       click at  an  item  a  REQ_TOGGLE_ITEM  is  generated  and
                      +       E_UNKNOWN_COMMAND  is  returned.  This  return value makes
                      +       sense, because a double click usually means that an  item-
                      +       specific  action should be returned. It's exactly the pur-
                      +       pose of this return value to signal  that  an  application
                      +       specific command should be executed. If a translation into
                      +       a request was done, menu_driver returns the result of this
                      +       request.   If  you  clicked outside the user window or the
                      +       mouse event couldn't be translated into a menu request  an
                      +       E_REQUEST_DENIED is returned.
                      +
                      +       If  the second argument is neither printable ASCII nor one
                      +       of the above pre-defined menu requests or  KEY_MOUSE,  the
                      +       drive  assumes  it  is an application-specific command and
                      +       returns E_UNKNOWN_COMMAND.   Application-defined  commands
                      +       should  be  defined  relative  to MAX_COMMAND, the maximum
                      +       value of these pre-defined requests.
                       
                      -
                      -

                      RETURN VALUE

                              menu_driver return one of the following error codes:
                       
                              E_OK The routine succeeded.
                      @@ -96,7 +117,7 @@
                                   System error occurred (see errno).
                       
                              E_BAD_ARGUMENT
                      -            Routine  detected  an incorrect or out-of-range argu-
                      +            Routine detected an incorrect or  out-of-range  argu-
                                   ment.
                       
                              E_BAD_STATE
                      @@ -111,6 +132,8 @@
                       
                              E_NO_MATCH
                                   Character failed to match.
                      +
                      +       E_REQUEST_DENIED
                                   The menu driver could not process the request.
                       
                       
                      @@ -121,14 +144,15 @@
                       
                       

                      NOTES

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

                      PORTABILITY

                      -       These routines emulate the System V  menu  library.   They
                      -       were not supported on Version 7 or BSD versions.
                      +       These  routines  emulate  the System V menu library.  They
                      +       were not supported on Version 7 or BSD versions. The  sup-
                      +       port for mouse events is ncurses specific.
                       
                       
                       
                      @@ -145,32 +169,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -
                      diff --git a/Ada95/html/menu_format.3x.html b/Ada95/html/man/menu_format.3x.html similarity index 87% rename from Ada95/html/menu_format.3x.html rename to Ada95/html/man/menu_format.3x.html index e2ab655e..9c6e7a14 100644 --- a/Ada95/html/menu_format.3x.html +++ b/Ada95/html/man/menu_format.3x.html @@ -1,12 +1,12 @@ - +
                              menu_format - set and get menu sizes
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_menu_format(MENU *menu, int rows, int cols);
                              int menu_format(const MENU *menu, int *rows, int *cols);
                       
                      @@ -55,8 +55,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_hook.3x.html b/Ada95/html/man/menu_hook.3x.html similarity index 95% rename from Ada95/html/menu_hook.3x.html rename to Ada95/html/man/menu_hook.3x.html index 1f611114..edaeb7a3 100644 --- a/Ada95/html/menu_hook.3x.html +++ b/Ada95/html/man/menu_hook.3x.html @@ -1,5 +1,5 @@ - +
                              menu_hook - set hooks for automatic invocation by applica-
                              tions
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_item_init(MENU *menu, void (*func)(MENU *));
                              void (*)(MENU *) item_init(const MENU *menu);
                              int set_item_term(MENU *menu, void (*func)(MENU *));
                      diff --git a/Ada95/html/menu_items.3x.html b/Ada95/html/man/menu_items.3x.html
                      similarity index 88%
                      rename from Ada95/html/menu_items.3x.html
                      rename to Ada95/html/man/menu_items.3x.html
                      index 463ee587..fb016b8c 100644
                      --- a/Ada95/html/menu_items.3x.html
                      +++ b/Ada95/html/man/menu_items.3x.html
                      @@ -1,5 +1,5 @@
                       
                      -
                      +
                       
                              menu_items  - make and break connections between items and
                              menus
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_menu_items(MENU *menu, ITEM **items);
                              ITEM **menu_items(const MENU *menu);
                              int item_count(const MENU *menu);
                      @@ -59,8 +59,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_mark.3x.html b/Ada95/html/man/menu_mark.3x.html similarity index 87% rename from Ada95/html/menu_mark.3x.html rename to Ada95/html/man/menu_mark.3x.html index d2e386f9..959dc1b5 100644 --- a/Ada95/html/menu_mark.3x.html +++ b/Ada95/html/man/menu_mark.3x.html @@ -1,12 +1,12 @@ - +
                              menu_mark - get and set the menu mark string
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_menu_mark(MENU *menu, const char *mark);
                              const char *menu_mark(const MENU *menu);
                       
                      @@ -53,8 +53,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_new.3x.html b/Ada95/html/man/menu_new.3x.html similarity index 84% rename from Ada95/html/menu_new.3x.html rename to Ada95/html/man/menu_new.3x.html index d125a476..b96d85a2 100644 --- a/Ada95/html/menu_new.3x.html +++ b/Ada95/html/man/menu_new.3x.html @@ -1,12 +1,12 @@ - +
                              menu_new - create and destroy menus
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              MENU *new_menu(ITEM **items);
                              int free_menu(MENU *menu);
                       
                      @@ -47,8 +47,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_opts.3x.html b/Ada95/html/man/menu_opts.3x.html similarity index 89% rename from Ada95/html/menu_opts.3x.html rename to Ada95/html/man/menu_opts.3x.html index 2e4362ce..8de4b8a2 100644 --- a/Ada95/html/menu_opts.3x.html +++ b/Ada95/html/man/menu_opts.3x.html @@ -1,12 +1,12 @@ - +
                              menu_opts - set and get menu options
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_menu_opts(MENU *menu, OPTIONS opts);
                              int menu_opts_on(MENU *menu, OPTIONS opts);
                              int menu_opts_off(MENU *menu, OPTIONS opts);
                      @@ -72,8 +72,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_pattern.3x.html b/Ada95/html/man/menu_pattern.3x.html similarity index 87% rename from Ada95/html/menu_pattern.3x.html rename to Ada95/html/man/menu_pattern.3x.html index dc4d217e..6effa22e 100644 --- a/Ada95/html/menu_pattern.3x.html +++ b/Ada95/html/man/menu_pattern.3x.html @@ -1,12 +1,12 @@ - +
                              menu_pattern - get and set a menu's pattern buffer
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_menu_pattern(MENU *menu, const char *pattern);
                              char *menu_pattern(const MENU *menu);
                       
                      @@ -53,8 +53,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_post.3x.html b/Ada95/html/man/menu_post.3x.html similarity index 93% rename from Ada95/html/menu_post.3x.html rename to Ada95/html/man/menu_post.3x.html index 65c79f9f..3ac47938 100644 --- a/Ada95/html/menu_post.3x.html +++ b/Ada95/html/man/menu_post.3x.html @@ -1,5 +1,5 @@ - +
                              menu_post  -  write or erase menus from associated subwin-
                              dows
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int post_menu(MENU *menu);
                              int unpost_menu(MENU *menu);
                       
                      diff --git a/Ada95/html/menu_requestname.3x.html b/Ada95/html/man/menu_requestname.3x.html
                      similarity index 83%
                      rename from Ada95/html/menu_requestname.3x.html
                      rename to Ada95/html/man/menu_requestname.3x.html
                      index 25b3f545..dd8f26e5 100644
                      --- a/Ada95/html/menu_requestname.3x.html
                      +++ b/Ada95/html/man/menu_requestname.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              menu_requestname - handle printable menu request names
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              const char *menu_request_name(int request);
                              int menu_request_by_name(const char *name);
                       
                      @@ -34,8 +34,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_spacing.3x.html b/Ada95/html/man/menu_spacing.3x.html similarity index 89% rename from Ada95/html/menu_spacing.3x.html rename to Ada95/html/man/menu_spacing.3x.html index 71b88170..8ed19c22 100644 --- a/Ada95/html/menu_spacing.3x.html +++ b/Ada95/html/man/menu_spacing.3x.html @@ -1,12 +1,12 @@ - +
                              menu_spacing - Control spacing between menu items.
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_menu_spacing(MENU *menu,
                                                   int spc_description
                                                   int spc_rows,
                      @@ -52,8 +52,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_userptr.3x.html b/Ada95/html/man/menu_userptr.3x.html similarity index 83% rename from Ada95/html/menu_userptr.3x.html rename to Ada95/html/man/menu_userptr.3x.html index 68066579..606907b2 100644 --- a/Ada95/html/menu_userptr.3x.html +++ b/Ada95/html/man/menu_userptr.3x.html @@ -1,12 +1,12 @@ - +
                              menu_userptr - associate application data with a menu item
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_menu_userptr(MENU *menu, void *userptr);
                              void *menu_userptr(const MENU *menu);
                       
                      @@ -37,8 +37,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/menu_win.3x.html b/Ada95/html/man/menu_win.3x.html similarity index 89% rename from Ada95/html/menu_win.3x.html rename to Ada95/html/man/menu_win.3x.html index 08b0517c..50b879a6 100644 --- a/Ada95/html/menu_win.3x.html +++ b/Ada95/html/man/menu_win.3x.html @@ -1,5 +1,5 @@ - +
                              menu_win  - make and break menu window and subwindow asso-
                              ciations
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_menu_win(MENU *menu, WINDOW *win);
                              WINDOW *menu_win(const MENU *menu);
                              int set_menu_sub(MENU *menu, WINDOW *sub);
                      @@ -61,8 +61,8 @@
                       

                      SEE ALSO

                              curses(3X), menu(3X).
                       
                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/mitem_current.3x.html b/Ada95/html/man/mitem_current.3x.html similarity index 87% rename from Ada95/html/mitem_current.3x.html rename to Ada95/html/man/mitem_current.3x.html index d5cacd70..344ada63 100644 --- a/Ada95/html/mitem_current.3x.html +++ b/Ada95/html/man/mitem_current.3x.html @@ -1,12 +1,12 @@ - +
                              mitem_current - set and get current_menu_item
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_current_item(MENU *menu, const ITEM *item);
                              ITEM *current_item(const MENU *menu);
                              int set_top_row(MENU *menu, int row);
                      @@ -37,7 +37,7 @@
                              current_item returns NULL on error.
                       
                              top_row and item_index  return  ERR  (the  general  curses
                      -       error value) on error.
                      +       error value) on error.
                       
                              set_current_item and set_top_row return one of the follow-
                              ing:
                      @@ -61,8 +61,8 @@
                       
                       

                      SEE ALSO

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/mitem_name.3x.html b/Ada95/html/man/mitem_name.3x.html similarity index 78% rename from Ada95/html/mitem_name.3x.html rename to Ada95/html/man/mitem_name.3x.html index 7af9608d..6e3ebef3 100644 --- a/Ada95/html/mitem_name.3x.html +++ b/Ada95/html/man/mitem_name.3x.html @@ -1,12 +1,12 @@ - +
                              mitem_name - get menu item name and description fields
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              const char *item_name(const ITEM *item);
                              const char *item_description(const ITEM *item);
                       
                      @@ -31,8 +31,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/mitem_new.3x.html b/Ada95/html/man/mitem_new.3x.html similarity index 87% rename from Ada95/html/mitem_new.3x.html rename to Ada95/html/man/mitem_new.3x.html index b2f5b020..0c8e2a14 100644 --- a/Ada95/html/mitem_new.3x.html +++ b/Ada95/html/man/mitem_new.3x.html @@ -1,12 +1,12 @@ - +
                              mitem_new - create and destroy menu items
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              ITEM *new_item(const char *name, const char *description);
                              int free_item(ITEM *item);
                       
                      @@ -52,8 +52,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/mitem_opts.3x.html b/Ada95/html/man/mitem_opts.3x.html similarity index 86% rename from Ada95/html/mitem_opts.3x.html rename to Ada95/html/man/mitem_opts.3x.html index 02fd97e0..a4224ff5 100644 --- a/Ada95/html/mitem_opts.3x.html +++ b/Ada95/html/man/mitem_opts.3x.html @@ -1,12 +1,12 @@ - +
                              mitem_opts - set and get menu item options
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_item_opts(ITEM *item, OPTIONS opts);
                              int item_opts_on(ITEM *item, OPTIONS opts);
                              int item_opts_off(ITEM *item, OPTIONS opts);
                      @@ -51,8 +51,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/mitem_userptr.3x.html b/Ada95/html/man/mitem_userptr.3x.html similarity index 83% rename from Ada95/html/mitem_userptr.3x.html rename to Ada95/html/man/mitem_userptr.3x.html index d39d1ff4..4d1616b6 100644 --- a/Ada95/html/mitem_userptr.3x.html +++ b/Ada95/html/man/mitem_userptr.3x.html @@ -1,5 +1,5 @@ - +
                              mitem_userptr  -  associate  application  data with a menu
                              item
                      @@ -7,7 +7,7 @@
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_item_userptr(ITEM *item, void *userptr);
                              void *item_userptr(const ITEM *item);
                       
                      @@ -37,8 +37,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/mitem_value.3x.html b/Ada95/html/man/mitem_value.3x.html similarity index 85% rename from Ada95/html/mitem_value.3x.html rename to Ada95/html/man/mitem_value.3x.html index 451361db..8d13b911 100644 --- a/Ada95/html/mitem_value.3x.html +++ b/Ada95/html/man/mitem_value.3x.html @@ -1,12 +1,12 @@ - +
                              mitem_value - set and get menu item values
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              int set_item_value(ITEM *item, bool value);
                              bool item_value(const ITEM *item);
                       
                      @@ -43,8 +43,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/mitem_visible.3x.html b/Ada95/html/man/mitem_visible.3x.html similarity index 76% rename from Ada95/html/mitem_visible.3x.html rename to Ada95/html/man/mitem_visible.3x.html index cf4d67cc..86c4090a 100644 --- a/Ada95/html/mitem_visible.3x.html +++ b/Ada95/html/man/mitem_visible.3x.html @@ -1,12 +1,12 @@ - +
                              mitem_visible - check visibility of a menu item
                       
                       
                       

                      SYNOPSIS

                      -       #include <menu.h>
                      +       #include 
                              bool item_visible(const ITEM *item);
                       
                       
                      @@ -25,8 +25,8 @@
                       
                       

                      NOTES

                      -       The header file <menu.h> automatically includes the header
                      -       file <curses.h>.
                      +       The header file  automatically includes the header
                      +       file .
                       
                       
                       
                      diff --git a/Ada95/html/man/ncurses.3x.html b/Ada95/html/man/ncurses.3x.html new file mode 100644 index 00000000..164ae90a --- /dev/null +++ b/Ada95/html/man/ncurses.3x.html @@ -0,0 +1,701 @@ + + +
                      +       ncurses - CRT screen handling and optimization package
                      +
                      +
                      +
                      +

                      SYNOPSIS

                      +       #include 
                      +
                      +
                      +
                      +

                      DESCRIPTION

                      +       The  ncurses  library  routines  give the user a terminal-
                      +       independent method  of  updating  character  screens  with
                      +       reasonable  optimization.   This  implementation  is ``new
                      +       curses'' (ncurses) and is  the  approved  replacement  for
                      +       4.4BSD classic curses, which has been discontinued.
                      +
                      +       The  ncurses  routines  emulate  the curses(3X) library of
                      +       System V Release 4 UNIX, and the XPG4 curses standard (XSI
                      +       curses)  but the ncurses library is freely redistributable
                      +       in source form.  Differences  from  the  SVr4  curses  are
                      +       summarized  under  the  EXTENSIONS and BUGS sections below
                      +       and  described  in  detail  in  the  EXTENSIONS  and  BUGS
                      +       sections of individual man pages.
                      +
                      +       A  program  using  these  routines must be linked with the
                      +       -lncurses option, or (if it has been generated)  with  the
                      +       debugging  library  -lncurses_g.   (Your system integrator
                      +       may also have installed these libraries  under  the  names
                      +       -lcurses and -lcurses_g.)  The ncurses_g library generates
                      +       trace logs (in  a  file  called  'trace'  in  the  current
                      +       directory) that describe curses actions.
                      +
                      +       The  ncurses  package supports: overall screen, window and
                      +       pad manipulation; output  to  windows  and  pads;  reading
                      +       terminal input; control over terminal and curses input and
                      +       output  options;   environment   query   routines;   color
                      +       manipulation;   use   of   soft   label   keys;   terminfo
                      +       capabilities;   and   access   to   low-level    terminal-
                      +       manipulation routines.
                      +
                      +       To initialize the routines, the routine initscr or newterm
                      +       must be called before any of the other routines that  deal
                      +       with  windows  and  screens  are used.  The routine endwin
                      +       must be called before exiting.  To get character-at-a-time
                      +       input  without  echoing (most interactive, screen oriented
                      +       programs want this),  the  following  sequence  should  be
                      +       used:
                      +
                      +             initscr(); cbreak(); noecho();
                      +
                      +       Most programs would additionally use the sequence:
                      +
                      +             nonl();
                      +             intrflush(stdscr, FALSE);
                      +             keypad(stdscr, TRUE);
                      +
                      +       defined,  must  be  output.  This can be done by executing
                      +       the tput init command after the shell environment variable
                      +       TERM  has  been  exported.  tset(1) is usually responsible
                      +       for doing this.  [See terminfo(5) for further details.]
                      +
                      +       The  ncurses  library   permits   manipulation   of   data
                      +       structures,  called  windows,  which  can be thought of as
                      +       two-dimensional arrays of characters representing  all  or
                      +       part  of  a  CRT  screen.  A default window called stdscr,
                      +       which is the size of the  terminal  screen,  is  supplied.
                      +       Others may be created with newwin.
                      +
                      +       Note  that  curses  does  not  handle overlapping windows,
                      +       that's done by the panel(3X) library. This means that  you
                      +       can  either  use  stdscr  or  divide the screen into tiled
                      +       windows and not using stdscr at all. Mixing the  two  will
                      +       result in unpredictable, and undesired, effects.
                      +
                      +       Windows are referred to by variables declared as WINDOW *.
                      +       These  data  structures  are  manipulated  with   routines
                      +       described  here and elsewhere in the ncurses manual pages.
                      +       Among which the most basic routines are  move  and  addch.
                      +       More  general versions of these routines are included with
                      +       names beginning with w, allowing the  user  to  specify  a
                      +       window.  The routines not beginning with w affect stdscr.)
                      +
                      +       After using routines to manipulate a  window,  refresh  is
                      +       called,  telling curses to make the user's CRT screen look
                      +       like stdscr.  The characters in a window are  actually  of
                      +       type  chtype, (character and attribute data) so that other
                      +       information about the character may also  be  stored  with
                      +       each character.
                      +
                      +       Special  windows  called  pads  may  also  be manipulated.
                      +       These are windows which are not constrained to the size of
                      +       the  screen  and  whose  contents  need  not be completely
                      +       displayed.  See curs_pad(3X) for more information.
                      +
                      +       In addition to drawing characters  on  the  screen,  video
                      +       attributes  and  colors  may  be  supported,  causing  the
                      +       characters to show up in  such  modes  as  underlined,  in
                      +       reverse  video, or in color on terminals that support such
                      +       display enhancements.   Line  drawing  characters  may  be
                      +       specified  to be output.  On input, curses is also able to
                      +       translate arrow and function  keys  that  transmit  escape
                      +       sequences  into single values.  The video attributes, line
                      +       drawing characters, and input values use names, defined in
                      +       , such as A_REVERSE, ACS_HLINE, and KEY_LEFT.
                      +
                      +       If the environment variables LINES and COLUMNS are set, or
                      +       if the program is executing in a window environment,  line
                      +       and  column  information  in the environment will override
                      +       of a screen is changeable (see ENVIRONMENT).
                      +
                      +       If the  environment  variable  TERMINFO  is  defined,  any
                      +       program   using   curses   checks  for  a  local  terminal
                      +       definition before checking in  the  standard  place.   For
                      +       example,  if  TERM  is  set  to att4424, then the compiled
                      +       terminal definition is found in
                      +
                      +             @DATADIR@/terminfo/a/att4424.
                      +
                      +       (The a is copied from the first letter of att4424 to avoid
                      +       creation  of  huge  directories.)  However, if TERMINFO is
                      +       set to $HOME/myterms, curses first checks
                      +
                      +             $HOME/myterms/a/att4424,
                      +
                      +       and if that fails, it then checks
                      +
                      +             @DATADIR@/terminfo/a/att4424.
                      +
                      +       This is useful for developing experimental definitions  or
                      +       when   write   permission  in  @DATADIR@/terminfo  is  not
                      +       available.
                      +
                      +       The integer  variables  LINES  and  COLS  are  defined  in
                      +         and will be filled in by initscr with the size
                      +       of the screen.  The constants  TRUE  and  FALSE  have  the
                      +       values 1 and 0, respectively.
                      +
                      +       The  curses  routines  also  define  the WINDOW * variable
                      +       curscr which is used for certain low-level operations like
                      +       clearing  and  redrawing a screen containing garbage.  The
                      +       curscr can be used in only a few routines.
                      +
                      +
                      +   Routine and Argument Names
                      +       Many curses routines  have  two  or  more  versions.   The
                      +       routines  prefixed  with w require a window argument.  The
                      +       routines prefixed with p require a  pad  argument.   Those
                      +       without a prefix generally use stdscr.
                      +
                      +       The routines prefixed with mv require a y and x coordinate
                      +       to move to before performing the appropriate action.   The
                      +       mv  routines  imply  a call to move before the call to the
                      +       other routine.  The coordinate y always refers to the  row
                      +       (of  the  window), and x always refers to the column.  The
                      +       upper left-hand corner is always (0,0), not (1,1).
                      +
                      +       The routines prefixed with mvw take both a window argument
                      +       and  x  and  y coordinates.  The window argument is always
                      +       specified before the coordinates.
                      +
                      +       WINDOW.
                      +
                      +       Option setting routines require a Boolean flag bf with the
                      +       value  TRUE  or  FALSE;  bf  is  always of type bool.  The
                      +       variables ch and attrs below are always  of  type  chtype.
                      +       The  types WINDOW, SCREEN, bool, and chtype are defined in
                      +       .  The type TERMINAL  is  defined  in  .
                      +       All other arguments are integers.
                      +
                      +
                      +   Routine Name Index
                      +       The following table lists each curses routine and the name
                      +       of the manual page on which  it  is  described.   Routines
                      +       flagged  with  `*'  are ncurses-specific, not described by
                      +       XPG4 or present in SVr4.
                      +
                      +       center tab(/); l l l l .  curses Routine Name/Manual  Page
                      +       Name  =  addch/curs_addch(3X)  addchnstr/curs_addchstr(3X)
                      +       addchstr/curs_addchstr(3X)         addnstr/curs_addstr(3X)
                      +       addstr/curs_addstr(3X)              attr_get/curs_attr(3X)
                      +       attr_off/curs_attr(3X)               attr_on/curs_attr(3X)
                      +       attr_set/curs_attr(3X)               attroff/curs_attr(3X)
                      +       attron/curs_attr(3X)                 attrset/curs_attr(3X)
                      +       baudrate/curs_termattrs(3X)             beep/curs_beep(3X)
                      +       bkgd/curs_bkgd(3X)                   bkgdset/curs_bkgd(3X)
                      +       border/curs_border(3X)                 box/curs_border(3X)
                      +       can_change_color/curs_color(3X)     cbreak/curs_inopts(3X)
                      +       chgat/curs_attr(3X)                   clear/curs_clear(3X)
                      +       clearok/curs_outopts(3X)           clrtobot/curs_clear(3X)
                      +       clrtoeol/curs_clear(3X)       color_content/curs_color(3X)
                      +       color_set/curs_attr(3X)           copywin/curs_overlay(3X)
                      +       curs_set/curs_kernel(3X)     def_prog_mode/curs_kernel(3X)
                      +       def_shell_mode/curs_kernel(3X)  define_key/define_key(3X)*
                      +       del_curterm/curs_terminfo(3X)   delay_output/curs_util(3X)
                      +       delch/curs_delch(3X)            deleteln/curs_deleteln(3X)
                      +       delscreen/curs_initscr(3X)          delwin/curs_window(3X)
                      +       derwin/curs_window(3X)           doupdate/curs_refresh(3X)
                      +       dupwin/curs_window(3X)                echo/curs_inopts(3X)
                      +       echochar/curs_addch(3X)            endwin/curs_initscr(3X)
                      +       erase/curs_clear(3X)          erasechar/curs_termattrs(3X)
                      +       filter/curs_util(3X)                   flash/curs_beep(3X)
                      +       flushinp/curs_util(3X)             getbegyx/curs_getyx(3X)
                      +       getbkgd/curs_bkgd(3X)                 getch/curs_getch(3X)
                      +       getmaxyx/curs_getyx(3X)           getmouse/curs_mouse(3X)*
                      +       getnstr/curs_getstr(3X)            getparyx/curs_getyx(3X)
                      +       getstr/curs_getstr(3X)              getsyx/curs_kernel(3X)
                      +       getwin/curs_util(3X)                  getyx/curs_getyx(3X)
                      +       halfdelay/curs_inopts(3X)        has_colors/curs_color(3X)
                      +       has_ic/curs_termattrs(3X)        has_il/curs_termattrs(3X)
                      +       has_key/curs_getch(3X)*              hline/curs_border(3X)
                      +       idcok/curs_outopts(3X)              idlok/curs_outopts(3X)
                      +       immedok/curs_outopts(3X)                inch/curs_inch(3X)
                      +       initscr/curs_initscr(3X)             innstr/curs_instr(3X)
                      +       insch/curs_insch(3X)            insdelln/curs_deleteln(3X)
                      +       insertln/curs_deleteln(3X)         insnstr/curs_insstr(3X)
                      +       insstr/curs_insstr(3X)                instr/curs_instr(3X)
                      +       intrflush/curs_inopts(3X)    is_linetouched/curs_touch(3X)
                      +       is_wintouched/curs_touch(3X)     isendwin/curs_initscr(3X)
                      +       keyname/curs_util(3X)                     keyok/keyok(3X)*
                      +       keypad/curs_inopts(3X)         killchar/curs_termattrs(3X)
                      +       leaveok/curs_outopts(3X)       longname/curs_termattrs(3X)
                      +       mcprint/curs_print(3X)*               meta/curs_inopts(3X)
                      +       mouseinterval/curs_mouse(3X)*    mousemask/curs_mouse(3X)*
                      +       move/curs_move(3X)                  mvaddch/curs_addch(3X)
                      +       mvaddchnstr/curs_addchstr(3X) mvaddchstr/curs_addchstr(3X)
                      +       mvaddnstr/curs_addstr(3X)         mvaddstr/curs_addstr(3X)
                      +       mvchgat/curs_attr(3X)              mvcur/curs_terminfo(3X)
                      +       mvdelch/curs_delch(3X)            mvderwin/curs_window(3X)
                      +       mvgetch/curs_getch(3X)           mvgetnstr/curs_getstr(3X)
                      +       mvgetstr/curs_getstr(3X)           mvhline/curs_border(3X)
                      +       mvinch/curs_inch(3X)           mvinchnstr/curs_inchstr(3X)
                      +       mvinchstr/curs_inchstr(3X)         mvinnstr/curs_instr(3X)
                      +       mvinsch/curs_insch(3X)           mvinsnstr/curs_insstr(3X)
                      +       mvinsstr/curs_insstr(3X)            mvinstr/curs_instr(3X)
                      +       mvprintw/curs_printw(3X)            mvscanw/curs_scanw(3X)
                      +       mvwaddch/curs_addch(3X)     mvwaddchnstr/curs_addchstr(3X)
                      +       mvwaddchstr/curs_addchstr(3X)   mvwaddnstr/curs_addstr(3X)
                      +       mvwaddstr/curs_addstr(3X)           mvwchgat/curs_attr(3X)
                      +       mvwdelch/curs_delch(3X)            mvwgetch/curs_getch(3X)
                      +       mvwgetnstr/curs_getstr(3X)       mvwgetstr/curs_getstr(3X)
                      +       mvwhline/curs_border(3X)             mvwin/curs_window(3X)
                      +       mvwinch/curs_inch(3X)         mvwinchnstr/curs_inchstr(3X)
                      +       mvwinchstr/curs_inchstr(3X)       mvwinnstr/curs_instr(3X)
                      +       mvwinsch/curs_insch(3X)         mvwinsnstr/curs_insstr(3X)
                      +       mvwinsstr/curs_insstr(3X)          mvwinstr/curs_instr(3X)
                      +       mvwprintw/curs_printw(3X)          mvwscanw/curs_scanw(3X)
                      +       mvwvline/curs_border(3X)             napms/curs_kernel(3X)
                      +       newpad/curs_pad(3X)               newterm/curs_initscr(3X)
                      +       newwin/curs_window(3X)                 nl/curs_outopts(3X)
                      +       nocbreak/curs_inopts(3X)           nodelay/curs_inopts(3X)
                      +       noecho/curs_inopts(3X)               nonl/curs_outopts(3X)
                      +       noqiflush/curs_inopts(3X)            noraw/curs_inopts(3X)
                      +       notimeout/curs_inopts(3X)         overlay/curs_overlay(3X)
                      +       overwrite/curs_overlay(3X)     pair_content/curs_color(3X)
                      +       pechochar/curs_pad(3X)           pnoutrefresh/curs_pad(3X)
                      +       prefresh/curs_pad(3X)               printw/curs_printw(3X)
                      +       putp/curs_terminfo(3X)                putwin/curs_util(3X)
                      +       qiflush/curs_inopts(3X)                raw/curs_inopts(3X)
                      +       redrawwin/curs_refresh(3X)        refresh/curs_refresh(3X)
                      +       reset_prog_mode/curs_kernel(3X)
                      +       reset_shell_mode/curs_kernel(3X)   resetty/curs_kernel(3X)
                      +       resizeterm/resizeterm(3X)*   restartterm/curs_terminfo(3X)
                      +       ripoffline/curs_kernel(3X)         savetty/curs_kernel(3X)
                      +       scanw/curs_scanw(3X)            scr_dump/curs_scr_dump(3X)
                      +       scroll/curs_scroll(3X)           scrollok/curs_outopts(3X)
                      +       set_curterm/curs_terminfo(3X)    set_term/curs_initscr(3X)
                      +       setscrreg/curs_outopts(3X)          setsyx/curs_kernel(3X)
                      +       setterm/curs_terminfo(3X)      setupterm/curs_terminfo(3X)
                      +       slk_attr/curs_slk(3X)*           slk_attr_off/curs_slk(3X)
                      +       slk_attr_on/curs_slk(3X)         slk_attr_set/curs_slk(3X)
                      +       slk_attroff/curs_slk(3X)           slk_attron/curs_slk(3X)
                      +       slk_attrset/curs_slk(3X)            slk_clear/curs_slk(3X)
                      +       slk_color/curs_slk(3X)               slk_init/curs_slk(3X)
                      +       slk_label/curs_slk(3X)        slk_noutrefresh/curs_slk(3X)
                      +       slk_refresh/curs_slk(3X)          slk_restore/curs_slk(3X)
                      +       slk_set/curs_slk(3X)                slk_touch/curs_slk(3X)
                      +       standend/curs_attr(3X)              standout/curs_attr(3X)
                      +       start_color/curs_color(3X)             subpad/curs_pad(3X)
                      +       subwin/curs_window(3X)              syncok/curs_window(3X)
                      +       termattrs/curs_termattrs(3X)   termname/curs_termattrs(3X)
                      +       tgetent/curs_termcap(3X)         tgetflag/curs_termcap(3X)
                      +       tgetnum/curs_termcap(3X)          tgetstr/curs_termcap(3X)
                      +       tgoto/curs_termcap(3X)         tigetflag/curs_terminfo(3X)
                      +       tigetnum/curs_terminfo(3X)      tigetstr/curs_terminfo(3X)
                      +       timeout/curs_inopts(3X)           touchline/curs_touch(3X)
                      +       touchwin/curs_touch(3X)            tparm/curs_terminfo(3X)
                      +       tputs/curs_termcap(3X)             tputs/curs_terminfo(3X)
                      +       typeahead/curs_inopts(3X)             unctrl/curs_util(3X)
                      +       ungetch/curs_getch(3X)          ungetmouse/curs_mouse(3X)*
                      +       untouchwin/curs_touch(3X) use_default_colors/dft_fgbg(3X)*
                      +       use_env/curs_util(3X)            vidattr/curs_terminfo(3X)
                      +       vidputs/curs_terminfo(3X)            vline/curs_border(3X)
                      +       vw_printw/curs_printw(3X)          vw_scanw/curs_scanw(3X)
                      +       vwprintw/curs_printw(3X)            vwscanw/curs_scanw(3X)
                      +       waddch/curs_addch(3X)         waddchnstr/curs_addchstr(3X)
                      +       waddchstr/curs_addchstr(3X)       waddnstr/curs_addstr(3X)
                      +       waddstr/curs_addstr(3X)            wattr_get/curs_attr(3X)
                      +       wattr_off/curs_attr(3X)             wattr_on/curs_attr(3X)
                      +       wattr_set/curs_attr(3X)             wattroff/curs_attr(3X)
                      +       wattron/curs_attr(3X)               wattrset/curs_attr(3X)
                      +       wbkgd/curs_bkgd(3X)                 wbkgdset/curs_bkgd(3X)
                      +       wborder/curs_border(3X)               wchgat/curs_attr(3X)
                      +       wclear/curs_clear(3X)             wclrtobot/curs_clear(3X)
                      +       wclrtoeol/curs_clear(3X)          wcolor_set/curs_attr(3X)
                      +       wcursyncup/curs_window(3X)           wdelch/curs_delch(3X)
                      +       wdeleteln/curs_deleteln(3X)       wechochar/curs_addch(3X)
                      +       wenclose/curs_mouse(3X)*             werase/curs_clear(3X)
                      +       wgetch/curs_getch(3X)             wgetnstr/curs_getstr(3X)
                      +       wgetstr/curs_getstr(3X)             whline/curs_border(3X)
                      +       winch/curs_inch(3X)             winchnstr/curs_inchstr(3X)
                      +       winchstr/curs_inchstr(3X)           winnstr/curs_instr(3X)
                      +       winsch/curs_insch(3X)          winsdelln/curs_deleteln(3X)
                      +       winsertln/curs_deleteln(3X)       winsnstr/curs_insstr(3X)
                      +       winsstr/curs_insstr(3X)              winstr/curs_instr(3X)
                      +       wmouse_trafo/curs_mouse(3X)            wmove/curs_move(3X)
                      +       wnoutrefresh/curs_refresh(3X)      wprintw/curs_printw(3X)
                      +       wscrl/curs_scroll(3X)          wsetscrreg/curs_outopts(3X)
                      +       wstandend/curs_attr(3X)            wstandout/curs_attr(3X)
                      +       wsyncdown/curs_window(3X)          wsyncup/curs_window(3X)
                      +       wtimeout/curs_inopts(3X)           wtouchln/curs_touch(3X)
                      +       wvline/curs_border(3X)
                      +
                      +
                      +
                      +

                      RETURN VALUE

                      +       Routines that return an integer return  ERR  upon  failure
                      +       and  an  integer  value  other  than  ERR  upon successful
                      +       completion,  unless  otherwise  noted   in   the   routine
                      +       descriptions.
                      +
                      +       All  macros  return  the  value  of  the w version, except
                      +       setscrreg, wsetscrreg,  getyx,  getbegyx,  getmaxyx.   The
                      +       return  values  of setscrreg, wsetscrreg, getyx, getbegyx,
                      +       and getmaxyx are undefined (i.e., these should not be used
                      +       as the right-hand side of assignment statements).
                      +
                      +       Routines that return pointers return NULL on error.
                      +
                      +
                      +
                      +

                      ENVIRONMENT

                      +       The   following   environment   symbols   are  useful  for
                      +       customizing the runtime behavior of the  ncurses  library.
                      +       The  most  important  ones  have been already discussed in
                      +       detail.
                      +
                      +       BAUDRATE
                      +            The debugging library checks this environment  symbol
                      +            when the application has redirected output to a file.
                      +            The symbol's numeric value is used for the  baudrate.
                      +            If  no value is found ncurses uses 9600.  This allows
                      +            testers to construct repeatable test-cases that  take
                      +            into account costs that depend on baudrate.
                      +
                      +       CC   When set, change occurrences of the command_character
                      +            (i.e., the cmdch capability) of the  loaded  terminfo
                      +            entries  to  the  value  of  this  symbol.   Very few
                      +            terminfo entries provide this feature.
                      +
                      +       COLUMNS
                      +            Specify  the  width  of  the  screen  in  characters.
                      +            Applications   running  in  a  windowing  environment
                      +            usually are able to obtain the width of the window in
                      +            which  they  are  executing.  If neither the $COLUMNS
                      +            value nor the terminal's screen  size  is  available,
                      +            ncurses  uses  the size which may be specified in the
                      +            terminfo database (i.e., the cols capability).
                      +
                      +            It is important that your application use  a  correct
                      +            size  for  the  screen.   However, this is not always
                      +            possible because your application may be running on a
                      +            host  which  does  not honor NAWS (Negotiations About
                      +
                      +            Either  COLUMNS  or  LINES  symbols  may be specified
                      +            independently.  This is mainly useful  to  circumvent
                      +            legacy  misfeatures  of  terminal descriptions, e.g.,
                      +            xterm which commonly specifies a 65 line screen.  For
                      +            best  results, lines and cols should not be specified
                      +            in a terminal description for terminals which are run
                      +            as emulations.
                      +
                      +            Use the use_env function to disable this feature.
                      +
                      +       ESCDELAY
                      +            Specifies  the total time, in milliseconds, for which
                      +            ncurses will await  a  character  sequence,  e.g.,  a
                      +            function  key.  The default value, 1000 milliseconds,
                      +            is enough for most  uses.   However,  it  is  made  a
                      +            variable to accommodate unusual applications.
                      +
                      +            The most common instance where you may wish to change
                      +            this value is to work with slow hosts, e.g.,  running
                      +            on  a  network.   If  the host cannot read characters
                      +            rapidly enough, it will have the same  effect  as  if
                      +            the  terminal did not send characters rapidly enough.
                      +            The library will still see a timeout.
                      +
                      +            Note that  xterm  mouse  events  are  built  up  from
                      +            character sequences received from the xterm.  If your
                      +            application makes heavy use of multiple-clicking, you
                      +            may  wish  to lengthen this default value because the
                      +            timeout applies to the composed multi-click event  as
                      +            well as the individual clicks.
                      +
                      +       HOME Tells  ncurses where your home directory is.  That is
                      +            where  it  may  read  and  write  auxiliary  terminal
                      +            descriptions:
                      +
                      +            $HOME/.termcap
                      +            $HOME/.terminfo
                      +
                      +       LINES
                      +            Like  COLUMNS,  specify  the  height of the screen in
                      +            characters.  See COLUMNS for a detailed  description.
                      +
                      +       MOUSE_BUTTONS_123
                      +            This applies only to the OS/2 EMX port.  It specifies
                      +            the order of buttons on the mouse.   OS/2  numbers  a
                      +            3-button mouse inconsistently from other platforms:
                      +
                      +            1 = left
                      +            2 = right
                      +            3 = middle.
                      +
                      +            123  or  321.   If  it is not specified, ncurses uses
                      +            132.
                      +
                      +       NCURSES_NO_PADDING
                      +            Most of the terminal  descriptions  in  the  terminfo
                      +            database  are  written for real "hardware" terminals.
                      +            Many people use terminal emulators  which  run  in  a
                      +            windowing    environment    and    use   curses-based
                      +            applications.  Terminal emulators can  duplicate  all
                      +            of  the important aspects of a hardware terminal, but
                      +            they do not have the  same  limitations.   The  chief
                      +            limitation of a hardware terminal from the standpoint
                      +            of your application is the  management  of  dataflow,
                      +            i.e.,   timing.    Unless   a  hardware  terminal  is
                      +            interfaced into a terminal concentrator  (which  does
                      +            flow  control),  it (or your application) must manage
                      +            dataflow, preventing overruns.  The cheapest solution
                      +            (no  hardware cost) is for your program to do this by
                      +            pausing  after  operations  that  the  terminal  does
                      +            slowly, such as clearing the display.
                      +
                      +            As  a  result,  many terminal descriptions (including
                      +            the vt100) have delay times embedded.  You  may  wish
                      +            to  use  these  descriptions, but not want to pay the
                      +            performance penalty.
                      +
                      +            Set the NCURSES_NO_PADDING symbol to disable all  but
                      +            mandatory  padding.   Mandatory  padding is used as a
                      +            part of special control sequences such as flash.
                      +
                      +       NCURSES_NO_SETBUF
                      +            Normally  ncurses  enables  buffered  output   during
                      +            terminal  initialization.   This  is done (as in SVr4
                      +            curses)  for  performance   reasons.    For   testing
                      +            purposes,  both  of ncurses and certain applications,
                      +            this  feature  is   made   optional.    Setting   the
                      +            NCURSES_NO_SETBUF variable disables output buffering,
                      +            leaving the output  in  the  original  (usually  line
                      +            buffered) mode.
                      +
                      +       NCURSES_TRACE
                      +            During  initialization, the ncurses debugging library
                      +            checks the NCURSES_TRACE symbol.  If it  is  defined,
                      +            to a numeric value, ncurses calls the trace function,
                      +            using that value as the argument.
                      +
                      +            The argument values, which are defined  in  curses.h,
                      +            provide  several  types of information.  When running
                      +            with traces enabled, your application will write  the
                      +            file trace to the current directory.
                      +
                      +       TERM Denotes  your  terminal  type.  Each terminal type is
                      +            If the  ncurses  library  has  been  configured  with
                      +            termcap  support, ncurses will check for a terminal's
                      +            description in termcap form if it is not available in
                      +            the terminfo database.
                      +
                      +            The   TERMCAP   symbol  contains  either  a  terminal
                      +            description (with newlines stripped out), or  a  file
                      +            name  telling  where  the  information denoted by the
                      +            TERM symbol  exists.   In  either  case,  setting  it
                      +            directs  ncurses  to  ignore the usual place for this
                      +            information, e.g., /etc/termcap.
                      +
                      +       TERMINFO
                      +            Overrides the directory in which ncurses searches for
                      +            your terminal description.  This is the simplest, but
                      +            not the only way to change the list  of  directories.
                      +            The complete list of directories in order follows:
                      +
                      +            -  the last directory to which ncurses wrote, if any,
                      +               is searched first.
                      +
                      +            -  the directory specified by the TERMINFO symbol
                      +
                      +            -  $HOME/.terminfo
                      +
                      +            -  directories listed in the TERMINFO_DIRS symbol
                      +
                      +            -  one or more directories whose names are configured
                      +               and  compiled  into  the  ncurses  library,  e.g.,
                      +               @DATADIR@/terminfo
                      +
                      +       TERMINFO_DIRS
                      +            Specifies  a  list  of  directories  to  search   for
                      +            terminal  descriptions.   The  list  is  separated by
                      +            colons (i.e., ":").  All of the terminal descriptions
                      +            are  in  terminfo  form,  which  makes a subdirectory
                      +            named for the first  letter  of  the  terminal  names
                      +            therein.
                      +
                      +       TERMPATH
                      +            If  TERMCAP  does  not  hold a file name then ncurses
                      +            checks the  TERMPATH  symbol.   This  is  a  list  of
                      +            filenames  separated  by  colons (i.e., ":").  If the
                      +            TERMPATH symbol is not  set,  ncurses  looks  in  the
                      +            files   /etc/termcap,   /usr/share/misc/termcap   and
                      +            $HOME/.termcap, in that order.
                      +
                      +
                      +
                      +

                      FILES

                      +       @DATADIR@/tabset
                      +            directory containing  initialization  files  for  the
                      +            terminal   capability   database   @DATADIR@/terminfo
                      +            terminal capability database
                      +
                      +       terminfo(5) and 3X pages whose  names  begin  "curs_"  for
                      +       detailed routine descriptions.
                      +
                      +
                      +
                      +

                      EXTENSIONS

                      +       The  ncurses  library  can  be  compiled  with  an  option
                      +       (-DUSE_GETCAP)  that   falls   back   to   the   old-style
                      +       /etc/termcap file if the terminal setup code cannot find a
                      +       terminfo entry corresponding to TERM.  Use of this feature
                      +       is  not  recommended, as it essentially includes an entire
                      +       termcap  compiler  in  the  ncurses   startup   code,   at
                      +       significant cost in core and startup cycles.
                      +
                      +       The  ncurses  library  includes  facilities  for capturing
                      +       mouse events on certain terminals (including  xterm).  See
                      +       the curs_mouse(3X) manual page for details.
                      +
                      +       The  ncurses library includes facilities for responding to
                      +       window resizing events, e.g., when running  in  an  xterm.
                      +       See  the  resizeterm(3X)  and wresize(3X) manual pages for
                      +       details.  In addition, the library may be configured  with
                      +       a SIGWINCH handler.
                      +
                      +       The  ncurses library extends the fixed set of function key
                      +       capabilities of  terminals  by  allowing  the  application
                      +       designer  to  define  additional key sequences at runtime.
                      +       See the define_key(3X)  and  keyok(3X)  manual  pages  for
                      +       details.
                      +
                      +       The  ncurses  library  can  exploit  the  capabilities  of
                      +       terminals which implement the ISO-6429 SGR 39 and  SGR  49
                      +       controls, which allow an application to reset the terminal
                      +       to its original foreground and  background  colors.   From
                      +       the  users'  perspective,  the application is able to draw
                      +       colored  text  on  a  background  whose   color   is   set
                      +       independently,   providing   better   control  over  color
                      +       contrasts.  See the use_default_colors(3X) manual page for
                      +       details.
                      +
                      +       The  ncurses  library  includes  a  function for directing
                      +       application output to a printer attached to  the  terminal
                      +       device.  See the curs_print(3X) manual page for details.
                      +
                      +
                      +
                      +

                      PORTABILITY

                      +       The   ncurses   library   is  intended  to  be  BASE-level
                      +       conformant with the XSI Curses standard.  Certain portions
                      +       of  the EXTENDED XSI Curses functionality (including color
                      +       support) are supported.  The following EXTENDED XSI Curses
                      +       calls  in  support  of wide (multibyte) characters are not
                      +       yet   implemented:   add_wch,   add_wchnstr,   add_wchstr,
                      +       addnwstr, addwstr, bkgrnd, bkgrndset, border_set, box_set,
                      +       echo_wchar,  erasewchar,  get_wch,  get_wstr,   getbkgrnd,
                      +       getcchar,   getn_wstr,   getwchtype,   hline_set,  in_wch,
                      +       killwchar,   mvadd_wch,    mvadd_wchnstr,    mvadd_wchstr,
                      +       mvaddnwstr, mvaddwstr, mvget_wch, mvget_wstr, mvgetn_wstr,
                      +       mvhline_set, mvin_wch, mvinnwstr, mvins_nwstr,  mvins_wch,
                      +       mvins_wstr, mvinwchnstr, mvinwchstr, mvinwchstr, mvinwstr,
                      +       mvvline_set,  mvwadd_wch,  mvwadd_wchnstr,  mvwadd_wchstr,
                      +       mvwaddnwstr,     mvwaddwstr,     mvwget_ch,    mvwget_wch,
                      +       mvwget_wstr,   mvwgetn_wstr,   mvwhline_set,    mvwin_wch,
                      +       mvwin_wchnstr,   mvwin_wchstr,  mvwinnwstr,  mvwins_nwstr,
                      +       mvwins_wch,   mvwins_wstr,    mvwinwchnstr.     mvwinwstr,
                      +       mvwvline_set, pecho_wchar, setcchar, slk_wset, term_attrs,
                      +       unget_wch,  vhline_set,  vid_attr,  vid_puts,   vline_set,
                      +       wadd_wch,  wadd_wchnstr, wadd_wchstr, waddnwstr, waddwstr,
                      +       waddwstr, wbkgrnd,  wbkgrndset,  wbkgrndset,  wborder_set,
                      +       wecho_wchar, wecho_wchar, wget_wch, wget_wstr, wgetbkgrnd,
                      +       wgetn_wstr, whline_set, win_wch, win_wchnstr,  win_wchstr,
                      +       winnwstr,  wins_nwstr,  wins_wch,  wins_wstr,  winwchnstr,
                      +       winwchstr, winwstr, wunctrl, wvline_set,
                      +
                      +       A small number of local differences (that  is,  individual
                      +       differences  between the XSI Curses and ncurses calls) are
                      +       described in  PORTABILITY  sections  of  the  library  man
                      +       pages.
                      +
                      +       The routine has_key is not part of XPG4, nor is it present
                      +       in SVr4.  See the curs_getch(3X) manual page for  details.
                      +
                      +       The  routine  slk_attr  is  not  part  of  XPG4, nor is it
                      +       present in SVr4.  See the  curs_slk(3X)  manual  page  for
                      +       details.
                      +
                      +       The     routines    getmouse,    mousemask,    ungetmouse,
                      +       mouseinterval, and wenclose relating to mouse  interfacing
                      +       are  not  part of XPG4, nor are they present in SVr4.  See
                      +       the curs_mouse(3X) manual page for details.
                      +
                      +       The routine mcprint was not present in any previous curses
                      +       implementation.   See  the  curs_print(3X) manual page for
                      +       details.
                      +
                      +       The routine wresize is not part of XPG4, nor is it present
                      +       in SVr4.  See the wresize(3X) manual page for details.
                      +
                      +       In  historic  curses  versions,  delays  embedded  in  the
                      +       capabilities  cr,  ind,  cub1,  ff   and   tab   activated
                      +       corresponding  delay bits in the UNIX tty driver.  In this
                      +       implementation, all padding is done by  NUL  sends.   This
                      +       method   is  slightly  more  expensive,  but  narrows  the
                      +       interface to the UNIX kernel significantly  and  increases
                      +       the package's portability correspondingly.
                      +
                      +       In  the  XSI  standard  and  SVr4 manual pages, many entry
                      +       points have prototype arguments of the for char *const (or
                      +       (see  section  3.5.4.1), these declarations are either (a)
                      +       meaningless,  or  (b)  meaningless   and   illegal.    The
                      +       declaration  const  char  *x  is  a  modifiable pointer to
                      +       unmodifiable data, but char *const x' is  an  unmodifiable
                      +       pointer to modifiable data.  Given that C passes arguments
                      +       by value,  *const  as  a  formal  type  is  at  best
                      +       dubious.    Some   compilers   choke  on  the  prototypes.
                      +       Therefore, in this implementation, they have been  changed
                      +       to const  * globally.
                      +
                      +
                      +
                      +

                      NOTES

                      +       The  header  file    automatically  includes the
                      +       header files  and .
                      +
                      +       If standard output from a ncurses program  is  re-directed
                      +       to  something  which  is not a tty, screen updates will be
                      +       directed to standard  error.   This  was  an  undocumented
                      +       feature of AT&T System V Release 3 curses.
                      +
                      +
                      +
                      +

                      AUTHORS

                      +       Zeyd  M.  Ben-Halim,  Eric  S.  Raymond, Thomas E. Dickey.
                      +       Based on pcurses by Pavel Curtis.
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      + + diff --git a/Ada95/html/panel.3x.html b/Ada95/html/man/panel.3x.html similarity index 96% rename from Ada95/html/panel.3x.html rename to Ada95/html/man/panel.3x.html index 74d806c5..29120fc8 100644 --- a/Ada95/html/panel.3x.html +++ b/Ada95/html/man/panel.3x.html @@ -1,12 +1,12 @@ - +
                              panel - panel stack extension for curses
                       
                       
                       

                      SYNOPSIS

                      -       #include <panel.h>
                      +       #include 
                       
                              cc [flags] sourcefiles -lpanel -lncurses
                       
                      @@ -166,8 +166,8 @@
                       
                       

                      AUTHOR

                      -       Originally   written   by   Warren  Tucker  <wht@n4hgf.mt-
                      -       park.ga.us>, primarily to assist  in  porting  u386mon  to
                      +       Originally   written   by   Warren  Tucker  , primarily to assist  in  porting  u386mon  to
                              systems  without  a native panels library.  Repackaged for
                              ncurses by Zeyd ben-Halim.
                       
                      diff --git a/Ada95/html/resizeterm.3x.html b/Ada95/html/man/resizeterm.3x.html
                      similarity index 94%
                      rename from Ada95/html/resizeterm.3x.html
                      rename to Ada95/html/man/resizeterm.3x.html
                      index 92c125db..7b6e7df0 100644
                      --- a/Ada95/html/resizeterm.3x.html
                      +++ b/Ada95/html/man/resizeterm.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              resizeterm - change the curses terminal size
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int resizeterm(int lines, int columns);
                       
                      diff --git a/Ada95/html/wresize.3x.html b/Ada95/html/man/wresize.3x.html
                      similarity index 91%
                      rename from Ada95/html/wresize.3x.html
                      rename to Ada95/html/man/wresize.3x.html
                      index a5fd1ab8..95354f26 100644
                      --- a/Ada95/html/wresize.3x.html
                      +++ b/Ada95/html/man/wresize.3x.html
                      @@ -1,12 +1,12 @@
                       
                      -
                      +
                       
                              wresize - resize a curses window
                       
                       
                       

                      SYNOPSIS

                      -       #include <curses.h>
                      +       #include 
                       
                              int wresize(WINDOW *win, int lines, int columns);
                       
                      diff --git a/Ada95/html/ncurses.3x.html b/Ada95/html/ncurses.3x.html
                      deleted file mode 100644
                      index 4cae6bbe..00000000
                      --- a/Ada95/html/ncurses.3x.html
                      +++ /dev/null
                      @@ -1,490 +0,0 @@
                      -
                      -
                      -
                      -       ncurses - CRT screen handling and optimization package
                      -
                      -
                      -
                      -

                      SYNOPSIS

                      -       #include <curses.h>
                      -
                      -
                      -
                      -

                      DESCRIPTION

                      -       The curses library routines give the user a terminal-inde-
                      -       pendent method of updating character screens with  reason-
                      -       able  optimization.  This implementation is ``new curses''
                      -       (ncurses) and is the approved replacement for 4.4BSD clas-
                      -       sic curses, which has been discontinued.
                      -
                      -       The  ncurses  routines  emulate  the curses(3X) library of
                      -       System V Release 4 UNIX, and the XPG4 curses standard (XSI
                      -       curses)  but the ncurses library is freely redistributable
                      -       in source form.  Differences from the SVr4 curses are sum-
                      -       marized  under  the EXTENSIONS and BUGS sections below and
                      -       described in detail in the EXTENSIONS and BUGS sections of
                      -       individual man pages.
                      -
                      -       A  program  using  these  routines must be linked with the
                      -       -lncurses option, or (if it has been generated)  with  the
                      -       debugging  library  -lncurses_g.   (Your system integrator
                      -       may also have installed these libraries  under  the  names
                      -       -lcurses and -lcurses_g.)  The ncurses_g library generates
                      -       trace logs (in a file called 'trace' in the current direc-
                      -       tory) that describe curses actions.
                      -
                      -       The  ncurses  package supports: overall screen, window and
                      -       pad manipulation; output to windows and pads; reading ter-
                      -       minal  input;  control  over terminal and curses input and
                      -       output options; environment query routines; color  manipu-
                      -       lation; use of soft label keys; terminfo capabilities; and
                      -       access to low-level terminal-manipulation routines.
                      -
                      -       To initialize the routines, the routine initscr or newterm
                      -       must  be called before any of the other routines that deal
                      -       with windows and screens are  used.   The  routine  endwin
                      -       must be called before exiting.  To get character-at-a-time
                      -       input without echoing (most interactive,  screen  oriented
                      -       programs  want  this),  the  following  sequence should be
                      -       used:
                      -
                      -             initscr(); cbreak(); noecho();
                      -
                      -       Most programs would additionally use the sequence:
                      -
                      -             nonl();
                      -             intrflush(stdscr, FALSE);
                      -             keypad(stdscr, TRUE);
                      -
                      -       Before a curses program is run, the tab stops of the  ter-
                      -       the tput init command after the shell environment variable
                      -       TERM has been exported.  tset(1)  is  usually  responsible
                      -       for doing this.  [See terminfo(5) for further details.]
                      -
                      -       The  curses  library  permits  manipulation of data struc-
                      -       tures, called windows, which can be  thought  of  as  two-
                      -       dimensional  arrays of characters representing all or part
                      -       of a CRT screen.  A default window called stdscr, which is
                      -       the  size of the terminal screen, is supplied.  Others may
                      -       be created with newwin.
                      -
                      -       Note that curses  does  not  handle  overlapping  windows,
                      -       that's  done by the panel(3X) library. This means that you
                      -       can either use stdscr or divide the screen into tiled win-
                      -       dows  and  not  using  stdscr  at all. Mixing the two will
                      -       result in unpredictable, and undesired, effects.
                      -
                      -       Windows are referred to by variables declared as WINDOW *.
                      -       These   data  structures  are  manipulated  with  routines
                      -       described here and elsewhere in the ncurses manual  pages.
                      -       Among  which  the  most basic routines are move and addch.
                      -       More general versions of these routines are included  with
                      -       names  beginning  with  w,  allowing the user to specify a
                      -       window.  The routines not beginning with w affect stdscr.)
                      -
                      -       After  using  routines  to manipulate a window, refresh is
                      -       called, telling curses to make the user's CRT screen  look
                      -       like  stdscr.   The characters in a window are actually of
                      -       type chtype, (character and attribute data) so that  other
                      -       information  about  the  character may also be stored with
                      -       each character.
                      -
                      -       Special windows  called  pads  may  also  be  manipulated.
                      -       These are windows which are not constrained to the size of
                      -       the screen and whose contents need not be completely  dis-
                      -       played.  See curs_pad(3X) for more information.
                      -
                      -       In  addition  to  drawing  characters on the screen, video
                      -       attributes and colors may be supported, causing the  char-
                      -       acters  to show up in such modes as underlined, in reverse
                      -       video, or in color on terminals that support such  display
                      -       enhancements.  Line drawing characters may be specified to
                      -       be output.  On input, curses is  also  able  to  translate
                      -       arrow  and  function  keys  that transmit escape sequences
                      -       into single values.  The video  attributes,  line  drawing
                      -       characters,   and  input  values  use  names,  defined  in
                      -       <curses.h>, such as A_REVERSE, ACS_HLINE, and KEY_LEFT.
                      -
                      -       If the environment variables LINES and COLUMNS are set, or
                      -       if  the program is executing in a window environment, line
                      -       and column information in the  environment  will  override
                      -       information read by terminfo.  This would effect a program
                      -
                      -       If  the environment variable TERMINFO is defined, any pro-
                      -       gram using curses checks for a local  terminal  definition
                      -       before  checking  in  the standard place.  For example, if
                      -       TERM is set to att4424, then the compiled terminal defini-
                      -       tion is found in
                      -
                      -             @DATADIR@/terminfo/a/att4424.
                      -
                      -       (The a is copied from the first letter of att4424 to avoid
                      -       creation of huge directories.)  However,  if  TERMINFO  is
                      -       set to $HOME/myterms, curses first checks
                      -
                      -             $HOME/myterms/a/att4424,
                      -
                      -       and if that fails, it then checks
                      -
                      -             @DATADIR@/terminfo/a/att4424.
                      -
                      -       This  is useful for developing experimental definitions or
                      -       when write permission in @DATADIR@/terminfo is not  avail-
                      -       able.
                      -
                      -       The  integer  variables  LINES  and  COLS  are  defined in
                      -       <curses.h> and will be filled in by initscr with the  size
                      -       of the screen.  The constants TRUE and FALSE have the val-
                      -       ues 1 and 0, respectively.
                      -
                      -       The curses routines also  define  the  WINDOW  *  variable
                      -       curscr which is used for certain low-level operations like
                      -       clearing and redrawing a screen containing  garbage.   The
                      -       curscr can be used in only a few routines.
                      -
                      -
                      -   Routine and Argument Names
                      -       Many  curses routines have two or more versions.  The rou-
                      -       tines prefixed with w require a window argument.  The rou-
                      -       tines prefixed with p require a pad argument.  Those with-
                      -       out a prefix generally use stdscr.
                      -
                      -       The routines prefixed with mv require a y and x coordinate
                      -       to  move to before performing the appropriate action.  The
                      -       mv routines imply a call to move before the  call  to  the
                      -       other  routine.  The coordinate y always refers to the row
                      -       (of the window), and x always refers to the  column.   The
                      -       upper left-hand corner is always (0,0), not (1,1).
                      -
                      -       The routines prefixed with mvw take both a window argument
                      -       and x and y coordinates.  The window  argument  is  always
                      -       specified before the coordinates.
                      -
                      -       In  each  case, win is the window affected, and pad is the
                      -
                      -       Option setting routines require a Boolean flag bf with the
                      -       value TRUE or FALSE; bf is always of type bool.  The vari-
                      -       ables  ch  and attrs below are always of type chtype.  The
                      -       types WINDOW, SCREEN, bool,  and  chtype  are  defined  in
                      -       <curses.h>.   The  type  TERMINAL  is defined in <term.h>.
                      -       All other arguments are integers.
                      -
                      -
                      -   Routine Name Index
                      -       The following table lists each curses routine and the name
                      -       of  the  manual  page  on which it is described.  Routines
                      -       flagged with `*' are ncurses-specific,  not  described  by
                      -       XPG4 or present in SVr4.
                      -
                      -       center  tab(/); l l l l .  curses Routine Name/Manual Page
                      -       Name  =  addch/curs_addch(3X)  addchnstr/curs_addchstr(3X)
                      -       addchstr/curs_addchstr(3X)         addnstr/curs_addstr(3X)
                      -       addstr/curs_addstr(3X)               attroff/curs_attr(3X)
                      -       attron/curs_attr(3X)       attrset/curs_attr(3X)      bau-
                      -       drate/curs_termattrs(3X)                beep/curs_beep(3X)
                      -       bkgd/curs_bkgd(3X)  bkgdset/curs_bkgd(3X) border/curs_bor-
                      -       der(3X)                                box/curs_border(3X)
                      -       can_change_color/curs_color(3X)     cbreak/curs_inopts(3X)
                      -       clear/curs_clear(3X)    clearok/curs_outopts(3X)    clrto-
                      -       bot/curs_clear(3X)    clrtoeol/curs_clear(3X)   color_con-
                      -       tent/curs_color(3X)               copywin/curs_overlay(3X)
                      -       curs_set/curs_kernel(3X)     def_prog_mode/curs_kernel(3X)
                      -       def_shell_mode/curs_kernel(3X)       del_curterm/curs_ter-
                      -       minfo(3X)  delay_output/curs_util(3X) delch/curs_delch(3X)
                      -       deleteln/curs_deleteln(3X) delscreen/curs_initscr(3X) del-
                      -       win/curs_window(3X)      derwin/curs_window(3X)      doup-
                      -       date/curs_refresh(3X)               dupwin/curs_window(3X)
                      -       echo/curs_inopts(3X)      echochar/curs_addch(3X)     end-
                      -       win/curs_initscr(3X)                  erase/curs_clear(3X)
                      -       erasechar/curs_termattrs(3X)          filter/curs_util(3X)
                      -       flash/curs_beep(3X)     flushinp/curs_util(3X)      getbe-
                      -       gyx/curs_getyx(3X)        getch/curs_getch(3X)        get-
                      -       maxyx/curs_getyx(3X)     getmouse/curs_mouse(3X)*     get-
                      -       paryx/curs_getyx(3X)      getstr/curs_getstr(3X)      get-
                      -       syx/curs_kernel(3X)                   getwin/curs_util(3X)
                      -       getyx/curs_getyx(3X)   halfdelay/curs_inopts(3X)  has_col-
                      -       ors/curs_color(3X)               has_ic/curs_termattrs(3X)
                      -       has_il/curs_termattrs(3X)          has_key/curs_getch(3X)*
                      -       hline/curs_border(3X)               idcok/curs_outopts(3X)
                      -       idlok/curs_outopts(3X)            immedok/curs_outopts(3X)
                      -       inch/curs_inch(3X)     inchnstr/curs_inchstr(3X)     inch-
                      -       str/curs_inchstr(3X)             init_color/curs_color(3X)
                      -       init_pair/curs_color(3X)          initscr/curs_initscr(3X)
                      -       innstr/curs_instr(3X)       insch/curs_insch(3X)      ins-
                      -       delln/curs_deleteln(3X)         insertln/curs_deleteln(3X)
                      -       insnstr/curs_insstr(3X)             insstr/curs_insstr(3X)
                      -       isendwin/curs_initscr(3X)    keyname/curs_util(3X)    key-
                      -       pad/curs_inopts(3X)            killchar/curs_termattrs(3X)
                      -       leaveok/curs_outopts(3X)       longname/curs_termattrs(3X)
                      -       mcprint/curs_print(3X)*  meta/curs_inopts(3X)  mouseinter-
                      -       val/curs_mouse(3X)*              mousemask/curs_mouse(3X)*
                      -       move/curs_move(3X)     mvaddch/curs_addch(3X)    mvaddchn-
                      -       str/curs_addchstr(3X)         mvaddchstr/curs_addchstr(3X)
                      -       mvaddnstr/curs_addstr(3X)         mvaddstr/curs_addstr(3X)
                      -       mvcur/curs_terminfo(3X)   mvdelch/curs_delch(3X)    mvder-
                      -       win/curs_window(3X)      mvgetch/curs_getch(3X)     mvget-
                      -       str/curs_getstr(3X)     mvinch/curs_inch(3X)      mvinchn-
                      -       str/curs_inchstr(3X)            mvinchstr/curs_inchstr(3X)
                      -       mvinnstr/curs_instr(3X)    mvinsch/curs_insch(3X)    mvin-
                      -       snstr/curs_insstr(3X)    mvinsstr/curs_insstr(3X)    mvin-
                      -       str/curs_instr(3X)      mvprintw/curs_printw(3X)      mvs-
                      -       canw/curs_scanw(3X)   mvwaddch/curs_addch(3X)   mvwaddchn-
                      -       str/curs_addchstr(3X)        mvwaddchstr/curs_addchstr(3X)
                      -       mvwaddnstr/curs_addstr(3X)       mvwaddstr/curs_addstr(3X)
                      -       mvwdelch/curs_delch(3X)  mvwgetch/curs_getch(3X)   mvwget-
                      -       str/curs_getstr(3X)                  mvwin/curs_window(3X)
                      -       mvwinch/curs_inch(3X)         mvwinchnstr/curs_inchstr(3X)
                      -       mvwinchstr/curs_inchstr(3X)       mvwinnstr/curs_instr(3X)
                      -       mvwinsch/curs_insch(3X)         mvwinsnstr/curs_insstr(3X)
                      -       mvwinsstr/curs_insstr(3X)   mvwinstr/curs_instr(3X)   mvw-
                      -       printw/curs_printw(3X)             mvwscanw/curs_scanw(3X)
                      -       napms/curs_kernel(3X)                  newpad/curs_pad(3X)
                      -       newterm/curs_initscr(3X)            newwin/curs_window(3X)
                      -       nl/curs_outopts(3X)     nocbreak/curs_inopts(3X)     node-
                      -       lay/curs_inopts(3X) noecho/curs_inopts(3X)  nonl/curs_out-
                      -       opts(3X)  noqiflush/curs_inopts(3X)  noraw/curs_inopts(3X)
                      -       notimeout/curs_inopts(3X)  overlay/curs_overlay(3X)  over-
                      -       write/curs_overlay(3X)         pair_content/curs_color(3X)
                      -       pechochar/curs_pad(3X)   pnoutrefresh/curs_pad(3X)    pre-
                      -       fresh/curs_pad(3X)  printw/curs_printw(3X)  putp/curs_ter-
                      -       minfo(3X)   putwin/curs_util(3X)   qiflush/curs_inopts(3X)
                      -       raw/curs_inopts(3X)             redrawwin/curs_refresh(3X)
                      -       refresh/curs_refresh(3X)   reset_prog_mode/curs_kernel(3X)
                      -       reset_shell_mode/curs_kernel(3X)   resetty/curs_kernel(3X)
                      -       resizeterm/resizeterm(3X)*   restartterm/curs_terminfo(3X)
                      -       ripoffline/curs_kernel(3X)         savetty/curs_kernel(3X)
                      -       scanw/curs_scanw(3X)            scr_dump/curs_scr_dump(3X)
                      -       scr_init/curs_scr_dump(3X)   scr_restore/curs_scr_dump(3X)
                      -       scr_set/curs_scr_dump(3X)             scrl/curs_scroll(3X)
                      -       scroll/curs_scroll(3X)           scrollok/curs_outopts(3X)
                      -       set_curterm/curs_terminfo(3X)    set_term/curs_initscr(3X)
                      -       setscrreg/curs_outopts(3X)   setsyx/curs_kernel(3X)   set-
                      -       term/curs_terminfo(3X)         setupterm/curs_terminfo(3X)
                      -       slk_attr/curs_slk(3X)*            slk_attroff/curs_slk(3X)
                      -       slk_attron/curs_slk(3X)           slk_attrset/curs_slk(3X)
                      -       slk_clear/curs_slk(3X)               slk_init/curs_slk(3X)
                      -       slk_label/curs_slk(3X)        slk_noutrefresh/curs_slk(3X)
                      -       slk_refresh/curs_slk(3X)          slk_restore/curs_slk(3X)
                      -       start_color/curs_color(3X)    subpad/curs_pad(3X)     sub-
                      -       win/curs_window(3X)     syncok/curs_window(3X)     termat-
                      -       trs/curs_termattrs(3X)  termname/curs_termattrs(3X)   tge-
                      -       tent/curs_termcap(3X)    tgetflag/curs_termcap(3X)   tget-
                      -       num/curs_termcap(3X)              tgetstr/curs_termcap(3X)
                      -       tgoto/curs_termcap(3X)  tigetflag/curs_terminfo(3X) tiget-
                      -       num/curs_terminfo(3X)   tigetstr/curs_terminfo(3X)   time-
                      -       out/curs_inopts(3X)     touchline/curs_touch(3X)    touch-
                      -       win/curs_touch(3X)                 tparm/curs_terminfo(3X)
                      -       tputs/curs_termcap(3X)    tputs/curs_terminfo(3X)   typea-
                      -       head/curs_inopts(3X)                  unctrl/curs_util(3X)
                      -       ungetch/curs_getch(3X) ungetmouse/curs_mouse(3X)* untouch-
                      -       win/curs_touch(3X) use_env/curs_util(3X) vidattr/curs_ter-
                      -       minfo(3X)  vidputs/curs_terminfo(3X) vline/curs_border(3X)
                      -       vwprintw/curs_printw(3X)    vwscanw/curs_scanw(3X)    wad-
                      -       dch/curs_addch(3X)   waddchnstr/curs_addchstr(3X)  waddch-
                      -       str/curs_addchstr(3X)             waddnstr/curs_addstr(3X)
                      -       waddstr/curs_addstr(3X)     wattroff/curs_attr(3X)    wat-
                      -       tron/curs_attr(3X)                  wattrset/curs_attr(3X)
                      -       wbkgd/curs_bkgd(3X)      wbkgdset/curs_bkgd(3X)      wbor-
                      -       der/curs_border(3X)     wclear/curs_clear(3X)      wclrto-
                      -       bot/curs_clear(3X)    wclrtoeol/curs_clear(3X)    wcursyn-
                      -       cup/curs_window(3X)                  wdelch/curs_delch(3X)
                      -       wdeleteln/curs_deleteln(3X)  wechochar/curs_addch(3X) wen-
                      -       close/curs_mouse(3X)*                werase/curs_clear(3X)
                      -       wgetch/curs_getch(3X)    wgetnstr/curs_getstr(3X)    wget-
                      -       str/curs_getstr(3X)                 whline/curs_border(3X)
                      -       winch/curs_inch(3X)    winchnstr/curs_inchstr(3X)   winch-
                      -       str/curs_inchstr(3X)      winnstr/curs_instr(3X)      win-
                      -       sch/curs_insch(3X)     winsdelln/curs_deleteln(3X)    win-
                      -       sertln/curs_deleteln(3X)          winsnstr/curs_insstr(3X)
                      -       winsstr/curs_insstr(3X)              winstr/curs_instr(3X)
                      -       wmove/curs_move(3X)          wnoutrefresh/curs_refresh(3X)
                      -       wprintw/curs_printw(3X)   wredrawln/curs_refresh(3X)  wre-
                      -       fresh/curs_refresh(3X)                wresize/wresize(3X)*
                      -       wscanw/curs_scanw(3X)    wscrl/curs_scroll(3X)    wsetscr-
                      -       reg/curs_outopts(3X)    wstandend/curs_attr(3X)    wstand-
                      -       out/curs_attr(3X)      wsyncdown/curs_window(3X)     wsyn-
                      -       cup/curs_window(3X)               wtimeout/curs_inopts(3X)
                      -       wtouchln/curs_touch(3X) wvline/curs_border(3X)
                      -
                      -
                      -
                      -

                      RETURN VALUE

                      -       Routines  that  return  an integer return ERR upon failure
                      -       and an integer value other than ERR upon  successful  com-
                      -       pletion,  unless  otherwise  noted in the routine descrip-
                      -       tions.
                      -
                      -       All macros return the  value  of  the  w  version,  except
                      -       setscrreg,  wsetscrreg,  getyx,  getbegyx,  getmaxyx.  The
                      -       return values of setscrreg, wsetscrreg,  getyx,  getbegyx,
                      -       and getmaxyx are undefined (i.e., these should not be used
                      -       as the right-hand side of assignment statements).
                      -
                      -
                      -
                      -

                      SEE ALSO

                      -       terminfo(5) and 3X pages whose  names  begin  "curs_"  for
                      -       detailed routine descriptions.
                      -
                      -
                      -
                      -

                      EXTENSIONS

                      -       The curses library can be compiled with an option (-DTERM-
                      -       CAP_FILE) that falls back to  the  old-style  /etc/termcap
                      -       file  if  the  terminal  setup code cannot find a terminfo
                      -       entry corresponding to TERM.  Use of this feature  is  not
                      -       recommended,  as it essentially includes an entire termcap
                      -       compiler in the curses startup code, at  significant  cost
                      -       in core and startup cycles.
                      -
                      -       Compiling  with  -DTERMCAP_FILE changes the library's ini-
                      -       tialization sequence in a way intended to mimic the behav-
                      -       ior of 4.4BSD curses.  If there is no local or system ter-
                      -       minfo entry matching TERM,  then  the  library  looks  for
                      -       termcap  entries  in the following places: (1) if TERMINFO
                      -       is undefined, in the file named by  TERMCAP_FILE;  (2)  if
                      -       TERMINFO  is defined and begins with a slash, it is inter-
                      -       preted as the name of a termcap file to search  for  TERM;
                      -       (3) otherwise, if TERMINFO has a leading string that looks
                      -       like a terminal entry name list, and it matches TERM,  the
                      -       contents  of  TERMINFO is interpreted as a termcap; (4) if
                      -       TERMINFO looks like a termcap but doesn't match TERM,  the
                      -       termcap  file  is  searched  for among the colon-separated
                      -       paths in the environment variable  TERMPATHS  if  that  is
                      -       defined,  and  in  ~/.termcap  and the file value of TERM-
                      -       CAP_FILE otherwise.
                      -
                      -       Versions of curses compiled on PC clones  support  display
                      -       of  the  PC ROM characters (including ROM characters 0-31,
                      -       which stock SVr4 curses cannot display).  See  the  EXTEN-
                      -       SIONS sections of curs_addch(3X) and curs_attr(3X).
                      -
                      -       The curses library includes facilities for capturing mouse
                      -       events on certain terminals  (including  xterm).  See  the
                      -       curs_mouse(3X) manual page for details.
                      -
                      -       The  curses  library  includes  a  function  for directing
                      -       application output to a printer attached to  the  terminal
                      -       device.  See the curs_print(3X) manual page for details.
                      -
                      -
                      -
                      -

                      PORTABILITY

                      -       The curses library is intended to be BASE-level conformant
                      -       with the XSI Curses standard.   Certain  portions  of  the
                      -       EXTENDED  XSI  Curses  functionality (including color sup-
                      -       port) are supported.  The following  EXTENDED  XSI  Curses
                      -       calls  in  support  of wide (multibyte) characters are not
                      -       yet implemented: addnwstr, addwstr, mvaddnwstr,  mvwaddnw-
                      -       str,  mvaddwstr,  waddnwstr,  waddwstr, add_wch, wadd_wch,
                      -       mvwadd_wchnstr,  mvwadd_wchstr,  bkgrndset,  bkgrnd,  get-
                      -       bkgrnd, wbkgrnd, wbkgrndset, wgetbkgrnd, border_set, wbor-
                      -       der_set,  box_set,  hline_set,  mvhline_set,  mvvline_set,
                      -       mvwhline_set,    mvwvline_set,   whline_set,   vhline_set,
                      -       wvline_set,  echo_wchar,  wecho_wchar,  erasewchar,  kill-
                      -       wchar,    get_wch,    mvget_wch,    mvwget_ch,   wget_wch,
                      -       getwchtype, get_wstr,  getn_wstr,  wget_wstr,  wgetn_wstr,
                      -       mvget_wstr,  mvgetn_wstr, mvwget_wstr, mvwgetn_wstr, innw-
                      -       str,  inwstr,  winnwstr,  winwstr,  mvinnwstr,   mvinwstr,
                      -       mvwinnwstr,  mvwinwstr,  ins_nwstr, ins_wstr, mvins_nwstr,
                      -       mvins_wstr,   mvwins_nwstr,    mvwins_wstr,    wins_nwstr,
                      -       wins_wstr,   ins_wch,   wins_wch,  mvins_wch,  mvwins_wch,
                      -       in_wch, win_wch, mvin_wch, mvwin_wch, inwchstr, inwchnstr,
                      -       winwchstr,  winwchnstr,  mvinwchstr, mvinwchnstr, mvinwch-
                      -       str, mvwinwchnstr.
                      -
                      -       A small number of local differences (that  is,  individual
                      -       differences  between  the XSI Curses and curses calls) are
                      -       described in  PORTABILITY  sections  of  the  library  man
                      -       pages.
                      -
                      -       The routine has_key is not part of XPG4, nor is it present
                      -       in SVr4.  See the curs_getch(3X) manual page for  details.
                      -
                      -       The  routine  slk_attr is not part of XPG4, nor is it pre-
                      -       sent in  SVr4.   See  the  curs_slk(3X)  manual  page  for
                      -       details.
                      -
                      -       The  routines getmouse, mousemask, ungetmouse, mouseinter-
                      -       val, and wenclose relating to mouse  interfacing  are  not
                      -       part  of  XPG4,  nor  are  they  present in SVr4.  See the
                      -       curs_mouse(3X) manual page for details.
                      -
                      -       The routine mcprint was not present in any previous curses
                      -       implementation.   See  the  curs_print(3X) manual page for
                      -       details.
                      -
                      -       The routine wresize is not part of XPG4, nor is it present
                      -       in SVr4.  See the wresize(3X) manual page for details.
                      -
                      -       In  historic curses versions, delays embedded in the capa-
                      -       bilities cr, ind, cub1, ff and tab activated corresponding
                      -       delay  bits  in  the UNIX tty driver.  In this implementa-
                      -       tion, all padding is done by NUL sends.   This  method  is
                      -       slightly  more expensive, but narrows the interface to the
                      -       UNIX kernel  significantly  and  increases  the  package's
                      -       portability correspondingly.
                      -
                      -       In  the  XSI  standard  and  SVr4 manual pages, many entry
                      -       points have prototype arguments of the for char *const (or
                      -       cchar_t  *const,  or  wchar_t  *const,  or  void  *const).
                      -       Depending on one's interpretation of the ANSI  C  standard
                      -       tion const char *x is a modifiable pointer to unmodifiable
                      -       data, but char *const x' is  an  unmodifiable  pointer  to
                      -       modifiable  data.  Given that C passes arguments by value,
                      -       <type> *const as a formal type is at best  dubious.   Some
                      -       compilers  choke  on  the  prototypes.  Therefore, in this
                      -       implementation, they have been changed to const  <type>  *
                      -       globally.
                      -
                      -
                      -
                      -

                      NOTES

                      -       The  header  file  <curses.h>  automatically  includes the
                      -       header files <stdio.h> and <unctrl.h>.
                      -
                      -       If standard output from a curses program is re-directed to
                      -       something  which  is  not  a  tty,  screen updates will be
                      -       directed to standard error.  This was an undocumented fea-
                      -       ture of AT&T System V Release 3 curses.
                      -
                      -
                      -
                      -

                      AUTHORS

                      -       Zeyd  M.  Ben-Halim,  Eric  S. Raymond.  Descends from the
                      -       original pcurses by Pavel Curtis.
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      - - diff --git a/Ada95/html/table.html b/Ada95/html/table.html index e984bb47..7d21204a 100644 --- a/Ada95/html/table.html +++ b/Ada95/html/table.html @@ -4,310 +4,322 @@ PUBLIC "-//IETF//DTD HTML 3.0//EN"> Correspondence between ncurses C and Ada functions - +

                      Correspondence between ncurses C and Ada functions

                      Sorted by C function name

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


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_types-alphanumeric_s.html b/Ada95/html/terminal_interface-curses-forms-field_types-alphanumeric_s.html deleted file mode 100644 index 48aaeaa9..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_types-alphanumeric_s.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.1 @
                      -------------------------------------------------------------------------------
                      -package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
                      -
                      -   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);
                      -
                      -end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_types-enumeration-ada_s.html b/Ada95/html/terminal_interface-curses-forms-field_types-enumeration-ada_s.html deleted file mode 100644 index 4be75b70..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_types-enumeration-ada_s.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           GNAT ncurses Binding                           --
                      ---                                                                          --
                      ---         Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada      --
                      ---                                                                          --
                      ---                                 S P E C                                  --
                      ---                                                                          --
                      -------------------------------------------------------------------------------
                      --- Copyright (c) 1998 Free Software Foundation, Inc.                        --
                      ---                                                                          --
                      --- Permission is hereby granted, free of charge, to any person obtaining a  --
                      --- copy of this software and associated documentation files (the            --
                      --- "Software"), to deal in the Software without restriction, including      --
                      --- without limitation the rights to use, copy, modify, merge, publish,      --
                      --- distribute, distribute with modifications, sublicense, and/or sell       --
                      --- copies of the Software, and to permit persons to whom the Software is    --
                      --- furnished to do so, subject to the following conditions:                 --
                      ---                                                                          --
                      --- The above copyright notice and this permission notice shall be included  --
                      --- in all copies or substantial portions of the Software.                   --
                      ---                                                                          --
                      --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
                      --- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
                      --- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
                      --- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
                      --- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
                      --- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
                      --- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
                      ---                                                                          --
                      --- Except as contained in this notice, the name(s) of the above copyright   --
                      --- holders shall not be used in advertising or otherwise to promote the     --
                      --- sale, use or other dealings in this Software without prior written       --
                      --- authorization.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.1 @
                      -------------------------------------------------------------------------------
                      -generic
                      -   type T is (<>);
                      -
                      -package 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;
                      -
                      -   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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_types-enumeration_s.html b/Ada95/html/terminal_interface-curses-forms-field_types-enumeration_s.html deleted file mode 100644 index d72b2a0b..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_types-enumeration_s.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.1 @
                      -------------------------------------------------------------------------------
                      -with Interfaces.C.Strings;
                      -
                      -package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
                      -
                      -   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);
                      -
                      -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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_types-intfield_s.html b/Ada95/html/terminal_interface-curses-forms-field_types-intfield_s.html deleted file mode 100644 index 6a556c73..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_types-intfield_s.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.1 @
                      -------------------------------------------------------------------------------
                      -package Terminal_Interface.Curses.Forms.Field_Types.IntField is
                      -
                      -   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);
                      -
                      -end Terminal_Interface.Curses.Forms.Field_Types.IntField;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_types-ipv4_address_s.html b/Ada95/html/terminal_interface-curses-forms-field_types-ipv4_address_s.html deleted file mode 100644 index a8938712..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_types-ipv4_address_s.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.1 @
                      -------------------------------------------------------------------------------
                      -package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
                      -
                      -   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);
                      -
                      -end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_types-numeric_s.html b/Ada95/html/terminal_interface-curses-forms-field_types-numeric_s.html deleted file mode 100644 index c9164429..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_types-numeric_s.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.1 @
                      -------------------------------------------------------------------------------
                      -package Terminal_Interface.Curses.Forms.Field_Types.Numeric is
                      -
                      -   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);
                      -
                      -end Terminal_Interface.Curses.Forms.Field_Types.Numeric;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_types-regexp_s.html b/Ada95/html/terminal_interface-curses-forms-field_types-regexp_s.html deleted file mode 100644 index eb197a2c..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_types-regexp_s.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.1 @
                      -------------------------------------------------------------------------------
                      -package Terminal_Interface.Curses.Forms.Field_Types.RegExp is
                      -
                      -   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);
                      -
                      -end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_types-user-choice_s.html b/Ada95/html/terminal_interface-curses-forms-field_types-user-choice_s.html deleted file mode 100644 index 3efb8a08..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_types-user-choice_s.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.1 @
                      -------------------------------------------------------------------------------
                      -with Ada.Unchecked_Deallocation;
                      -with Terminal_Interface.Curses.Aux;
                      -
                      -package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
                      -
                      -   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 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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_types-user_s.html b/Ada95/html/terminal_interface-curses-forms-field_types-user_s.html deleted file mode 100644 index df4346e0..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_types-user_s.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.1 @
                      -------------------------------------------------------------------------------
                      -with Ada.Unchecked_Deallocation;
                      -with Terminal_Interface.Curses.Aux;
                      -
                      -package Terminal_Interface.Curses.Forms.Field_Types.User is
                      -
                      -   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 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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_types_s.html b/Ada95/html/terminal_interface-curses-forms-field_types_s.html deleted file mode 100644 index 89f8a85c..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_types_s.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.1 @
                      -------------------------------------------------------------------------------
                      -with Terminal_Interface.Curses.Aux;
                      -
                      -package Terminal_Interface.Curses.Forms.Field_Types is
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_fieldtype.3x
                      -   --  |=====================================================================
                      -
                      -   type Field_Type is abstract tagged null record;
                      -   --  Abstract base type for all field types. A concrete field type
                      -   --  is an extension that adds some data elements describing formats or
                      -   --  boundary values for the type and validation routines.
                      -   --  For the builtin low-level fieldtypes, the validation routines are
                      -   --  already defined by the low-level C library.
                      -   --  The builtin types like Alpha or AlphaNumeric etc. are defined in
                      -   --  child packages of this package. You may use one of them as example
                      -   --  how to create you own child packages for low-level field types that
                      -   --  you may have already written in C.
                      -
                      -   type Field_Type_Access is access all Field_Type'Class;
                      -
                      -   --  |
                      -   procedure Set_Field_Type (Fld      : in Field;
                      -                             Fld_Type : in Field_Type) is abstract;
                      -   --  AKA: set_field_type()
                      -   --  But: we hide the vararg mechanism of the C interface. You always
                      -   --       have to pass a single Field_Type parameter.
                      -
                      -   --  ---------------------------------------------------------------------
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_field_validation.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Get_Type (Fld : in Field) return Field_Type_Access;
                      -   --  AKA: field_type()
                      -   --  AKA: field_arg()
                      -   --  In Ada95 we can combine these. If you try to retrieve the field type
                      -   --  that is not defined as extension of the abstract tagged type above,
                      -   --  you will raise a Form_Exception.
                      -
                      -   --  +----------------------------------------------------------------------
                      -   --  | Private Part.
                      -   --  | Most of this is used by the implementations of the child packages.
                      -   --  |
                      -private
                      -   use Terminal_Interface.Curses.Aux;
                      -
                      -   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 :              C_Short;
                      -         Ref_Count :           C_Long_Int;
                      -         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.
                      -   --  |
                      -   C_Generic_Type   : C_Field_Type := Null_Field_Type;
                      -   C_Generic_Choice : C_Field_Type := Null_Field_Type;
                      -   C_Builtin_Router : C_Field_Type := Null_Field_Type;
                      -   C_Choice_Router  : C_Field_Type := Null_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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-field_user_data_s.html b/Ada95/html/terminal_interface-curses-forms-field_user_data_s.html deleted file mode 100644 index 16c28b0f..00000000 --- a/Ada95/html/terminal_interface-curses-forms-field_user_data_s.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.4 @
                      -------------------------------------------------------------------------------
                      -
                      -generic
                      -   type User is limited private;
                      -   type User_Access is access User;
                      -package Terminal_Interface.Curses.Forms.Field_User_Data is
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_field_userptr.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_User_Data (Fld  : in Field;
                      -                            Data : in User_Access);
                      -   --  AKA: set_field_userptr
                      -   pragma Inline (Set_User_Data);
                      -
                      -   --  |
                      -   procedure Get_User_Data (Fld  : in  Field;
                      -                            Data : out User_Access);
                      -   --  AKA: field_userptr
                      -   pragma Inline (Get_User_Data);
                      -
                      -end Terminal_Interface.Curses.Forms.Field_User_Data;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms-form_user_data_s.html b/Ada95/html/terminal_interface-curses-forms-form_user_data_s.html deleted file mode 100644 index 0478e861..00000000 --- a/Ada95/html/terminal_interface-curses-forms-form_user_data_s.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.4 @
                      -------------------------------------------------------------------------------
                      -
                      -generic
                      -   type User is limited private;
                      -   type User_Access is access User;
                      -package Terminal_Interface.Curses.Forms.Form_User_Data is
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_userptr.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_User_Data (Frm  : in Form;
                      -                            Data : in User_Access);
                      -   --  AKA: set_form_userptr
                      -   pragma Inline (Set_User_Data);
                      -
                      -   --  |
                      -   procedure Get_User_Data (Frm  : in  Form;
                      -                            Data : out User_Access);
                      -   --  AKA: form_userptr
                      -   pragma Inline (Get_User_Data);
                      -
                      -end Terminal_Interface.Curses.Forms.Form_User_Data;
                      -
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-forms_s.html b/Ada95/html/terminal_interface-curses-forms_s.html deleted file mode 100644 index 1f0302bd..00000000 --- a/Ada95/html/terminal_interface-curses-forms_s.html +++ /dev/null @@ -1,742 +0,0 @@ - - - - - -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.10 @
                      -------------------------------------------------------------------------------
                      ---  form binding.
                      ---  This module is generated. Please don't change it manually!
                      ---  Run the generator instead.
                      ---  |
                      -with System;
                      -with Ada.Characters.Latin_1;
                      -with Interfaces.C;
                      -
                      -package Terminal_Interface.Curses.Forms is
                      -
                      -   pragma Linker_Options ("-lform");
                      -
                      -
                      -   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);
                      -
                      -   type Field_Option_Set is
                      -      record
                      -         Visible   : Boolean;
                      -         Active    : Boolean;
                      -         Public    : Boolean;
                      -         Edit      : Boolean;
                      -         Wrap      : Boolean;
                      -         Blank     : Boolean;
                      -         Auto_Skip : Boolean;
                      -         Null_Ok   : Boolean;
                      -         Pass_Ok   : Boolean;
                      -         Static    : Boolean;
                      -         Reserved  : Boolean;
                      -      end record;
                      -   pragma Pack (Field_Option_Set);
                      -   pragma Convention (C, Field_Option_Set);
                      -
                      -   for Field_Option_Set use
                      -      record
                      -         Visible   at 0 range  0 ..  0;
                      -         Active    at 0 range  1 ..  1;
                      -         Public    at 0 range  2 ..  2;
                      -         Edit      at 0 range  3 ..  3;
                      -         Wrap      at 0 range  4 ..  4;
                      -         Blank     at 0 range  5 ..  5;
                      -         Auto_Skip at 0 range  6 ..  6;
                      -         Null_Ok   at 0 range  7 ..  7;
                      -         Pass_Ok   at 0 range  8 ..  8;
                      -         Static    at 0 range  9 ..  9;
                      -         Reserved  at 0 range 31 .. 31;
                      -      end record;
                      -   for Field_Option_Set'Size use Interfaces.C.int'Size;
                      -   --  Please note: this rep. clause is generated and may be
                      -   --               different on your system.
                      -
                      -   Default_Field_Options : Field_Option_Set;
                      -   --  The initial defaults for the field options.
                      -
                      -   type Form_Option_Set is
                      -      record
                      -         NL_Overload : Boolean;
                      -         BS_Overload : Boolean;
                      -         Reserved    : Boolean;
                      -      end record;
                      -   pragma Pack (Form_Option_Set);
                      -   pragma Convention (C, Form_Option_Set);
                      -
                      -   for Form_Option_Set use
                      -      record
                      -         NL_Overload at 0 range  0 ..  0;
                      -         BS_Overload at 0 range  1 ..  1;
                      -         Reserved    at 0 range 31 .. 31;
                      -      end record;
                      -   for Form_Option_Set'Size use Interfaces.C.int'Size;
                      -   --  Please note: this rep. clause is generated and may be
                      -   --               different on your system.
                      -
                      -   Default_Form_Options : Form_Option_Set;
                      -   --  The initial defaults for the 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;
                      -
                      -   --  |=====================================================================
                      -   --  | 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;
                      -   --  AKA: 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: new_field()
                      -
                      -   --  |
                      -   procedure Delete (Fld : in out Field);
                      -   --  AKA: free_field()
                      -   --  Reset Fld to Null_Field
                      -
                      -   --  |
                      -   function Duplicate (Fld  : Field;
                      -                       Top  : Line_Position;
                      -                       Left : Column_Position) return Field;
                      -   --  AKA: dup_field()
                      -
                      -   --  |
                      -   function Link (Fld  : Field;
                      -                  Top  : Line_Position;
                      -                  Left : Column_Position) return Field;
                      -   --  AKA: link_field()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_field_just.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Justification (Fld  : in Field;
                      -                                Just : in Field_Justification := None);
                      -   --  AKA: set_field_just()
                      -
                      -   --  |
                      -   function Get_Justification (Fld : Field) return Field_Justification;
                      -   --  AKA: field_just()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_field_buffer.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Buffer
                      -     (Fld    : in Field;
                      -      Buffer : in Buffer_Number := Buffer_Number'First;
                      -      Str    : in String);
                      -   --  AKA: set_field_buffer()
                      -
                      -   --  |
                      -   procedure Get_Buffer
                      -     (Fld    : in Field;
                      -      Buffer : in Buffer_Number := Buffer_Number'First;
                      -      Str    : out String);
                      -   --  AKA: field_buffer()
                      -
                      -   function Get_Buffer
                      -     (Fld    : in Field;
                      -      Buffer : in Buffer_Number := Buffer_Number'First) return String;
                      -   --  AKA: field_buffer()
                      -   --  Same but as function
                      -
                      -   --  |
                      -   procedure Set_Status (Fld    : in Field;
                      -                         Status : in Boolean := True);
                      -   --  AKA: set_field_status()
                      -
                      -   --  |
                      -   function Changed (Fld : Field) return Boolean;
                      -   --  AKA: field_status()
                      -
                      -   --  |
                      -   procedure Set_Maximum_Size (Fld : in Field;
                      -                               Max : in Natural := 0);
                      -   --  AKA: set_field_max()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_field_opts.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Options (Fld     : in Field;
                      -                          Options : in Field_Option_Set);
                      -   --  AKA: set_field_opts()
                      -
                      -   --  |
                      -   procedure Switch_Options (Fld     : in Field;
                      -                             Options : in Field_Option_Set;
                      -                             On      : Boolean := True);
                      -   --  AKA: field_opts_on()
                      -   --  AKA: field_opts_off()
                      -
                      -   --  |
                      -   procedure Get_Options (Fld     : in  Field;
                      -                          Options : out Field_Option_Set);
                      -   --  AKA: field_opts()
                      -
                      -   --  |
                      -   function Get_Options (Fld : Field := Null_Field)
                      -                         return Field_Option_Set;
                      -   --  AKA: field_opts()
                      -
                      -   --  |=====================================================================
                      -   --  | 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);
                      -   --  AKA: set_field_fore()
                      -
                      -   --  |
                      -   procedure Foreground (Fld  : in  Field;
                      -                         Fore : out Character_Attribute_Set);
                      -   --  AKA: field_fore()
                      -
                      -   --  |
                      -   procedure Foreground (Fld   : in  Field;
                      -                         Fore  : out Character_Attribute_Set;
                      -                         Color : out Color_Pair);
                      -   --  AKA: field_fore()
                      -
                      -   --  |
                      -   procedure Set_Background
                      -     (Fld   : in Field;
                      -      Back  : in Character_Attribute_Set := Normal_Video;
                      -      Color : in Color_Pair := Color_Pair'First);
                      -   --  AKA: set_field_back()
                      -
                      -   --  |
                      -   procedure Background (Fld  : in  Field;
                      -                         Back : out Character_Attribute_Set);
                      -   --  AKA: field_back()
                      -
                      -   --  |
                      -   procedure Background (Fld   : in  Field;
                      -                         Back  : out Character_Attribute_Set;
                      -                         Color : out Color_Pair);
                      -   --  AKA: field_back()
                      -
                      -   --  |
                      -   procedure Set_Pad_Character (Fld : in Field;
                      -                                Pad : in Character := Space);
                      -   --  AKA: set_field_pad()
                      -
                      -   --  |
                      -   procedure Pad_Character (Fld : in  Field;
                      -                            Pad : out Character);
                      -   --  AKA: field_pad()
                      -
                      -   --  |=====================================================================
                      -   --  | 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);
                      -   --  AKA: field_info()
                      -
                      -   --  |
                      -   procedure Dynamic_Info (Fld     : in Field;
                      -                           Lines   : out Line_Count;
                      -                           Columns : out Column_Count;
                      -                           Max     : out Natural);
                      -   --  AKA: dynamic_field_info()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_win.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Window (Frm : in Form;
                      -                         Win : in Window);
                      -   --  AKA: set_form_win()
                      -
                      -   --  |
                      -   function Get_Window (Frm : Form) return Window;
                      -   --  AKA: form_win()
                      -
                      -   --  |
                      -   procedure Set_Sub_Window (Frm : in Form;
                      -                             Win : in Window);
                      -   --  AKA: set_form_sub()
                      -
                      -   --  |
                      -   function Get_Sub_Window (Frm : Form) return Window;
                      -   --  AKA: form_sub()
                      -
                      -   --  |
                      -   procedure Scale (Frm     : in Form;
                      -                    Lines   : out Line_Count;
                      -                    Columns : out Column_Count);
                      -   --  AKA: scale_form()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_hook.3x
                      -   --  |=====================================================================
                      -
                      -   type Form_Hook_Function is access procedure (Frm : in Form);
                      -   pragma Convention (C, Form_Hook_Function);
                      -
                      -   --  |
                      -   procedure Set_Field_Init_Hook (Frm  : in Form;
                      -                                  Proc : in Form_Hook_Function);
                      -   --  AKA: set_field_init()
                      -
                      -   --  |
                      -   procedure Set_Field_Term_Hook (Frm  : in Form;
                      -                                  Proc : in Form_Hook_Function);
                      -   --  AKA: set_field_term()
                      -
                      -   --  |
                      -   procedure Set_Form_Init_Hook (Frm  : in Form;
                      -                                 Proc : in Form_Hook_Function);
                      -   --  AKA: set_form_init()
                      -
                      -   --  |
                      -   procedure Set_Form_Term_Hook (Frm  : in Form;
                      -                                 Proc : in Form_Hook_Function);
                      -   --  AKA: set_form_term()
                      -
                      -   --  |
                      -   function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function;
                      -   --  AKA: field_init()
                      -   pragma Import (C, Get_Field_Init_Hook, "field_init");
                      -
                      -   --  |
                      -   function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function;
                      -   --  AKA: field_term()
                      -   pragma Import (C, Get_Field_Term_Hook, "field_term");
                      -
                      -   --  |
                      -   function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function;
                      -   --  AKA: form_init()
                      -   pragma Import (C, Get_Form_Init_Hook, "form_init");
                      -
                      -   --  |
                      -   function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function;
                      -   --  AKA: form_term()
                      -   pragma Import (C, Get_Form_Term_Hook, "form_term");
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_field.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Redefine (Frm  : in Form;
                      -                       Flds : in Field_Array_Access);
                      -   --  AKA: set_form_fields()
                      -
                      -   --  |
                      -   procedure Set_Fields (Frm  : in Form;
                      -                         Flds : in Field_Array_Access) renames Redefine;
                      -   --  AKA: set_form_fields()
                      -
                      -   --  |
                      -   function Fields (Frm   : Form;
                      -                    Index : Positive) return Field;
                      -   --  AKA: form_fields()
                      -
                      -   --  |
                      -   function Field_Count (Frm : Form) return Natural;
                      -   --  AKA: field_count()
                      -
                      -   --  |
                      -   procedure Move (Fld    : in Field;
                      -                   Line   : in Line_Position;
                      -                   Column : in Column_Position);
                      -   --  AKA: move_field()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_new.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Create (Fields : Field_Array_Access) return Form;
                      -   --  AKA: new_form()
                      -
                      -   --  |
                      -   function New_Form (Fields : Field_Array_Access) return Form
                      -     renames Create;
                      -   --  AKA: new_form()
                      -
                      -   --  |
                      -   procedure Delete (Frm : in out Form);
                      -   --  AKA: free_form()
                      -   --  Reset Frm to Null_Form
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_opts.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Options (Frm     : in Form;
                      -                          Options : in Form_Option_Set);
                      -   --  AKA: set_form_opts()
                      -
                      -   --  |
                      -   procedure Switch_Options (Frm     : in Form;
                      -                             Options : in Form_Option_Set;
                      -                             On      : Boolean := True);
                      -   --  AKA: form_opts_on()
                      -   --  AKA: form_opts_off()
                      -
                      -   --  |
                      -   procedure Get_Options (Frm     : in  Form;
                      -                          Options : out Form_Option_Set);
                      -   --  AKA: form_opts()
                      -
                      -   --  |
                      -   function Get_Options (Frm : Form := Null_Form) return Form_Option_Set;
                      -   --  AKA: form_opts()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_post.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Post (Frm  : in Form;
                      -                   Post : in Boolean := True);
                      -   --  AKA: post_form()
                      -   --  AKA: unpost_form()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_cursor.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Position_Cursor (Frm : Form);
                      -   --  AKA: pos_form_cursor()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_data.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Data_Ahead (Frm : Form) return Boolean;
                      -   --  AKA: data_ahead()
                      -
                      -   --  |
                      -   function Data_Behind (Frm : Form) return Boolean;
                      -   --  AKA: data_behind()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_driver.3x
                      -   --  |=====================================================================
                      -
                      -   type Driver_Result is (Form_Ok,
                      -                          Request_Denied,
                      -                          Unknown_Request,
                      -                          Invalid_Field);
                      -
                      -   --  |
                      -   function Driver (Frm : Form;
                      -                    Key : Key_Code) return Driver_Result;
                      -   --  AKA: form_driver()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_page.3x
                      -   --  |=====================================================================
                      -
                      -   type Page_Number is new Natural;
                      -
                      -   --  |
                      -   procedure Set_Current (Frm : in Form;
                      -                          Fld : in Field);
                      -   --  AKA: set_current_field()
                      -
                      -   --  |
                      -   function Current (Frm : in Form) return Field;
                      -   --  AKA: current_field()
                      -
                      -   --  |
                      -   procedure Set_Page (Frm  : in Form;
                      -                       Page : in Page_Number := Page_Number'First);
                      -   --  AKA: set_form_page()
                      -
                      -   --  |
                      -   function Page (Frm : Form) return Page_Number;
                      -   --  AKA: form_page()
                      -
                      -   --  |
                      -   function Get_Index (Fld : Field) return Positive;
                      -   --  AKA: field_index()
                      -   --  Please note that in this binding we start the numbering of fields
                      -   --  with 1. So this is number is one more than you get from the low
                      -   --  level call.
                      -
                      -   --  |=====================================================================
                      -   --  | Man page form_new_page.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_New_Page (Fld      : in Field;
                      -                           New_Page : in Boolean := True);
                      -   --  AKA: set_new_page()
                      -
                      -   --  |
                      -   function Is_New_Page (Fld : Field) return Boolean;
                      -   --  AKA: new_page()
                      -
                      -
                      -------------------------------------------------------------------------------
                      -private
                      -
                      -   type Field        is new System.Address;
                      -   type Form         is new System.Address;
                      -
                      -   Null_Field        : constant Field        := Field (System.Null_Address);
                      -   Null_Form         : constant Form         := Form  (System.Null_Address);
                      -
                      -   Generation_Bit_Order : constant System.Bit_Order := System.Low_Order_First;
                      -   --  This constant may be different on your system.
                      -
                      -end Terminal_Interface.Curses.Forms;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-menus-item_user_data_s.html b/Ada95/html/terminal_interface-curses-menus-item_user_data_s.html deleted file mode 100644 index a867f54b..00000000 --- a/Ada95/html/terminal_interface-curses-menus-item_user_data_s.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.3 @
                      -------------------------------------------------------------------------------
                      -
                      -generic
                      -   type User is limited private;
                      -   type User_Access is access User;
                      -package Terminal_Interface.Curses.Menus.Item_User_Data is
                      -
                      -   --  The binding uses the same user pointer for menu items
                      -   --  as the low level C implementation. So you can safely
                      -   --  read or write the user pointer also with the C routines
                      -   --
                      -   --  |=====================================================================
                      -   --  | Man page mitem_userptr.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_User_Data (Itm  : in Item;
                      -                            Data : in User_Access);
                      -   --  AKA: set_item_userptr
                      -   pragma Inline (Set_User_Data);
                      -
                      -   --  |
                      -   procedure Get_User_Data (Itm  : in  Item;
                      -                            Data : out User_Access);
                      -   --  AKA: item_userptr
                      -   pragma Inline (Get_User_Data);
                      -
                      -end Terminal_Interface.Curses.Menus.Item_User_Data;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-menus-menu_user_data_s.html b/Ada95/html/terminal_interface-curses-menus-menu_user_data_s.html deleted file mode 100644 index 69ff87f9..00000000 --- a/Ada95/html/terminal_interface-curses-menus-menu_user_data_s.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.3 @
                      -------------------------------------------------------------------------------
                      -
                      -generic
                      -   type User is limited private;
                      -   type User_Access is access User;
                      -package Terminal_Interface.Curses.Menus.Menu_User_Data is
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_userptr.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_User_Data (Men  : in Menu;
                      -                            Data : in User_Access);
                      -   --  AKA: set_menu_userptr
                      -   pragma Inline (Set_User_Data);
                      -
                      -   --  |
                      -   procedure Get_User_Data (Men  : in  Menu;
                      -                            Data : out User_Access);
                      -   --  AKA: menu_userptr
                      -   pragma Inline (Get_User_Data);
                      -
                      -end Terminal_Interface.Curses.Menus.Menu_User_Data;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-menus_s.html b/Ada95/html/terminal_interface-curses-menus_s.html deleted file mode 100644 index 394bfff3..00000000 --- a/Ada95/html/terminal_interface-curses-menus_s.html +++ /dev/null @@ -1,634 +0,0 @@ - - - - - -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.8 @
                      -------------------------------------------------------------------------------
                      ---  menu binding.
                      ---  This module is generated. Please don't change it manually!
                      ---  Run the generator instead.
                      ---  |
                      -with System;
                      -with Interfaces.C;
                      -with Ada.Characters.Latin_1;
                      -
                      -package Terminal_Interface.Curses.Menus is
                      -
                      -   pragma Linker_Options ("-lmenu");
                      -
                      -
                      -
                      -   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
                      -   --
                      -
                      -   type Menu_Option_Set is
                      -      record
                      -         One_Valued        : Boolean;
                      -         Show_Descriptions : Boolean;
                      -         Row_Major_Order   : Boolean;
                      -         Ignore_Case       : Boolean;
                      -         Show_Matches      : Boolean;
                      -         Non_Cyclic        : Boolean;
                      -         Reserved          : Boolean;
                      -      end record;
                      -   pragma Pack (Menu_Option_Set);
                      -   pragma Convention (C, Menu_Option_Set);
                      -
                      -   for Menu_Option_Set use
                      -      record
                      -         One_Valued        at 0 range  0 ..  0;
                      -         Show_Descriptions at 0 range  1 ..  1;
                      -         Row_Major_Order   at 0 range  2 ..  2;
                      -         Ignore_Case       at 0 range  3 ..  3;
                      -         Show_Matches      at 0 range  4 ..  4;
                      -         Non_Cyclic        at 0 range  5 ..  5;
                      -         Reserved          at 0 range 31 .. 31;
                      -      end record;
                      -   for Menu_Option_Set'Size use Interfaces.C.int'Size;
                      -   --  Please note: this rep. clause is generated and may be
                      -   --               different on your system.
                      -
                      -   Default_Menu_Options : Menu_Option_Set;
                      -   --  Initial default options for a menu.
                      -
                      -   --
                      -   --  Item options
                      -   --
                      -   type Item_Option_Set is
                      -      record
                      -         Selectable : Boolean;
                      -         Reserved   : Boolean;
                      -      end record;
                      -   pragma Pack (Item_Option_Set);
                      -   pragma Convention (C, Item_Option_Set);
                      -
                      -   for Item_Option_Set use
                      -      record
                      -         Selectable at 0 range  0 ..  0;
                      -         Reserved   at 0 range 31 .. 31;
                      -      end record;
                      -   for Item_Option_Set'Size use Interfaces.C.int'Size;
                      -   --  Please note: this rep. clause is generated and may be
                      -   --               different on your system.
                      -
                      -   Default_Item_Options : Item_Option_Set;
                      -   --  Initial default options for an item.
                      -
                      -   --
                      -   --  Item Array
                      -   --
                      -   type Item_Array is array (Positive range <>) of aliased Item;
                      -   pragma Convention (C, Item_Array);
                      -
                      -   type Item_Array_Access is access Item_Array;
                      -
                      -   procedure Free (IA         : in out Item_Array_Access;
                      -                   Free_Items : Boolean := False);
                      -   --  Release the memory for an allocated item array
                      -   --  If Free_Items is True, call Delete() for all the items in
                      -   --  the array.
                      -
                      -   --  |=====================================================================
                      -   --  | Man page mitem_new.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Create (Name        : String;
                      -                    Description : String := "") return Item;
                      -   --  AKA: new_item()
                      -
                      -   --  |
                      -   function New_Item (Name        : String;
                      -                      Description : String := "") return Item
                      -     renames Create;
                      -   --  AKA: new_item()
                      -
                      -   --  |
                      -   procedure Delete (Itm : in out Item);
                      -   --  AKA: free_item()
                      -   --  Resets Itm to Null_Item
                      -
                      -   --  |=====================================================================
                      -   --  | Man page mitem_value.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Value (Itm   : in Item;
                      -                        Value : in Boolean := True);
                      -   --  AKA: set_item_value()
                      -
                      -   --  |
                      -   function Value (Itm : Item) return Boolean;
                      -   --  AKA: item_value()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page mitem_visible.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Visible (Itm : Item) return Boolean;
                      -   --  AKA: item_visible()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page mitem_opts.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Options (Itm     : in Item;
                      -                          Options : in Item_Option_Set);
                      -   --  AKA: set_item_opts()
                      -
                      -   --  |
                      -   procedure Switch_Options (Itm     : in Item;
                      -                             Options : in Item_Option_Set;
                      -                             On      : Boolean := True);
                      -   --  AKA: item_opts_on()
                      -   --  AKA: item_opts_off()
                      -
                      -   --  |
                      -   procedure Get_Options (Itm     : in  Item;
                      -                          Options : out Item_Option_Set);
                      -   --  AKA: item_opts()
                      -
                      -   --  |
                      -   function Get_Options (Itm : Item := Null_Item) return Item_Option_Set;
                      -   --  AKA: item_opts()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page mitem_name.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Name (Itm  : in Item;
                      -                   Name : out String);
                      -   --  AKA: item_name()
                      -   function  Name (Itm : Item) return String;
                      -   --  AKA: item_name()
                      -   --  Implemented as function
                      -
                      -   --  |
                      -   procedure Description (Itm         : in Item;
                      -                          Description : out String);
                      -   --  AKA: item_description();
                      -
                      -   function  Description (Itm : Item) return String;
                      -   --  AKA: item_description();
                      -   --  Implemented as function
                      -
                      -   --  |=====================================================================
                      -   --  | Man page mitem_current.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Current (Men : in Menu;
                      -                          Itm : in Item);
                      -   --  AKA: set_current_item()
                      -
                      -   --  |
                      -   function Current (Men : Menu) return Item;
                      -   --  AKA: current_item()
                      -
                      -   --  |
                      -   procedure Set_Top_Row (Men  : in Menu;
                      -                          Line : in Line_Position);
                      -   --  AKA: set_top_row()
                      -
                      -   --  |
                      -   function Top_Row (Men : Menu) return Line_Position;
                      -   --  AKA: top_row()
                      -
                      -   --  |
                      -   function Get_Index (Itm : Item) return Positive;
                      -   --  AKA: item_index()
                      -   --  Please note that in this binding we start the numbering of items
                      -   --  with 1. So this is number is one more than you get from the low
                      -   --  level call.
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_post.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Post (Men  : in Menu;
                      -                   Post : in Boolean := True);
                      -   --  AKA: post_menu()
                      -   --  AKA: unpost_menu()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_opts.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Options (Men     : in Menu;
                      -                          Options : in Menu_Option_Set);
                      -   --  AKA: set_menu_opts()
                      -
                      -   --  |
                      -   procedure Switch_Options (Men     : in Menu;
                      -                             Options : in Menu_Option_Set;
                      -                             On      : Boolean := True);
                      -   --  AKA: menu_opts_on()
                      -   --  AKA: menu_opts_off()
                      -
                      -   --  |
                      -   procedure Get_Options (Men     : in  Menu;
                      -                          Options : out Menu_Option_Set);
                      -   --  AKA: menu_opts()
                      -
                      -   --  |
                      -   function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set;
                      -   --  AKA: menu_opts()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_win.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Window (Men : in Menu;
                      -                         Win : in Window);
                      -   --  AKA: set_menu_win()
                      -
                      -   --  |
                      -   function Get_Window (Men : Menu) return Window;
                      -   --  AKA: menu_win()
                      -
                      -   --  |
                      -   procedure Set_Sub_Window (Men : in Menu;
                      -                             Win : in Window);
                      -   --  AKA: set_menu_sub()
                      -
                      -   --  |
                      -   function Get_Sub_Window (Men : Menu) return Window;
                      -   --  AKA: menu_sub()
                      -
                      -   --  |
                      -   procedure Scale (Men     : in Menu;
                      -                    Lines   : out Line_Count;
                      -                    Columns : out Column_Count);
                      -   --  AKA: scale_menu()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_cursor.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Position_Cursor (Men : Menu);
                      -   --  AKA: pos_menu_cursor()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_mark.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Mark (Men  : in Menu;
                      -                       Mark : in String);
                      -   --  AKA: set_menu_mark()
                      -
                      -   --  |
                      -   procedure Mark (Men  : in  Menu;
                      -                   Mark : out String);
                      -   --  AKA: menu_mark()
                      -
                      -   function  Mark (Men : Menu) return String;
                      -   --  AKA: menu_mark()
                      -   --  Implemented as function
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_attribs.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Foreground
                      -     (Men   : in Menu;
                      -      Fore  : in Character_Attribute_Set := Normal_Video;
                      -      Color : in Color_Pair := Color_Pair'First);
                      -   --  AKA: set_menu_fore()
                      -
                      -   --  |
                      -   procedure Foreground (Men   : in  Menu;
                      -                         Fore  : out Character_Attribute_Set);
                      -   --  AKA: menu_fore()
                      -
                      -   --  |
                      -   procedure Foreground (Men   : in  Menu;
                      -                         Fore  : out Character_Attribute_Set;
                      -                         Color : out Color_Pair);
                      -   --  AKA: menu_fore()
                      -
                      -   --  |
                      -   procedure Set_Background
                      -     (Men   : in Menu;
                      -      Back  : in Character_Attribute_Set := Normal_Video;
                      -      Color : in Color_Pair := Color_Pair'First);
                      -   --  AKA: set_menu_back()
                      -
                      -   --  |
                      -   procedure Background (Men  : in  Menu;
                      -                         Back : out Character_Attribute_Set);
                      -   --  AKA: menu_back()
                      -   --  |
                      -
                      -   procedure Background (Men   : in  Menu;
                      -                         Back  : out Character_Attribute_Set;
                      -                         Color : out Color_Pair);
                      -   --  AKA: menu_back()
                      -
                      -   --  |
                      -   procedure Set_Grey
                      -     (Men   : in Menu;
                      -      Grey  : in Character_Attribute_Set := Normal_Video;
                      -      Color : in Color_Pair := Color_Pair'First);
                      -   --  AKA: set_menu_grey()
                      -
                      -   --  |
                      -   procedure Grey (Men  : in  Menu;
                      -                   Grey : out Character_Attribute_Set);
                      -   --  AKA: menu_grey()
                      -
                      -   --  |
                      -   procedure Grey
                      -     (Men   : in  Menu;
                      -      Grey  : out Character_Attribute_Set;
                      -      Color : out Color_Pair);
                      -   --  AKA: menu_grey()
                      -
                      -   --  |
                      -   procedure Set_Pad_Character (Men : in Menu;
                      -                                Pad : in Character := Space);
                      -   --  AKA: set_menu_pad()
                      -
                      -   --  |
                      -   procedure Pad_Character (Men : in  Menu;
                      -                            Pad : out Character);
                      -   --  AKA: menu_pad()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_spacing.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Spacing (Men   : in Menu;
                      -                          Descr : in Column_Position := 0;
                      -                          Row   : in Line_Position   := 0;
                      -                          Col   : in Column_Position := 0);
                      -   --  AKA: set_menu_spacing()
                      -
                      -   --  |
                      -   procedure Spacing (Men   : in Menu;
                      -                      Descr : out Column_Position;
                      -                      Row   : out Line_Position;
                      -                      Col   : out Column_Position);
                      -   --  AKA: menu_spacing()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_pattern.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Set_Pattern (Men  : Menu;
                      -                         Text : String) return Boolean;
                      -   --  AKA: set_menu_pattern()
                      -   --  Return TRUE if the pattern matches, FALSE otherwise
                      -
                      -   --  |
                      -   procedure Pattern (Men  : in  Menu;
                      -                      Text : out String);
                      -   --  AKA: menu_pattern()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_format.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Format (Men     : in Menu;
                      -                         Lines   : in Line_Count;
                      -                         Columns : in Column_Count);
                      -   --  AKA: set_menu_format()
                      -
                      -   --  |
                      -   procedure Format (Men     : in  Menu;
                      -                     Lines   : out Line_Count;
                      -                     Columns : out Column_Count);
                      -   --  AKA: menu_format()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_hook.3x
                      -   --  |=====================================================================
                      -
                      -   type Menu_Hook_Function is access procedure (Men : in Menu);
                      -   pragma Convention (C, Menu_Hook_Function);
                      -
                      -   --  |
                      -   procedure Set_Item_Init_Hook (Men  : in Menu;
                      -                                 Proc : in Menu_Hook_Function);
                      -   --  AKA: set_item_init()
                      -
                      -   --  |
                      -   procedure Set_Item_Term_Hook (Men  : in Menu;
                      -                                 Proc : in Menu_Hook_Function);
                      -   --  AKA: set_item_term()
                      -
                      -   --  |
                      -   procedure Set_Menu_Init_Hook (Men  : in Menu;
                      -                                 Proc : in Menu_Hook_Function);
                      -   --  AKA: set_menu_init()
                      -
                      -   --  |
                      -   procedure Set_Menu_Term_Hook (Men  : in Menu;
                      -                                 Proc : in Menu_Hook_Function);
                      -   --  AKA: set_menu_term()
                      -
                      -   --  |
                      -   function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function;
                      -   --  AKA: item_init()
                      -
                      -   --  |
                      -   function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function;
                      -   --  AKA: item_term()
                      -
                      -   --  |
                      -   function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function;
                      -   --  AKA: menu_init()
                      -
                      -   --  |
                      -   function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function;
                      -   --  AKA: menu_term()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_items.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Redefine (Men   : in Menu;
                      -                       Items : in Item_Array_Access);
                      -   --  AKA: set_menu_items()
                      -
                      -   procedure Set_Items (Men   : in Menu;
                      -                        Items : in Item_Array_Access) renames Redefine;
                      -
                      -   --  |
                      -   function Items (Men   : Menu;
                      -                   Index : Positive) return Item;
                      -   --  AKA: menu_items()
                      -
                      -   --  |
                      -   function Item_Count (Men : Menu) return Natural;
                      -   --  AKA: item_count()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_new.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Create (Items : Item_Array_Access) return Menu;
                      -   --  AKA: new_menu()
                      -
                      -   function New_Menu (Items : Item_Array_Access) return Menu renames Create;
                      -
                      -   --  |
                      -   procedure Delete (Men : in out Menu);
                      -   --  AKA: free_menu()
                      -   --  Reset Men to Null_Menu
                      -
                      -   --  |=====================================================================
                      -   --  | Man page menu_new.3x
                      -   --  |=====================================================================
                      -
                      -   type Driver_Result is (Menu_Ok,
                      -                          Request_Denied,
                      -                          Unknown_Request,
                      -                          No_Match);
                      -
                      -   --  |
                      -   function Driver (Men : Menu;
                      -                    Key : Key_Code) return Driver_Result;
                      -   --  AKA: menu_driver()
                      -
                      --------------------------------------------------------------------------------
                      -private
                      -   type Item   is new System.Address;
                      -   type Menu   is new System.Address;
                      -
                      -   Null_Item : constant Item := Item (System.Null_Address);
                      -   Null_Menu : constant Menu := Menu (System.Null_Address);
                      -
                      -   Generation_Bit_Order : constant System.Bit_Order := System.Low_Order_First;
                      -   --  This constant may be different on your system.
                      -
                      -end Terminal_Interface.Curses.Menus;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-mouse_s.html b/Ada95/html/terminal_interface-curses-mouse_s.html deleted file mode 100644 index 8054e668..00000000 --- a/Ada95/html/terminal_interface-curses-mouse_s.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.8 @
                      -------------------------------------------------------------------------------
                      ---  mouse binding.
                      ---  This module is generated. Please don't change it manually!
                      ---  Run the generator instead.
                      ---  |
                      -with System;
                      -
                      -package Terminal_Interface.Curses.Mouse is
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_mouse.3x
                      -   --  |=====================================================================
                      -   --  Please note, that in ncurses-1.9.9e documentation mouse support
                      -   --  is still marked as experimental. So also this binding will change
                      -   --  if the ncurses methods change.
                      -   --
                      -   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
                      -
                      -   type Button_State is (Released,
                      -                         Pressed,
                      -                         Clicked,
                      -                         Double_Clicked,
                      -                         Triple_Clicked);
                      -
                      -   type Mouse_Event is private;
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_mouse.3x
                      -   --  |=====================================================================
                      -
                      -   function Has_Mouse return Boolean;
                      -   --  Return true if a mouse device is supported, false otherwise.
                      -
                      -   procedure Register_Reportable_Event
                      -     (B    : in Mouse_Button;
                      -      S    : 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
                      -
                      -   --  |
                      -   function Start_Mouse (Mask : Event_Mask := All_Events)
                      -                         return Event_Mask;
                      -   --  AKA: mousemask()
                      -
                      -   procedure End_Mouse;
                      -   --  Terminates the mouse
                      -
                      -   --  |
                      -   function Get_Mouse return Mouse_Event;
                      -   --  AKA: getmouse()
                      -
                      -   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.
                      -
                      -   --  |
                      -   procedure Unget_Mouse (Event : in Mouse_Event);
                      -   --  AKA: ungetmouse()
                      -
                      -   --  |
                      -   function Enclosed_In_Window (Win    : Window := Standard_Window;
                      -                                Event  : Mouse_Event) return Boolean;
                      -   --  AKA: wenclose()
                      -   --  But : use event instead of screen coordinates.
                      -
                      -   --  |
                      -   function Mouse_Interval (Msec : Natural := 200) return Natural;
                      -   --  AKA: mouseinterval()
                      -
                      -private
                      -   type Event_Mask is new Interfaces.C.int;
                      -   No_Events  : constant Event_Mask := 0;
                      -   All_Events : constant Event_Mask := -1;
                      -
                      -   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);
                      -
                      -   for Mouse_Event use
                      -      record
                      -         Id      at 0 range   0 ..  15;
                      -         X       at 0 range  32 ..  63;
                      -         Y       at 0 range  64 ..  95;
                      -         Z       at 0 range  96 .. 127;
                      -         Bstate  at 0 range 128 .. 159;
                      -      end record;
                      -      --  Please note: this rep. clause is generated and may be
                      -      --               different on your system.
                      -
                      -   Generation_Bit_Order : constant System.Bit_Order := System.Low_Order_First;
                      -   --  This constant may be different on your system.
                      -
                      -end Terminal_Interface.Curses.Mouse;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-panels-user_data_s.html b/Ada95/html/terminal_interface-curses-panels-user_data_s.html deleted file mode 100644 index 307d0c84..00000000 --- a/Ada95/html/terminal_interface-curses-panels-user_data_s.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.3 @
                      -------------------------------------------------------------------------------
                      -
                      -generic
                      -   type User is limited private;
                      -   type User_Access is access all User;
                      -package Terminal_Interface.Curses.Panels.User_Data is
                      -
                      -   --  |=====================================================================
                      -   --  | Man page panel.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_User_Data (Pan  : in Panel;
                      -                            Data : in User_Access);
                      -   --  AKA: set_panel_userptr
                      -   pragma Convention (C, Set_User_Data);
                      -
                      -   --  |
                      -   procedure Get_User_Data (Pan  : in  Panel;
                      -                            Data : out User_Access);
                      -   --  AKA: panel_userptr
                      -   pragma Convention (C, Get_User_Data);
                      -
                      -end Terminal_Interface.Curses.Panels.User_Data;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-panels_s.html b/Ada95/html/terminal_interface-curses-panels_s.html deleted file mode 100644 index 9d2ca4c4..00000000 --- a/Ada95/html/terminal_interface-curses-panels_s.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.3 @
                      -------------------------------------------------------------------------------
                      -with System;
                      -
                      -package Terminal_Interface.Curses.Panels is
                      -
                      -   pragma Linker_Options ("-lpanel");
                      -
                      -
                      -   type Panel is private;
                      -
                      -   ---------------------------
                      -   --  Interface constants  --
                      -   ---------------------------
                      -   Null_Panel : constant Panel;
                      -
                      -   -------------------
                      -   --  Exceptions   --
                      -   -------------------
                      -
                      -   Panel_Exception : exception;
                      -
                      -   --  |=====================================================================
                      -   --  | Man page panel.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Create (Win : Window) return Panel;
                      -   --  AKA: new_panel()
                      -
                      -   --  |
                      -   function New_Panel (Win : Window) return Panel renames Create;
                      -   --  AKA: new_panel()
                      -
                      -   --  |
                      -   procedure Bottom (Pan : in Panel);
                      -   --  AKA: bottom_panel()
                      -
                      -   --  |
                      -   procedure Top (Pan : in Panel);
                      -   --  AKA: top_panel()
                      -
                      -   --  |
                      -   procedure Show (Pan : in Panel);
                      -   --  AKA: show_panel()
                      -
                      -   --  |
                      -   procedure Update_Panels;
                      -   --  AKA: update_panels()
                      -   pragma Import (C, Update_Panels, "update_panels");
                      -
                      -   --  |
                      -   procedure Hide (Pan : in Panel);
                      -   --  AKA: hide_panel()
                      -
                      -   --  |
                      -   function Get_Window (Pan : Panel) return Window;
                      -   --  AKA: panel_window()
                      -
                      -   --  |
                      -   function Panel_Window (Pan : Panel) return Window renames Get_Window;
                      -
                      -   --  |
                      -   procedure Replace (Pan : in Panel;
                      -                      Win : in Window);
                      -   --  AKA: replace_panel()
                      -
                      -   --  |
                      -   procedure Move (Pan    : in Panel;
                      -                   Line   : in Line_Position;
                      -                   Column : in Column_Position);
                      -   --  AKA: move_panel()
                      -
                      -   --  |
                      -   function Is_Hidden (Pan : Panel) return Boolean;
                      -   --  AKA: panel_hidden()
                      -
                      -   --  |
                      -   function Above (Pan : Panel) return Panel;
                      -   --  AKA: panel_above()
                      -   pragma Import (C, Above, "panel_above");
                      -
                      -   --  |
                      -   function Below (Pan : Panel) return Panel;
                      -   --  AKA: panel_below()
                      -   pragma Import (C, Below, "panel_below");
                      -
                      -   --  |
                      -   procedure Delete (Pan : in out Panel);
                      -   --  AKA: del_panel()
                      -
                      -   private
                      -      type Panel is new System.Address;
                      -      Null_Panel : constant Panel := Panel (System.Null_Address);
                      -
                      -end Terminal_Interface.Curses.Panels;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-text_io-complex_io_s.html b/Ada95/html/terminal_interface-curses-text_io-complex_io_s.html deleted file mode 100644 index 8a959df2..00000000 --- a/Ada95/html/terminal_interface-curses-text_io-complex_io_s.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.4 @
                      -------------------------------------------------------------------------------
                      -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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-text_io-decimal_io_s.html b/Ada95/html/terminal_interface-curses-text_io-decimal_io_s.html deleted file mode 100644 index 3dd4f325..00000000 --- a/Ada95/html/terminal_interface-curses-text_io-decimal_io_s.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.5 @
                      -------------------------------------------------------------------------------
                      -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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-text_io-enumeration_io_s.html b/Ada95/html/terminal_interface-curses-text_io-enumeration_io_s.html deleted file mode 100644 index 0c45c78a..00000000 --- a/Ada95/html/terminal_interface-curses-text_io-enumeration_io_s.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.5 @
                      -------------------------------------------------------------------------------
                      -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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-text_io-fixed_io_s.html b/Ada95/html/terminal_interface-curses-text_io-fixed_io_s.html deleted file mode 100644 index 72f1bd1b..00000000 --- a/Ada95/html/terminal_interface-curses-text_io-fixed_io_s.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.5 @
                      -------------------------------------------------------------------------------
                      -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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-text_io-float_io_s.html b/Ada95/html/terminal_interface-curses-text_io-float_io_s.html deleted file mode 100644 index 9d337e18..00000000 --- a/Ada95/html/terminal_interface-curses-text_io-float_io_s.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.5 @
                      -------------------------------------------------------------------------------
                      -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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-text_io-integer_io_s.html b/Ada95/html/terminal_interface-curses-text_io-integer_io_s.html deleted file mode 100644 index 6346da73..00000000 --- a/Ada95/html/terminal_interface-curses-text_io-integer_io_s.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.5 @
                      -------------------------------------------------------------------------------
                      -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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-text_io-modular_io_s.html b/Ada95/html/terminal_interface-curses-text_io-modular_io_s.html deleted file mode 100644 index fa631501..00000000 --- a/Ada95/html/terminal_interface-curses-text_io-modular_io_s.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.5 @
                      -------------------------------------------------------------------------------
                      -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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses-text_io_s.html b/Ada95/html/terminal_interface-curses-text_io_s.html deleted file mode 100644 index 1b88db78..00000000 --- a/Ada95/html/terminal_interface-curses-text_io_s.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.6 @
                      -------------------------------------------------------------------------------
                      -with System;
                      -with System.Parameters;
                      -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 Integer range 0 .. System.Parameters.Field_Max;
                      -   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;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface-curses_s.html b/Ada95/html/terminal_interface-curses_s.html deleted file mode 100644 index e294a6d3..00000000 --- a/Ada95/html/terminal_interface-curses_s.html +++ /dev/null @@ -1,1573 +0,0 @@ - - - - - -


                      -

                      -
                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.9 @
                      -------------------------------------------------------------------------------
                      ---  curses binding.
                      ---  This module is generated. Please don't change it manually!
                      ---  Run the generator instead.
                      ---  |
                      -with System;
                      -with Interfaces.C;   --  We need this for some assertions.
                      -
                      -package Terminal_Interface.Curses is
                      -
                      -   pragma Linker_Options ("-lncurses");
                      -
                      -   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 .. 8#777#;
                      -   --  This are the codes that potentially represent a real keystroke.
                      -   --  Not all codes may be possible on a specific terminal. To check the
                      -   --  availability of a special key, the Has_Key function is provided.
                      -
                      -   subtype Special_Key_Code is Real_Key_Code
                      -     range 8#400# .. Real_Key_Code'Last;
                      -   --  Type for a function- or special key number
                      -
                      -   subtype Normal_Key_Code is Real_Key_Code range
                      -     Character'Pos (Character'First) .. Character'Pos (Character'Last);
                      -   --  This are the codes for regular (incl. non-graphical) characters.
                      -
                      -   --  Constants for function- and special keys
                      -   --
                      -   Key_None                       : constant Special_Key_Code := 8#400#;
                      -   Key_Code_Yes                   : constant Special_Key_Code := 8#400#;
                      -   Key_Min                        : constant Special_Key_Code := 8#401#;
                      -   Key_Break                      : constant Special_Key_Code := 8#401#;
                      -   Key_Cursor_Down                : constant Special_Key_Code := 8#402#;
                      -   Key_Cursor_Up                  : constant Special_Key_Code := 8#403#;
                      -   Key_Cursor_Left                : constant Special_Key_Code := 8#404#;
                      -   Key_Cursor_Right               : constant Special_Key_Code := 8#405#;
                      -   Key_Home                       : constant Special_Key_Code := 8#406#;
                      -   Key_Backspace                  : constant Special_Key_Code := 8#407#;
                      -   Key_F0                         : constant Special_Key_Code := 8#410#;
                      -   Key_F1                         : constant Special_Key_Code := 8#411#;
                      -   Key_F2                         : constant Special_Key_Code := 8#412#;
                      -   Key_F3                         : constant Special_Key_Code := 8#413#;
                      -   Key_F4                         : constant Special_Key_Code := 8#414#;
                      -   Key_F5                         : constant Special_Key_Code := 8#415#;
                      -   Key_F6                         : constant Special_Key_Code := 8#416#;
                      -   Key_F7                         : constant Special_Key_Code := 8#417#;
                      -   Key_F8                         : constant Special_Key_Code := 8#420#;
                      -   Key_F9                         : constant Special_Key_Code := 8#421#;
                      -   Key_F10                        : constant Special_Key_Code := 8#422#;
                      -   Key_F11                        : constant Special_Key_Code := 8#423#;
                      -   Key_F12                        : constant Special_Key_Code := 8#424#;
                      -   Key_F13                        : constant Special_Key_Code := 8#425#;
                      -   Key_F14                        : constant Special_Key_Code := 8#426#;
                      -   Key_F15                        : constant Special_Key_Code := 8#427#;
                      -   Key_F16                        : constant Special_Key_Code := 8#430#;
                      -   Key_F17                        : constant Special_Key_Code := 8#431#;
                      -   Key_F18                        : constant Special_Key_Code := 8#432#;
                      -   Key_F19                        : constant Special_Key_Code := 8#433#;
                      -   Key_F20                        : constant Special_Key_Code := 8#434#;
                      -   Key_F21                        : constant Special_Key_Code := 8#435#;
                      -   Key_F22                        : constant Special_Key_Code := 8#436#;
                      -   Key_F23                        : constant Special_Key_Code := 8#437#;
                      -   Key_F24                        : constant Special_Key_Code := 8#440#;
                      -   Key_Delete_Line                : constant Special_Key_Code := 8#510#;
                      -   Key_Insert_Line                : constant Special_Key_Code := 8#511#;
                      -   Key_Delete_Char                : constant Special_Key_Code := 8#512#;
                      -   Key_Insert_Char                : constant Special_Key_Code := 8#513#;
                      -   Key_Exit_Insert_Mode           : constant Special_Key_Code := 8#514#;
                      -   Key_Clear_Screen               : constant Special_Key_Code := 8#515#;
                      -   Key_Clear_End_Of_Screen        : constant Special_Key_Code := 8#516#;
                      -   Key_Clear_End_Of_Line          : constant Special_Key_Code := 8#517#;
                      -   Key_Scroll_1_Forward           : constant Special_Key_Code := 8#520#;
                      -   Key_Scroll_1_Backward          : constant Special_Key_Code := 8#521#;
                      -   Key_Next_Page                  : constant Special_Key_Code := 8#522#;
                      -   Key_Previous_Page              : constant Special_Key_Code := 8#523#;
                      -   Key_Set_Tab                    : constant Special_Key_Code := 8#524#;
                      -   Key_Clear_Tab                  : constant Special_Key_Code := 8#525#;
                      -   Key_Clear_All_Tabs             : constant Special_Key_Code := 8#526#;
                      -   Key_Enter_Or_Send              : constant Special_Key_Code := 8#527#;
                      -   Key_Soft_Reset                 : constant Special_Key_Code := 8#530#;
                      -   Key_Reset                      : constant Special_Key_Code := 8#531#;
                      -   Key_Print                      : constant Special_Key_Code := 8#532#;
                      -   Key_Bottom                     : constant Special_Key_Code := 8#533#;
                      -   Key_Upper_Left_Of_Keypad       : constant Special_Key_Code := 8#534#;
                      -   Key_Upper_Right_Of_Keypad      : constant Special_Key_Code := 8#535#;
                      -   Key_Center_Of_Keypad           : constant Special_Key_Code := 8#536#;
                      -   Key_Lower_Left_Of_Keypad       : constant Special_Key_Code := 8#537#;
                      -   Key_Lower_Right_Of_Keypad      : constant Special_Key_Code := 8#540#;
                      -   Key_Back_Tab                   : constant Special_Key_Code := 8#541#;
                      -   Key_Beginning                  : constant Special_Key_Code := 8#542#;
                      -   Key_Cancel                     : constant Special_Key_Code := 8#543#;
                      -   Key_Close                      : constant Special_Key_Code := 8#544#;
                      -   Key_Command                    : constant Special_Key_Code := 8#545#;
                      -   Key_Copy                       : constant Special_Key_Code := 8#546#;
                      -   Key_Create                     : constant Special_Key_Code := 8#547#;
                      -   Key_End                        : constant Special_Key_Code := 8#550#;
                      -   Key_Exit                       : constant Special_Key_Code := 8#551#;
                      -   Key_Find                       : constant Special_Key_Code := 8#552#;
                      -   Key_Help                       : constant Special_Key_Code := 8#553#;
                      -   Key_Mark                       : constant Special_Key_Code := 8#554#;
                      -   Key_Message                    : constant Special_Key_Code := 8#555#;
                      -   Key_Move                       : constant Special_Key_Code := 8#556#;
                      -   Key_Next                       : constant Special_Key_Code := 8#557#;
                      -   Key_Open                       : constant Special_Key_Code := 8#560#;
                      -   Key_Options                    : constant Special_Key_Code := 8#561#;
                      -   Key_Previous                   : constant Special_Key_Code := 8#562#;
                      -   Key_Redo                       : constant Special_Key_Code := 8#563#;
                      -   Key_Reference                  : constant Special_Key_Code := 8#564#;
                      -   Key_Refresh                    : constant Special_Key_Code := 8#565#;
                      -   Key_Replace                    : constant Special_Key_Code := 8#566#;
                      -   Key_Restart                    : constant Special_Key_Code := 8#567#;
                      -   Key_Resume                     : constant Special_Key_Code := 8#570#;
                      -   Key_Save                       : constant Special_Key_Code := 8#571#;
                      -   Key_Shift_Begin                : constant Special_Key_Code := 8#572#;
                      -   Key_Shift_Cancel               : constant Special_Key_Code := 8#573#;
                      -   Key_Shift_Command              : constant Special_Key_Code := 8#574#;
                      -   Key_Shift_Copy                 : constant Special_Key_Code := 8#575#;
                      -   Key_Shift_Create               : constant Special_Key_Code := 8#576#;
                      -   Key_Shift_Delete_Char          : constant Special_Key_Code := 8#577#;
                      -   Key_Shift_Delete_Line          : constant Special_Key_Code := 8#600#;
                      -   Key_Select                     : constant Special_Key_Code := 8#601#;
                      -   Key_Shift_End                  : constant Special_Key_Code := 8#602#;
                      -   Key_Shift_Clear_End_Of_Line    : constant Special_Key_Code := 8#603#;
                      -   Key_Shift_Exit                 : constant Special_Key_Code := 8#604#;
                      -   Key_Shift_Find                 : constant Special_Key_Code := 8#605#;
                      -   Key_Shift_Help                 : constant Special_Key_Code := 8#606#;
                      -   Key_Shift_Home                 : constant Special_Key_Code := 8#607#;
                      -   Key_Shift_Insert_Char          : constant Special_Key_Code := 8#610#;
                      -   Key_Shift_Cursor_Left          : constant Special_Key_Code := 8#611#;
                      -   Key_Shift_Message              : constant Special_Key_Code := 8#612#;
                      -   Key_Shift_Move                 : constant Special_Key_Code := 8#613#;
                      -   Key_Shift_Next_Page            : constant Special_Key_Code := 8#614#;
                      -   Key_Shift_Options              : constant Special_Key_Code := 8#615#;
                      -   Key_Shift_Previous_Page        : constant Special_Key_Code := 8#616#;
                      -   Key_Shift_Print                : constant Special_Key_Code := 8#617#;
                      -   Key_Shift_Redo                 : constant Special_Key_Code := 8#620#;
                      -   Key_Shift_Replace              : constant Special_Key_Code := 8#621#;
                      -   Key_Shift_Cursor_Right         : constant Special_Key_Code := 8#622#;
                      -   Key_Shift_Resume               : constant Special_Key_Code := 8#623#;
                      -   Key_Shift_Save                 : constant Special_Key_Code := 8#624#;
                      -   Key_Shift_Suspend              : constant Special_Key_Code := 8#625#;
                      -   Key_Shift_Undo                 : constant Special_Key_Code := 8#626#;
                      -   Key_Suspend                    : constant Special_Key_Code := 8#627#;
                      -   Key_Undo                       : constant Special_Key_Code := 8#630#;
                      -   Key_Mouse                      : constant Special_Key_Code := 8#631#;
                      -   Key_Resize                     : constant Special_Key_Code := 8#632#;
                      -
                      -   Key_Max                        : constant Special_Key_Code
                      -     := Special_Key_Code'Last;
                      -
                      -   subtype User_Key_Code is Key_Code
                      -     range (Key_Max + 129) .. Key_Code'Last;
                      -   --  This is reserved for user defined key codes. The range between Key_Max
                      -   --  and the first user code is reserved for subsystems like menu and forms.
                      -
                      -   --  For those who like to use the original key names we produce them were
                      -   --  they differ from the original. Please note that they may differ in
                      -   --  lower/upper case.
                      -   KEY_DOWN         : Special_Key_Code renames Key_Cursor_Down;
                      -   KEY_UP           : Special_Key_Code renames Key_Cursor_Up;
                      -   KEY_LEFT         : Special_Key_Code renames Key_Cursor_Left;
                      -   KEY_RIGHT        : Special_Key_Code renames Key_Cursor_Right;
                      -   KEY_DL           : Special_Key_Code renames Key_Delete_Line;
                      -   KEY_IL           : Special_Key_Code renames Key_Insert_Line;
                      -   KEY_DC           : Special_Key_Code renames Key_Delete_Char;
                      -   KEY_IC           : Special_Key_Code renames Key_Insert_Char;
                      -   KEY_EIC          : Special_Key_Code renames Key_Exit_Insert_Mode;
                      -   KEY_CLEAR        : Special_Key_Code renames Key_Clear_Screen;
                      -   KEY_EOS          : Special_Key_Code renames Key_Clear_End_Of_Screen;
                      -   KEY_EOL          : Special_Key_Code renames Key_Clear_End_Of_Line;
                      -   KEY_SF           : Special_Key_Code renames Key_Scroll_1_Forward;
                      -   KEY_SR           : Special_Key_Code renames Key_Scroll_1_Backward;
                      -   KEY_NPAGE        : Special_Key_Code renames Key_Next_Page;
                      -   KEY_PPAGE        : Special_Key_Code renames Key_Previous_Page;
                      -   KEY_STAB         : Special_Key_Code renames Key_Set_Tab;
                      -   KEY_CTAB         : Special_Key_Code renames Key_Clear_Tab;
                      -   KEY_CATAB        : Special_Key_Code renames Key_Clear_All_Tabs;
                      -   KEY_ENTER        : Special_Key_Code renames Key_Enter_Or_Send;
                      -   KEY_SRESET       : Special_Key_Code renames Key_Soft_Reset;
                      -   KEY_LL           : Special_Key_Code renames Key_Bottom;
                      -   KEY_A1           : Special_Key_Code renames Key_Upper_Left_Of_Keypad;
                      -   KEY_A3           : Special_Key_Code renames Key_Upper_Right_Of_Keypad;
                      -   KEY_B2           : Special_Key_Code renames Key_Center_Of_Keypad;
                      -   KEY_C1           : Special_Key_Code renames Key_Lower_Left_Of_Keypad;
                      -   KEY_C3           : Special_Key_Code renames Key_Lower_Right_Of_Keypad;
                      -   KEY_BTAB         : Special_Key_Code renames Key_Back_Tab;
                      -   KEY_BEG          : Special_Key_Code renames Key_Beginning;
                      -   KEY_SBEG         : Special_Key_Code renames Key_Shift_Begin;
                      -   KEY_SCANCEL      : Special_Key_Code renames Key_Shift_Cancel;
                      -   KEY_SCOMMAND     : Special_Key_Code renames Key_Shift_Command;
                      -   KEY_SCOPY        : Special_Key_Code renames Key_Shift_Copy;
                      -   KEY_SCREATE      : Special_Key_Code renames Key_Shift_Create;
                      -   KEY_SDC          : Special_Key_Code renames Key_Shift_Delete_Char;
                      -   KEY_SDL          : Special_Key_Code renames Key_Shift_Delete_Line;
                      -   KEY_SEND         : Special_Key_Code renames Key_Shift_End;
                      -   KEY_SEOL         : Special_Key_Code renames Key_Shift_Clear_End_Of_Line;
                      -   KEY_SEXIT        : Special_Key_Code renames Key_Shift_Exit;
                      -   KEY_SFIND        : Special_Key_Code renames Key_Shift_Find;
                      -   KEY_SHELP        : Special_Key_Code renames Key_Shift_Help;
                      -   KEY_SHOME        : Special_Key_Code renames Key_Shift_Home;
                      -   KEY_SIC          : Special_Key_Code renames Key_Shift_Insert_Char;
                      -   KEY_SLEFT        : Special_Key_Code renames Key_Shift_Cursor_Left;
                      -   KEY_SMESSAGE     : Special_Key_Code renames Key_Shift_Message;
                      -   KEY_SMOVE        : Special_Key_Code renames Key_Shift_Move;
                      -   KEY_SNEXT        : Special_Key_Code renames Key_Shift_Next_Page;
                      -   KEY_SOPTIONS     : Special_Key_Code renames Key_Shift_Options;
                      -   KEY_SPREVIOUS    : Special_Key_Code renames Key_Shift_Previous_Page;
                      -   KEY_SPRINT       : Special_Key_Code renames Key_Shift_Print;
                      -   KEY_SREDO        : Special_Key_Code renames Key_Shift_Redo;
                      -   KEY_SREPLACE     : Special_Key_Code renames Key_Shift_Replace;
                      -   KEY_SRIGHT       : Special_Key_Code renames Key_Shift_Cursor_Right;
                      -   KEY_SRSUME       : Special_Key_Code renames Key_Shift_Resume;
                      -   KEY_SSAVE        : Special_Key_Code renames Key_Shift_Save;
                      -   KEY_SSUSPEND     : Special_Key_Code renames Key_Shift_Suspend;
                      -   KEY_SUNDO        : Special_Key_Code renames Key_Shift_Undo;
                      -
                      -
                      -------------------------------------------------------------------------------
                      -
                      -   type Color_Number is range 0 .. 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.
                      -
                      -   Black    : constant Color_Number := 0;
                      -   Red      : constant Color_Number := 1;
                      -   Green    : constant Color_Number := 2;
                      -   Yellow   : constant Color_Number := 3;
                      -   Blue     : constant Color_Number := 4;
                      -   Magenta  : constant Color_Number := 5;
                      -   Cyan     : constant Color_Number := 6;
                      -   White    : constant Color_Number := 7;
                      -
                      -   type RGB_Value is range 0 .. Integer (Interfaces.C.Short'Last);
                      -   for RGB_Value'Size use Interfaces.C.short'Size;
                      -   --  Some system may allow to redefine a color by setting RGB values.
                      -
                      -   type Color_Pair is range 0 .. 255;
                      -   for Color_Pair'Size use 8;
                      -   subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255;
                      -   --  (n)curses reserves 1 Byte for the color-pair number. Color Pair 0
                      -   --  is fixed (Black & White). A color pair is simply a combination of
                      -   --  two colors described by Color_Numbers, one for the foreground and
                      -   --  the other for the background
                      -
                      -   type Character_Attribute_Set is
                      -      record
                      -         Stand_Out               : Boolean;
                      -         Under_Line              : Boolean;
                      -         Reverse_Video           : Boolean;
                      -         Blink                   : Boolean;
                      -         Dim_Character           : Boolean;
                      -         Bold_Character          : Boolean;
                      -         Alternate_Character_Set : Boolean;
                      -         Invisible_Character     : Boolean;
                      -         Protected_Character     : Boolean;
                      -         Horizontal              : Boolean;
                      -         Left                    : Boolean;
                      -         Low                     : Boolean;
                      -         Right                   : Boolean;
                      -         Top                     : Boolean;
                      -         Vertical                : Boolean;
                      -         Reserved                : Boolean;
                      -      end record;
                      -   pragma Pack (Character_Attribute_Set);
                      -   pragma Convention (C, Character_Attribute_Set);
                      -
                      -   for Character_Attribute_Set use
                      -      record
                      -         Stand_Out               at 0 range  0 ..  0;
                      -         Under_Line              at 0 range  1 ..  1;
                      -         Reverse_Video           at 0 range  2 ..  2;
                      -         Blink                   at 0 range  3 ..  3;
                      -         Dim_Character           at 0 range  4 ..  4;
                      -         Bold_Character          at 0 range  5 ..  5;
                      -         Alternate_Character_Set at 0 range  6 ..  6;
                      -         Invisible_Character     at 0 range  7 ..  7;
                      -         Protected_Character     at 0 range  8 ..  8;
                      -         Horizontal              at 0 range  9 ..  9;
                      -         Left                    at 0 range 10 .. 10;
                      -         Low                     at 0 range 11 .. 11;
                      -         Right                   at 0 range 12 .. 12;
                      -         Top                     at 0 range 13 .. 13;
                      -         Vertical                at 0 range 14 .. 14;
                      -         Reserved                at 0 range 15 .. 15;
                      -      end record;
                      -   for Character_Attribute_Set'Size use Interfaces.C.int'Size / 2;
                      -   --  Please note: this rep. clause is generated and may be
                      -   --               different on your system.
                      -   --  (n)curses uses half of an integer for attributes.
                      -
                      -   Normal_Video : constant Character_Attribute_Set := (others => False);
                      -
                      -   type Attributed_Character is
                      -      record
                      -         Attr  : Character_Attribute_Set := Normal_Video;
                      -         Color : Color_Pair := 0;
                      -         Ch    : Character  := ' ';
                      -      end record;
                      -   pragma Convention (C, Attributed_Character);
                      -   --  This is the counterpart for the chtype in C.
                      -
                      -   for Attributed_Character use
                      -      record
                      -         Ch    at 0 range  0 ..  7;
                      -         Color at 0 range  8 .. 15;
                      -         Attr  at 0 range 16 .. 31;
                      -      end record;
                      -   for Attributed_Character'Size use Interfaces.C.int'Size;
                      -      --  Please note: this rep. clause is generated and may be
                      -      --               different on your system.
                      -
                      -   Default_Character : constant Attributed_Character
                      -     := (Ch    => Character'First,
                      -         Color => Color_Pair'First,
                      -         Attr  => 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;
                      -
                      -   --  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 symbols 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.
                      -   --
                      -   ACS_Upper_Left_Corner    : constant Character := 'l';
                      -   ACS_Lower_Left_Corner    : constant Character := 'm';
                      -   ACS_Upper_Right_Corner   : constant Character := 'k';
                      -   ACS_Lower_Right_Corner   : constant Character := 'j';
                      -   ACS_Left_Tee             : constant Character := 't';
                      -   ACS_Right_Tee            : constant Character := 'u';
                      -   ACS_Bottom_Tee           : constant Character := 'v';
                      -   ACS_Top_Tee              : constant Character := 'w';
                      -   ACS_Horizontal_Line      : constant Character := 'q';
                      -   ACS_Vertical_Line        : constant Character := 'x';
                      -   ACS_Plus_Symbol          : constant Character := 'n';
                      -   ACS_Scan_Line_1          : constant Character := 'o';
                      -   ACS_Scan_Line_9          : constant Character := 's';
                      -   ACS_Diamond              : constant Character := Character'Val (96);
                      -   ACS_Checker_Board        : constant Character := 'a';
                      -   ACS_Degree               : constant Character := 'f';
                      -   ACS_Plus_Minus           : constant Character := 'g';
                      -   ACS_Bullet               : constant Character := '~';
                      -   ACS_Left_Arrow           : constant Character := ',';
                      -   ACS_Right_Arrow          : constant Character := '+';
                      -   ACS_Down_Arrow           : constant Character := '.';
                      -   ACS_Up_Arrow             : constant Character := '-';
                      -   ACS_Board_Of_Squares     : constant Character := 'h';
                      -   ACS_Lantern              : constant Character := 'i';
                      -   ACS_Solid_Block          : constant Character := '0';
                      -   ACS_Scan_Line_3          : constant Character := 'p';
                      -   ACS_Scan_Line_7          : constant Character := 'r';
                      -   ACS_Less_Or_Equal        : constant Character := 'y';
                      -   ACS_Greater_Or_Equal     : constant Character := 'z';
                      -   ACS_PI                   : constant Character := '{';
                      -   ACS_Not_Equal            : constant Character := '|';
                      -   ACS_Sterling             : constant Character := '}';
                      -
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_initscr.3x
                      -   --  |=====================================================================
                      -   --  | Not implemented: newterm, set_term, delscreen
                      -
                      -   --  |
                      -   function Standard_Window return Window;
                      -   --  AKA: stdscr
                      -   pragma Inline (Standard_Window);
                      -
                      -   --  |
                      -   procedure Init_Screen;
                      -
                      -   --  |
                      -   procedure Init_Windows renames Init_Screen;
                      -   --  AKA: initscr()
                      -
                      -   --  |
                      -   procedure End_Windows;
                      -   --  AKA: endwin()
                      -   procedure End_Screen renames End_Windows;
                      -
                      -   --  |
                      -   function Is_End_Window return Boolean;
                      -   --  AKA: isendwin()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_move.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Move_Cursor (Win    : in Window := Standard_Window;
                      -                          Line   : in Line_Position;
                      -                          Column : in Column_Position);
                      -   --  AKA: wmove()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_addch.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Add (Win :  in Window := Standard_Window;
                      -                  Ch  :  in Attributed_Character);
                      -   --  AKA: waddch()
                      -
                      -   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.
                      -
                      -   --  |
                      -   procedure Add
                      -     (Win    : in Window := Standard_Window;
                      -      Line   : in Line_Position;
                      -      Column : in Column_Position;
                      -      Ch     : in Attributed_Character);
                      -   --  AKA: mvwaddch()
                      -
                      -   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
                      -
                      -   --  |
                      -   procedure Add_With_Immediate_Echo
                      -     (Win : in Window := Standard_Window;
                      -      Ch  : in Attributed_Character);
                      -   --  AKA: wechochar()
                      -
                      -   procedure Add_With_Immediate_Echo
                      -     (Win : in Window := Standard_Window;
                      -      Ch  : in Character);
                      -   --  Add a character and do an immediate resfresh of the screen.
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_window.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Create
                      -     (Number_Of_Lines       : Line_Count;
                      -      Number_Of_Columns     : Column_Count;
                      -      First_Line_Position   : Line_Position;
                      -      First_Column_Position : Column_Position) return Window;
                      -   --  AKA: newwin()
                      -
                      -   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;
                      -
                      -   --  |
                      -   procedure Delete (Win : in out Window);
                      -   --  AKA: delwin()
                      -   --  Reset Win to Null_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: subwin()
                      -
                      -   --  |
                      -   function Derived_Window
                      -     (Win                   : Window := Standard_Window;
                      -      Number_Of_Lines       : Line_Count;
                      -      Number_Of_Columns     : Column_Count;
                      -      First_Line_Position   : Line_Position;
                      -      First_Column_Position : Column_Position) return Window;
                      -   --  AKA: derwin()
                      -
                      -   --  |
                      -   function Duplicate (Win : Window) return Window;
                      -   --  AKA: dupwin()
                      -
                      -   --  |
                      -   procedure Move_Window (Win    : in Window;
                      -                          Line   : in Line_Position;
                      -                          Column : in Column_Position);
                      -   --  AKA: mvwin()
                      -
                      -   --  |
                      -   procedure Move_Derived_Window (Win    : in Window;
                      -                                  Line   : in Line_Position;
                      -                                  Column : in Column_Position);
                      -   --  AKA: mvderwin()
                      -
                      -   --  |
                      -   procedure Synchronize_Upwards (Win : in Window);
                      -   --  AKA: wsyncup()
                      -   pragma Import (C, Synchronize_Upwards, "wsyncup");
                      -
                      -   --  |
                      -   procedure Synchronize_Downwards (Win : in Window);
                      -   --  AKA: wsyncdown()
                      -   pragma Import (C, Synchronize_Downwards, "wsyncdown");
                      -
                      -   --  |
                      -   procedure Set_Synch_Mode (Win  : in Window := Standard_Window;
                      -                             Mode : in Boolean := False);
                      -   --  AKA: syncok()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_addstr.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Add (Win : in Window := Standard_Window;
                      -                  Str : in String;
                      -                  Len : in Integer := -1);
                      -   --  AKA: waddnstr()
                      -   --  AKA: waddstr()
                      -
                      -   --  |
                      -   procedure Add (Win    : in Window := Standard_Window;
                      -                  Line   : in Line_Position;
                      -                  Column : in Column_Position;
                      -                  Str    : in String;
                      -                  Len    : in Integer := -1);
                      -   --  AKA: mvwaddnstr()
                      -   --  AKA: mvwaddstr()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_addchstr.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Add (Win : in Window := Standard_Window;
                      -                  Str : in Attributed_String;
                      -                  Len : in Integer := -1);
                      -   --  AKA: waddchnstr()
                      -   --  AKA: waddchstr()
                      -
                      -   --  |
                      -   procedure Add (Win    : in Window := Standard_Window;
                      -                  Line   : in Line_Position;
                      -                  Column : in Column_Position;
                      -                  Str    : in Attributed_String;
                      -                  Len    : in Integer := -1);
                      -   --  AKA: mvwaddchnstr()
                      -   --  AKA: mvwaddchstr()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_border.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   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: wborder()
                      -
                      -   --  |
                      -   procedure Box
                      -     (Win               : in Window := Standard_Window;
                      -      Vertical_Symbol   : in Attributed_Character := Default_Character;
                      -      Horizontal_Symbol : in Attributed_Character := Default_Character);
                      -   --  AKA: box()
                      -
                      -   --  |
                      -   procedure Horizontal_Line
                      -     (Win         : in Window := Standard_Window;
                      -      Line_Size   : in Natural;
                      -      Line_Symbol : in Attributed_Character := Default_Character);
                      -   --  AKA: whline()
                      -
                      -   --  |
                      -   procedure Vertical_Line
                      -     (Win         : in Window := Standard_Window;
                      -      Line_Size   : in Natural;
                      -      Line_Symbol : in Attributed_Character := Default_Character);
                      -   --  AKA: wvline()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_getch.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Get_Keystroke (Win : Window := Standard_Window)
                      -                           return Real_Key_Code;
                      -   --  AKA: wgetch()
                      -   --  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.
                      -
                      -   --  |
                      -   procedure Undo_Keystroke (Key : in Real_Key_Code);
                      -   --  AKA: ungetch()
                      -
                      -   --  |
                      -   function Has_Key (Key : Special_Key_Code) return Boolean;
                      -   --  AKA: 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)
                      -
                      -   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.
                      -
                      -   function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
                      -   --  Return the key code for a given functionkey number.
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_attr.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   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.
                      -   --  AKA: wattron()
                      -   --  AKA: wattroff()
                      -
                      -   --  |
                      -   procedure Set_Character_Attributes
                      -     (Win   : in Window := Standard_Window;
                      -      Attr  : in Character_Attribute_Set := Normal_Video;
                      -      Color : in Color_Pair := Color_Pair'First);
                      -   --  AKA: wattrset()
                      -
                      -   --  |
                      -   function Get_Character_Attribute
                      -     (Win : in Window := Standard_Window) return Character_Attribute_Set;
                      -   --  AKA: wattr_get()
                      -
                      -   --  |
                      -   function Get_Character_Attribute
                      -     (Win : in Window := Standard_Window) return Color_Pair;
                      -   --  AKA: wattr_get()
                      -
                      -   --  |
                      -   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: wchgat()
                      -
                      -   --  |
                      -   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: mvwchgat()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_beep.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Beep;
                      -   --  AKA: beep()
                      -
                      -   --  |
                      -   procedure Flash_Screen;
                      -   --  AKA: flash()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_inopts.3x
                      -   --  |=====================================================================
                      -
                      -   --  | Not implemented : typeahead
                      -   --
                      -   --  |
                      -   procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True);
                      -   --  AKA: cbreak()
                      -   --  AKA: nocbreak()
                      -
                      -   --  |
                      -   procedure Set_Raw_Mode (SwitchOn : in Boolean := True);
                      -   --  AKA: raw()
                      -   --  AKA: noraw()
                      -
                      -   --  |
                      -   procedure Set_Echo_Mode (SwitchOn : in Boolean := True);
                      -   --  AKA: echo()
                      -   --  AKA: noecho()
                      -
                      -   --  |
                      -   procedure Set_Meta_Mode (Win      : in Window := Standard_Window;
                      -                            SwitchOn : in Boolean := True);
                      -   --  AKA: meta()
                      -
                      -   --  |
                      -   procedure Set_KeyPad_Mode (Win      : in Window := Standard_Window;
                      -                              SwitchOn : in Boolean := True);
                      -   --  AKA: keypad()
                      -
                      -   type Half_Delay_Amount is range 1 .. 255;
                      -
                      -   --  |
                      -   procedure Half_Delay (Amount : in Half_Delay_Amount);
                      -   --  AKA: halfdelay()
                      -
                      -   --  |
                      -   procedure Set_Flush_On_Interrupt_Mode
                      -     (Win  : in Window := Standard_Window;
                      -      Mode : in Boolean := True);
                      -   --  AKA: intrflush()
                      -
                      -   --  |
                      -   procedure Set_Queue_Interrupt_Mode
                      -     (Win   : in Window := Standard_Window;
                      -      Flush : in Boolean := True);
                      -   --  AKA: qiflush()
                      -   --  AKA: noqiflush()
                      -
                      -   --  |
                      -   procedure Set_NoDelay_Mode
                      -     (Win  : in Window := Standard_Window;
                      -      Mode : in Boolean := False);
                      -   --  AKA: nodelay()
                      -
                      -   type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
                      -
                      -   --  |
                      -   procedure Set_Timeout_Mode (Win    : in Window := Standard_Window;
                      -                               Mode   : in Timeout_Mode;
                      -                               Amount : in Natural); --  in Miliseconds
                      -   --  AKA: wtimeout()
                      -   --  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.
                      -
                      -   --  |
                      -   procedure Set_Escape_Timer_Mode
                      -     (Win       : in Window := Standard_Window;
                      -      Timer_Off : in Boolean := False);
                      -   --  AKA: notimeout()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_outopts.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_NL_Mode (SwitchOn : in Boolean := True);
                      -   --  AKA: nl()
                      -   --  AKA: nonl()
                      -
                      -   --  |
                      -   procedure Clear_On_Next_Update
                      -     (Win      : in Window := Standard_Window;
                      -      Do_Clear : in Boolean := True);
                      -   --  AKA: clearok()
                      -
                      -   --  |
                      -   procedure Use_Insert_Delete_Line
                      -     (Win    : in Window := Standard_Window;
                      -      Do_Idl : in Boolean := True);
                      -   --  AKA: idlok()
                      -
                      -   --  |
                      -   procedure Use_Insert_Delete_Character
                      -     (Win    : in Window := Standard_Window;
                      -      Do_Idc : in Boolean := True);
                      -   --  AKA: idcok()
                      -
                      -   --  |
                      -   procedure Leave_Cursor_After_Update
                      -     (Win      : in Window := Standard_Window;
                      -      Do_Leave : in Boolean := True);
                      -   --  AKA: leaveok()
                      -
                      -   --  |
                      -   procedure Immediate_Update_Mode
                      -     (Win  : in Window := Standard_Window;
                      -      Mode : in Boolean := False);
                      -   --  AKA: immedok()
                      -
                      -   --  |
                      -   procedure Allow_Scrolling
                      -     (Win  : in Window := Standard_Window;
                      -      Mode : in Boolean := False);
                      -   --  AKA: scrollok()
                      -
                      -   function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
                      -   --  There is no such function in the C interface.
                      -
                      -   --  |
                      -   procedure Set_Scroll_Region
                      -     (Win         : in Window := Standard_Window;
                      -      Top_Line    : in Line_Position;
                      -      Bottom_Line : in Line_Position);
                      -   --  AKA: wsetscrreg()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_refresh.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Update_Screen;
                      -   --  AKA: doupdate()
                      -
                      -   --  |
                      -   procedure Refresh (Win : in Window := Standard_Window);
                      -   --  AKA: wrefresh()
                      -
                      -   --  |
                      -   procedure Refresh_Without_Update
                      -     (Win : in Window := Standard_Window);
                      -   --  AKA: wnoutrefresh()
                      -
                      -   --  |
                      -   procedure Redraw (Win : in Window := Standard_Window);
                      -   --  AKA: redrawwin()
                      -
                      -   --  |
                      -   procedure Redraw (Win        : in Window := Standard_Window;
                      -                     Begin_Line : in Line_Position;
                      -                     Line_Count : in Positive);
                      -   --  AKA: wredrawln()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_clear.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Erase (Win : in Window := Standard_Window);
                      -   --  AKA: werase()
                      -
                      -   --  |
                      -   procedure Clear
                      -     (Win : in Window := Standard_Window);
                      -   --  AKA: wclear()
                      -
                      -   --  |
                      -   procedure Clear_To_End_Of_Screen
                      -     (Win : in Window := Standard_Window);
                      -   --  AKA: wclrtobot()
                      -
                      -   --  |
                      -   procedure Clear_To_End_Of_Line
                      -     (Win : in Window := Standard_Window);
                      -   --  AKA: wclrtoeol()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_bkgd.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Set_Background
                      -     (Win : in Window := Standard_Window;
                      -      Ch  : in Attributed_Character);
                      -   --  AKA: wbkgdset()
                      -
                      -   --  |
                      -   procedure Change_Background
                      -     (Win : in Window := Standard_Window;
                      -      Ch  : in Attributed_Character);
                      -   --  AKA: wbkgd()
                      -
                      -   --  |
                      -   function Get_Background (Win : Window := Standard_Window)
                      -     return Attributed_Character;
                      -   --  AKA: wbkgdget()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_touch.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Touch (Win : in Window := Standard_Window);
                      -   --  AKA: touchwin()
                      -
                      -   --  |
                      -   procedure Untouch (Win : in Window := Standard_Window);
                      -   --  AKA: untouchwin()
                      -
                      -   --  |
                      -   procedure Touch (Win   : in Window := Standard_Window;
                      -                    Start : in Line_Position;
                      -                    Count : in Positive);
                      -   --  AKA: touchline()
                      -
                      -   --  |
                      -   procedure Change_Lines_Status (Win   : in Window := Standard_Window;
                      -                                  Start : in Line_Position;
                      -                                  Count : in Positive;
                      -                                  State : in Boolean);
                      -   --  AKA: wtouchln()
                      -
                      -   --  |
                      -   function Is_Touched (Win  : Window := Standard_Window;
                      -                        Line : Line_Position) return Boolean;
                      -   --  AKA: is_linetouched()
                      -
                      -   --  |
                      -   function Is_Touched (Win : Window := Standard_Window) return Boolean;
                      -   --  AKA: is_wintouched()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_overlay.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   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: copywin()
                      -
                      -   --  |
                      -   procedure Overwrite (Source_Window      : in Window;
                      -                        Destination_Window : in Window);
                      -   --  AKA: overwrite()
                      -
                      -   --  |
                      -   procedure Overlay (Source_Window      : in Window;
                      -                      Destination_Window : in Window);
                      -   --  AKA: overlay()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_deleteln.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Insert_Delete_Lines
                      -     (Win   : in Window  := Standard_Window;
                      -      Lines : in Integer := 1); --  default is to insert one line above
                      -   --  AKA: winsdelln()
                      -
                      -   --  |
                      -   procedure Delete_Line (Win : in Window := Standard_Window);
                      -   --  AKA: wdeleteln()
                      -
                      -   --  |
                      -   procedure Insert_Line (Win : in Window := Standard_Window);
                      -   --  AKA: winsertln()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_getyx.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Get_Size
                      -     (Win               : in Window := Standard_Window;
                      -      Number_Of_Lines   : out Line_Count;
                      -      Number_Of_Columns : out Column_Count);
                      -   --  AKA: getmaxyx()
                      -
                      -   --  |
                      -   procedure Get_Window_Position
                      -     (Win             : in Window := Standard_Window;
                      -      Top_Left_Line   : out Line_Position;
                      -      Top_Left_Column : out Column_Position);
                      -   --  AKA: getbegyx()
                      -
                      -   --  |
                      -   procedure Get_Cursor_Position
                      -     (Win    : in  Window := Standard_Window;
                      -      Line   : out Line_Position;
                      -      Column : out Column_Position);
                      -   --  AKA: getyx()
                      -
                      -   --  |
                      -   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: getparyx()
                      -   --  Instead of placing -1 in the coordinates as return, we use a boolean
                      -   --  to return the info that the window has no parent.
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_pad.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function New_Pad (Lines   : Line_Count;
                      -                     Columns : Column_Count) return Window;
                      -   --  AKA: newpad()
                      -
                      -   --  |
                      -   function Sub_Pad
                      -     (Pad                   : Window;
                      -      Number_Of_Lines       : Line_Count;
                      -      Number_Of_Columns     : Column_Count;
                      -      First_Line_Position   : Line_Position;
                      -      First_Column_Position : Column_Position) return Window;
                      -   --  AKA: subpad()
                      -
                      -   --  |
                      -   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: prefresh()
                      -
                      -   --  |
                      -   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: pnoutrefresh()
                      -
                      -   --  |
                      -   procedure Add_Character_To_Pad_And_Echo_It
                      -     (Pad : in Window;
                      -      Ch  : in Attributed_Character);
                      -   --  AKA: pechochar()
                      -
                      -   procedure Add_Character_To_Pad_And_Echo_It
                      -     (Pad : in Window;
                      -      Ch  : in Character);
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_scroll.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Scroll (Win    : in Window  := Standard_Window;
                      -                     Amount : in Integer := 1);
                      -   --  AKA: wscrl()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_delch.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Delete_Character (Win : in Window := Standard_Window);
                      -   --  AKA: wdelch()
                      -
                      -   --  |
                      -   procedure Delete_Character
                      -     (Win    : in Window := Standard_Window;
                      -      Line   : in Line_Position;
                      -      Column : in Column_Position);
                      -   --  AKA: mvwdelch()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_inch.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Peek (Win : Window := Standard_Window)
                      -     return Attributed_Character;
                      -   --  AKA: winch()
                      -
                      -   --  |
                      -   function Peek
                      -     (Win    : Window := Standard_Window;
                      -      Line   : Line_Position;
                      -      Column : Column_Position) return Attributed_Character;
                      -   --  AKA: mvwinch()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_winch.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Insert (Win : in Window := Standard_Window;
                      -                     Ch  : in Attributed_Character);
                      -   --  AKA: winsch()
                      -
                      -   --  |
                      -   procedure Insert (Win    : in Window := Standard_Window;
                      -                     Line   : in Line_Position;
                      -                     Column : in Column_Position;
                      -                     Ch     : in Attributed_Character);
                      -   --  AKA: mvwinsch()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_winch.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Insert (Win : in Window := Standard_Window;
                      -                     Str : in String;
                      -                     Len : in Integer := -1);
                      -   --  AKA: winsnstr()
                      -   --  AKA: winsstr()
                      -
                      -   --  |
                      -   procedure Insert (Win    : in Window := Standard_Window;
                      -                     Line   : in Line_Position;
                      -                     Column : in Column_Position;
                      -                     Str    : in String;
                      -                     Len    : in Integer := -1);
                      -   --  AKA: mvwinsnstr()
                      -   --  AKA: mvwinsstr()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_instr.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Peek (Win : in  Window := Standard_Window;
                      -                   Str : out String;
                      -                   Len : in  Integer := -1);
                      -   --  AKA: winnstr()
                      -   --  AKA: winstr()
                      -
                      -   --  |
                      -   procedure Peek (Win    : in  Window := Standard_Window;
                      -                   Line   : in  Line_Position;
                      -                   Column : in  Column_Position;
                      -                   Str    : out String;
                      -                   Len    : in  Integer := -1);
                      -   --  AKA: mvwinnstr()
                      -   --  AKA: mvwinstr()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_inchstr.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Peek (Win : in  Window := Standard_Window;
                      -                   Str : out Attributed_String;
                      -                   Len : in  Integer := -1);
                      -   --  AKA: winchnstr()
                      -   --  AKA: winchstr()
                      -
                      -   --  |
                      -   procedure Peek (Win    : in  Window := Standard_Window;
                      -                   Line   : in  Line_Position;
                      -                   Column : in  Column_Position;
                      -                   Str    : out Attributed_String;
                      -                   Len    : in  Integer := -1);
                      -   --  AKA: mvwinchnstr()
                      -   --  AKA: mvwinchstr()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_getstr.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Get (Win : in  Window := Standard_Window;
                      -                  Str : out String;
                      -                  Len : in  Integer := -1);
                      -   --  AKA: wgetnstr()
                      -   --  AKA: wgetstr()
                      -
                      -   procedure Get (Win    : in  Window := Standard_Window;
                      -                  Line   : in  Line_Position;
                      -                  Column : in  Column_Position;
                      -                  Str    : out String;
                      -                  Len    : in  Integer := -1);
                      -   --  AKA: wgetnstr(): not specified in ncurses, should be: mvwgetnstr()
                      -   --       and mvwgetstr() (which exists)
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_slk.3x
                      -   --  |=====================================================================
                      -
                      -   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);
                      -
                      -   --  |
                      -   procedure Init_Soft_Label_Keys
                      -     (Format : in Soft_Label_Key_Format := Three_Two_Three);
                      -   --  AKA: slk_init()
                      -
                      -   --  |
                      -   procedure Set_Soft_Label_Key (Label : in Label_Number;
                      -                                 Text  : in String;
                      -                                 Fmt   : in Label_Justification := Left);
                      -   --  AKA: slk_set()
                      -
                      -   --  |
                      -   procedure Refresh_Soft_Label_Keys;
                      -   --  AKA: slk_refresh()
                      -
                      -   --  |
                      -   procedure Refresh_Soft_Label_Keys_Without_Update;
                      -   --  AKA: slk_noutrefresh()
                      -
                      -   --  |
                      -   procedure Get_Soft_Label_Key (Label : in Label_Number;
                      -                                 Text  : out String);
                      -   --  AKA: slk_label()
                      -
                      -   --  |
                      -   procedure Clear_Soft_Label_Keys;
                      -   --  AKA: slk_clear()
                      -
                      -   --  |
                      -   procedure Restore_Soft_Label_Keys;
                      -   --  AKA: slk_restore()
                      -
                      -   --  |
                      -   procedure Touch_Soft_Label_Keys;
                      -   --  AKA: slk_touch()
                      -
                      -   --  |
                      -   procedure Switch_Soft_Label_Key_Attributes
                      -     (Attr : in Character_Attribute_Set;
                      -      On   : in Boolean := True);
                      -   --  AKA: slk_attron()
                      -   --  AKA: slk_attroff()
                      -
                      -   --  |
                      -   procedure Set_Soft_Label_Key_Attributes
                      -     (Attr  : in Character_Attribute_Set := Normal_Video;
                      -      Color : in Color_Pair := Color_Pair'First);
                      -   --  AKA: slk_attrset()
                      -
                      -   --  |
                      -   function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
                      -   --  AKA: slk_attr()
                      -
                      -   --  |
                      -   function Get_Soft_Label_Key_Attributes return Color_Pair;
                      -   --  AKA: slk_attr()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page keyok.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Enable_Key (Key    : in Special_Key_Code;
                      -                         Enable : in Boolean := True);
                      -   --  AKA: keyok()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page define_key.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Define_Key (Definition : in String;
                      -                         Key        : in Special_Key_Code);
                      -   --  AKA: define_key()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_util.3x
                      -   --  |=====================================================================
                      -
                      -   --  | Not implemented : filter, use_env, putwin, getwin
                      -   --
                      -   --  |
                      -   procedure Key_Name (Key  : in  Real_Key_Code;
                      -                       Name : out String);
                      -   --  AKA: keyname()
                      -   --  The external name for a real keystroke.
                      -
                      -   --  |
                      -   procedure Un_Control (Ch  : in Attributed_Character;
                      -                         Str : out String);
                      -   --  AKA: unctrl()
                      -
                      -   --  |
                      -   procedure Delay_Output (Msecs : in Natural);
                      -   --  AKA: delay_output()
                      -
                      -   --  |
                      -   procedure Flush_Input;
                      -   --  AKA: flushinp()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_termattrs.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   function Baudrate return Natural;
                      -   --  AKA: baudrate()
                      -
                      -   --  |
                      -   function Erase_Character return Character;
                      -   --  AKA: erasechar()
                      -
                      -   --  |
                      -   function Kill_Character return Character;
                      -   --  AKA: killchar()
                      -
                      -   --  |
                      -   function Has_Insert_Character return Boolean;
                      -   --  AKA: has_ic()
                      -
                      -   --  |
                      -   function Has_Insert_Line return Boolean;
                      -   --  AKA: has_il()
                      -
                      -   --  |
                      -   function Supported_Attributes return Character_Attribute_Set;
                      -   --  AKA: termattrs()
                      -
                      -   --  |
                      -   procedure Long_Name (Name : out String);
                      -   --  AKA: longname()
                      -
                      -   --  |
                      -   procedure Terminal_Name (Name : out String);
                      -   --  AKA: termname()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_color.3x
                      -   --  |=====================================================================
                      -
                      -   --  |
                      -   procedure Start_Color;
                      -   --  AKA: start_clolor()
                      -   pragma Import (C, Start_Color, "start_color");
                      -
                      -   --  |
                      -   procedure Init_Pair (Pair : in Redefinable_Color_Pair;
                      -                        Fore : in Color_Number;
                      -                        Back : in Color_Number);
                      -   --  AKA: init_pair()
                      -
                      -   --  |
                      -   procedure Pair_Content (Pair : in Color_Pair;
                      -                           Fore : out Color_Number;
                      -                           Back : out Color_Number);
                      -   --  AKA: pair_content()
                      -
                      -   --  |
                      -   function Has_Colors return Boolean;
                      -   --  AKA: has_colors()
                      -
                      -   --  |
                      -   procedure Init_Color (Color : in Color_Number;
                      -                         Red   : in RGB_Value;
                      -                         Green : in RGB_Value;
                      -                         Blue  : in RGB_Value);
                      -   --  AKA: init_color()
                      -
                      -   --  |
                      -   function Can_Change_Color return Boolean;
                      -   --  AKA: can_change_color()
                      -
                      -   --  |
                      -   procedure Color_Content (Color : in  Color_Number;
                      -                            Red   : out RGB_Value;
                      -                            Green : out RGB_Value;
                      -                            Blue  : out RGB_Value);
                      -   --  AKA: color_content()
                      -
                      -   --  |=====================================================================
                      -   --  | Man page curs_kernel.3x
                      -   --  |=====================================================================
                      -
                      -   --  | Not implemented: getsyx, setsyx
                      -   --
                      -   type Curses_Mode is (Curses, Shell);
                      -
                      -   --  |
                      -   procedure Save_Curses_Mode (Mode : in Curses_Mode);
                      -   --  AKA: def_prog_mode()
                      -   --  AKA: def_shell_mode()
                      -
                      -   --  |
                      -   procedure Reset_Curses_Mode (Mode : in Curses_Mode);
                      -   --  AKA: reset_prog_mode()
                      -   --  AKA: reset_shell_mode()
                      -
                      -   --  |
                      -   procedure Save_Terminal_State;
                      -   --  AKA: savetty()
                      -
                      -   --  |
                      -   procedure Reset_Terminal_State;
                      -   --  AKA: resetty();
                      -
                      -   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.
                      -
                      -   --  |
                      -   procedure Rip_Off_Lines (Lines : in Integer;
                      -                            Proc  : in Stdscr_Init_Proc);
                      -   --  AKA: ripoffline()
                      -   --  N.B.: to be more precise, this uses a ncurses specific enhancement of
                      -   --        ripoffline(), in which the Lines argument absolute value is the
                      -   --        number of lines to be ripped of. The official ripoffline() only
                      -   --        uses the sign of Lines to rip of a single line from bottom or top.
                      -
                      -   type Cursor_Visibility is (Invisible, Normal, Very_Visible);
                      -
                      -   --  |
                      -   procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
                      -   --  AKA: curs_set()
                      -
                      -   --  |
                      -   procedure Nap_Milli_Seconds (Ms : in Natural);
                      -   --  AKA: napms()
                      -
                      -   --  |=====================================================================
                      -   --  | Some usefull 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 parmeter.
                      -   --  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.
                      -
                      -private
                      -   type Window is new System.Address;
                      -   Null_Window : constant Window := Window (System.Null_Address);
                      -
                      -   Generation_Bit_Order : constant System.Bit_Order := System.Low_Order_First;
                      -   --  This constant may be different on your system.
                      -
                      -end Terminal_Interface.Curses;
                      -
                      -
                      - -


                      -This is BETA software. The interface is subject to change without notice. -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/html/terminal_interface_s.html b/Ada95/html/terminal_interface_s.html deleted file mode 100644 index e405d092..00000000 --- a/Ada95/html/terminal_interface_s.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - -

                      -------------------------------------------------------------------------------
                      ---                                                                          --
                      ---                           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.                                                           --
                      -------------------------------------------------------------------------------
                      ---  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
                      ---  Version Control:
                      ---  @Revision: 1.4 @
                      -------------------------------------------------------------------------------
                      -package Terminal_Interface is
                      ---
                      ---  Everything is in the child units
                      ---
                      -end Terminal_Interface;
                      -
                      -
                      - -


                      -

                      -This is BETA software. The interface is subject to change without notice.

                      - - -

                      This hypertext format was generated by David A. Wheeler's ada2html - - - diff --git a/Ada95/samples/Makefile.in b/Ada95/samples/Makefile.in index 09ed5518..c43e2873 100644 --- a/Ada95/samples/Makefile.in +++ b/Ada95/samples/Makefile.in @@ -26,10 +26,10 @@ # authorization. # ############################################################################## # -# Author: Juergen Pfeifer 1996 +# Author: Juergen Pfeifer 1996 # # Version Control -# $Revision: 1.16 $ +# $Revision: 1.21 $ # .SUFFIXES: @@ -41,8 +41,6 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ libdir = @libdir@ includedir = @includedir@ -datadir = @datadir@ -ticdir = $(datadir)/terminfo INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -70,8 +68,7 @@ LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ RANLIB = @RANLIB@ ################################################################################ -ada_srcdir=../ada_include -ada_objdir=../ada_objects +ada_srcdir=../src LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @@ -79,13 +76,13 @@ ADA = @cf_ada_compiler@ ADAFLAGS = @ADAFLAGS@ -I$(srcdir) ADAMAKE = @cf_ada_make@ -ADAMAKEFLAGS = -aI$(srcdir) -aI$(ada_srcdir) -aI$(srcdir)/$(ada_srcdir) -aO$(ada_objdir) +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 $(LD_FLAGS) +LARGS =-largs -L../../lib $(LD_FLAGS) -lncurses PROGS = tour rain diff --git a/Ada95/samples/rain.adb b/Ada95/samples/rain.adb index c29cd98d..f2814049 100644 --- a/Ada95/samples/rain.adb +++ b/Ada95/samples/rain.adb @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Laurent Pautet 1997 (modified by J.Pfeifer) -- Version Control --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.4 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -- -- with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; diff --git a/Ada95/samples/rain.ads b/Ada95/samples/rain.ads index 3f075e7f..5180a598 100644 --- a/Ada95/samples/rain.ads +++ b/Ada95/samples/rain.ads @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Laurent Pautet 1997 (modified by J.Pfeifer) -- Version Control --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.4 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -- -- procedure Rain; diff --git a/Ada95/samples/sample-curses_demo-attributes.adb b/Ada95/samples/sample-curses_demo-attributes.adb index 9b9089a5..1a329e7b 100644 --- a/Ada95/samples/sample-curses_demo-attributes.adb +++ b/Ada95/samples/sample-curses_demo-attributes.adb @@ -33,24 +33,19 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.10 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Sample.Manifest; use Sample.Manifest; -with Sample.Helpers; use Sample.Helpers; 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.Mouse; - package body Sample.Curses_Demo.Attributes is procedure Demo diff --git a/Ada95/samples/sample-curses_demo-attributes.ads b/Ada95/samples/sample-curses_demo-attributes.ads index 30f82577..ec0fb8cd 100644 --- a/Ada95/samples/sample-curses_demo-attributes.ads +++ b/Ada95/samples/sample-curses_demo-attributes.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo.Attributes is diff --git a/Ada95/samples/sample-curses_demo-mouse.adb b/Ada95/samples/sample-curses_demo-mouse.adb index 0240da5f..e526f598 100644 --- a/Ada95/samples/sample-curses_demo-mouse.adb +++ b/Ada95/samples/sample-curses_demo-mouse.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.11 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; @@ -73,7 +73,6 @@ package body Sample.Curses_Demo.Mouse is Msg : Window; Ctl : Controls; Pan : Panel; - N : constant Natural := Ctl'Length; K : Real_Key_Code; V : Cursor_Visibility := Invisible; W : Window; @@ -210,7 +209,7 @@ package body Sample.Curses_Demo.Mouse is Delete (Frame); Set_Cursor_Visibility (V); - End_Mouse; + End_Mouse (Mask); Pop_Environment; Update_Panels; Update_Screen; diff --git a/Ada95/samples/sample-curses_demo-mouse.ads b/Ada95/samples/sample-curses_demo-mouse.ads index 49eb84ab..93781709 100644 --- a/Ada95/samples/sample-curses_demo-mouse.ads +++ b/Ada95/samples/sample-curses_demo-mouse.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo.Mouse is diff --git a/Ada95/samples/sample-curses_demo.adb b/Ada95/samples/sample-curses_demo.adb index aa5b1091..0c708551 100644 --- a/Ada95/samples/sample-curses_demo.adb +++ b/Ada95/samples/sample-curses_demo.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.10 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; @@ -47,8 +47,7 @@ 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.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; diff --git a/Ada95/samples/sample-curses_demo.ads b/Ada95/samples/sample-curses_demo.ads index eb1f691e..32d2bb0b 100644 --- a/Ada95/samples/sample-curses_demo.ads +++ b/Ada95/samples/sample-curses_demo.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo is diff --git a/Ada95/samples/sample-explanation.adb b/Ada95/samples/sample-explanation.adb index eb7f4577..8701925d 100644 --- a/Ada95/samples/sample-explanation.adb +++ b/Ada95/samples/sample-explanation.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.9 $ --- Binding Version 00.93 +-- $Revision: 1.12 $ +-- 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 @@ -299,7 +299,6 @@ package body Sample.Explanation is Root : Help_Line_Access := null; Current : Help_Line_Access; Tail : Help_Line_Access := null; - Save : String_Access; function Next_Line return Boolean; diff --git a/Ada95/samples/sample-explanation.ads b/Ada95/samples/sample-explanation.ads index ff7bd4ba..1e20f051 100644 --- a/Ada95/samples/sample-explanation.ads +++ b/Ada95/samples/sample-explanation.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- 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 diff --git a/Ada95/samples/sample-form_demo-aux.adb b/Ada95/samples/sample-form_demo-aux.adb index 6da5e951..06a03b88 100644 --- a/Ada95/samples/sample-form_demo-aux.adb +++ b/Ada95/samples/sample-form_demo-aux.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.9 $ --- Binding Version 00.93 +-- $Revision: 1.11 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; diff --git a/Ada95/samples/sample-form_demo-aux.ads b/Ada95/samples/sample-form_demo-aux.ads index 1fd44778..69ff2c15 100644 --- a/Ada95/samples/sample-form_demo-aux.ads +++ b/Ada95/samples/sample-form_demo-aux.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; diff --git a/Ada95/samples/sample-form_demo-handler.adb b/Ada95/samples/sample-form_demo-handler.adb index 2678027d..a3a17d4a 100644 --- a/Ada95/samples/sample-form_demo-handler.adb +++ b/Ada95/samples/sample-form_demo-handler.adb @@ -33,14 +33,12 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Sample.Form_Demo.Aux; -with Sample.Explanation; use Sample.Explanation; package body Sample.Form_Demo.Handler is diff --git a/Ada95/samples/sample-form_demo-handler.ads b/Ada95/samples/sample-form_demo-handler.ads index 4754563a..07c2940e 100644 --- a/Ada95/samples/sample-form_demo-handler.ads +++ b/Ada95/samples/sample-form_demo-handler.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-form_demo.adb b/Ada95/samples/sample-form_demo.adb index 62189267..b8548bfc 100644 --- a/Ada95/samples/sample-form_demo.adb +++ b/Ada95/samples/sample-form_demo.adb @@ -33,22 +33,16 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; -with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; - 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; with Terminal_Interface.Curses.Forms.Field_User_Data; with Terminal_Interface.Curses.Forms.Form_User_Data; -with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.My_Field_Type; use Sample.My_Field_Type; -with Sample.Manifest; use Sample.Manifest; 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; diff --git a/Ada95/samples/sample-form_demo.ads b/Ada95/samples/sample-form_demo.ads index 7d9a2772..1ef37964 100644 --- a/Ada95/samples/sample-form_demo.ads +++ b/Ada95/samples/sample-form_demo.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Form_Demo is diff --git a/Ada95/samples/sample-function_key_setting.adb b/Ada95/samples/sample-function_key_setting.adb index 979fefd0..94d22a6d 100644 --- a/Ada95/samples/sample-function_key_setting.adb +++ b/Ada95/samples/sample-function_key_setting.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with Sample.Manifest; use Sample.Manifest; diff --git a/Ada95/samples/sample-function_key_setting.ads b/Ada95/samples/sample-function_key_setting.ads index 71c120f3..e9db6cd0 100644 --- a/Ada95/samples/sample-function_key_setting.ads +++ b/Ada95/samples/sample-function_key_setting.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; diff --git a/Ada95/samples/sample-header_handler.adb b/Ada95/samples/sample-header_handler.adb index 4787f24f..c299c79f 100644 --- a/Ada95/samples/sample-header_handler.adb +++ b/Ada95/samples/sample-header_handler.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Calendar; use Ada.Calendar; with Terminal_Interface.Curses.Text_IO.Integer_IO; diff --git a/Ada95/samples/sample-header_handler.ads b/Ada95/samples/sample-header_handler.ads index d2124ddb..7a7c0b98 100644 --- a/Ada95/samples/sample-header_handler.ads +++ b/Ada95/samples/sample-header_handler.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-helpers.adb b/Ada95/samples/sample-helpers.adb index 533f411c..9cbc7c12 100644 --- a/Ada95/samples/sample-helpers.adb +++ b/Ada95/samples/sample-helpers.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-helpers.ads b/Ada95/samples/sample-helpers.ads index d2f5f039..36ca4075 100644 --- a/Ada95/samples/sample-helpers.ads +++ b/Ada95/samples/sample-helpers.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-keyboard_handler.adb b/Ada95/samples/sample-keyboard_handler.adb index 1d7a85a1..062a676b 100644 --- a/Ada95/samples/sample-keyboard_handler.adb +++ b/Ada95/samples/sample-keyboard_handler.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; diff --git a/Ada95/samples/sample-keyboard_handler.ads b/Ada95/samples/sample-keyboard_handler.ads index 9b870247..454c934b 100644 --- a/Ada95/samples/sample-keyboard_handler.ads +++ b/Ada95/samples/sample-keyboard_handler.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-manifest.ads b/Ada95/samples/sample-manifest.ads index 4d9aa502..6ac180cf 100644 --- a/Ada95/samples/sample-manifest.ads +++ b/Ada95/samples/sample-manifest.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-menu_demo-aux.adb b/Ada95/samples/sample-menu_demo-aux.adb index 66e10c15..f1363d80 100644 --- a/Ada95/samples/sample-menu_demo-aux.adb +++ b/Ada95/samples/sample-menu_demo-aux.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; diff --git a/Ada95/samples/sample-menu_demo-aux.ads b/Ada95/samples/sample-menu_demo-aux.ads index 1efbb3dc..d1211985 100644 --- a/Ada95/samples/sample-menu_demo-aux.ads +++ b/Ada95/samples/sample-menu_demo-aux.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; diff --git a/Ada95/samples/sample-menu_demo-handler.adb b/Ada95/samples/sample-menu_demo-handler.adb index cac7578b..e7b1bf8a 100644 --- a/Ada95/samples/sample-menu_demo-handler.adb +++ b/Ada95/samples/sample-menu_demo-handler.adb @@ -33,14 +33,14 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.10 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample.Menu_Demo.Aux; -with Sample.Explanation; use Sample.Explanation; with Sample.Manifest; use Sample.Manifest; +with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; package body Sample.Menu_Demo.Handler is @@ -63,9 +63,14 @@ package body Sample.Menu_Demo.Handler is Col : in Column_Position; Title : in String := "") is - Pan : Panel := Aux.Create (M, Title, Lin, Col); - V : Cursor_Visibility := Invisible; + 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 @@ -79,6 +84,9 @@ package body Sample.Menu_Demo.Handler is 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; @@ -92,7 +100,7 @@ package body Sample.Menu_Demo.Handler is end case; end; end loop; - Set_Cursor_Visibility (V); + End_Mouse (Old); Aux.Destroy (M, Pan); end Drive_Me; diff --git a/Ada95/samples/sample-menu_demo-handler.ads b/Ada95/samples/sample-menu_demo-handler.ads index 78a2ebb5..bb31639d 100644 --- a/Ada95/samples/sample-menu_demo-handler.ads +++ b/Ada95/samples/sample-menu_demo-handler.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-menu_demo.adb b/Ada95/samples/sample-menu_demo.adb index 1d08316f..640c25cb 100644 --- a/Ada95/samples/sample-menu_demo.adb +++ b/Ada95/samples/sample-menu_demo.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.11 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; @@ -44,11 +44,8 @@ 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 Ada.Characters.Latin_1; use Ada.Characters.Latin_1; - 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.Menu_Demo.Handler; with Sample.Helpers; use Sample.Helpers; with Sample.Explanation; use Sample.Explanation; @@ -303,6 +300,7 @@ package body Sample.Menu_Demo is Flip_State := True; Pop_Environment; + pragma Assert (Get_Index (Items (M, 1)) = Get_Index (I (1))); Delete (M); Free (I, True); end Spacing_Test; diff --git a/Ada95/samples/sample-menu_demo.ads b/Ada95/samples/sample-menu_demo.ads index 250e0892..dda0180f 100644 --- a/Ada95/samples/sample-menu_demo.ads +++ b/Ada95/samples/sample-menu_demo.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Menu_Demo is diff --git a/Ada95/samples/sample-my_field_type.adb b/Ada95/samples/sample-my_field_type.adb index f2f1b112..11e42268 100644 --- a/Ada95/samples/sample-my_field_type.adb +++ b/Ada95/samples/sample-my_field_type.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; diff --git a/Ada95/samples/sample-my_field_type.ads b/Ada95/samples/sample-my_field_type.ads index b05a3ef4..0fac5e39 100644 --- a/Ada95/samples/sample-my_field_type.ads +++ b/Ada95/samples/sample-my_field_type.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; with Terminal_Interface.Curses.Forms.Field_Types.User; diff --git a/Ada95/samples/sample-text_io_demo.adb b/Ada95/samples/sample-text_io_demo.adb index 9962be9c..ed796095 100644 --- a/Ada95/samples/sample-text_io_demo.adb +++ b/Ada95/samples/sample-text_io_demo.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Numerics.Generic_Elementary_Functions; with Ada.Numerics.Complex_Types; @@ -55,7 +55,6 @@ with Terminal_Interface.Curses.Text_IO.Decimal_IO; with Terminal_Interface.Curses.Text_IO.Modular_IO; with Sample.Manifest; use Sample.Manifest; -with Sample.Helpers; use Sample.Helpers; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Explanation; use Sample.Explanation; diff --git a/Ada95/samples/sample-text_io_demo.ads b/Ada95/samples/sample-text_io_demo.ads index 3d64b299..5c31c7bb 100644 --- a/Ada95/samples/sample-text_io_demo.ads +++ b/Ada95/samples/sample-text_io_demo.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Text_IO_Demo is diff --git a/Ada95/samples/sample.adb b/Ada95/samples/sample.adb index ce0cc3a1..2d96142c 100644 --- a/Ada95/samples/sample.adb +++ b/Ada95/samples/sample.adb @@ -33,14 +33,13 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.8 $ --- Binding Version 00.93 +-- $Revision: 1.11 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Text_IO; -with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Ada.Exceptions; use Ada.Exceptions; with Terminal_Interface.Curses; use Terminal_Interface.Curses; @@ -50,7 +49,6 @@ with Terminal_Interface.Curses.Menus.Menu_User_Data; with Terminal_Interface.Curses.Menus.Item_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.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Header_Handler; use Sample.Header_Handler; diff --git a/Ada95/samples/sample.ads b/Ada95/samples/sample.ads index 7522815b..d438f74a 100644 --- a/Ada95/samples/sample.ads +++ b/Ada95/samples/sample.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample is procedure Whow; diff --git a/Ada95/samples/status.adb b/Ada95/samples/status.adb index 850e4e3c..8e4cd423 100644 --- a/Ada95/samples/status.adb +++ b/Ada95/samples/status.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.5 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -- This package has been contributed by Laurent Pautet -- -- -- diff --git a/Ada95/samples/status.ads b/Ada95/samples/status.ads index 4b81b0a5..600b2123 100644 --- a/Ada95/samples/status.ads +++ b/Ada95/samples/status.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -- This package has been contributed by Laurent Pautet -- -- -- @@ -44,6 +44,10 @@ 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; diff --git a/Ada95/samples/tour.adb b/Ada95/samples/tour.adb index 920eb91a..60a3d0ae 100644 --- a/Ada95/samples/tour.adb +++ b/Ada95/samples/tour.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample; use Sample; diff --git a/Ada95/samples/tour.ads b/Ada95/samples/tour.ads index 2abc440f..2675e30d 100644 --- a/Ada95/samples/tour.ads +++ b/Ada95/samples/tour.ads @@ -33,9 +33,9 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ procedure Tour; diff --git a/Ada95/src/Makefile.in b/Ada95/src/Makefile.in new file mode 100644 index 00000000..46b232ad --- /dev/null +++ b/Ada95/src/Makefile.in @@ -0,0 +1,353 @@ +############################################################################## +# Copyright (c) 1998 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# +# Author: Juergen Pfeifer 1996 +# +# Version Control +# $Revision: 1.19 $ +# +.SUFFIXES: + +SHELL = /bin/sh +THIS = Makefile + +MODEL = ../../@DFT_OBJ_SUBDIR@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ +datadir = @datadir@ +ticdir = $(datadir)/terminfo +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@ +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)-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)-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 : + @ + +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) + +distclean :: clean + rm -f Makefile + +realclean :: distclean + +BASEDEPS=$(ABASE).ads $(srcdir)/$(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)-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/Ada95/ada_include/terminal_interface-curses-aux.adb b/Ada95/src/terminal_interface-curses-aux.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-aux.adb rename to Ada95/src/terminal_interface-curses-aux.adb index c6827a40..2e974c4a 100644 --- a/Ada95/ada_include/terminal_interface-curses-aux.adb +++ b/Ada95/src/terminal_interface-curses-aux.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Aux is -- diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-alpha.adb b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-alpha.adb rename to Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb index 8c124159..1cbf1782 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-alpha.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb @@ -33,17 +33,17 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.6 $ +-- 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; + use type Interfaces.C.int; procedure Set_Field_Type (Fld : in Field; Typ : in Alpha_Field) diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-alpha.ads b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads similarity index 94% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-alpha.ads rename to Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads index e1ea0666..d5281e6d 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-alpha.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads @@ -33,13 +33,13 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.Alpha is - pragma Preelaborate (Alpha); + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha); type Alpha_Field is new Field_Type with record diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-alphanumeric.adb b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-alphanumeric.adb rename to Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb index 6d7eb3ad..2e82305e 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-alphanumeric.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb @@ -33,17 +33,17 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.6 $ +-- 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; + use type Interfaces.C.int; procedure Set_Field_Type (Fld : in Field; Typ : in AlphaNumeric_Field) diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-alphanumeric.ads b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads similarity index 94% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-alphanumeric.ads rename to Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads index 20ec1559..209117b3 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-alphanumeric.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads @@ -33,13 +33,14 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is - pragma Preelaborate (AlphaNumeric); + pragma Preelaborate + (Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric); type AlphaNumeric_Field is new Field_Type with record diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration-ada.adb b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration-ada.adb rename to Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb index 7ddbac49..d4f376dd 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration-ada.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.5 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Handling; use Ada.Characters.Handling; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration-ada.ads b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads similarity index 94% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration-ada.ads rename to Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads index e867b9e3..870a3a46 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration-ada.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads @@ -33,16 +33,17 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.4 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ generic type T is (<>); package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is - pragma Preelaborate (Enumeration.Ada); + pragma Preelaborate + (Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada); function Create (Set : Type_Set := Mixed_Case; Case_Sensitive : Boolean := False; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration.adb b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb similarity index 98% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration.adb rename to Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb index 6fa8daec..c4286af0 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.5 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with Interfaces.C; use Interfaces.C; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration.ads b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration.ads rename to Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads index 55309b60..04b0bfe8 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads @@ -33,15 +33,16 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C.Strings; package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is - pragma Preelaborate (Enumeration); + pragma Preelaborate + (Terminal_Interface.Curses.Forms.Field_Types.Enumeration); type String_Access is access String; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-intfield.adb b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-intfield.adb rename to Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb index e5742011..077ba321 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-intfield.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb @@ -33,17 +33,17 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.6 $ +-- 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; + use type Interfaces.C.int; procedure Set_Field_Type (Fld : in Field; Typ : in Integer_Field) diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-intfield.ads b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads similarity index 94% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-intfield.ads rename to Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads index f7f8f2b4..edef251c 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-intfield.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads @@ -33,13 +33,13 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.IntField is - pragma Preelaborate (IntField); + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IntField); type Integer_Field is new Field_Type with record diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-ipv4_address.adb b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-ipv4_address.adb rename to Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb index 1cf79879..263e50e2 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-ipv4_address.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb @@ -33,17 +33,17 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.6 $ +-- 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; + use type Interfaces.C.int; procedure Set_Field_Type (Fld : in Field; Typ : in Internet_V4_Address_Field) diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-ipv4_address.ads b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads similarity index 94% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-ipv4_address.ads rename to Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads index eb057f26..63a1bbfb 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-ipv4_address.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads @@ -33,13 +33,14 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is - pragma Preelaborate (IPV4_Address); + pragma Preelaborate + (Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address); type Internet_V4_Address_Field is new Field_Type with null record; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-numeric.adb b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb similarity index 85% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-numeric.adb rename to Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb index 0a8ae72c..0e2d5c2f 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-numeric.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb @@ -33,34 +33,34 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.7 $ +-- 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; + 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"); + 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"); + 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; + Res : Eti_Error; begin Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision), Arg2 => Double (Typ.Lower_Limit), diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-numeric.ads b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads similarity index 94% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-numeric.ads rename to Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads index 28844622..d5f126b6 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-numeric.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads @@ -33,13 +33,13 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.Numeric is - pragma Preelaborate (Numeric); + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Numeric); type Numeric_Field is new Field_Type with record diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-regexp.adb b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb similarity index 95% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-regexp.adb rename to Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb index e8940035..a9b4984a 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-regexp.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.3 $ --- Binding Version 00.93 +-- $Revision: 1.6 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; use Interfaces.C; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; @@ -46,7 +46,7 @@ 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; + 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"); diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-regexp.ads b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads similarity index 94% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-regexp.ads rename to Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads index 20f7c5eb..af192938 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-regexp.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads @@ -33,13 +33,13 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.RegExp is - pragma Preelaborate (RegExp); + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp); type String_Access is access String; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-user-choice.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-user-choice.adb rename to Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb index 1606eb5d..cd9cd3db 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-user-choice.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb @@ -33,17 +33,18 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.4 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- 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; + use type Interfaces.C.int; function To_Argument_Access is new Ada.Unchecked_Conversion (System.Address, Argument_Access); diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-user-choice.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads similarity index 93% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-user-choice.ads rename to Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads index ced81fe8..f8523071 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-user-choice.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads @@ -33,16 +33,19 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.4 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -with Ada.Unchecked_Deallocation; -with Terminal_Interface.Curses.Aux; +with Interfaces.C; package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is - pragma Preelaborate (Choice); + 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; @@ -72,7 +75,7 @@ package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is -- | Private Part. -- | private - use type Interfaces.C.Int; + use type Interfaces.C.int; function C_Generic_Choice return C_Field_Type; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-user.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-user.adb rename to Ada95/src/terminal_interface-curses-forms-field_types-user.adb index e5ce433c..aa923c4d 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-user.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb @@ -33,17 +33,18 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.4 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- 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; + use type Interfaces.C.int; procedure Set_Field_Type (Fld : in Field; Typ : in User_Defined_Field_Type) diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types-user.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads similarity index 94% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types-user.ads rename to Ada95/src/terminal_interface-curses-forms-field_types-user.ads index f06459b8..f93a904f 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types-user.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads @@ -33,16 +33,17 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.4 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -with Ada.Unchecked_Deallocation; -with Terminal_Interface.Curses.Aux; +with Interfaces.C; package Terminal_Interface.Curses.Forms.Field_Types.User is - pragma Preelaborate (User); + 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 @@ -75,7 +76,7 @@ package Terminal_Interface.Curses.Forms.Field_Types.User is -- | Private Part. -- | Used by the Choice child package. private - use type Interfaces.C.Int; + use type Interfaces.C.int; function C_Generic_Type return C_Field_Type; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types.adb b/Ada95/src/terminal_interface-curses-forms-field_types.adb similarity index 92% rename from Ada95/ada_include/terminal_interface-curses-forms-field_types.adb rename to Ada95/src/terminal_interface-curses-forms-field_types.adb index 60e1ff38..dccaf9d2 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_types.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types.adb @@ -33,17 +33,15 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.8 $ --- Binding Version 00.93 +-- $Revision: 1.12 $ +-- 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; -with Terminal_Interface.Curses.Forms.Field_Types.User; -with Terminal_Interface.Curses.Forms.Field_Types.User.Choice; -- | -- |===================================================================== -- | man page form_fieldtype.3x @@ -95,11 +93,20 @@ package body Terminal_Interface.Curses.Forms.Field_Types is function Make_Arg (Args : System.Address) return System.Address is - function Getarg (Arg : System.Address := Args) - return System.Address; - pragma Import (C, Getarg, "_nc_ada_getvarg"); + -- 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 Getarg; + return To_Access (To_Access (Args).all).all; end Make_Arg; function Copy_Arg (Usr : System.Address) return System.Address diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_user_data.adb b/Ada95/src/terminal_interface-curses-forms-field_user_data.adb similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-forms-field_user_data.adb rename to Ada95/src/terminal_interface-curses-forms-field_user_data.adb index a5729d40..711cfbba 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-field_user_data.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_user_data.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.10 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; @@ -49,7 +49,7 @@ package body Terminal_Interface.Curses.Forms.Field_User_Data is -- | -- | -- | - use type Interfaces.C.Int; + use type Interfaces.C.int; procedure Set_User_Data (Fld : in Field; Data : in User_Access) diff --git a/Ada95/ada_include/terminal_interface-curses-forms-form_user_data.adb b/Ada95/src/terminal_interface-curses-forms-form_user_data.adb similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-forms-form_user_data.adb rename to Ada95/src/terminal_interface-curses-forms-form_user_data.adb index 4c6f34cc..b6fff13c 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms-form_user_data.adb +++ b/Ada95/src/terminal_interface-curses-forms-form_user_data.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.10 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -- | -- |===================================================================== @@ -47,7 +47,7 @@ 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; + use type Interfaces.C.int; -- | -- | diff --git a/Ada95/ada_include/terminal_interface-curses-forms.adb b/Ada95/src/terminal_interface-curses-forms.adb similarity index 94% rename from Ada95/ada_include/terminal_interface-curses-forms.adb rename to Ada95/src/terminal_interface-curses-forms.adb index fbb43b7f..669ac5f3 100644 --- a/Ada95/ada_include/terminal_interface-curses-forms.adb +++ b/Ada95/src/terminal_interface-curses-forms.adb @@ -33,21 +33,28 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.13 $ --- Binding Version 00.93 +-- $Revision: 1.20 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; -with Unchecked_Conversion; +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; use Terminal_Interface.Curses.Aux; +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); + ------------------------------------------------------------------------------ -- | -- | @@ -55,20 +62,20 @@ package body Terminal_Interface.Curses.Forms is -- subtype chars_ptr is Interfaces.C.Strings.chars_ptr; function FOS_2_CInt is new - Unchecked_Conversion (Field_Option_Set, - C_Int); + Ada.Unchecked_Conversion (Field_Option_Set, + C_Int); function CInt_2_FOS is new - Unchecked_Conversion (C_Int, - Field_Option_Set); + Ada.Unchecked_Conversion (C_Int, + Field_Option_Set); function FrmOS_2_CInt is new - Unchecked_Conversion (Form_Option_Set, - C_Int); + Ada.Unchecked_Conversion (Form_Option_Set, + C_Int); function CInt_2_FrmOS is new - Unchecked_Conversion (C_Int, - Form_Option_Set); + Ada.Unchecked_Conversion (C_Int, + Form_Option_Set); procedure Request_Name (Key : in Form_Request_Code; Name : out String) @@ -219,7 +226,7 @@ package body Terminal_Interface.Curses.Forms is Buffer : in Buffer_Number := Buffer_Number'First; Str : in String) is - type Char_Ptr is access all Interfaces.C.Char; + type Char_Ptr is access all Interfaces.C.char; function Set_Fld_Buffer (Fld : Field; Bufnum : C_Int; S : Char_Ptr) @@ -316,9 +323,6 @@ package body Terminal_Interface.Curses.Forms is -- | -- | -- | - procedure Normalize_Field_Options (Options : in out C_Int); - pragma Import (C, Normalize_Field_Options, "_nc_ada_normalize_field_opts"); - procedure Set_Options (Fld : in Field; Options : in Field_Option_Set) is @@ -329,7 +333,6 @@ package body Terminal_Interface.Curses.Forms is Opt : C_Int := FOS_2_CInt (Options); Res : Eti_Error; begin - Normalize_Field_Options (Opt); Res := Set_Field_Opts (Fld, Opt); if Res /= E_Ok then Eti_Exception (Res); @@ -352,7 +355,6 @@ package body Terminal_Interface.Curses.Forms is Err : Eti_Error; Opt : C_Int := FOS_2_CInt (Options); begin - Normalize_Field_Options (Opt); if On then Err := Field_Opts_On (Fld, Opt); else @@ -373,7 +375,6 @@ package body Terminal_Interface.Curses.Forms is Res : C_Int := Field_Opts (Fld); begin - Normalize_Field_Options (Res); Options := CInt_2_FOS (Res); end Get_Options; -- | @@ -400,13 +401,14 @@ package body Terminal_Interface.Curses.Forms is Color : in Color_Pair := Color_Pair'First) is function Set_Field_Fore (Fld : Field; - Attr : C_Int) return C_Int; + 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, Chtype_To_CInt (Ch)); + Res : constant Eti_Error := + Set_Field_Fore (Fld, AttrChar_To_Chtype (Ch)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -418,21 +420,21 @@ package body Terminal_Interface.Curses.Forms is procedure Foreground (Fld : in Field; Fore : out Character_Attribute_Set) is - function Field_Fore (Fld : Field) return C_Int; + function Field_Fore (Fld : Field) return C_Chtype; pragma Import (C, Field_Fore, "field_fore"); begin - Fore := CInt_To_Chtype (Field_Fore (Fld)).Attr; + 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_Int; + function Field_Fore (Fld : Field) return C_Chtype; pragma Import (C, Field_Fore, "field_fore"); begin - Fore := CInt_To_Chtype (Field_Fore (Fld)).Attr; - Color := CInt_To_Chtype (Field_Fore (Fld)).Color; + Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr; + Color := Chtype_To_AttrChar (Field_Fore (Fld)).Color; end Foreground; -- | -- | @@ -443,13 +445,14 @@ package body Terminal_Interface.Curses.Forms is Color : in Color_Pair := Color_Pair'First) is function Set_Field_Back (Fld : Field; - Attr : C_Int) return C_Int; + 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, Chtype_To_CInt (Ch)); + Res : constant Eti_Error := + Set_Field_Back (Fld, AttrChar_To_Chtype (Ch)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -461,21 +464,21 @@ package body Terminal_Interface.Curses.Forms is procedure Background (Fld : in Field; Back : out Character_Attribute_Set) is - function Field_Back (Fld : Field) return C_Int; + function Field_Back (Fld : Field) return C_Chtype; pragma Import (C, Field_Back, "field_back"); begin - Back := CInt_To_Chtype (Field_Back (Fld)).Attr; + 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_Int; + function Field_Back (Fld : Field) return C_Chtype; pragma Import (C, Field_Back, "field_back"); begin - Back := CInt_To_Chtype (Field_Back (Fld)).Attr; - Color := CInt_To_Chtype (Field_Back (Fld)).Color; + Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr; + Color := Chtype_To_AttrChar (Field_Back (Fld)).Color; end Background; -- | -- | @@ -748,14 +751,18 @@ package body Terminal_Interface.Curses.Forms is function Fields (Frm : Form; Index : Positive) return Field is - function F_Fields (Frm : Form; - Idx : C_Int) return Field; - pragma Import (C, F_Fields, "_nc_get_field"); + use F_Array; + + function C_Fields (Frm : Form) return Pointer; + pragma Import (C, C_Fields, "form_fields"); + + P : Pointer := C_Fields (Frm); begin - if Frm = Null_Form or else Index not in 1 .. Field_Count (Frm) then + if P = null or else Index not in 1 .. Field_Count (Frm) then raise Form_Exception; else - return F_Fields (Frm, C_Int (Index) - 1); + P := P + ptrdiff_t (C_Int (Index) - 1); + return P.all; end if; end Fields; -- | @@ -831,9 +838,6 @@ package body Terminal_Interface.Curses.Forms is -- | -- | -- | - procedure Normalize_Form_Options (Options : in out C_Int); - pragma Import (C, Normalize_Form_Options, "_nc_ada_normalize_form_opts"); - procedure Set_Options (Frm : in Form; Options : in Form_Option_Set) is @@ -844,7 +848,6 @@ package body Terminal_Interface.Curses.Forms is Opt : C_Int := FrmOS_2_CInt (Options); Res : Eti_Error; begin - Normalize_Form_Options (Opt); Res := Set_Form_Opts (Frm, Opt); if Res /= E_Ok then Eti_Exception (Res); @@ -867,7 +870,6 @@ package body Terminal_Interface.Curses.Forms is Err : Eti_Error; Opt : C_Int := FrmOS_2_CInt (Options); begin - Normalize_Form_Options (Opt); if On then Err := Form_Opts_On (Frm, Opt); else @@ -888,7 +890,6 @@ package body Terminal_Interface.Curses.Forms is Res : C_Int := Form_Opts (Frm); begin - Normalize_Form_Options (Res); Options := CInt_2_FrmOS (Res); end Get_Options; -- | diff --git a/Ada95/ada_include/terminal_interface-curses-menus-item_user_data.adb b/Ada95/src/terminal_interface-curses-menus-item_user_data.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-menus-item_user_data.adb rename to Ada95/src/terminal_interface-curses-menus-item_user_data.adb index 858e1d25..98a22a5f 100644 --- a/Ada95/ada_include/terminal_interface-curses-menus-item_user_data.adb +++ b/Ada95/src/terminal_interface-curses-menus-item_user_data.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; diff --git a/Ada95/ada_include/terminal_interface-curses-menus-menu_user_data.adb b/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-menus-menu_user_data.adb rename to Ada95/src/terminal_interface-curses-menus-menu_user_data.adb index 25a4c941..00670dd3 100644 --- a/Ada95/ada_include/terminal_interface-curses-menus-menu_user_data.adb +++ b/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb @@ -33,16 +33,16 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.10 $ +-- 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; + use type Interfaces.C.int; procedure Set_User_Data (Men : in Menu; Data : in User_Access) diff --git a/Ada95/ada_include/terminal_interface-curses-menus.adb b/Ada95/src/terminal_interface-curses-menus.adb similarity index 92% rename from Ada95/ada_include/terminal_interface-curses-menus.adb rename to Ada95/src/terminal_interface-curses-menus.adb index 2df514ec..92ae0f9c 100644 --- a/Ada95/ada_include/terminal_interface-curses-menus.adb +++ b/Ada95/src/terminal_interface-curses-menus.adb @@ -33,40 +33,44 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.13 $ --- Binding Version 00.93 +-- $Revision: 1.20 $ +-- 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 Terminal_Interface.Curses; +with Interfaces.C.Pointers; -with Unchecked_Conversion; +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 - Unchecked_Conversion (Menu_Option_Set, - C_Int); + Ada.Unchecked_Conversion (Menu_Option_Set, + C_Int); function CInt_2_MOS is new - Unchecked_Conversion (C_Int, - Menu_Option_Set); + Ada.Unchecked_Conversion (C_Int, + Menu_Option_Set); function IOS_2_CInt is new - Unchecked_Conversion (Item_Option_Set, - C_Int); + Ada.Unchecked_Conversion (Item_Option_Set, + C_Int); function CInt_2_IOS is new - Unchecked_Conversion (C_Int, - Item_Option_Set); + Ada.Unchecked_Conversion (C_Int, + Item_Option_Set); ------------------------------------------------------------------------------ procedure Request_Name (Key : in Menu_Request_Code; @@ -89,7 +93,7 @@ package body Terminal_Interface.Curses.Menus is function Create (Name : String; Description : String := "") return Item is - type Char_Ptr is access all Interfaces.C.Char; + type Char_Ptr is access all Interfaces.C.char; function Newitem (Name, Desc : Char_Ptr) return Item; pragma Import (C, Newitem, "new_item"); @@ -183,9 +187,6 @@ package body Terminal_Interface.Curses.Menus is end if; end Visible; ------------------------------------------------------------------------------- - procedure Normalize_Item_Options (Options : in out C_Int); - pragma Import (C, Normalize_Item_Options, "_nc_ada_normalize_item_opts"); - procedure Set_Options (Itm : in Item; Options : in Item_Option_Set) is @@ -196,7 +197,6 @@ package body Terminal_Interface.Curses.Menus is Opt : C_Int := IOS_2_CInt (Options); Res : Eti_Error; begin - Normalize_Item_Options (Opt); Res := Set_Item_Opts (Itm, Opt); if Res /= E_Ok then Eti_Exception (Res); @@ -217,7 +217,6 @@ package body Terminal_Interface.Curses.Menus is Opt : C_Int := IOS_2_CInt (Options); Err : Eti_Error; begin - Normalize_Item_Options (Opt); if On then Err := Item_Opts_On (Itm, Opt); else @@ -236,7 +235,6 @@ package body Terminal_Interface.Curses.Menus is Res : C_Int := Item_Opts (Itm); begin - Normalize_Item_Options (Res); Options := CInt_2_IOS (Res); end Get_Options; @@ -369,9 +367,6 @@ package body Terminal_Interface.Curses.Menus is end if; end Post; ------------------------------------------------------------------------------- - procedure Normalize_Menu_Options (Options : in out C_Int); - pragma Import (C, Normalize_Menu_Options, "_nc_ada_normalize_menu_opts"); - procedure Set_Options (Men : in Menu; Options : in Menu_Option_Set) is @@ -382,7 +377,6 @@ package body Terminal_Interface.Curses.Menus is Opt : C_Int := MOS_2_CInt (Options); Res : Eti_Error; begin - Normalize_Menu_Options (Opt); Res := Set_Menu_Opts (Men, Opt); if Res /= E_Ok then Eti_Exception (Res); @@ -403,7 +397,6 @@ package body Terminal_Interface.Curses.Menus is Opt : C_Int := MOS_2_CInt (Options); Err : Eti_Error; begin - Normalize_Menu_Options (Opt); if On then Err := Menu_Opts_On (Men, Opt); else @@ -422,7 +415,6 @@ package body Terminal_Interface.Curses.Menus is Res : C_Int := Menu_Opts (Men); begin - Normalize_Menu_Options (Res); Options := CInt_2_MOS (Res); end Get_Options; @@ -517,7 +509,7 @@ package body Terminal_Interface.Curses.Menus is procedure Set_Mark (Men : in Menu; Mark : in String) is - type Char_Ptr is access all Interfaces.C.Char; + 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"); @@ -557,13 +549,13 @@ package body Terminal_Interface.Curses.Menus is Color : in Color_Pair := Color_Pair'First) is function Set_Menu_Fore (Men : Menu; - Attr : C_Int) return C_Int; + 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, Chtype_To_CInt (Ch)); + Res : constant Eti_Error := Set_Menu_Fore (Men, AttrChar_To_Chtype (Ch)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -573,21 +565,21 @@ package body Terminal_Interface.Curses.Menus is procedure Foreground (Men : in Menu; Fore : out Character_Attribute_Set) is - function Menu_Fore (Men : Menu) return C_Int; + function Menu_Fore (Men : Menu) return C_Chtype; pragma Import (C, Menu_Fore, "menu_fore"); begin - Fore := CInt_To_Chtype (Menu_Fore (Men)).Attr; + 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_Int; + function Menu_Fore (Men : Menu) return C_Chtype; pragma Import (C, Menu_Fore, "menu_fore"); begin - Fore := CInt_To_Chtype (Menu_Fore (Men)).Attr; - Color := CInt_To_Chtype (Menu_Fore (Men)).Color; + Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr; + Color := Chtype_To_AttrChar (Menu_Fore (Men)).Color; end Foreground; procedure Set_Background @@ -596,13 +588,13 @@ package body Terminal_Interface.Curses.Menus is Color : in Color_Pair := Color_Pair'First) is function Set_Menu_Back (Men : Menu; - Attr : C_Int) return C_Int; + 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, Chtype_To_CInt (Ch)); + Res : constant Eti_Error := Set_Menu_Back (Men, AttrChar_To_Chtype (Ch)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -612,21 +604,21 @@ package body Terminal_Interface.Curses.Menus is procedure Background (Men : in Menu; Back : out Character_Attribute_Set) is - function Menu_Back (Men : Menu) return C_Int; + function Menu_Back (Men : Menu) return C_Chtype; pragma Import (C, Menu_Back, "menu_back"); begin - Back := CInt_To_Chtype (Menu_Back (Men)).Attr; + 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_Int; + function Menu_Back (Men : Menu) return C_Chtype; pragma Import (C, Menu_Back, "menu_back"); begin - Back := CInt_To_Chtype (Menu_Back (Men)).Attr; - Color := CInt_To_Chtype (Menu_Back (Men)).Color; + Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr; + Color := Chtype_To_AttrChar (Menu_Back (Men)).Color; end Background; procedure Set_Grey (Men : in Menu; @@ -634,14 +626,14 @@ package body Terminal_Interface.Curses.Menus is Color : in Color_Pair := Color_Pair'First) is function Set_Menu_Grey (Men : Menu; - Attr : C_Int) return C_Int; + 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, Chtype_To_CInt (Ch)); + Res : constant Eti_Error := Set_Menu_Grey (Men, AttrChar_To_Chtype (Ch)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -651,21 +643,21 @@ package body Terminal_Interface.Curses.Menus is procedure Grey (Men : in Menu; Grey : out Character_Attribute_Set) is - function Menu_Grey (Men : Menu) return C_Int; + function Menu_Grey (Men : Menu) return C_Chtype; pragma Import (C, Menu_Grey, "menu_grey"); begin - Grey := CInt_To_Chtype (Menu_Grey (Men)).Attr; + 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_Int; + function Menu_Grey (Men : Menu) return C_Chtype; pragma Import (C, Menu_Grey, "menu_grey"); begin - Grey := CInt_To_Chtype (Menu_Grey (Men)).Attr; - Color := CInt_To_Chtype (Menu_Grey (Men)).Color; + 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; @@ -739,7 +731,7 @@ package body Terminal_Interface.Curses.Menus is function Set_Pattern (Men : Menu; Text : String) return Boolean is - type Char_Ptr is access all Interfaces.C.Char; + 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"); @@ -907,7 +899,7 @@ package body Terminal_Interface.Curses.Menus is if Items (Items'Last) /= Null_Item then raise Menu_Exception; else - Res := Set_Items (Men, Items (Items'First)'Address); + Res := Set_Items (Men, Items.all'Address); if Res /= E_Ok then Eti_Exception (Res); end if; @@ -925,14 +917,18 @@ package body Terminal_Interface.Curses.Menus is function Items (Men : Menu; Index : Positive) return Item is - function M_Items (Men : Menu; - Idx : C_Int) return Item; - pragma Import (C, M_Items, "_nc_get_item"); + use I_Array; + + function C_Mitems (Men : Menu) return Pointer; + pragma Import (C, C_Mitems, "menu_items"); + + P : Pointer := C_Mitems (Men); begin - if Men = Null_Menu or else Index not in 1 .. Item_Count (Men) then + if P = null or else Index not in 1 .. Item_Count (Men) then raise Menu_Exception; else - return M_Items (Men, C_Int (Index) - 1); + P := P + ptrdiff_t (C_Int (Index) - 1); + return P.all; end if; end Items; @@ -943,13 +939,12 @@ package body Terminal_Interface.Curses.Menus is pragma Import (C, Newmenu, "new_menu"); M : Menu; - I : Item_Array_Access; begin pragma Assert (Items (Items'Last) = Null_Item); if Items (Items'Last) /= Null_Item then raise Menu_Exception; else - M := Newmenu (Items (Items'First)'Address); + M := Newmenu (Items.all'Address); if M = Null_Menu then raise Menu_Exception; end if; diff --git a/Ada95/ada_include/terminal_interface-curses-mouse.adb b/Ada95/src/terminal_interface-curses-mouse.adb similarity index 63% rename from Ada95/ada_include/terminal_interface-curses-mouse.adb rename to Ada95/src/terminal_interface-curses-mouse.adb index bef31643..8a7499ac 100644 --- a/Ada95/ada_include/terminal_interface-curses-mouse.adb +++ b/Ada95/src/terminal_interface-curses-mouse.adb @@ -33,31 +33,22 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.9 $ --- Binding Version 00.93 +-- $Revision: 1.16 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with System; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; -with Interfaces; -with Interfaces.C; -with Unchecked_Conversion; +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 CInt_To_Mask is new - Unchecked_Conversion (Source => C_Int, - Target => Event_Mask); - - function Mask_To_CInt is new - Unchecked_Conversion (Source => Event_Mask, - Target => C_Int); - function Has_Mouse return Boolean is function Mouse_Avail return C_Int; @@ -85,66 +76,106 @@ package body Terminal_Interface.Curses.Mouse is return Event; end Get_Mouse; - procedure Register_Reportable_Event (B : in Mouse_Button; - S : in Button_State; - Mask : in out Event_Mask) + procedure Register_Reportable_Event (Button : in Mouse_Button; + State : in Button_State; + Mask : in out Event_Mask) is - type Evt_Access is access all Event_Mask; - function Register (B : C_Int; - S : C_Int; - M : Evt_Access) return C_Int; - pragma Import (C, Register, "_nc_ada_mouse_mask"); - - T : aliased Event_Mask := Mask; - M : Evt_Access := T'Access; - R : constant C_Int := Register (C_Int (Mouse_Button'Pos (B)), - C_Int (Button_State'Pos (S)), - M); + Button_Nr : constant Natural := Mouse_Button'Pos (Button); + State_Nr : constant Natural := Button_State'Pos (State); begin - if R = Curses_Err then + 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; - Mask := T; 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 - type Int_Access is access all C_Int; - function MMask (M : C_Int; O : Int_Access := null) return C_Int; + function MMask (M : Event_Mask; + O : access Event_Mask) return Event_Mask; pragma Import (C, MMask, "mousemask"); - R : C_Int; + R : Event_Mask; + Old : aliased Event_Mask; begin - R := MMask (Mask_To_CInt (Mask)); - return CInt_To_Mask (R); + R := MMask (Mask, Old'Access); + return Old; end Start_Mouse; - procedure End_Mouse + procedure End_Mouse (Mask : in Event_Mask := No_Events) is - Old : constant Event_Mask := Start_Mouse (No_Events); 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 - procedure Dispatch_Event (M : in C_Int; - B : out C_Int; - S : out C_Int); - pragma Import (C, Dispatch_Event, "_nc_ada_mouse_event"); - - Mask : constant Interfaces.C.int := Mask_To_CInt (Event.Bstate); - B, S : C_Int; + Mask : constant Event_Mask := Event.Bstate; begin X := Column_Position (Event.X); Y := Line_Position (Event.Y); - Dispatch_Event (Mask, B, S); - Button := Mouse_Button'Val (B); - State := Button_State'Val (S); + Dispatch_Event (Mask, Button, State); end Get_Event; procedure Unget_Mouse (Event : in Mouse_Event) @@ -160,10 +191,12 @@ package body Terminal_Interface.Curses.Mouse is 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 C_Int; + 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_False then + if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X)) + = Curses_Bool_False then return False; else return True; diff --git a/Ada95/ada_include/terminal_interface-curses-panels-user_data.adb b/Ada95/src/terminal_interface-curses-panels-user_data.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-panels-user_data.adb rename to Ada95/src/terminal_interface-curses-panels-user_data.adb index 287511a6..c5658c50 100644 --- a/Ada95/ada_include/terminal_interface-curses-panels-user_data.adb +++ b/Ada95/src/terminal_interface-curses-panels-user_data.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; with Terminal_Interface.Curses.Aux; diff --git a/Ada95/ada_include/terminal_interface-curses-panels.adb b/Ada95/src/terminal_interface-curses-panels.adb similarity index 98% rename from Ada95/ada_include/terminal_interface-curses-panels.adb rename to Ada95/src/terminal_interface-curses-panels.adb index 335668d4..5d42226a 100644 --- a/Ada95/ada_include/terminal_interface-curses-panels.adb +++ b/Ada95/src/terminal_interface-curses-panels.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Interfaces.C; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-aux.adb b/Ada95/src/terminal_interface-curses-text_io-aux.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-text_io-aux.adb rename to Ada95/src/terminal_interface-curses-text_io-aux.adb index abc3cab3..812f6622 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-aux.adb +++ b/Ada95/src/terminal_interface-curses-text_io-aux.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Text_IO.Aux is diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-aux.ads b/Ada95/src/terminal_interface-curses-text_io-aux.ads similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-text_io-aux.ads rename to Ada95/src/terminal_interface-curses-text_io-aux.ads index 4fad19c6..63a741fd 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-aux.ads +++ b/Ada95/src/terminal_interface-curses-text_io-aux.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.8 $ --- Binding Version 00.93 +-- $Revision: 1.10 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ private package Terminal_Interface.Curses.Text_IO.Aux is -- pragma Preelaborate (Aux); diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-complex_io.adb b/Ada95/src/terminal_interface-curses-text_io-complex_io.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-text_io-complex_io.adb rename to Ada95/src/terminal_interface-curses-text_io-complex_io.adb index 60cbecb4..a804ec65 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-complex_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-complex_io.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Text_IO.Float_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-complex_io.ads b/Ada95/src/terminal_interface-curses-text_io-complex_io.ads similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-text_io-complex_io.ads rename to Ada95/src/terminal_interface-curses-text_io-complex_io.ads index 74759845..47146266 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-complex_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-complex_io.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Numerics.Generic_Complex_Types; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.adb b/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.adb rename to Ada95/src/terminal_interface-curses-text_io-decimal_io.adb index fef58a39..d70a73f1 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.ads b/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.ads rename to Ada95/src/terminal_interface-curses-text_io-decimal_io.ads index 0d567047..60ac66b7 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Num is delta <> digits <>; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.adb b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.adb rename to Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb index 1d30946b..7abeffe7 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.ads b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.ads rename to Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads index 08d72a8d..3c13424c 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Enum is (<>); diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.adb b/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.adb rename to Ada95/src/terminal_interface-curses-text_io-fixed_io.adb index e7d45af5..760acb2b 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.ads b/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.ads rename to Ada95/src/terminal_interface-curses-text_io-fixed_io.ads index 9a6faa74..77f5743f 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Num is delta <>; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-float_io.adb b/Ada95/src/terminal_interface-curses-text_io-float_io.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-text_io-float_io.adb rename to Ada95/src/terminal_interface-curses-text_io-float_io.adb index f6255897..47fe94a1 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-float_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-float_io.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-float_io.ads b/Ada95/src/terminal_interface-curses-text_io-float_io.ads similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-text_io-float_io.ads rename to Ada95/src/terminal_interface-curses-text_io-float_io.ads index f0070db1..e46170e6 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-float_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-float_io.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Num is digits <>; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-integer_io.adb b/Ada95/src/terminal_interface-curses-text_io-integer_io.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-text_io-integer_io.adb rename to Ada95/src/terminal_interface-curses-text_io-integer_io.adb index 8fe2fa03..43d03a9f 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-integer_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-integer_io.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-integer_io.ads b/Ada95/src/terminal_interface-curses-text_io-integer_io.ads similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-text_io-integer_io.ads rename to Ada95/src/terminal_interface-curses-text_io-integer_io.ads index e21ac143..cd3b01b5 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-integer_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-integer_io.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Num is range <>; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-modular_io.adb b/Ada95/src/terminal_interface-curses-text_io-modular_io.adb similarity index 97% rename from Ada95/ada_include/terminal_interface-curses-text_io-modular_io.adb rename to Ada95/src/terminal_interface-curses-text_io-modular_io.adb index 3125390e..75bd624a 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-modular_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-modular_io.adb @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.6 $ --- Binding Version 00.93 +-- $Revision: 1.8 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-modular_io.ads b/Ada95/src/terminal_interface-curses-text_io-modular_io.ads similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-text_io-modular_io.ads rename to Ada95/src/terminal_interface-curses-text_io-modular_io.ads index 32a687b4..32920775 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io-modular_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-modular_io.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.7 $ --- Binding Version 00.93 +-- $Revision: 1.9 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Num is mod <>; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io.adb b/Ada95/src/terminal_interface-curses-text_io.adb similarity index 98% rename from Ada95/ada_include/terminal_interface-curses-text_io.adb rename to Ada95/src/terminal_interface-curses-text_io.adb index f362e40b..3d829a57 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io.adb @@ -33,13 +33,11 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.8 $ --- Binding Version 00.93 +-- $Revision: 1.11 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -with System; - package body Terminal_Interface.Curses.Text_IO is Default_Window : Window := Null_Window; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io.ads b/Ada95/src/terminal_interface-curses-text_io.ads similarity index 96% rename from Ada95/ada_include/terminal_interface-curses-text_io.ads rename to Ada95/src/terminal_interface-curses-text_io.ads index e80f33fb..02c3b7d5 100644 --- a/Ada95/ada_include/terminal_interface-curses-text_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io.ads @@ -33,13 +33,11 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.8 $ --- Binding Version 00.93 +-- $Revision: 1.11 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ -with System; -with System.Parameters; with Ada.Text_IO; with Ada.IO_Exceptions; @@ -49,7 +47,7 @@ package Terminal_Interface.Curses.Text_IO is subtype Count is Ada.Text_IO.Count; subtype Positive_Count is Count range 1 .. Count'Last; - subtype Field is Integer range 0 .. System.Parameters.Field_Max; + 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); diff --git a/Ada95/ada_include/terminal_interface-curses.adb b/Ada95/src/terminal_interface-curses.adb similarity index 85% rename from Ada95/ada_include/terminal_interface-curses.adb rename to Ada95/src/terminal_interface-curses.adb index b5ce9ef2..1f536d14 100644 --- a/Ada95/ada_include/terminal_interface-curses.adb +++ b/Ada95/src/terminal_interface-curses.adb @@ -33,22 +33,24 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.15 $ --- Binding Version 00.93 +-- $Revision: 1.25 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with System; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +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 Unchecked_Conversion; +with Ada.Unchecked_Conversion; package body Terminal_Interface.Curses is + use Aux; use type System.Bit_Order; package ASF renames Ada.Strings.Fixed; @@ -57,6 +59,36 @@ package body Terminal_Interface.Curses is 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 Key_Name (Key : in Real_Key_Code) return String is @@ -99,18 +131,11 @@ package body Terminal_Interface.Curses is function Initscr return Window; pragma Import (C, Initscr, "initscr"); - function Check_Version (Major, Minor : C_Int) return C_Int; - pragma Import (C, Check_Version, "_nc_ada_vcheck"); - W : Window; begin - if (Check_Version (NC_Major_Version, NC_Minor_Version) = 0) then - raise Wrong_Curses_Version; - else - W := Initscr; - if W = Null_Window then - raise Curses_Exception; - end if; + W := Initscr; + if W = Null_Window then + raise Curses_Exception; end if; end Init_Screen; @@ -126,10 +151,10 @@ package body Terminal_Interface.Curses is function Is_End_Window return Boolean is - function Isendwin return C_Int; + function Isendwin return Curses_Bool; pragma Import (C, Isendwin, "isendwin"); begin - if Isendwin = Curses_False then + if Isendwin = Curses_Bool_False then return False; else return True; @@ -155,10 +180,10 @@ package body Terminal_Interface.Curses is Ch : in Attributed_Character) is function Waddch (W : Window; - Ch : C_Int) return C_Int; + Ch : C_Chtype) return C_Int; pragma Import (C, Waddch, "waddch"); begin - if Waddch (Win, Chtype_To_Cint (Ch)) = Curses_Err then + if Waddch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then raise Curses_Exception; end if; end Add; @@ -182,12 +207,12 @@ package body Terminal_Interface.Curses is function mvwaddch (W : Window; Y : C_Int; X : C_Int; - Ch : C_Int) return C_Int; + Ch : C_Chtype) return C_Int; pragma Import (C, mvwaddch, "mvwaddch"); begin if mvwaddch (Win, C_Int (Line), C_Int (Column), - Chtype_To_CInt (Ch)) = Curses_Err then + AttrChar_To_Chtype (Ch)) = Curses_Err then raise Curses_Exception; end if; end Add; @@ -212,10 +237,10 @@ package body Terminal_Interface.Curses is Ch : in Attributed_Character) is function Wechochar (W : Window; - Ch : C_Int) return C_Int; + Ch : C_Chtype) return C_Int; pragma Import (C, Wechochar, "wechochar"); begin - if Wechochar (Win, Chtype_To_CInt (Ch)) = Curses_Err then + if Wechochar (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then raise Curses_Exception; end if; end Add_With_Immediate_Echo; @@ -367,10 +392,10 @@ package body Terminal_Interface.Curses is Mode : in Boolean := False) is function Syncok (Win : Window; - Mode : C_Int) return C_Int; + Mode : Curses_Bool) return C_Int; pragma Import (C, Syncok, "syncok"); begin - if Syncok (Win, Boolean'Pos (Mode)) = Curses_Err then + if Syncok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then raise Curses_Exception; end if; end Set_Synch_Mode; @@ -379,7 +404,7 @@ package body Terminal_Interface.Curses is Str : in String; Len : in Integer := -1) is - type Char_Ptr is access all Interfaces.C.Char; + type Char_Ptr is access all Interfaces.C.char; function Waddnstr (Win : Window; Str : Char_Ptr; Len : C_Int := -1) return C_Int; @@ -454,25 +479,25 @@ package body Terminal_Interface.Curses is Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character) is function Wborder (W : Window; - LS : C_Int; - RS : C_Int; - TS : C_Int; - BS : C_Int; - ULC : C_Int; - URC : C_Int; - LLC : C_Int; - LRC : C_Int) return C_Int; + 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, - Chtype_To_CInt (Left_Side_Symbol), - Chtype_To_CInt (Right_Side_Symbol), - Chtype_To_CInt (Top_Side_Symbol), - Chtype_To_CInt (Bottom_Side_Symbol), - Chtype_To_CInt (Upper_Left_Corner_Symbol), - Chtype_To_CInt (Upper_Right_Corner_Symbol), - Chtype_To_CInt (Lower_Left_Corner_Symbol), - Chtype_To_CInt (Lower_Right_Corner_Symbol) + 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; @@ -496,12 +521,12 @@ package body Terminal_Interface.Curses is Line_Symbol : in Attributed_Character := Default_Character) is function Whline (W : Window; - Ch : C_Int; + Ch : C_Chtype; Len : C_Int) return C_Int; pragma Import (C, Whline, "whline"); begin if Whline (Win, - Chtype_To_CInt (Line_Symbol), + AttrChar_To_Chtype (Line_Symbol), C_Int (Line_Size)) = Curses_Err then raise Curses_Exception; end if; @@ -513,12 +538,12 @@ package body Terminal_Interface.Curses is Line_Symbol : in Attributed_Character := Default_Character) is function Wvline (W : Window; - Ch : C_Int; + Ch : C_Chtype; Len : C_Int) return C_Int; pragma Import (C, Wvline, "wvline"); begin if Wvline (Win, - Chtype_To_CInt (Line_Symbol), + AttrChar_To_Chtype (Line_Symbol), C_Int (Line_Size)) = Curses_Err then raise Curses_Exception; end if; @@ -597,10 +622,10 @@ package body Terminal_Interface.Curses is On : in Boolean := True) is function Wattron (Win : Window; - C_Attr : C_Int) return C_Int; + C_Attr : C_AttrType) return C_Int; pragma Import (C, Wattron, "wattr_on"); function Wattroff (Win : Window; - C_Attr : C_Int) return C_Int; + 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. @@ -610,9 +635,9 @@ package body Terminal_Interface.Curses is Attr => Attr); begin if On then - Err := Wattron (Win, Chtype_To_CInt (AC)); + Err := Wattron (Win, AttrChar_To_AttrType (AC)); else - Err := Wattroff (Win, Chtype_To_CInt (AC)); + Err := Wattroff (Win, AttrChar_To_AttrType (AC)); end if; if Err = Curses_Err then raise Curses_Exception; @@ -625,14 +650,14 @@ package body Terminal_Interface.Curses is Color : in Color_Pair := Color_Pair'First) is function Wattrset (Win : Window; - C_Attr : C_Int) return C_Int; + C_Attr : C_AttrType) return C_Int; pragma Import (C, Wattrset, "wattrset"); -- ??? wattr_set begin if Wattrset (Win, - Chtype_To_CInt (Attributed_Character' - (Ch => Character'First, - Color => Color, - Attr => Attr))) = Curses_Err then + AttrChar_To_AttrType (Attributed_Character' + (Ch => Character'First, + Color => Color, + Attr => Attr))) = Curses_Err then raise Curses_Exception; end if; end Set_Character_Attributes; @@ -640,25 +665,64 @@ package body Terminal_Interface.Curses is function Get_Character_Attribute (Win : Window := Standard_Window) return Character_Attribute_Set is - function Wattrget (Win : Window) return C_Int; + function Wattrget (Win : Window; + Atr : access C_AttrType; + Col : access C_Short; + Opt : System.Address) return C_Int; pragma Import (C, Wattrget, "wattr_get"); - Ch : Attributed_Character := CInt_To_Chtype (Wattrget (Win)); + 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 - return Ch.Attr; + 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) return C_Int; + function Wattrget (Win : Window; + Atr : access C_AttrType; + Col : access C_Short; + Opt : System.Address) return C_Int; pragma Import (C, Wattrget, "wattr_get"); - Ch : Attributed_Character := CInt_To_Chtype (Wattrget (Win)); + 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 - return Ch.Color; + 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; @@ -667,7 +731,7 @@ package body Terminal_Interface.Curses is is function Wchgat (Win : Window; Cnt : C_Int; - Attr : C_Int; + Attr : C_AttrType; Color : C_Short; Opts : System.Address := System.Null_Address) return C_Int; @@ -676,7 +740,7 @@ package body Terminal_Interface.Curses is Ch : constant Attributed_Character := (Ch => Character'First, Color => Color_Pair'First, Attr => Attr); begin - if Wchgat (Win, C_Int (Count), Chtype_To_CInt (Ch), + if Wchgat (Win, C_Int (Count), AttrChar_To_AttrType (Ch), C_Short (Color)) = Curses_Err then raise Curses_Exception; end if; @@ -775,10 +839,10 @@ package body Terminal_Interface.Curses is procedure Set_Meta_Mode (Win : in Window := Standard_Window; SwitchOn : in Boolean := True) is - function Meta (W : Window; Mode : C_Int) return C_Int; + function Meta (W : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Meta, "meta"); begin - if Meta (Win, Boolean'Pos (SwitchOn)) = Curses_Err then + if Meta (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then raise Curses_Exception; end if; end Set_Meta_Mode; @@ -786,10 +850,10 @@ package body Terminal_Interface.Curses is procedure Set_KeyPad_Mode (Win : in Window := Standard_Window; SwitchOn : in Boolean := True) is - function Keypad (W : Window; Mode : C_Int) return C_Int; + function Keypad (W : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Keypad, "keypad"); begin - if Keypad (Win, Boolean'Pos (SwitchOn)) = Curses_Err then + if Keypad (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then raise Curses_Exception; end if; end Set_KeyPad_Mode; @@ -808,10 +872,10 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Mode : in Boolean := True) is - function Intrflush (Win : Window; Mode : C_Int) return C_Int; + function Intrflush (Win : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Intrflush, "intrflush"); begin - if Intrflush (Win, Boolean'Pos (Mode)) = Curses_Err then + if Intrflush (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then raise Curses_Exception; end if; end Set_Flush_On_Interrupt_Mode; @@ -836,10 +900,10 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Mode : in Boolean := False) is - function Nodelay (Win : Window; Mode : C_Int) return C_Int; + function Nodelay (Win : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Nodelay, "nodelay"); begin - if Nodelay (Win, Boolean'Pos (Mode)) = Curses_Err then + if Nodelay (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then raise Curses_Exception; end if; end Set_NoDelay_Mode; @@ -871,10 +935,11 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Timer_Off : in Boolean := False) is - function Notimeout (Win : Window; Mode : C_Int) return C_Int; + function Notimeout (Win : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Notimeout, "notimeout"); begin - if Notimeout (Win, Boolean'Pos (Timer_Off)) = Curses_Err then + if Notimeout (Win, Curses_Bool (Boolean'Pos (Timer_Off))) + = Curses_Err then raise Curses_Exception; end if; end Set_Escape_Timer_Mode; @@ -903,10 +968,10 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Do_Clear : in Boolean := True) is - function Clear_Ok (W : Window; Flag : C_Int) return C_Int; + function Clear_Ok (W : Window; Flag : Curses_Bool) return C_Int; pragma Import (C, Clear_Ok, "clearok"); begin - if Clear_Ok (Win, Boolean'Pos (Do_Clear)) = Curses_Err then + if Clear_Ok (Win, Curses_Bool (Boolean'Pos (Do_Clear))) = Curses_Err then raise Curses_Exception; end if; end Clear_On_Next_Update; @@ -915,10 +980,10 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Do_Idl : in Boolean := True) is - function IDL_Ok (W : Window; Flag : C_Int) return C_Int; + function IDL_Ok (W : Window; Flag : Curses_Bool) return C_Int; pragma Import (C, IDL_Ok, "idlok"); begin - if IDL_Ok (Win, Boolean'Pos (Do_Idl)) = Curses_Err then + if IDL_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idl))) = Curses_Err then raise Curses_Exception; end if; end Use_Insert_Delete_Line; @@ -927,10 +992,10 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Do_Idc : in Boolean := True) is - function IDC_Ok (W : Window; Flag : C_Int) return C_Int; + function IDC_Ok (W : Window; Flag : Curses_Bool) return C_Int; pragma Import (C, IDC_Ok, "idcok"); begin - if IDC_Ok (Win, Boolean'Pos (Do_Idc)) = Curses_Err then + if IDC_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idc))) = Curses_Err then raise Curses_Exception; end if; end Use_Insert_Delete_Character; @@ -939,10 +1004,10 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Do_Leave : in Boolean := True) is - function Leave_Ok (W : Window; Flag : C_Int) return C_Int; + function Leave_Ok (W : Window; Flag : Curses_Bool) return C_Int; pragma Import (C, Leave_Ok, "leaveok"); begin - if Leave_Ok (Win, Boolean'Pos (Do_Leave)) = Curses_Err then + if Leave_Ok (Win, Curses_Bool (Boolean'Pos (Do_Leave))) = Curses_Err then raise Curses_Exception; end if; end Leave_Cursor_After_Update; @@ -951,10 +1016,10 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Mode : in Boolean := False) is - function Immedok (Win : Window; Mode : C_Int) return C_Int; + function Immedok (Win : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Immedok, "immedok"); begin - if Immedok (Win, Boolean'Pos (Mode)) = Curses_Err then + if Immedok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then raise Curses_Exception; end if; end Immediate_Update_Mode; @@ -963,25 +1028,28 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Mode : in Boolean := False) is - function Scrollok (Win : Window; Mode : C_Int) return C_Int; + function Scrollok (Win : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Scrollok, "scrollok"); begin - if Scrollok (Win, Boolean'Pos (Mode)) = Curses_Err then + if Scrollok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then raise Curses_Exception; end if; end Allow_Scrolling; function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean is - function Is_Scroll (Win : Window) return C_Int; - pragma Import (C, Is_Scroll, "_nc_ada_isscroll"); - - Res : constant C_Int := Is_Scroll (Win); + Res : C_Int; begin + case Sizeof_bool is + when 1 => Res := C_Int (W_Get_Byte (Win, Offset_scroll)); + when 2 => Res := C_Int (W_Get_Short (Win, Offset_scroll)); + when 4 => Res := C_Int (W_Get_Int (Win, Offset_scroll)); + when others => raise Curses_Exception; + end case; + case Res is - when Curses_True => return True; - when Curses_False => return False; - when others => raise Curses_Exception; + when 0 => return False; + when others => return True; end case; end Scrolling_Allowed; @@ -1103,21 +1171,20 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Ch : in Attributed_Character) is - procedure WBackground (W : in Window; Ch : in C_Int); + procedure WBackground (W : in Window; Ch : in C_Chtype); pragma Import (C, WBackground, "wbkgdset"); begin - WBackground (Win, Chtype_To_CInt (Ch)); + 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_Int) - return C_Int; + function WChangeBkgd (W : Window; Ch : C_Chtype) return C_Int; pragma Import (C, WChangeBkgd, "wbkgd"); begin - if WChangeBkgd (Win, Chtype_To_CInt (Ch)) = Curses_Err then + if WChangeBkgd (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then raise Curses_Exception; end if; end Change_Background; @@ -1125,10 +1192,10 @@ package body Terminal_Interface.Curses is function Get_Background (Win : Window := Standard_Window) return Attributed_Character is - function Wgetbkgd (Win : Window) return C_Int; + function Wgetbkgd (Win : Window) return C_Chtype; pragma Import (C, Wgetbkgd, "getbkgd"); begin - return CInt_To_Chtype (Wgetbkgd (Win)); + return Chtype_To_AttrChar (Wgetbkgd (Win)); end Get_Background; ------------------------------------------------------------------------------ procedure Change_Lines_Status (Win : in Window := Standard_Window; @@ -1178,10 +1245,10 @@ package body Terminal_Interface.Curses is (Win : Window := Standard_Window; Line : Line_Position) return Boolean is - function WLineTouched (W : Window; L : C_Int) return C_Int; + function WLineTouched (W : Window; L : C_Int) return Curses_Bool; pragma Import (C, WLineTouched, "is_linetouched"); begin - if WLineTouched (Win, C_Int (Line)) = Curses_False then + if WLineTouched (Win, C_Int (Line)) = Curses_Bool_False then return False; else return True; @@ -1191,10 +1258,10 @@ package body Terminal_Interface.Curses is function Is_Touched (Win : Window := Standard_Window) return Boolean is - function WWinTouched (W : Window) return C_Int; + function WWinTouched (W : Window) return Curses_Bool; pragma Import (C, WWinTouched, "is_wintouched"); begin - if WWinTouched (Win) = Curses_False then + if WWinTouched (Win) = Curses_Bool_False then return False; else return True; @@ -1286,24 +1353,20 @@ package body Terminal_Interface.Curses is 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 - type Int_Access is access all C_Int; - function Getmaxyx (W : Window; Y, X : Int_Access) return C_Int; - pragma Import (C, Getmaxyx, "_nc_ada_getmaxyx"); - - Y, X : aliased C_Int; - Err : constant C_Int := Getmaxyx (Win, Y'Access, X'Access); + -- 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 - if Err = Curses_Err then - raise Curses_Exception; - else - Number_Of_Lines := Line_Count (Y); - Number_Of_Columns := Column_Count (X); - end if; + Number_Of_Lines := Line_Count (Y); + Number_Of_Columns := Column_Count (X); end Get_Size; procedure Get_Window_Position @@ -1311,19 +1374,11 @@ package body Terminal_Interface.Curses is Top_Left_Line : out Line_Position; Top_Left_Column : out Column_Position) is - type Int_Access is access all C_Int; - function Getbegyx (W : Window; Y, X : Int_Access) return C_Int; - pragma Import (C, Getbegyx, "_nc_ada_getbegyx"); - - Y, X : aliased C_Int; - Err : constant C_Int := Getbegyx (Win, Y'Access, X'Access); + Y : C_Short := W_Get_Short (Win, Offset_begy); + X : C_Short := W_Get_Short (Win, Offset_begx); begin - if Err = Curses_Err then - raise Curses_Exception; - else - Top_Left_Line := Line_Position (Y); - Top_Left_Column := Column_Position (X); - end if; + Top_Left_Line := Line_Position (Y); + Top_Left_Column := Column_Position (X); end Get_Window_Position; procedure Get_Cursor_Position @@ -1331,19 +1386,11 @@ package body Terminal_Interface.Curses is Line : out Line_Position; Column : out Column_Position) is - type Int_Access is access all C_Int; - function Getyx (W : Window; Y, X : Int_Access) return C_Int; - pragma Import (C, Getyx, "_nc_ada_getyx"); - - Y, X : aliased C_Int; - Err : constant C_Int := Getyx (Win, Y'Access, X'Access); + Y : C_Short := W_Get_Short (Win, Offset_cury); + X : C_Short := W_Get_Short (Win, Offset_curx); begin - if Err = Curses_Err then - raise Curses_Exception; - else - Line := Line_Position (Y); - Column := Column_Position (X); - end if; + Line := Line_Position (Y); + Column := Column_Position (X); end Get_Cursor_Position; procedure Get_Origin_Relative_To_Parent @@ -1352,25 +1399,17 @@ package body Terminal_Interface.Curses is Top_Left_Column : out Column_Position; Is_Not_A_Subwindow : out Boolean) is - type Int_Access is access all C_Int; - function Getparyx (W : Window; Y, X : Int_Access) return C_Int; - pragma Import (C, Getparyx, "_nc_ada_getparyx"); - - Y, X : aliased C_Int; - Err : constant C_Int := Getparyx (Win, Y'Access, X'Access); + Y : C_Int := W_Get_Int (Win, Offset_pary); + X : C_Int := W_Get_Int (Win, Offset_parx); begin - if Err = Curses_Err then - raise Curses_Exception; + if Y = -1 then + Top_Left_Line := Line_Position'Last; + Top_Left_Column := Column_Position'Last; + Is_Not_A_Subwindow := True; else - 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; + 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; ------------------------------------------------------------------------------ @@ -1481,11 +1520,11 @@ package body Terminal_Interface.Curses is (Pad : in Window; Ch : in Attributed_Character) is - function Pechochar (Pad : Window; Ch : C_Int) + function Pechochar (Pad : Window; Ch : C_Chtype) return C_Int; pragma Import (C, Pechochar, "pechochar"); begin - if Pechochar (Pad, Chtype_To_CInt (Ch)) = Curses_Err then + if Pechochar (Pad, AttrChar_To_Chtype (Ch)) = Curses_Err then raise Curses_Exception; end if; end Add_Character_To_Pad_And_Echo_It; @@ -1543,10 +1582,10 @@ package body Terminal_Interface.Curses is function Peek (Win : Window := Standard_Window) return Attributed_Character is - function Winch (Win : Window) return C_Int; + function Winch (Win : Window) return C_Chtype; pragma Import (C, Winch, "winch"); begin - return CInt_To_Chtype (Winch (Win)); + return Chtype_To_AttrChar (Winch (Win)); end Peek; function Peek @@ -1556,19 +1595,19 @@ package body Terminal_Interface.Curses is is function Mvwinch (Win : Window; Lin : C_Int; - Col : C_Int) return C_Int; + Col : C_Int) return C_Chtype; pragma Import (C, Mvwinch, "mvwinch"); begin - return CInt_To_Chtype (Mvwinch (Win, C_Int (Line), C_Int (Column))); + 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_Int) return C_Int; + function Winsch (Win : Window; Ch : C_Chtype) return C_Int; pragma Import (C, Winsch, "winsch"); begin - if Winsch (Win, Chtype_To_CInt (Ch)) = Curses_Err then + if Winsch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then raise Curses_Exception; end if; end Insert; @@ -1582,13 +1621,13 @@ package body Terminal_Interface.Curses is function Mvwinsch (Win : Window; Lin : C_Int; Col : C_Int; - Ch : C_Int) return C_Int; + Ch : C_Chtype) return C_Int; pragma Import (C, Mvwinsch, "mvwinsch"); begin if Mvwinsch (Win, C_Int (Line), C_Int (Column), - Chtype_To_CInt (Ch)) = Curses_Err then + AttrChar_To_Chtype (Ch)) = Curses_Err then raise Curses_Exception; end if; end Insert; @@ -1597,7 +1636,7 @@ package body Terminal_Interface.Curses is Str : in String; Len : in Integer := -1) is - type Char_Ptr is access all Interfaces.C.Char; + type Char_Ptr is access all Interfaces.C.char; function Winsnstr (Win : Window; Str : Char_Ptr; Len : Integer := -1) return C_Int; @@ -1619,7 +1658,7 @@ package body Terminal_Interface.Curses is Str : in String; Len : in Integer := -1) is - type Char_Ptr is access all Interfaces.C.Char; + type Char_Ptr is access all Interfaces.C.char; function Mvwinsnstr (Win : Window; Line : C_Int; Column : C_Int; @@ -1784,7 +1823,7 @@ package body Terminal_Interface.Curses is Text : in String; Fmt : in Label_Justification := Left) is - type Char_Ptr is access all Interfaces.C.Char; + type Char_Ptr is access all Interfaces.C.char; function Slk_Set (Label : C_Int; Txt : Char_Ptr; Fmt : C_Int) return C_Int; @@ -1873,9 +1912,9 @@ package body Terminal_Interface.Curses is (Attr : in Character_Attribute_Set; On : in Boolean := True) is - function Slk_Attron (Ch : C_Int) return C_Int; + function Slk_Attron (Ch : C_Chtype) return C_Int; pragma Import (C, Slk_Attron, "slk_attron"); - function Slk_Attroff (Ch : C_Int) return C_Int; + function Slk_Attroff (Ch : C_Chtype) return C_Int; pragma Import (C, Slk_Attroff, "slk_attroff"); Err : C_Int; @@ -1884,9 +1923,9 @@ package body Terminal_Interface.Curses is Color => Color_Pair'First); begin if On then - Err := Slk_Attron (Chtype_To_CInt (Ch)); + Err := Slk_Attron (AttrChar_To_Chtype (Ch)); else - Err := Slk_Attroff (Chtype_To_CInt (Ch)); + Err := Slk_Attroff (AttrChar_To_Chtype (Ch)); end if; if Err = Curses_Err then raise Curses_Exception; @@ -1897,46 +1936,58 @@ package body Terminal_Interface.Curses is (Attr : in Character_Attribute_Set := Normal_Video; Color : in Color_Pair := Color_Pair'First) is - function Slk_Attrset (Ch : C_Int) return C_Int; + 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 (Chtype_To_CInt (Ch)) = Curses_Err then + 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_Int; + function Slk_Attr return C_Chtype; pragma Import (C, Slk_Attr, "slk_attr"); - Attr : constant C_Int := Slk_Attr; + Attr : constant C_Chtype := Slk_Attr; begin - return CInt_To_Chtype (Attr).Attr; + 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_Int; + function Slk_Attr return C_Chtype; pragma Import (C, Slk_Attr, "slk_attr"); - Attr : constant C_Int := Slk_Attr; + Attr : constant C_Chtype := Slk_Attr; begin - return CInt_To_Chtype (Attr).Color; + 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 : C_Int) return C_Int; + On_Off : Curses_Bool) return C_Int; pragma Import (C, Keyok, "keyok"); begin - if Keyok (C_Int (Key), Boolean'Pos (Enable)) = Curses_Err then + if Keyok (C_Int (Key), Curses_Bool (Boolean'Pos (Enable))) + = Curses_Err then raise Curses_Exception; end if; end Enable_Key; @@ -1944,7 +1995,7 @@ package body Terminal_Interface.Curses is procedure Define_Key (Definition : in String; Key : in Special_Key_Code) is - type Char_Ptr is access all Interfaces.C.Char; + type Char_Ptr is access all Interfaces.C.char; function Defkey (Def : Char_Ptr; Key : C_Int) return C_Int; pragma Import (C, Defkey, "define_key"); @@ -1961,18 +2012,18 @@ package body Terminal_Interface.Curses is procedure Un_Control (Ch : in Attributed_Character; Str : out String) is - function Unctrl (Ch : C_Int) return chars_ptr; + function Unctrl (Ch : C_Chtype) return chars_ptr; pragma Import (C, Unctrl, "unctrl"); begin - Fill_String (Unctrl (Chtype_To_CInt (Ch)), Str); + 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_Int) return chars_ptr; + function Unctrl (Ch : C_Chtype) return chars_ptr; pragma Import (C, Unctrl, "unctrl"); begin - return Fill_String (Unctrl (Chtype_To_CInt (Ch))); + return Fill_String (Unctrl (AttrChar_To_Chtype (Ch))); end Un_Control; procedure Delay_Output (Msecs : in Natural) @@ -2021,10 +2072,10 @@ package body Terminal_Interface.Curses is function Has_Insert_Character return Boolean is - function Has_Ic return C_Int; + function Has_Ic return Curses_Bool; pragma Import (C, Has_Ic, "has_ic"); begin - if Has_Ic = Curses_False then + if Has_Ic = Curses_Bool_False then return False; else return True; @@ -2033,10 +2084,10 @@ package body Terminal_Interface.Curses is function Has_Insert_Line return Boolean is - function Has_Il return C_Int; + function Has_Il return Curses_Bool; pragma Import (C, Has_Il, "has_il"); begin - if Has_Il = Curses_False then + if Has_Il = Curses_Bool_False then return False; else return True; @@ -2045,10 +2096,10 @@ package body Terminal_Interface.Curses is function Supported_Attributes return Character_Attribute_Set is - function Termattrs return C_Int; + function Termattrs return C_Chtype; pragma Import (C, Termattrs, "termattrs"); - Ch : constant Attributed_Character := CInt_To_Chtype (Termattrs); + Ch : constant Attributed_Character := Chtype_To_AttrChar (Termattrs); begin return Ch.Attr; end Supported_Attributes; @@ -2128,10 +2179,10 @@ package body Terminal_Interface.Curses is function Has_Colors return Boolean is - function Hascolors return C_Int; + function Hascolors return Curses_Bool; pragma Import (C, Hascolors, "has_colors"); begin - if Hascolors = Curses_False then + if Hascolors = Curses_Bool_False then return False; else return True; @@ -2157,10 +2208,10 @@ package body Terminal_Interface.Curses is function Can_Change_Color return Boolean is - function Canchangecolor return C_Int; + function Canchangecolor return Curses_Bool; pragma Import (C, Canchangecolor, "can_change_color"); begin - if Canchangecolor = Curses_False then + if Canchangecolor = Curses_Bool_False then return False; else return True; @@ -2340,12 +2391,12 @@ package body Terminal_Interface.Curses is type Int_Access is access all C_Int; function Transform (W : Window; Y, X : Int_Access; - Dir : C_Int) return C_Int; - pragma Import (C, Transform, "_nc_ada_coord_transform"); + 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 : C_Int := 0; + D : Curses_Bool := Curses_Bool_False; R : C_Int; begin if Dir = To_Screen then diff --git a/Ada95/ada_include/terminal_interface.ads b/Ada95/src/terminal_interface.ads similarity index 96% rename from Ada95/ada_include/terminal_interface.ads rename to Ada95/src/terminal_interface.ads index 18e254d0..89544bb0 100644 --- a/Ada95/ada_include/terminal_interface.ads +++ b/Ada95/src/terminal_interface.ads @@ -33,10 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.8 $ --- Binding Version 00.93 +-- $Revision: 1.10 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface is pragma Pure (Terminal_Interface); diff --git a/INSTALL b/INSTALL index b7504674..5033c44b 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,4 @@ --- $Id: INSTALL,v 1.28 1998/02/12 23:43:24 tom Exp $ +-- $Id: INSTALL,v 1.33 1999/09/18 23:04:36 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -195,12 +195,17 @@ INSTALLATION PROCEDURE: 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 need to have c++ (and its libraries) installed before you can + panels. You must have c++ (and its libraries) installed before you can compile and run the demo. - If you do not have C++, you must use the --without-cxx option to tell - the configure script to not attempt to build the C++ bindings. + 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++. + 7. If you're running an older Linux, you must either (a) tell Linux that the console terminal type is `linux' or (b) make a link to or copy of the linux entry in the appropriate place under your terminfo directory, named @@ -247,7 +252,12 @@ IF YOU ARE A SYSTEM INTEGRATOR: 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/read_termcap.c for details. + 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: @@ -275,8 +285,7 @@ IF YOU ARE A SYSTEM INTEGRATOR: term(7) manual page included with this distribution for more on conventions for choosing type names. - Here are our recommended primary console names for the most important - freeware UNIX distributions: + Here are some recommended primary console names: linux -- Linux console driver freebsd -- FreeBSD @@ -294,7 +303,8 @@ RECENT XTERM VERSIONS 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 entry, which adds ANSI color + 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 @@ -468,8 +478,8 @@ an offset of -11 lines. BUGS: Send any feedback to the ncurses mailing list at - ncurses@bsdi.com. To subscribe send mail to - ncurses-request@mailgate.bsdi.com with body that reads: + 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 misc directory includes some guidelines diff --git a/MANIFEST b/MANIFEST index 5dc59fae..a69adea6 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2,62 +2,10 @@ ./Ada95/Makefile.in ./Ada95/README ./Ada95/TODO -./Ada95/ada_include/Makefile.in -./Ada95/ada_include/terminal_interface-curses-aux.adb -./Ada95/ada_include/terminal_interface-curses-aux.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types-alpha.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_types-alpha.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types-alphanumeric.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_types-alphanumeric.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration-ada.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration-ada.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_types-enumeration.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types-intfield.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_types-intfield.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types-ipv4_address.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_types-ipv4_address.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types-numeric.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_types-numeric.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types-regexp.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_types-regexp.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types-user-choice.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_types-user-choice.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types-user.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_types-user.ads -./Ada95/ada_include/terminal_interface-curses-forms-field_types.adb -./Ada95/ada_include/terminal_interface-curses-forms-field_user_data.adb -./Ada95/ada_include/terminal_interface-curses-forms-form_user_data.adb -./Ada95/ada_include/terminal_interface-curses-forms.adb -./Ada95/ada_include/terminal_interface-curses-menus-item_user_data.adb -./Ada95/ada_include/terminal_interface-curses-menus-menu_user_data.adb -./Ada95/ada_include/terminal_interface-curses-menus.adb -./Ada95/ada_include/terminal_interface-curses-mouse.adb -./Ada95/ada_include/terminal_interface-curses-panels-user_data.adb -./Ada95/ada_include/terminal_interface-curses-panels.adb -./Ada95/ada_include/terminal_interface-curses-text_io-aux.adb -./Ada95/ada_include/terminal_interface-curses-text_io-aux.ads -./Ada95/ada_include/terminal_interface-curses-text_io-complex_io.adb -./Ada95/ada_include/terminal_interface-curses-text_io-complex_io.ads -./Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.adb -./Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.ads -./Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.adb -./Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.ads -./Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.adb -./Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.ads -./Ada95/ada_include/terminal_interface-curses-text_io-float_io.adb -./Ada95/ada_include/terminal_interface-curses-text_io-float_io.ads -./Ada95/ada_include/terminal_interface-curses-text_io-integer_io.adb -./Ada95/ada_include/terminal_interface-curses-text_io-integer_io.ads -./Ada95/ada_include/terminal_interface-curses-text_io-modular_io.adb -./Ada95/ada_include/terminal_interface-curses-text_io-modular_io.ads -./Ada95/ada_include/terminal_interface-curses-text_io.adb -./Ada95/ada_include/terminal_interface-curses-text_io.ads -./Ada95/ada_include/terminal_interface-curses.adb -./Ada95/ada_include/terminal_interface.ads ./Ada95/gen/Makefile.in ./Ada95/gen/gen.c ./Ada95/gen/normal.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 @@ -69,131 +17,152 @@ ./Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 ./Ada95/gen/terminal_interface-curses-panels.ads.m4 ./Ada95/gen/terminal_interface-curses.ads.m4 -./Ada95/html/curs_addch.3x.html -./Ada95/html/curs_addchstr.3x.html -./Ada95/html/curs_addstr.3x.html -./Ada95/html/curs_attr.3x.html -./Ada95/html/curs_beep.3x.html -./Ada95/html/curs_bkgd.3x.html -./Ada95/html/curs_border.3x.html -./Ada95/html/curs_clear.3x.html -./Ada95/html/curs_color.3x.html -./Ada95/html/curs_delch.3x.html -./Ada95/html/curs_deleteln.3x.html -./Ada95/html/curs_getch.3x.html -./Ada95/html/curs_getstr.3x.html -./Ada95/html/curs_getyx.3x.html -./Ada95/html/curs_inch.3x.html -./Ada95/html/curs_inchstr.3x.html -./Ada95/html/curs_initscr.3x.html -./Ada95/html/curs_inopts.3x.html -./Ada95/html/curs_insch.3x.html -./Ada95/html/curs_insstr.3x.html -./Ada95/html/curs_instr.3x.html -./Ada95/html/curs_kernel.3x.html -./Ada95/html/curs_mouse.3x.html -./Ada95/html/curs_move.3x.html -./Ada95/html/curs_outopts.3x.html -./Ada95/html/curs_overlay.3x.html -./Ada95/html/curs_pad.3x.html -./Ada95/html/curs_print.3x.html -./Ada95/html/curs_printw.3x.html -./Ada95/html/curs_refresh.3x.html -./Ada95/html/curs_scanw.3x.html -./Ada95/html/curs_scr_dmp.3x.html -./Ada95/html/curs_scroll.3x.html -./Ada95/html/curs_slk.3x.html -./Ada95/html/curs_termattrs.3x.html -./Ada95/html/curs_termcap.3x.html -./Ada95/html/curs_terminfo.3x.html -./Ada95/html/curs_touch.3x.html -./Ada95/html/curs_util.3x.html -./Ada95/html/curs_window.3x.html -./Ada95/html/define_key.3x.html -./Ada95/html/dft_fgbg.3x.html -./Ada95/html/form.3x.html -./Ada95/html/form_cursor.3x.html -./Ada95/html/form_data.3x.html -./Ada95/html/form_driver.3x.html -./Ada95/html/form_field.3x.html -./Ada95/html/form_field_attributes.3x.html -./Ada95/html/form_field_buffer.3x.html -./Ada95/html/form_field_info.3x.html -./Ada95/html/form_field_just.3x.html -./Ada95/html/form_field_new.3x.html -./Ada95/html/form_field_opts.3x.html -./Ada95/html/form_field_userptr.3x.html -./Ada95/html/form_field_validation.3x.html -./Ada95/html/form_fieldtype.3x.html -./Ada95/html/form_hook.3x.html -./Ada95/html/form_new.3x.html -./Ada95/html/form_new_page.3x.html -./Ada95/html/form_opts.3x.html -./Ada95/html/form_page.3x.html -./Ada95/html/form_post.3x.html -./Ada95/html/form_requestname.3x.html -./Ada95/html/form_userptr.3x.html -./Ada95/html/form_win.3x.html +./Ada95/html/ada/files.htm +./Ada95/html/ada/files/T.htm +./Ada95/html/ada/funcs.htm +./Ada95/html/ada/funcs/A.htm +./Ada95/html/ada/funcs/C.htm +./Ada95/html/ada/funcs/E.htm +./Ada95/html/ada/funcs/F.htm +./Ada95/html/ada/funcs/G.htm +./Ada95/html/ada/funcs/I.htm +./Ada95/html/ada/funcs/L.htm +./Ada95/html/ada/funcs/M.htm +./Ada95/html/ada/funcs/N.htm +./Ada95/html/ada/funcs/P.htm +./Ada95/html/ada/funcs/R.htm +./Ada95/html/ada/funcs/S.htm +./Ada95/html/ada/funcs/T.htm +./Ada95/html/ada/funcs/U.htm +./Ada95/html/ada/funcs/V.htm +./Ada95/html/ada/index.htm +./Ada95/html/ada/main.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_types__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm +./Ada95/html/ada/terminal_interface-curses-forms__ads.htm +./Ada95/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm +./Ada95/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm +./Ada95/html/ada/terminal_interface-curses-menus__ads.htm +./Ada95/html/ada/terminal_interface-curses-mouse__ads.htm +./Ada95/html/ada/terminal_interface-curses-panels-user_data__ads.htm +./Ada95/html/ada/terminal_interface-curses-panels__ads.htm +./Ada95/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm +./Ada95/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm +./Ada95/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm +./Ada95/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm +./Ada95/html/ada/terminal_interface-curses-text_io-float_io__ads.htm +./Ada95/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm +./Ada95/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm +./Ada95/html/ada/terminal_interface-curses-text_io__ads.htm +./Ada95/html/ada/terminal_interface-curses__ads.htm +./Ada95/html/ada/terminal_interface__ads.htm ./Ada95/html/index.html -./Ada95/html/keyok.3x.html -./Ada95/html/menu.3x.html -./Ada95/html/menu_attribs.3x.html -./Ada95/html/menu_cursor.3x.html -./Ada95/html/menu_driver.3x.html -./Ada95/html/menu_format.3x.html -./Ada95/html/menu_hook.3x.html -./Ada95/html/menu_items.3x.html -./Ada95/html/menu_mark.3x.html -./Ada95/html/menu_new.3x.html -./Ada95/html/menu_opts.3x.html -./Ada95/html/menu_pattern.3x.html -./Ada95/html/menu_post.3x.html -./Ada95/html/menu_requestname.3x.html -./Ada95/html/menu_spacing.3x.html -./Ada95/html/menu_userptr.3x.html -./Ada95/html/menu_win.3x.html -./Ada95/html/mitem_current.3x.html -./Ada95/html/mitem_name.3x.html -./Ada95/html/mitem_new.3x.html -./Ada95/html/mitem_opts.3x.html -./Ada95/html/mitem_userptr.3x.html -./Ada95/html/mitem_value.3x.html -./Ada95/html/mitem_visible.3x.html -./Ada95/html/ncurses.3x.html -./Ada95/html/panel.3x.html -./Ada95/html/resizeterm.3x.html +./Ada95/html/man/curs_addch.3x.html +./Ada95/html/man/curs_addchstr.3x.html +./Ada95/html/man/curs_addstr.3x.html +./Ada95/html/man/curs_attr.3x.html +./Ada95/html/man/curs_beep.3x.html +./Ada95/html/man/curs_bkgd.3x.html +./Ada95/html/man/curs_border.3x.html +./Ada95/html/man/curs_clear.3x.html +./Ada95/html/man/curs_color.3x.html +./Ada95/html/man/curs_delch.3x.html +./Ada95/html/man/curs_deleteln.3x.html +./Ada95/html/man/curs_getch.3x.html +./Ada95/html/man/curs_getstr.3x.html +./Ada95/html/man/curs_getyx.3x.html +./Ada95/html/man/curs_inch.3x.html +./Ada95/html/man/curs_inchstr.3x.html +./Ada95/html/man/curs_initscr.3x.html +./Ada95/html/man/curs_inopts.3x.html +./Ada95/html/man/curs_insch.3x.html +./Ada95/html/man/curs_insstr.3x.html +./Ada95/html/man/curs_instr.3x.html +./Ada95/html/man/curs_kernel.3x.html +./Ada95/html/man/curs_mouse.3x.html +./Ada95/html/man/curs_move.3x.html +./Ada95/html/man/curs_outopts.3x.html +./Ada95/html/man/curs_overlay.3x.html +./Ada95/html/man/curs_pad.3x.html +./Ada95/html/man/curs_print.3x.html +./Ada95/html/man/curs_printw.3x.html +./Ada95/html/man/curs_refresh.3x.html +./Ada95/html/man/curs_scanw.3x.html +./Ada95/html/man/curs_scr_dmp.3x.html +./Ada95/html/man/curs_scr_dump.3x.html +./Ada95/html/man/curs_scroll.3x.html +./Ada95/html/man/curs_slk.3x.html +./Ada95/html/man/curs_termattrs.3x.html +./Ada95/html/man/curs_termcap.3x.html +./Ada95/html/man/curs_terminfo.3x.html +./Ada95/html/man/curs_touch.3x.html +./Ada95/html/man/curs_util.3x.html +./Ada95/html/man/curs_window.3x.html +./Ada95/html/man/define_key.3x.html +./Ada95/html/man/dft_fgbg.3x.html +./Ada95/html/man/form.3x.html +./Ada95/html/man/form_cursor.3x.html +./Ada95/html/man/form_data.3x.html +./Ada95/html/man/form_driver.3x.html +./Ada95/html/man/form_field.3x.html +./Ada95/html/man/form_field_attributes.3x.html +./Ada95/html/man/form_field_buffer.3x.html +./Ada95/html/man/form_field_info.3x.html +./Ada95/html/man/form_field_just.3x.html +./Ada95/html/man/form_field_new.3x.html +./Ada95/html/man/form_field_opts.3x.html +./Ada95/html/man/form_field_userptr.3x.html +./Ada95/html/man/form_field_validation.3x.html +./Ada95/html/man/form_fieldtype.3x.html +./Ada95/html/man/form_hook.3x.html +./Ada95/html/man/form_new.3x.html +./Ada95/html/man/form_new_page.3x.html +./Ada95/html/man/form_opts.3x.html +./Ada95/html/man/form_page.3x.html +./Ada95/html/man/form_post.3x.html +./Ada95/html/man/form_requestname.3x.html +./Ada95/html/man/form_userptr.3x.html +./Ada95/html/man/form_win.3x.html +./Ada95/html/man/keyok.3x.html +./Ada95/html/man/menu.3x.html +./Ada95/html/man/menu_attribs.3x.html +./Ada95/html/man/menu_cursor.3x.html +./Ada95/html/man/menu_driver.3x.html +./Ada95/html/man/menu_format.3x.html +./Ada95/html/man/menu_hook.3x.html +./Ada95/html/man/menu_items.3x.html +./Ada95/html/man/menu_mark.3x.html +./Ada95/html/man/menu_new.3x.html +./Ada95/html/man/menu_opts.3x.html +./Ada95/html/man/menu_pattern.3x.html +./Ada95/html/man/menu_post.3x.html +./Ada95/html/man/menu_requestname.3x.html +./Ada95/html/man/menu_spacing.3x.html +./Ada95/html/man/menu_userptr.3x.html +./Ada95/html/man/menu_win.3x.html +./Ada95/html/man/mitem_current.3x.html +./Ada95/html/man/mitem_name.3x.html +./Ada95/html/man/mitem_new.3x.html +./Ada95/html/man/mitem_opts.3x.html +./Ada95/html/man/mitem_userptr.3x.html +./Ada95/html/man/mitem_value.3x.html +./Ada95/html/man/mitem_visible.3x.html +./Ada95/html/man/ncurses.3x.html +./Ada95/html/man/panel.3x.html +./Ada95/html/man/resizeterm.3x.html +./Ada95/html/man/wresize.3x.html ./Ada95/html/table.html -./Ada95/html/terminal_interface-curses-forms-field_types-alpha_s.html -./Ada95/html/terminal_interface-curses-forms-field_types-alphanumeric_s.html -./Ada95/html/terminal_interface-curses-forms-field_types-enumeration-ada_s.html -./Ada95/html/terminal_interface-curses-forms-field_types-enumeration_s.html -./Ada95/html/terminal_interface-curses-forms-field_types-intfield_s.html -./Ada95/html/terminal_interface-curses-forms-field_types-ipv4_address_s.html -./Ada95/html/terminal_interface-curses-forms-field_types-numeric_s.html -./Ada95/html/terminal_interface-curses-forms-field_types-regexp_s.html -./Ada95/html/terminal_interface-curses-forms-field_types-user-choice_s.html -./Ada95/html/terminal_interface-curses-forms-field_types-user_s.html -./Ada95/html/terminal_interface-curses-forms-field_types_s.html -./Ada95/html/terminal_interface-curses-forms-field_user_data_s.html -./Ada95/html/terminal_interface-curses-forms-form_user_data_s.html -./Ada95/html/terminal_interface-curses-forms_s.html -./Ada95/html/terminal_interface-curses-menus-item_user_data_s.html -./Ada95/html/terminal_interface-curses-menus-menu_user_data_s.html -./Ada95/html/terminal_interface-curses-menus_s.html -./Ada95/html/terminal_interface-curses-mouse_s.html -./Ada95/html/terminal_interface-curses-panels-user_data_s.html -./Ada95/html/terminal_interface-curses-panels_s.html -./Ada95/html/terminal_interface-curses-text_io-complex_io_s.html -./Ada95/html/terminal_interface-curses-text_io-decimal_io_s.html -./Ada95/html/terminal_interface-curses-text_io-enumeration_io_s.html -./Ada95/html/terminal_interface-curses-text_io-fixed_io_s.html -./Ada95/html/terminal_interface-curses-text_io-float_io_s.html -./Ada95/html/terminal_interface-curses-text_io-integer_io_s.html -./Ada95/html/terminal_interface-curses-text_io-modular_io_s.html -./Ada95/html/terminal_interface-curses-text_io_s.html -./Ada95/html/terminal_interface-curses_s.html -./Ada95/html/terminal_interface_s.html -./Ada95/html/wresize.3x.html ./Ada95/samples/Makefile.in ./Ada95/samples/README ./Ada95/samples/explain.txt @@ -238,12 +207,66 @@ ./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-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.adb +./Ada95/src/terminal_interface.ads ./INSTALL ./MANIFEST ./Makefile.glibc ./Makefile.in +./Makefile.os2 ./NEWS ./README +./README.emx ./README.glibc ./TO-DO ./aclocal.m4 @@ -262,6 +285,7 @@ ./c++/cursesmain.cc ./c++/cursesp.cc ./c++/cursesp.h +./c++/cursespad.cc ./c++/cursesw.cc ./c++/cursesw.h ./c++/cursslk.cc @@ -276,6 +300,7 @@ ./config.sub ./configure ./configure.in +./convert_configure.pl ./dist.mk ./form/Makefile.in ./form/READ.ME @@ -300,7 +325,6 @@ ./form/fld_user.c ./form/form.h ./form/form.priv.h -./form/frm_adabind.c ./form/frm_cursor.c ./form/frm_data.c ./form/frm_def.c @@ -376,7 +400,7 @@ ./man/curs_printw.3x ./man/curs_refresh.3x ./man/curs_scanw.3x -./man/curs_scr_dmp.3x +./man/curs_scr_dump.3x ./man/curs_scroll.3x ./man/curs_slk.3x ./man/curs_termattrs.3x @@ -411,6 +435,7 @@ ./man/form_userptr.3x ./man/form_win.3x ./man/infocmp.1m +./man/keybound.3x ./man/keyok.3x ./man/make_sed.sh ./man/man_db.renames @@ -454,7 +479,6 @@ ./menu/eti.h ./menu/headers ./menu/llib-lmenu -./menu/m_adabind.c ./menu/m_attribs.c ./menu/m_cursor.c ./menu/m_driver.c @@ -486,12 +510,24 @@ ./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/hackguide.doc ./misc/hackguide.html +./misc/makedef.cmd ./misc/makellib +./misc/menu.def +./misc/menu.ref ./misc/ncurses-intro.doc ./misc/ncurses-intro.html +./misc/ncurses.def +./misc/ncurses.ref +./misc/panel.def +./misc/panel.ref ./misc/run_tic.sh ./misc/shlib ./misc/tabset/std @@ -504,139 +540,164 @@ ./mk-1st.awk ./mk-2nd.awk ./mkinstalldirs -./ncurses/MKcaptab.awk -./ncurses/MKexpanded.sh -./ncurses/MKfallback.sh -./ncurses/MKkeyname.awk -./ncurses/MKlib_gen.sh -./ncurses/MKnames.awk -./ncurses/MKunctrl.awk ./ncurses/Makefile.in ./ncurses/README ./ncurses/SigAction.h -./ncurses/alloc_entry.c -./ncurses/captoinfo.c -./ncurses/comp_error.c -./ncurses/comp_expand.c -./ncurses/comp_hash.c -./ncurses/comp_parse.c -./ncurses/comp_scan.c +./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/define_key.c ./ncurses/fifo_defs.h -./ncurses/hardscroll.c -./ncurses/hashmap.c -./ncurses/keyok.c -./ncurses/keys.list -./ncurses/lib_acs.c -./ncurses/lib_adabind.c -./ncurses/lib_addch.c -./ncurses/lib_addstr.c -./ncurses/lib_baudrate.c -./ncurses/lib_beep.c -./ncurses/lib_bkgd.c -./ncurses/lib_box.c -./ncurses/lib_chgat.c -./ncurses/lib_clear.c -./ncurses/lib_clearok.c -./ncurses/lib_clrbot.c -./ncurses/lib_clreol.c -./ncurses/lib_color.c -./ncurses/lib_cur_term.c -./ncurses/lib_data.c -./ncurses/lib_delch.c -./ncurses/lib_delwin.c -./ncurses/lib_dft_fgbg.c -./ncurses/lib_doupdate.c -./ncurses/lib_echo.c -./ncurses/lib_endwin.c -./ncurses/lib_erase.c -./ncurses/lib_flash.c -./ncurses/lib_freeall.c -./ncurses/lib_getch.c -./ncurses/lib_getstr.c -./ncurses/lib_hline.c -./ncurses/lib_immedok.c -./ncurses/lib_inchstr.c -./ncurses/lib_initscr.c -./ncurses/lib_insch.c -./ncurses/lib_insdel.c -./ncurses/lib_insstr.c -./ncurses/lib_instr.c -./ncurses/lib_isendwin.c -./ncurses/lib_kernel.c -./ncurses/lib_leaveok.c -./ncurses/lib_longname.c -./ncurses/lib_mouse.c -./ncurses/lib_move.c -./ncurses/lib_mvcur.c -./ncurses/lib_mvwin.c -./ncurses/lib_napms.c -./ncurses/lib_newterm.c -./ncurses/lib_newwin.c -./ncurses/lib_nl.c -./ncurses/lib_options.c -./ncurses/lib_overlay.c -./ncurses/lib_pad.c -./ncurses/lib_print.c -./ncurses/lib_printw.c -./ncurses/lib_raw.c -./ncurses/lib_redrawln.c -./ncurses/lib_refresh.c -./ncurses/lib_restart.c -./ncurses/lib_scanw.c -./ncurses/lib_screen.c -./ncurses/lib_scroll.c -./ncurses/lib_scrollok.c -./ncurses/lib_scrreg.c -./ncurses/lib_set_term.c -./ncurses/lib_setup.c -./ncurses/lib_slk.c -./ncurses/lib_slkatrof.c -./ncurses/lib_slkatron.c -./ncurses/lib_slkatrset.c -./ncurses/lib_slkattr.c -./ncurses/lib_slkclear.c -./ncurses/lib_slkinit.c -./ncurses/lib_slklab.c -./ncurses/lib_slkrefr.c -./ncurses/lib_slkset.c -./ncurses/lib_slktouch.c -./ncurses/lib_termcap.c -./ncurses/lib_ti.c -./ncurses/lib_touch.c -./ncurses/lib_tparm.c -./ncurses/lib_tputs.c -./ncurses/lib_trace.c -./ncurses/lib_traceatr.c -./ncurses/lib_tracechr.c -./ncurses/lib_tracedmp.c -./ncurses/lib_tracemse.c -./ncurses/lib_tstp.c -./ncurses/lib_twait.c -./ncurses/lib_ungetch.c -./ncurses/lib_vidattr.c -./ncurses/lib_vline.c -./ncurses/lib_wattroff.c -./ncurses/lib_wattron.c -./ncurses/lib_window.c ./ncurses/llib-lncurses -./ncurses/make_keys.c ./ncurses/modules -./ncurses/name_match.c -./ncurses/nc_panel.c -./ncurses/parse_entry.c -./ncurses/read_entry.c -./ncurses/read_termcap.c -./ncurses/resizeterm.c -./ncurses/safe_sprintf.c -./ncurses/sigaction.c -./ncurses/softscroll.c -./ncurses/trace_buf.c -./ncurses/tries.c -./ncurses/vsscanf.c -./ncurses/wresize.c -./ncurses/write_entry.c +./ncurses/tinfo/MKcaptab.awk +./ncurses/tinfo/MKfallback.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/keys.list +./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_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/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/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 ./panel/Makefile.in ./panel/headers ./panel/llib-lpanel @@ -679,15 +740,42 @@ ./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 diff --git a/Makefile.glibc b/Makefile.glibc index 75b54b17..53b35abb 100644 --- a/Makefile.glibc +++ b/Makefile.glibc @@ -1,4 +1,4 @@ -# Copyright (C) 1997 Free Software Foundation, Inc. +# 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 @@ -58,7 +58,6 @@ libform-routines = \ fld_stat \ fld_type \ fld_user \ - frm_adabind \ frm_cursor \ frm_data \ frm_def \ @@ -81,132 +80,153 @@ libform-routines = \ fty_regex libncurses-routines = \ - alloc_entry \ - captoinfo \ + 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 \ - comp_error \ - comp_expand \ - comp_hash \ - comp_parse \ - comp_scan \ - define_key \ expanded \ fallback \ - hardscroll \ - hashmap \ - keyok \ - lib_acs \ - lib_adabind \ - lib_addch \ - lib_addstr \ - lib_baudrate \ - lib_beep \ - lib_bkgd \ - lib_box \ - lib_chgat \ - lib_clear \ - lib_clearok \ - lib_clrbot \ - lib_clreol \ - lib_color \ - lib_cur_term \ - lib_data \ - lib_delch \ - lib_delwin \ - lib_dft_fgbg \ - lib_doupdate \ - lib_echo \ - lib_endwin \ - lib_erase \ - lib_flash \ - lib_freeall \ lib_gen \ - lib_getch \ - lib_getstr \ - lib_hline \ - lib_immedok \ - lib_inchstr \ - lib_initscr \ - lib_insch \ - lib_insdel \ - lib_insstr \ - lib_instr \ - lib_isendwin \ - lib_kernel \ lib_keyname \ - lib_leaveok \ - lib_longname \ - lib_mouse \ - lib_move \ - lib_mvcur \ - lib_mvwin \ - lib_napms \ - lib_newterm \ - lib_newwin \ - lib_nl \ - lib_options \ - lib_overlay \ - lib_pad \ - lib_print \ - lib_printw \ - lib_raw \ - lib_redrawln \ - lib_refresh \ - lib_restart \ - lib_scanw \ - lib_screen \ - lib_scroll \ - lib_scrollok \ - lib_scrreg \ - lib_set_term \ - lib_setup \ - lib_slk \ - lib_slkatrof \ - lib_slkatron \ - lib_slkatrset \ - lib_slkattr \ - lib_slkclear \ - lib_slkinit \ - lib_slklab \ - lib_slkrefr \ - lib_slkset \ - lib_slktouch \ - lib_termcap \ - lib_ti \ - lib_touch \ - lib_tparm \ - lib_tputs \ - lib_trace \ - lib_traceatr \ - lib_tracechr \ - lib_tracedmp \ - lib_tracemse \ - lib_tstp \ - lib_twait \ - lib_ungetch \ - lib_vidattr \ - lib_vline \ - lib_wattroff \ - lib_wattron \ - lib_window \ - name_match \ names \ - nc_panel \ - parse_entry \ - read_entry \ - read_termcap \ - resizeterm \ - safe_sprintf \ - softscroll \ - trace_buf \ - tries \ - unctrl \ - wresize \ - write_entry + 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_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/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 \ + tty/hardscroll \ + tty/hashmap \ + tty/lib_mvcur \ + tty/lib_tstp \ + tty/lib_vidattr \ + tty/lib_twait \ + tty/tty_update \ + unctrl libmenu-routines = \ - m_adabind \ m_attribs \ m_cursor \ m_driver \ @@ -265,15 +285,9 @@ tset-objs = tset.o dump_entry.o extra-objs = $(tic-objs) $(toe-objs) $(infocmp-objs) $(clear-objs) \ $(tput-objs) $(tset-objs) -# mvcur won't compile -test-srcs = tctest thardscroll thashmap \ - blue bs firework firstlast gdc hanoi hashtest knight \ +test-srcs = blue bs cardfile ditto firework firstlast gdc hanoi hashtest knight \ lrtest ncurses newdemo rain tclock testaddch testcurs \ testscanw view worm xmas -mvcur-objs = mvcur.o dump_entry.o -tctest-objs = tctest.o -thardscroll-objs = thardscroll.o -thashmap-objs = thashmap.o hhardscroll.o include ../Rules @@ -308,43 +322,7 @@ endif LDLIBS-tclock = math/libm -tests: $(test-srcs:%=$(objpfx)%) - -$(objpfx)mvcur.d: ncurses/lib_mvcur.c - $(CC) -M $(CFLAGS) $(CPPFLAGS) -DTRACE -DMAIN $? | \ - sed -e 's/^lib_mvcur.o/mvcur.o/' > $@ - -$(objpfx)mvcur.o: ncurses/lib_mvcur.c - $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DMAIN $? - -$(objpfx)tctest.d: ncurses/captoinfo.c - $(CC) -M $(CFLAGS) $(CPPFLAGS) -DTRACE -DMAIN $? | \ - sed -e 's/^captoinfo.o/tctest.o/' > $@ - -$(objpfx)tctest.o: ncurses/captoinfo.c - $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DMAIN $? - -$(objpfx)thardscroll.d: ncurses/hardscroll.c - $(CC) -M $(CFLAGS) $(CPPFLAGS) -DTRACE -DSCROLLDEBUG $? | \ - sed -e 's/^hardscroll.o/thardscroll.o/' > $@ - -$(objpfx)thardscroll.o: ncurses/hardscroll.c - $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DSCROLLDEBUG $? - -$(objpfx)thashmap.d: ncurses/hashmap.c - $(CC) -M $(CFLAGS) $(CPPFLAGS) -DTRACE -DHASHDEBUG $? | \ - sed -e 's/^hashmap.o/thashmap.o/' > $@ - -$(objpfx)thashmap.o: ncurses/hashmap.c - $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DHASHDEBUG $? - -$(objpfx)hhardscroll.o: ncurses/hardscroll.c - $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DHASHDEBUG $? - -$(objpfx)mvcur: $(addprefix $(objpfx),$(mvcur-objs)) -$(objpfx)tctest: $(addprefix $(objpfx),$(tctest-objs)) -$(objpfx)thardscroll: $(addprefix $(objpfx),$(thardscroll-objs)) -$(objpfx)thashmap: $(addprefix $(objpfx),$(thashmap-objs)) +tests: $(test-srcs:%=$(objpfx)%) $(objpfx)clear: $(addprefix $(objpfx),$(clear-objs)) $(objpfx)infocmp: $(addprefix $(objpfx),$(infocmp-objs)) @@ -403,7 +381,7 @@ $(inst_tabsetdir)/std: \ echo installing $$f; \ $(INSTALL_DATA) $$f $(inst_tabsetdir); \ done - + ifeq (no,$(cross-compiling)) subdir_install: $(inst_terminfodir)/v/vt100 diff --git a/Makefile.in b/Makefile.in index 6019d0a3..381ca9e7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.15 1998/02/11 12:13:39 tom Exp $ +# $Id: Makefile.in,v 1.18 1998/08/22 23:45:00 tom Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -51,7 +51,10 @@ includedir = @includedir@ libdir = @libdir@ mandir = @mandir@ -DIRS_TO_MAKE = @DIRS_TO_MAKE@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +DIRS_TO_MAKE = @DIRS_TO_MAKE@ all :: $(DIRS_TO_MAKE) @@ -68,8 +71,14 @@ preinstall : @ echo ' man directory: '$(mandir) @ echo ' terminfo directory: '$(datadir)/terminfo @ echo '' - @ if test "$(includedir)" != "$(prefix)/include" ; then \ - echo '** Include-directory is not in a standard location'; fi + @ 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. diff --git a/Makefile.os2 b/Makefile.os2 new file mode 100644 index 00000000..7a6f56da --- /dev/null +++ b/Makefile.os2 @@ -0,0 +1,235 @@ +################################################################################ +# Wrapper Makefile for ncurses library under OS/2. +################################################################################ +# $Id: Makefile.os2,v 1.8 1998/12/13 02:23:13 tom Exp $ +# +# 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 +# make -f Makefile.os2 CC=gcc HOSTCC=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 = $(INSTALL_PREFIX)$(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 = $(INSTALL_PREFIX)$(datadir)/terminfo +TABSETDIR = $(INSTALL_PREFIX)$(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/NEWS b/NEWS index 5b22ebaf..274f0815 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ --- $Id: NEWS,v 1.316 1998/02/28 23:10:26 tom Exp $ +-- $Id: NEWS,v 1.504 1999/10/24 00:31:05 tom Exp $ This is a log of changes that ncurses has gone through since Zeyd started working with Pavel Curtis' original work, pcurses, in 1992. @@ -6,6 +6,1163 @@ 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. +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 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 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 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 ). @@ -87,7 +1244,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + remove sgr string from qnx terminfo entry since it is reported to turn off attributes inconsistently. -980124 +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' diff --git a/README b/README index cf1ab656..8b8c78ac 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ --- $Id: README,v 1.17 1998/02/15 01:26:47 tom Exp $ +-- $Id: README,v 1.19 1999/10/23 20:39:24 tom Exp $ ------------------------------------------------------------------------------- README file for the ncurses package @@ -18,7 +18,7 @@ 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 is distributed separately). +(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 @@ -114,7 +114,7 @@ Pavel Curtis: Zeyd M. Ben-Halim: port of original to Linux and many enhancements. -Thomas Dickey (maintainer since 1.9.9e): +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 diff --git a/README.emx b/README.emx new file mode 100644 index 00000000..4fa430ab --- /dev/null +++ b/README.emx @@ -0,0 +1,48 @@ +-- $Id: README.emx,v 1.1 1998/11/21 20:13:05 tom Exp $ +-- 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.12). + GNU patch (version 2.5) + +Apply the autoconf patches from + + http://www.clark.net/pub/dickey/autoconf + ftp://ftp.clark.net/pub/dickey/autoconf + +These are ordered by date: + + autoconf-2.12-970309.patch + autoconf-2.12-970429.patch + autoconf-2.12-971222-emx.patch + autoconf-2.12-971222.patch + autoconf-2.12-971230.patch + +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/TO-DO b/TO-DO index 57c87f85..21e8ee0c 100644 --- a/TO-DO +++ b/TO-DO @@ -1,9 +1,12 @@ --- $Id: TO-DO,v 1.38 1997/10/11 14:47:42 tom Exp $ +-- $Id: TO-DO,v 1.39 1998/07/12 00:25:39 tom Exp $ 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. + * XPG4 specifies that the enhanced features are not available unless the _XOPEN_SOURCE_EXTENDED test macro is defined by the application. Ncurses uses this macro (incorrectly) to address a dependency upon wchar_t. The functions diff --git a/aclocal.m4 b/aclocal.m4 index dbc6baa2..b4edb242 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998 Free Software Foundation, Inc. * +dnl Copyright (c) 1998,1999 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1996,1997,1998 dnl -dnl $Id: aclocal.m4,v 1.121 1998/02/11 12:13:40 tom Exp $ +dnl $Id: aclocal.m4,v 1.179 1999/10/23 21:49:25 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl --------------------------------------------------------------------------- @@ -55,6 +55,72 @@ fi AC_SUBST(ACPPFLAGS) ])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_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) +AC_CACHE_VAL(cf_cv_ansi_cc,[ +cf_cv_ansi_cc=no +cf_save_CFLAGS="$CFLAGS" +# 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 \ + "-Aa -D_HPUX_SOURCE +e" \ + "-Aa -D_HPUX_SOURCE" \ + -Xc +do + CFLAGS="$cf_save_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" +]) +AC_MSG_RESULT($cf_cv_ansi_cc) + +if test "$cf_cv_ansi_cc" != "no"; then +if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then + CFLAGS="$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. @@ -63,13 +129,16 @@ 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_MSG_CHECKING([for builtin c++ bool type]) -AC_CACHE_VAL(cf_cv_builtin_bool,[ - AC_TRY_COMPILE([],[bool x = false], - [cf_cv_builtin_bool=1], - [cf_cv_builtin_bool=0]) +AC_MSG_CHECKING([for builtin ifelse(AC_LANG,[C],$CC,$CXX) 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 $cf_cv_builtin_bool = 1 +if test $ifelse($1,,cf_cv_builtin_bool,[$1]) = 1 then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi @@ -79,13 +148,17 @@ 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. AC_DEFUN([CF_BOOL_SIZE], [ -AC_MSG_CHECKING([for size of c++ bool]) +AC_MSG_CHECKING([for size of ifelse(AC_LANG,[C],$CC,$CXX) bool]) AC_CACHE_VAL(cf_cv_type_of_bool,[ rm -f cf_test.out AC_TRY_RUN([ #include #include -#if HAVE_BUILTIN_H +#if HAVE_GXX_BUILTIN_H +#include +#elif HAVE_GPP_BUILTIN_H +#include +#elif HAVE_BUILTIN_H #include #endif main() @@ -93,7 +166,7 @@ main() FILE *fp = fopen("cf_test.out", "w"); if (fp != 0) { bool x = true; - if ((-x) >= 0) + if ((bool)(-x) >= 0) fputs("unsigned ", fp); if (sizeof(x) == sizeof(int)) fputs("int", fp); else if (sizeof(x) == sizeof(char)) fputs("char", fp); @@ -168,47 +241,6 @@ AC_MSG_RESULT($includedir) fi ])dnl dnl --------------------------------------------------------------------------- -dnl Check for data that is usually declared in or -dnl $1 = the name to check -AC_DEFUN([CF_CHECK_ERRNO], -[ -AC_MSG_CHECKING([declaration of $1]) -AC_CACHE_VAL(cf_cv_dcl_$1,[ - AC_TRY_COMPILE([ -#include -#include -#include ], - [long x = (long) $1], - [eval 'cf_cv_dcl_'$1'=yes'], - [eval 'cf_cv_dcl_'$1'=no]')]) -eval 'cf_result=$cf_cv_dcl_'$1 -AC_MSG_RESULT($cf_result) - -# It's possible (for near-UNIX clones) that the data doesn't exist -AC_CACHE_VAL(cf_cv_have_$1,[ -if test $cf_result = no ; then - eval 'cf_result=DECL_'$1 - CF_UPPER(cf_result,$cf_result) - AC_DEFINE_UNQUOTED($cf_result) - AC_MSG_CHECKING([existence of $1]) - AC_TRY_LINK([ -#undef $1 -extern long $1; -], - [$1 = 2], - [eval 'cf_cv_have_'$1'=yes'], - [eval 'cf_cv_have_'$1'=no']) - eval 'cf_result=$cf_cv_have_'$1 - AC_MSG_RESULT($cf_result) -else - eval 'cf_cv_have_'$1'=yes' -fi -]) -eval 'cf_result=HAVE_'$1 -CF_UPPER(cf_result,$cf_result) -eval 'test $cf_cv_have_'$1' = yes && AC_DEFINE_UNQUOTED($cf_result)' -])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],[ @@ -234,7 +266,7 @@ 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). +dnl better job than uname). AC_DEFUN([CF_CHECK_CACHE], [ if test -f $srcdir/config.guess ; then @@ -258,26 +290,99 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])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_CXX_LIBRARY], +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 (I would use AC_CACHE_CHECK here, but it will not work when called in a +dnl loop from CF_SYS_ERRLIST). +dnl +dnl $1 = the name to check +AC_DEFUN([CF_CHECK_ERRNO], [ -cf_cxx_library=unknown -if test $ac_cv_prog_gxx = yes; then - AC_MSG_CHECKING([for libg++]) - cf_save="$LIBS" - LIBS="$LIBS -lg++ -lm" - AC_TRY_LINK([ -#include - ], - [float foo=abs(1.0)], - [cf_cxx_library=yes - CXXLIBS="$CXXLIBS -lg++ -lm"], - [cf_cxx_library=no]) - LIBS="$cf_save" - AC_MSG_RESULT($cf_cxx_library) +AC_MSG_CHECKING(if external $1 is declared) +AC_CACHE_VAL(cf_cv_dcl_$1,[ + AC_TRY_COMPILE([ +#if HAVE_STDLIB_H +#include +#endif +#include +#include +#include ], + [long x = (long) $1], + [eval 'cf_cv_dcl_'$1'=yes'], + [eval 'cf_cv_dcl_'$1'=no]') +]) + +eval 'cf_result=$cf_cv_dcl_'$1 +AC_MSG_RESULT($cf_result) + +if test "$cf_result" = no ; then + eval 'cf_result=DECL_'$1 + CF_UPPER(cf_result,$cf_result) + 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_MSG_CHECKING(if external $1 exists) +AC_CACHE_VAL(cf_cv_have_$1,[ + AC_TRY_LINK([ +#undef $1 +extern $2 $1; +], + [$1 = 2], + [eval 'cf_cv_have_'$1'=yes'], + [eval 'cf_cv_have_'$1'=no'])]) + +eval 'cf_result=$cf_cv_have_'$1 +AC_MSG_RESULT($cf_result) + +if test "$cf_result" = yes ; then + eval 'cf_result=HAVE_'$1 + CF_UPPER(cf_result,$cf_result) + 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_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]) +]) fi +test "$cf_cv_cpp_param_init" = yes && AC_DEFINE(CPP_HAS_PARAM_INIT) ])dnl dnl --------------------------------------------------------------------------- AC_DEFUN([CF_DIRS_TO_MAKE], @@ -301,6 +406,63 @@ 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 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. @@ -324,7 +486,7 @@ cat > conftest.i < conftest.$ac_ext <&AC_FD_CC + echo "checking for $CC $cf_directive" 1>&AC_FD_CC case $cf_attribute in scanf|printf) cat >conftest.h < 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], [ @@ -435,22 +620,68 @@ 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-9]*|[4-9].*) - ac_cv_prog_gnat_correct=yes + cf_cv_prog_gnat_correct=yes ;; *) echo Unsupported GNAT version $cf_cv_gnat_version. Required is 3.10 or better. Disabling Ada95 binding. - ac_cv_prog_gnat_correct=no + 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 changequote([, ])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 -lm" + AC_TRY_LINK([ +#include <$cf_gpp_libname/builtin.h> + ], + [//float foo=abs(1.0); + two_arg_error_handler_t foo2 = lib_error_handler], + [cf_cxx_library=yes + CXXLIBS="$CXXLIBS -l$cf_gpp_libname -lm" + 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 + ], + [//float foo=abs(1.0); + two_arg_error_handler_t foo2 = lib_error_handler], + [cf_cxx_library=yes + CXXLIBS="$CXXLIBS -l$cf_gpp_libname -lm" + 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 @@ -493,6 +724,18 @@ AC_MSG_RESULT($cf_cv_have_isascii) test $cf_cv_have_isascii = yes && AC_DEFINE(HAVE_ISASCII) ])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 + os2) $1='' ;; + *) $1='lib' ;; + esac + LIB_PREFIX=[$]$1 + 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 @@ -525,7 +768,7 @@ do ;; *) #(vi cf_item=`echo $cf_libs_to_make |sed -e s/$LIB_NAME/$TINFO_NAME/g` - cf_libs_to_make="$cf_libs_to_make $cf_item" + cf_libs_to_make="$cf_item $cf_libs_to_make" ;; esac fi @@ -637,10 +880,12 @@ done cat >> Makefile < +#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' + CF_UPPER(cf_FUNC,$cf_func) + AC_DEFINE_UNQUOTED(HAVE_$cf_FUNC)],[ + 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 + ]) +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 :-) +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_MSG_CHECKING([for makeflags variable]) AC_CACHE_VAL(cf_cv_makeflags,[ cf_cv_makeflags='' - for cf_option in '$(MFLAGS)' '-$(MAKEFLAGS)' + for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)' do cat >cf_makeflags.tmp </dev/null` - if test "$cf_result" != "." - then - cf_cv_makeflags=$cf_option + cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/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 - fi + ;; + *) echo no match "$cf_result" + ;; + esac done rm -f cf_makeflags.tmp]) AC_MSG_RESULT($cf_cv_makeflags) AC_SUBST(cf_cv_makeflags) ])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], -[AC_MSG_CHECKING(format of man-pages) +dnl Option to allow user to override automatic configuration of manpage format. +dnl There are several special cases. +AC_DEFUN([CF_MANPAGE_FORMAT], +[ 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], + [cf_manpage_form=$withval], + [cf_manpage_form=unknown]) + +case ".$cf_manpage_form" 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}:" - cf_form=unknown + cf_manpage_form=unknown for cf_dir in $MANPATH; do test -z "$cf_dir" && cf_dir=/usr/man - cf_rename="" - cf_format=no changequote({{,}})dnl for cf_name in $cf_dir/*/date.[01]* $cf_dir/*/date changequote([,])dnl @@ -888,41 +1203,97 @@ changequote([,])dnl cf_test=`echo $cf_name | sed -e 's/*//'` if test "x$cf_test" = "x$cf_name" ; then case "$cf_name" in - *.gz) cf_form=gzip; cf_name=`basename $cf_name .gz`;; - *.Z) cf_form=compress; cf_name=`basename $cf_name .Z`;; - *.0) cf_form=BSDI; cf_format=yes;; - *) cf_form=cat;; + *.gz) cf_manpage_form=gzip;; + *.Z) cf_manpage_form=compress;; + *.0) cf_manpage_form=BSDI,formatted;; + *) cf_manpage_form=normal;; esac break fi done - if test "$cf_form" != "unknown" ; then + if test "$cf_manpage_form" != "unknown" ; then break fi done IFS="$ac_save_ifs" - if test "$prefix" = "NONE" ; then - cf_prefix="$ac_default_prefix" + ;; +.*) # (vi + AC_MSG_WARN(Unexpected manpage-format) + ;; +esac + +AC_MSG_RESULT($cf_manpage_form) +])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], + [cf_manpage_renames=$withval], + [cf_manpage_renames=yes]) + +case ".$cf_manpage_renames" in #(vi +.no) #(vi + ;; +.|.yes) + # Debian 'man' program? + if test -f /etc/debian_version ; then + cf_manpage_renames=`cd $srcdir && pwd`/man/man_db.renames else - cf_prefix="$prefix" + cf_manpage_renames=no fi + ;; +esac - # Debian 'man' program? - test -f /etc/debian_version && \ - cf_rename=`cd $srcdir && pwd`/man/man_db.renames +if test "$cf_manpage_renames" != no ; then + if test ! -f $cf_manpage_renames ; then + AC_MSG_ERROR(not a filename: $cf_manpage_renames) + fi test ! -d man && mkdir man # Construct a sed-script to perform renaming within man-pages - if test -n "$cf_rename" ; then - $srcdir/man/make_sed.sh $cf_rename >man/edit_man.sed + if test -n "$cf_manpage_renames" ; then + test ! -d man && mkdir man + $srcdir/man/make_sed.sh $cf_manpage_renames >man/edit_man.sed fi - if test $cf_format = yes ; then - cf_subdir='$mandir/cat' +fi + +AC_MSG_RESULT($cf_manpage_renames) +])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 + + if test "$prefix" = "NONE" ; then + cf_prefix="$ac_default_prefix" else - cf_subdir='$mandir/man' + cf_prefix="$prefix" fi + case "$cf_manpage_form" 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 <\$TMP CF_EOF else cat >>man/edit_man.sh <>man/edit_man.sh <\$TMP CF_EOF fi -if test \$verb = installing ; then if test $cf_format = yes ; then cat >>man/edit_man.sh <\$TMP.out mv \$TMP.out \$TMP CF_EOF fi -fi -case "$cf_form" in -compress) +case "$cf_manpage_form" in #(vi +*compress*) #(vi 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 </dev/null ) -then - echo "$2 is unchanged" - rm -f $1 -else - echo "creating $2" - rm -f $2 - mv $1 $2 -fi +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 workaround autoconf's +dnl delayed evaluation of those symbols. +AC_DEFUN([CF_PATH_SYNTAX],[ +case ".[$]$1" in #(vi +./*) #(vi + ;; +.\[$]{*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@` + ;; +*) + AC_ERROR(expected a pathname) + ;; +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 -D__ST_MT_ERRNO__" + CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__" + LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"` + PROG_EXT=".exe" + ;; +cygwin*) + PROG_EXT=".exe" + ;; +esac +AC_SUBST(PROG_EXT) ])dnl dnl --------------------------------------------------------------------------- dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the @@ -1103,55 +1498,10 @@ case $cf_cv_regex in esac ])dnl dnl --------------------------------------------------------------------------- -dnl This bypasses the normal autoconf process because we're generating an -dnl arbitrary number of NEED_xxxx definitions with the CF_HAVE_FUNCS macro. -dnl Rather than populate an aclocal.h file with all of those definitions, we do -dnl it here. -dnl -dnl Parameters: -dnl $1 = input, which configure has done substitutions upon (will delete) -dnl $2 = target file -dnl $3 = preamble, if any (a 'here' document) -dnl $4 = trailer, if any (a 'here' document) -dnl -AC_DEFUN([CF_SED_CONFIG_H],[ -cf_config_h=conf$$ -rm -f $cf_config_h -## PREAMBLE -ifelse($3,,[ -echo '/* generated by configure-script */' >$cf_config_h -],[cat >$cf_config_h <$cf_config_h - $ac_cv_path_TD_CONFIG $1 |egrep '^#' | sort >>$cf_config_h -else -grep -v '^ -D' $1 >>$cf_config_h -changequote(,)dnl -sed -e '/^ -D/!d' \ - -e '/^# /d' \ - -e 's/ -D/\ -#define /g' \ - -e 's/\(#define [A-Za-z_][A-Za-z0-9_]*\)=/\1 /g' \ - -e 's@\\@@g' \ - $1 | sort >>$cf_config_h -changequote([,])dnl -fi -## TRAILER -ifelse($4,,, -[cat >>$cf_config_h < -#if HAVE_TERMIOS_H -#include -#endif], - [speed_t x = 0], - [cf_cv_type_speed_t=yes], - [cf_cv_type_speed_t=no]) - ]) -AC_MSG_RESULT($cf_cv_type_speed_t) -test $cf_cv_type_speed_t != yes && AC_DEFINE(speed_t,unsigned) +AC_MSG_CHECKING(for speed_t) +OSPEED_INCLUDES= +AC_TRY_COMPILE([#include ], + [speed_t some_variable = 0], + [OSPEED_TYPE=speed_t], + [OSPEED_TYPE=unsigned]) +AC_TRY_COMPILE([#include ], + [speed_t some_variable = 0], + [OSPEED_TYPE=speed_t + OSPEED_INCLUDES="#include "],[]) +AC_SUBST(OSPEED_TYPE) +AC_SUBST(OSPEED_INCLUDES) +if test "$OSPEED_TYPE" = "unsigned" ; then + AC_MSG_RESULT(no) + AC_DEFINE(speed_t,unsigned) +else + AC_MSG_RESULT(yes) +fi ])dnl dnl --------------------------------------------------------------------------- dnl For each parameter, test if the source-directory exists, and if it contains @@ -1433,12 +1887,12 @@ do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done SRC_SUBDIRS="$SRC_SUBDIRS misc test" -test $cf_cxx_library != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" +test $cf_with_cxx_binding != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= -if test "$ac_cv_prog_gnat_correct" = yes && test -d $srcdir/Ada95; then +if test "$cf_cv_prog_gnat_correct" = yes && test -d $srcdir/Ada95; then SRC_SUBDIRS="$SRC_SUBDIRS Ada95" - ADA_SUBDIRS="gen ada_include samples" + ADA_SUBDIRS="gen src samples" fi SUB_MAKEFILES= @@ -1449,13 +1903,42 @@ done if test -n "$ADA_SUBDIRS"; then for cf_dir in $ADA_SUBDIRS - do + 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 -lm" +AC_TRY_LINK([ +#include ],[ +char buf[80]; +strstreambuf foo(buf, sizeof(buf)) +//destroy foo +], + [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 @@ -1546,8 +2029,9 @@ 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_type_of_bool) +AC_SUBST(cf_cv_type_of_bool)dnl ])dnl dnl --------------------------------------------------------------------------- dnl Check if we can include with ; this breaks on @@ -1741,24 +2225,33 @@ 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 -case ".$withval" in #(vi -./*) #(vi - ;; -.\[$]{*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@` - ;; -*) - AC_ERROR(expected a pathname for $1) - ;; -esac +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 +AC_DEFUN([CF_WITH_PATHLIST],[ +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="${IFS}:" +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" + +eval $3="$cf_dst_path" +AC_SUBST($3)dnl +])dnl diff --git a/announce.html b/announce.html index 611888a5..f87c7c4f 100644 --- a/announce.html +++ b/announce.html @@ -1,18 +1,19 @@ - + -Announcing ncurses 4.2 +Announcing ncurses 5.0 -

                      Announcing ncurses 4.2

                      +

                      Announcing ncurses 5.0

                      -The ncurses (new curses) library is a freeware emulation of System V -Release 4.0 curses. It uses terminfo format, supports pads and color +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.

                      @@ -21,7 +22,7 @@ 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 Linux. It should port easily to +The ncurses code was developed under GNU/Linux. 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 @@ -31,24 +32,170 @@ the library and tools.

                      The ncurses distribution is available via anonymous FTP at the GNU distribution site -ftp://prep.ai.mit.edu/pub/gnu. +ftp://ftp.gnu.org/pub/gnu/ncurses. It is also available at ftp://ftp.clark.net/pub/dickey/ncurses. -

                      Features of ncurses

                      +

                      Release Notes

                      -The ncurses package is fully compatible with SVr4 (System V Release 4) curses:

                      +We decided to release ncurses as a new whole number release (5.0) because it +incorporates several interface changes, including some that would invalidate +existing shared libraries. These are the highlights from the change-log +since ncurses 4.2 release. +

                      +Interface changes: +

                        +
                      • The principal source of changes to the interface comes from the + release of X/Open Curses in 1997. Earlier versions of ncurses (4.0 + and before) were based on a draft version of the specification. The + release version adds parameters to some functions to support the + evolving internationalization of curses. These summarize the impact: +
                          +
                        • modified several prototypes to correspond with 1997 version of + X/Open Curses (affects ABI since developers have used attr_get). + +
                        • 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. + +
                        • 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. + +
                        • 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. + +
                        • reviewed/corrected macros in curses.h as per XSI document. + +
                        • add set_a_attributes and set_pglen_inch to terminfo structure, as per + XSI and Solaris 2.5. +
                        +
                      • The newest version of the X/Open Curses is implemented on Solaris + and other vendor's systems. It adds new features to the terminfo + descriptions: +
                          +
                        • implement tparm %l format. + +
                        • implement tparm printf-style width and precision for %s, %d, %x, %o + as per XSI. +
                        +
                      • We made additional changes to reduce impact by future interface + changes: +
                          +
                        • rename key_names[] array to _nc_key_names since it is not part of + the curses interface. + +
                        • move macro winch to a function, to hide details of struct ldat +
                        +
                      • modify configure script to embed ABI in shared libraries for HP-UX + 10.x (detailed request by Tim Mooney). + +
                      • 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). +
                      +New features: +
                        +
                      • enable sigwinch handler by default. + +
                      • turn on hashmap scrolling code by default + +
                      • improved support for termcap applications +
                          +
                        • modify tput to accept termcap names as an alternative to terminfo + names. + +
                        • provide support for termcap PC variable by copying it from terminfo + data and using it as the padding character in tputs. + +
                        • 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. + +
                        • change name-comparisons in lib_termcap to compare no more than 2 + characters. + +
                        • add configure option --enable-tcap-names, which essentially + allows users to define new capabilities as in termcap. +
                        +
                      • add mouse support to ncurses menus. + +
                      • add mouse and dll support for OS/2 EMX + +
                      • modify terminfo parsing to accept octal and hexadecimal constants + +
                      • 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. + +
                      • 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 -f option to infocmp and tic, which formats the terminfo + if/then/else/endif so that they are readable (with newlines and + tabs). + +
                      • modify tic to compile into %'char' form in preference to %{number}, + since that is a little more efficient. +
                      +Major bug fixes: +
                        +
                      • 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. + +
                      • 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. + +
                      • 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. + +
                      • modify setupterm so that cancelled strings are treated the same as + absent strings, cancelled and absent booleans false (does not affect + tic, infocmp). + +
                      • 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. + +
                      • 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. + +
                      • 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. +
                      + +

                      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 +
                      • 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 +
                      • 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 +
                      • 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. @@ -56,21 +203,19 @@ are bit-for-bit-compatible with the entry format SVr4 curses uses. 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 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, +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 SVr4 curses, ncurses can write to the rightmost-bottommost corner +
                      • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner of the screen if your terminal has an insert-character capability. -
                      • (PC-clone boxes only) Support for access to the IBM PC ROM characters -0-32 through the highlight A_ALTCHARSET.
                      • Ada95 and C++ bindings. -
                      • Support for mouse event reporting under xterm. +
                      • 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. @@ -98,7 +243,7 @@ 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 +
                      • 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). @@ -111,7 +256,7 @@ 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 +
                      • 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 @@ -139,30 +284,37 @@ 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 +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:

                        +including (versions starting with those noted):

                        +
                        cdk +
                        Curses Development Kit +Curses Development Kit +ftp://ftp.clark.net/pub/dickey/cdk.
                        ded
                        directory-editor ftp://ftp.clark.net/pub/dickey/ded.
                        dialog
                        the underlying application used in Slackware's setup, and the basis -for similar applications on Linux. -
                        lynx-2.7 +for similar applications on GNU/Linux. +
                        lynx
                        the character-screen WWW browser
                        Midnight Commander 4.1
                        file manager -
                        mutt 0.88 +
                        mutt
                        mail utility -
                        ncftp 2.0 +
                        ncftp
                        file-transfer utility
                        nvi
                        New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. +
                        tin +
                        newsreader, supporting color, MIME +ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff.
                        taper
                        tape archive utility
                        vh-1.6 @@ -170,11 +322,8 @@ for similar applications on Linux.
                        as well as some that use ncurses for the terminfo support alone:
                        -
                        minicom-1.75 +
                        minicom
                        terminal emulator -
                        tin-unoff -
                        tin 1.4 newsreader, supporting color, MIME -ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff.
                        vile
                        vi-like-emacs ftp://ftp.clark.net/pub/dickey/vile. @@ -192,8 +341,8 @@ HREF="mailto:zmbenhal@netcom.com">Zeyd Ben-Halim and Ongoing work is being done by Thomas Dickey and -Jürgen Pfeifer. -Florian La Roche +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 @@ -217,7 +366,7 @@ Beta versions of ncurses and patches to the current release are made available a
                      • 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 +We need people to help with these projects. If you are interested in working on them, please join the ncurses list.

                      Other Related Resources

                      @@ -232,7 +381,7 @@ not covered in the terminfo file at archive. - @@ -11,8 +11,9 @@

                      Announcing ncurses @VERSION@

                      -The ncurses (new curses) library is a freeware emulation of System V -Release 4.0 curses. It uses terminfo format, supports pads and color +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.

                      @@ -21,7 +22,7 @@ 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 Linux. It should port easily to +The ncurses code was developed under GNU/Linux. 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 @@ -31,24 +32,170 @@ the library and tools.

                      The ncurses distribution is available via anonymous FTP at the GNU distribution site -ftp://prep.ai.mit.edu/pub/gnu. +ftp://ftp.gnu.org/pub/gnu/ncurses. It is also available at ftp://ftp.clark.net/pub/dickey/ncurses. -

                      Features of ncurses

                      +

                      Release Notes

                      -The ncurses package is fully compatible with SVr4 (System V Release 4) curses:

                      +We decided to release ncurses as a new whole number release (5.0) because it +incorporates several interface changes, including some that would invalidate +existing shared libraries. These are the highlights from the change-log +since ncurses 4.2 release. +

                      +Interface changes: +

                        +
                      • The principal source of changes to the interface comes from the + release of X/Open Curses in 1997. Earlier versions of ncurses (4.0 + and before) were based on a draft version of the specification. The + release version adds parameters to some functions to support the + evolving internationalization of curses. These summarize the impact: +
                          +
                        • modified several prototypes to correspond with 1997 version of + X/Open Curses (affects ABI since developers have used attr_get). + +
                        • 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. + +
                        • 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. + +
                        • 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. + +
                        • reviewed/corrected macros in curses.h as per XSI document. + +
                        • add set_a_attributes and set_pglen_inch to terminfo structure, as per + XSI and Solaris 2.5. +
                        +
                      • The newest version of the X/Open Curses is implemented on Solaris + and other vendor's systems. It adds new features to the terminfo + descriptions: +
                          +
                        • implement tparm %l format. + +
                        • implement tparm printf-style width and precision for %s, %d, %x, %o + as per XSI. +
                        +
                      • We made additional changes to reduce impact by future interface + changes: +
                          +
                        • rename key_names[] array to _nc_key_names since it is not part of + the curses interface. + +
                        • move macro winch to a function, to hide details of struct ldat +
                        +
                      • modify configure script to embed ABI in shared libraries for HP-UX + 10.x (detailed request by Tim Mooney). + +
                      • 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). +
                      +New features: +
                        +
                      • enable sigwinch handler by default. + +
                      • turn on hashmap scrolling code by default + +
                      • improved support for termcap applications +
                          +
                        • modify tput to accept termcap names as an alternative to terminfo + names. + +
                        • provide support for termcap PC variable by copying it from terminfo + data and using it as the padding character in tputs. + +
                        • 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. + +
                        • change name-comparisons in lib_termcap to compare no more than 2 + characters. + +
                        • add configure option --enable-tcap-names, which essentially + allows users to define new capabilities as in termcap. +
                        +
                      • add mouse support to ncurses menus. + +
                      • add mouse and dll support for OS/2 EMX + +
                      • modify terminfo parsing to accept octal and hexadecimal constants + +
                      • 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. + +
                      • 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 -f option to infocmp and tic, which formats the terminfo + if/then/else/endif so that they are readable (with newlines and + tabs). + +
                      • modify tic to compile into %'char' form in preference to %{number}, + since that is a little more efficient. +
                      +Major bug fixes: +
                        +
                      • 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. + +
                      • 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. + +
                      • 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. + +
                      • modify setupterm so that cancelled strings are treated the same as + absent strings, cancelled and absent booleans false (does not affect + tic, infocmp). + +
                      • 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. + +
                      • 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. + +
                      • 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. +
                      + +

                      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 +
                      • 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 +
                      • 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 +
                      • 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. @@ -56,21 +203,19 @@ are bit-for-bit-compatible with the entry format SVr4 curses uses. 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 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, +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 SVr4 curses, ncurses can write to the rightmost-bottommost corner +
                      • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner of the screen if your terminal has an insert-character capability. -
                      • (PC-clone boxes only) Support for access to the IBM PC ROM characters -0-32 through the highlight A_ALTCHARSET.
                      • Ada95 and C++ bindings. -
                      • Support for mouse event reporting under xterm. +
                      • 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. @@ -98,7 +243,7 @@ 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 +
                      • 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). @@ -111,7 +256,7 @@ 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 +
                      • 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 @@ -139,30 +284,37 @@ 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 +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:

                        +including (versions starting with those noted):

                        +
                        cdk +
                        Curses Development Kit +Curses Development Kit +ftp://ftp.clark.net/pub/dickey/cdk.
                        ded
                        directory-editor ftp://ftp.clark.net/pub/dickey/ded.
                        dialog
                        the underlying application used in Slackware's setup, and the basis -for similar applications on Linux. -
                        lynx-2.7 +for similar applications on GNU/Linux. +
                        lynx
                        the character-screen WWW browser
                        Midnight Commander 4.1
                        file manager -
                        mutt 0.88 +
                        mutt
                        mail utility -
                        ncftp 2.0 +
                        ncftp
                        file-transfer utility
                        nvi
                        New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. +
                        tin +
                        newsreader, supporting color, MIME +ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff.
                        taper
                        tape archive utility
                        vh-1.6 @@ -170,11 +322,8 @@ for similar applications on Linux.
                        as well as some that use ncurses for the terminfo support alone:
                        -
                        minicom-1.75 +
                        minicom
                        terminal emulator -
                        tin-unoff -
                        tin 1.4 newsreader, supporting color, MIME -ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff.
                        vile
                        vi-like-emacs ftp://ftp.clark.net/pub/dickey/vile. @@ -192,8 +341,8 @@ HREF="mailto:zmbenhal@netcom.com">Zeyd Ben-Halim and Ongoing work is being done by Thomas Dickey and -Jürgen Pfeifer. -Florian La Roche +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 @@ -217,7 +366,7 @@ Beta versions of ncurses and patches to the current release are made available a
                      • 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 +We need people to help with these projects. If you are interested in working on them, please join the ncurses list.

                      Other Related Resources

                      @@ -232,7 +381,7 @@ not covered in the terminfo file at archive. - A Hacker's Guide to Ncurses Internals - + @@ -26,7 +26,6 @@ this one.
                    • How to Design Extensions
                  • Portability and Configuration
                  • Documentation Conventions

                    @@ -65,8 +64,8 @@ package.

                    Objective of the Package

                    -The objective of the ncurses package is to provide a freeware API for -character-cell terminals and terminal emulators with the following +The objective of the ncurses package is to provide a free software API for +character-cell terminals and terminal emulators with the following characteristics:

                      @@ -74,7 +73,7 @@ characteristics:

                      the original BSD curses and System V curses.

                    • Conformant with the XSI Curses standard issued as part of XPG4 by - X/Open. + X/Open.

                    • High-quality -- stable and reliable code, wide portability, good packaging, superior documentation. @@ -136,33 +135,11 @@ not available under POSIX/ANSI, provided only that:

                      in the ncurses API between platforms.

                    -We use GNU autoconf(1) as a tool to deal with portability issues. +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.

                    -

                    If autoconf Fails

                    - -The 'configure' script usually gets your system environment right -automatically. Here are some -D options you might need to compile -with if it fails:

                    -

                    -
                    -DHAVE_UNISTD_H -
                    if <unistd.h> is present -
                    -DHAVE_SIGACTION -
                    if the sigaction function is present -
                    -DHAVE_USLEEP -
                    if the usleep function is present -
                    -DSVR4_ACTION -
                    if (e.g., svr4) you need _POSIX_SOURCE to have sigaction -
                    -DHAVE_TERMIOS_H -
                    if you have <termios.h> -
                    -DHAVE_TERMIO_H -
                    if you have <termio.h>; otherwise it uses <sgtty.h> -
                    -DBROKEN_TIOCGETWINSZ -
                    on SVR4 and HPUX, the get window size ioctl is broken. -
                    -

                    Documentation Conventions

                    There are three kinds of documentation associated with this package. Each @@ -193,7 +170,7 @@ 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 +version from it. Also, of course, it make exporting things like the announcement document to WWW pretty trivial.

                    How to Report Bugs

                    @@ -201,7 +178,7 @@ announcement document to WWW pretty trivial.

                    The reporting address for bugs is bug-ncurses@gnu.org. This is a majordomo list; to join, write -to ncurses-request@gnu.org with a message containing the line: +to bug-ncurses-request@gnu.org with a message containing the line:

                                  subscribe <name>@<host.domain>
                     
                    @@ -210,7 +187,7 @@ 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 +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 @@ -241,7 +218,7 @@ 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 +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.

                    @@ -332,62 +309,160 @@ 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_bkgnd.c, lib_box.c, lib_clear.c, -lib_clrbot.c, lib_clreol.c, lib_data.c, -lib_delch.c, lib_delwin.c, lib_erase.c, -lib_getstr.c, lib_inchstr.c, lib_insch.c, -lib_insdel.c, lib_insstr.c, lib_instr.c, -lib_isendwin.c, lib_keyname.c, lib_move.c, -lib_mvwin.c, lib_overlay.c, lib_pad.c, -lib_printw.c, lib_scanw.c, lib_screen.c, -lib_scroll.c, lib_scrreg.c, lib_set_term.c, -lib_slk.c, lib_touch.c, lib_unctrl.c, and -lib_window.c are all in this category. They are very +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.

                    -The lib_trace.c, lib_traceatr.c, and -lib_tracechr.c file are used only for debugging support. +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, -and read_entry.c. These are likely to need revision only if +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.

                    -The files lib_kernel.c, lib_baudrate.c, lib_raw.c, -lib_tstp.c, and lib_twait.c have serious hooks into -the tty driver and signal facilities. If you run into porting snafus +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 +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 -hashmap.c, hardscroll.c, -lib_addch.c, lib_doupdate.c, lib_mvcur.c, -lib_getch.c, lib_mouse.c, lib_refresh.c, -and lib_setup.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 +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, and parse_entry.c, -read_termcap.c, and write_entry.c. We'll discuss these -in the compiler tour.

                    +

                    +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

                    @@ -456,11 +531,11 @@ 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), +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 +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.

                    @@ -483,7 +558,7 @@ insertion, and deletion operations to make the indices match. It calls 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 +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 @@ -538,8 +613,8 @@ 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. +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).

                    @@ -553,7 +628,7 @@ Translation.

                    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 +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 @@ -564,7 +639,7 @@ 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.

                    +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 @@ -614,7 +689,7 @@ 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 +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.

                    @@ -633,7 +708,7 @@ 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 +The tput and clear utilities just do an entry load followed by a tputs() of a selected capability.

                    Style Tips for Developers

                    @@ -678,7 +753,7 @@ 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 @@ -710,28 +785,28 @@ lib_tparm.c lib_tputs.c lib_unctrl.c lib_window.c -panel.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_endwin.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:

                    @@ -743,7 +818,8 @@ This modules assist in POSIX emulation on non-POSIX systems:

                    The following source files will not be needed for a single-terminal-type port.

                    - +

                    +alloc_entry.c captoinfo.c clear.c comp_captab.c @@ -752,24 +828,23 @@ comp_hash.c comp_main.c comp_parse.c comp_scan.c -alloc_entry.c dump_entry.c +infocmp.c parse_entry.c read_entry.c -write_entry.c -infocmp.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 +
                    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:

                    @@ -777,76 +852,29 @@ 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
                    -	longname()		-- return long name of terminal
                    -lib_acs.c	-- assumes acs_map as a double indirection
                    -	init_acs()		-- initialize acs map
                    -lib_mvcur.c	-- assumes cursor moves have variable cost
                    -	mvcur_init()		-- initialize
                    -	mvcur()			-- do physical cursor move
                    -	mvcur_wrap()		-- wrap
                    -	scrolln()		-- do physical scrolling
                    -lib_termcap.c	-- assumes there may be multiple terminals
                    -	tgetent()		-- load entry
                    -	tgetflag()		-- get boolean capability
                    -	tgetnum()		-- get numeric capability
                    -	tgetstr()		-- get string capability
                    -lib_ti.c	-- assumes there may be multiple terminals
                    -	tigetent()		-- load entry
                    -	tigetflag()		-- get boolean capability
                    -	tigetnum()		-- get numeric capability
                    -	tigetstr()		-- get string capability
                    +
                    +
                    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 - doupdate() -- repaint real screen to match virtual - _nc_outch() -- put out a single character -lib_getch.c -- read() - wgetch() -- get single character - wungetch() -- push back single character -lib_initscr.c -- getenv() - initscr() -- initialize curses functions -lib_newterm.c - newterm() -- set up new terminal screen -lib_baudrate.c - baudrate() -- return the baudrate -lib_kernel.c -- various tty-manipulation and system calls - reset_prog_mode() -- reset ccurses-raw mode - reset_shell_mode() -- reset cooked mode - erasechar() -- return the erase char - killchar() -- return the kill character - flushinp() -- flush pending input - savetty() -- save tty state - resetty() -- reset tty to state at last savetty() -lib_raw.c -- various tty-manipulation calls - raw() - echo() - nl() - qiflush() - cbreak() - noraw() - noecho() - nonl() - noqiflush() - nocbreak() -lib_setup.c -- various tty-manipulation calls - use_env() - setupterm() -lib_restart.c -- various tty-manipulation calls - def_shell_mode() - def_prog_mode() - set_curterm() - del_curterm() -lib_tstp.c -- signal-manipulation calls - _nc_signal_handler() -- enable/disable window-mode signal catching -lib_twait.c -- gettimeofday(), select(). - usleep() -- microsecond sleep - _nc_timed_wait() -- timed wait for input -
                    - -The package kernel could be made smaller.

                    +

                    +
                    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 <esr@snark.thyrsus.com>
                    diff --git a/misc/makedef.cmd b/misc/makedef.cmd new file mode 100644 index 00000000..f3d9740e --- /dev/null +++ b/misc/makedef.cmd @@ -0,0 +1,151 @@ +/* + * $Id: makedef.cmd,v 1.4 1998/11/22 03:14:08 tom Exp $ + * + * Author: Juan Jose Garcia Ripoll . + * Webpage: http://www.arrakis.es/~worm/ + * + * makedef.cmd - update a DLL export list using a newly created library file + * in a.out format, plus an old .DEF file. + * + * standard output gets a sorted list with all entrypoints with entrycodes. + * This list, plus a few .def sentences (LIBRARY, DESCRIPTION and EXPORT) + * is used to build a new .def file. + * + * `_nc_*' symbols are ignored. + * + * returns 1 when the old def_file is corrupted -- that is, export items are + * not properly formatted. + * + * returns 0 if everything went OK. + */ + +parse arg lib_file def_file + +lib_file = translate(lib_file,'\','/') +def_file = translate(def_file,'\','/') + +call CleanQueue + +/* + * `codes' is the stem that links a code to every symbol + * `names' is the stem where symbols are stored sequentially + * `last' is the index of the last symbol defined + */ +last = 0 +used. = 0 +codes. = 0 +names. = '' + +tmp_name = 'foo.tmp' + +/* + * This sed expression cleans empty lines, comments and special .DEF + * commands, such as LIBRARY..., EXPORTS..., etc + */ +tidy_up = '"/^[A-Z]/d;s/[ ][ ]*/ /g;s/;.*$//g;s/^[ ]*//g;/^[ ]*$/d"' + +/* + * First we find all public symbols (functions and variables). Next we + * concatenate this list with the old one, sorting it and wiping out + * all unused data (comments, DLL directives, blanks, etc). All this + * information is pushed into a REXX private list with the RXQUEUE + * utility program. + */ +'@echo off' +'emxexp -u' lib_file '>' tmp_name +'cat' tmp_name def_file '| sed' tidy_up '| sort > foo2.tmp' +'type foo2.tmp | rxqueue' +'del' tmp_name '1>NUL' + +/* + * This loop runs over the queue items + */ +do while queued() > 0 + /* + * We retrieve the symbol name (NEW_NAME) and its number (NEW_NUMBER) + * When the line comes from `emximp's output, there's no number, so + * we assign it the special value 0. + */ + parse pull new_symbol '@'new_code rest + if Left(new_symbol,1) = '"' then + parse var new_symbol '"' new_name '"' rest + else + do + echo 'Symbol 'new_symbol' was not quoted' + new_name = new_symbol + end + + if new_code = '' then + new_code = 0 + /* + * Here, one would place all smart checks that would kill unused symbols. + * However, export tables are not that big, so why bothering? + if Left(new_name,4) = '_nc_' then + iterate + */ + /* + * The algorithm: + * IF (this is the 2nd time the symbol appears) THEN + * (this symbol comes from a .DEF file) + * it has a valid code that we store + * we mark that code as used + * ELIF (it has no number) THEN + * (it's a new symbol) + * we increase the counter of defined symbols + * we assign it the special number 0 + * (later on it'll be assigned an unused export code) + * ELSE + * this symbol was in the old DLL and it's no longer + * here, so we skip it. + */ + select + when new_name = '' then + 'echo Warning: empty symbol found 1>&2' + when names.last = new_name then + do + codes.last = new_code + used.new_code = 1 + end + when new_code = 0 then + do + last = last + 1 + names.last = new_name + codes.last = 0 + end + otherwise + 'echo Warning: symbol "'new_name'" has disappeared 1>&2' + end /* select */ +end /* do while queued() */ + +/* + * Finally we scan the stem, writing out all symbols with export codes. + * Those that did not have a valid one (just 0) are assigned a new one. + */ +new_code = 1 +inx = 1 +do while inx <= last + if codes.inx = 0 then + do + do while used.new_code \= 0 + new_code = new_code + 1 + end + codes.inx = new_code + used.new_code = 1 + end + say ' "'names.inx'" @'codes.inx' NONAME' + inx = inx + 1 +end +'del foo2.tmp 1>NUL' +exit 0 + +/* + * Cleans the REXX queue by pulling and forgetting every line. + * This is needed, at least, when `makedef.cmd' starts, because an aborted + * REXX program might have left some rubbish in. + */ +CleanQueue: procedure + do while queued() > 0 + parse pull foo + end +return + diff --git a/misc/menu.def b/misc/menu.def new file mode 100644 index 00000000..a84e63d1 --- /dev/null +++ b/misc/menu.def @@ -0,0 +1,81 @@ +LIBRARY menu5 INITINSTANCE TERMINSTANCE +DESCRIPTION "NCurses-5-0-990828, module menu" +CODE LOADONCALL +DATA LOADONCALL NONSHARED MULTIPLE +EXPORTS + "_nc_Calculate_Item_Length_and_Width" @11 NONAME + "_nc_Connect_Items" @38 NONAME + "_nc_Default_Item" @63 NONAME + "_nc_Default_Menu" @64 NONAME + "_nc_Disconnect_Items" @65 NONAME + "_nc_Draw_Menu" @66 NONAME + "_nc_Link_Items" @67 NONAME + "_nc_Match_Next_Character_In_Item_Name" @68 NONAME + "_nc_New_TopRow_and_CurrentItem" @69 NONAME + "_nc_Post_Item" @70 NONAME + "_nc_Show_Menu" @71 NONAME + "_nc_menu_cursor_pos" @72 NONAME + "current_item" @2 NONAME + "free_item" @23 NONAME + "free_menu" @24 NONAME + "item_count" @25 NONAME + "item_description" @14 NONAME + "item_index" @26 NONAME + "item_init" @7 NONAME + "item_name" @15 NONAME + "item_opts" @5 NONAME + "item_opts_off" @27 NONAME + "item_opts_on" @28 NONAME + "item_term" @8 NONAME + "item_userptr" @18 NONAME + "item_value" @60 NONAME + "item_visible" @61 NONAME + "menu_back" @20 NONAME + "menu_driver" @29 NONAME + "menu_fore" @21 NONAME + "menu_format" @62 NONAME + "menu_grey" @22 NONAME + "menu_init" @9 NONAME + "menu_items" @1 NONAME + "menu_mark" @16 NONAME + "menu_opts" @6 NONAME + "menu_opts_off" @30 NONAME + "menu_opts_on" @31 NONAME + "menu_pad" @32 NONAME + "menu_pattern" @17 NONAME + "menu_request_by_name" @73 NONAME + "menu_request_name" @74 NONAME + "menu_spacing" @75 NONAME + "menu_sub" @12 NONAME + "menu_term" @10 NONAME + "menu_userptr" @19 NONAME + "menu_win" @13 NONAME + "new_item" @3 NONAME + "new_menu" @4 NONAME + "pos_menu_cursor" @33 NONAME + "post_menu" @34 NONAME + "scale_menu" @35 NONAME + "set_current_item" @36 NONAME + "set_item_init" @37 NONAME + "set_item_opts" @39 NONAME + "set_item_term" @40 NONAME + "set_item_userptr" @41 NONAME + "set_item_value" @42 NONAME + "set_menu_back" @43 NONAME + "set_menu_fore" @44 NONAME + "set_menu_format" @45 NONAME + "set_menu_grey" @46 NONAME + "set_menu_init" @47 NONAME + "set_menu_items" @48 NONAME + "set_menu_mark" @49 NONAME + "set_menu_opts" @50 NONAME + "set_menu_pad" @51 NONAME + "set_menu_pattern" @52 NONAME + "set_menu_spacing" @76 NONAME + "set_menu_sub" @53 NONAME + "set_menu_term" @54 NONAME + "set_menu_userptr" @55 NONAME + "set_menu_win" @56 NONAME + "set_top_row" @57 NONAME + "top_row" @58 NONAME + "unpost_menu" @59 NONAME diff --git a/misc/menu.ref b/misc/menu.ref new file mode 100644 index 00000000..cee964f7 --- /dev/null +++ b/misc/menu.ref @@ -0,0 +1,73 @@ +LIBRARY MENU2 INITINSTANCE +DESCRIPTION 'NCurses 1.9.9e-1 for OS/2 - menu library' +EXPORTS + "menu_items" @1 ;NONAME + "current_item" @2 ;NONAME + "new_item" @3 ;NONAME + + "new_menu" @4 ;NONAME + + "item_opts" @5 ;NONAME + "menu_opts" @6 ;NONAME + + "item_init" @7 ;NONAME + "item_term" @8 ;NONAME + "menu_init" @9 ;NONAME + "menu_term" @10 ;NONAME + + "menu_sub" @12 ;NONAME + "menu_win" @13 ;NONAME + + "item_description" @14 ;NONAME + "item_name" @15 ;NONAME + "menu_mark" @16 ;NONAME + "menu_pattern" @17 ;NONAME + + "item_userptr" @18 ;NONAME + "menu_userptr" @19 ;NONAME + + "menu_back" @20 ;NONAME + "menu_fore" @21 ;NONAME + "menu_grey" @22 ;NONAME + + "free_item" @23 ;NONAME + "free_menu" @24 ;NONAME + "item_count" @25 ;NONAME + "item_index" @26 ;NONAME + "item_opts_off" @27 ;NONAME + "item_opts_on" @28 ;NONAME + "menu_driver" @29 ;NONAME + "menu_opts_off" @30 ;NONAME + "menu_opts_on" @31 ;NONAME + "menu_pad" @32 ;NONAME + "pos_menu_cursor" @33 ;NONAME + "post_menu" @34 ;NONAME + "scale_menu" @35 ;NONAME + "set_current_item" @36 ;NONAME + "set_item_init" @37 ;NONAME + "set_item_opts" @39 ;NONAME + "set_item_term" @40 ;NONAME + "set_item_userptr" @41 ;NONAME + "set_item_value" @42 ;NONAME + "set_menu_back" @43 ;NONAME + "set_menu_fore" @44 ;NONAME + "set_menu_format" @45 ;NONAME + "set_menu_grey" @46 ;NONAME + "set_menu_init" @47 ;NONAME + "set_menu_items" @48 ;NONAME + "set_menu_mark" @49 ;NONAME + "set_menu_opts" @50 ;NONAME + "set_menu_pad" @51 ;NONAME + "set_menu_pattern" @52 ;NONAME + "set_menu_sub" @53 ;NONAME + "set_menu_term" @54 ;NONAME + "set_menu_userptr" @55 ;NONAME + "set_menu_win" @56 ;NONAME + "set_top_row" @57 ;NONAME + "top_row" @58 ;NONAME + "unpost_menu" @59 ;NONAME + + "item_value" @60 ;NONAME + "item_visible" @61 ;NONAME + + "menu_format" @62 ;NONAME diff --git a/misc/ncurses-intro.doc b/misc/ncurses-intro.doc index ada9b08d..e45ca353 100644 --- a/misc/ncurses-intro.doc +++ b/misc/ncurses-intro.doc @@ -2,6 +2,7 @@ Writing Programs with NCURSES by Eric S. Raymond and Zeyd M. Ben-Halim + updates since release 1.9.9e by Thomas Dickey Contents @@ -149,9 +150,9 @@ A Brief History of Curses Scope of This Document - This document describes ncurses, a freeware implementation of the - System V curses API with some clearly marked extensions. It includes - the following System V curses features: + This document describes ncurses, a free implementation of the System V + curses API with some clearly marked extensions. It includes the + following System V curses features: * Support for multiple screen highlights (BSD curses could only handle one `standout' highlight, usually reverse-video). @@ -173,7 +174,7 @@ Scope of This Document This document includes tips for using the mouse. The ncurses package was originated by Pavel Curtis. The original - maintainer of the package is Zeyd Ben-Halim . + maintainer of this package is Zeyd Ben-Halim . Eric S. Raymond wrote many of the new features in versions after 1.8.1 and wrote most of this introduction. Jürgen Pfeifer wrote all of the menu and forms code as well as the Ada95 @@ -513,18 +514,24 @@ static void finish(int sig) Mouse Interfacing - The ncurses library also provides a mouse interface. Note: his - facility is original to ncurses, it is not part of either the XSI - Curses standard, nor of System V Release 4, nor BSD curses. Thus, we - recommend that you wrap mouse-related code in an #ifdef using the - feature macro NCURSES_MOUSE_VERSION so it will not be compiled and - linked on non-ncurses systems. - - Presently, mouse event reporting works only under xterm. In the - future, ncurses will detect the presence of gpm(1), Alessandro - Rubini's freeware mouse server for Linux systems, and accept mouse - reports through it. - + The ncurses library also provides a mouse interface. + + NOTE: this facility is specific to ncurses, it is not part of + either the XSI Curses standard, nor of System V Release 4, nor BSD + curses. System V Release 4 curses contains code with similar + interface definitions, however it is not documented. Other than by + disassembling the library, we have no way to determine exactly how + that mouse code works. Thus, we recommend that you wrap + mouse-related code in an #ifdef using the feature macro + NCURSES_MOUSE_VERSION so it will not be compiled and linked on + non-ncurses systems. + + Presently, mouse event reporting works in the following environments: + * xterm and similar programs such as rxvt. + * Linux console, when configured with gpm(1), Alessandro Rubini's + mouse server. + * OS/2 EMX + The mouse interface is very simple. To activate it, you use the function mousemask(), passing it as first argument a bit-mask that specifies what kinds of events you want your program to be able to @@ -692,8 +699,8 @@ Function Descriptions Debugging - NOTE: These functions are not part of the standard curses API! - + NOTE: These functions are not part of the standard curses API! + trace() This function can be used to explicitly set a trace level. If the trace level is nonzero, execution of your program will @@ -735,13 +742,13 @@ Hints, Tips, and Tricks likely to hurt your application's usability with other curses libraries. - Bear in mind that refresh() is a synonym for wrefresh(stdscr), and - don't try to mix use of stdscr with use of windows declared by - newwin(); a refresh() call will blow them off the screen. The right - way to handle this is to use subwin(), or not touch stdscr at all and - tile your screen with declared windows which you then wnoutrefresh() - somewhere in your program event loop, with a single doupdate() call to - trigger actual repainting. + Bear in mind that refresh() is a synonym for wrefresh(stdscr). Don't + try to mix use of stdscr with use of windows declared by newwin(); a + refresh() call will blow them off the screen. The right way to handle + this is to use subwin(), or not touch stdscr at all and tile your + screen with declared windows which you then wnoutrefresh() somewhere + in your program event loop, with a single doupdate() call to trigger + actual repainting. You are much less likely to run into problems if you design your screen layouts to use tiled rather than overlapping windows. @@ -749,16 +756,16 @@ Hints, Tips, and Tricks fragile, and poorly documented. The ncurses library is not yet an exception to this rule. - There is a freeware panels library included in the ncurses - distribution that does a pretty good job of strengthening the - overlapping-windows facilities. + There is a panels library included in the ncurses distribution that + does a pretty good job of strengthening the overlapping-windows + facilities. Try to avoid using the global variables LINES and COLS. Use getmaxyx() on the stdscr context instead. Reason: your code may be ported to run in an environment with window resizes, in which case several screens could be open with different sizes. - Temporarily Leaving ncurses Mode + Temporarily Leaving NCURSES Mode Sometimes you will want to write a program that spends most of its time in screen mode, but occasionally returns to ordinary `cooked' @@ -783,18 +790,30 @@ Hints, Tips, and Tricks addstr("returned.\n"); /* prepare return message */ refresh(); /* restore save modes, repaint screen */ - Using ncurses Under xterm + Using NCURSES under XTERM A resize operation in X sends SIGWINCH to the application running - under xterm. The ncurses library does not catch this signal, because - it cannot in general know how you want the screen re-painted. You will - have to write the SIGWINCH handler yourself. + under xterm. The ncurses library provides an experimental signal + handler, but in general does not catch this signal, because it cannot + know how you want the screen re-painted. You will usually have to + write the SIGWINCH handler yourself. Ncurses can give you some help. The easiest way to code your SIGWINCH handler is to have it do an endwin, followed by an refresh and a screen repaint you code yourself. The refresh will pick up the new screen size from the xterm's environment. + That is the standard way, of course (it even works with some vendor's + curses implementations). Its drawback is that it clears the screen to + reinitialize the display, and does not resize subwindows which must be + shrunk. Ncurses provides an extension which works better, the + resizeterm function. That function ensures that all windows are + limited to the new screen dimensions, and pads stdscr with blanks if + the screen is larger. + + Finally, ncurses can be configured to provide its own SIGWINCH + handler, based on resizeterm. + Handling Multiple Terminal Screens The initscr() function actually calls a function named newterm() to do @@ -828,14 +847,25 @@ Hints, Tips, and Tricks Try to make attribute changes infrequent on your screens. Don't use the immedok() option! - Special Features of ncurses + Special Features of NCURSES - When running on PC-clones, ncurses has enhanced support for the IBM - high-half and ROM characters. The A_ALTCHARSET highlight, enables - display of both high-half ACS graphics and the PC ROM graphics 0-31 - that are normally interpreted as control characters. + The wresize() function allows you to resize a window in place. The + associated resizeterm() function simplifies the construction of + SIGWINCH handlers, for resizing all windows. + + The define_key() function allows you to define at runtime function-key + control sequences which are not in the terminal description. The + keyok() function allows you to temporarily enable or disable + interpretation of any function-key control sequence. + + The use_default_colors() function allows you to construct applications + which can use the terminal's default foreground and background colors + as an additional "default" color. Several terminal emulators support + this feature, which is based on ISO 6429. - The wresize() function allows you to resize a window in place. + Ncurses supports up 16 colors, unlike SVr4 curses which defines only + 8. While most terminals which provide color allow only 8 colors, about + a quarter (including XFree86 xterm) support 16 colors. Compatibility with Older Versions @@ -940,7 +970,7 @@ XSI Curses Conformance panels library. The panel library first appeared in AT&T System V. The version - documented here is the freeware panel code distributed with ncurses. + documented here is the panel code distributed with ncurses. Compiling With the Panels Library @@ -1044,7 +1074,7 @@ Miscellaneous Other Facilities flexible interface. The menu library first appeared in AT&T System V. The version - documented here is the freeware menu code distributed with ncurses. + documented here is the menu code distributed with ncurses. Compiling With the menu Library @@ -1236,7 +1266,7 @@ Miscellaneous Other Features of on-screen forms for data entry and program control. The form library first appeared in AT&T System V. The version - documented here is the freeware form code distributed with ncurses. + documented here is the form code distributed with ncurses. Compiling With the form Library @@ -1408,7 +1438,7 @@ int field_info(FIELD *field, /* field from which to fetch */ Changing the Field Location - If is possible to move a field's location on the screen: + It is possible to move a field's location on the screen: int move_field(FIELD *field, /* field to alter */ int top, int left); /* new upper-left corner */ diff --git a/misc/ncurses-intro.html b/misc/ncurses-intro.html index a2e01492..d01c65e6 100644 --- a/misc/ncurses-intro.html +++ b/misc/ncurses-intro.html @@ -1,6 +1,6 @@ - + @@ -13,6 +13,7 @@
                    by Eric S. Raymond and Zeyd M. Ben-Halim
                    +updates since release 1.9.9e by Thomas Dickey

                    Contents

                    @@ -52,7 +53,7 @@ by Eric S. Raymond and Zeyd M. Ben-Halim
                  • Hints, Tips, and Tricks
                    • Some Notes of Caution -
                    • Temporarily Leaving ncurses Mode +
                    • Temporarily Leaving ncurses Mode
                    • Using ncurses under xterm
                    • Handling Multiple Terminal Screens
                    • Testing for Terminal Capabilities @@ -139,7 +140,7 @@ by Eric S. Raymond and Zeyd M. Ben-Halim

                      Introduction

                      -This document is an introduction to programming with curses. It is +This document is an introduction to programming with curses. It is not an exhaustive reference for the curses Application Programming Interface (API); that role is filled by the curses manual pages. Rather, it is intended to help C programmers ease into using the package.

                      @@ -148,7 +149,7 @@ This document is aimed at C applications programmers not yet specifically familiar with ncurses. If you are already an experienced curses programmer, you should nevertheless read the sections on Mouse Interfacing, Debugging, -Compatibility with Older Versions, +Compatibility with Older Versions, and Hints, Tips, and Tricks. These will bring you up to speed on the special features and quirks of the ncurses implementation. If you are not so experienced, keep reading.

                      @@ -189,7 +190,7 @@ more capabilities, going far beyond BSD curses in power and flexibility.

                      Scope of This Document

                      -This document describes ncurses, a freeware implementation of +This document describes ncurses, a free implementation of the System V curses API with some clearly marked extensions. It includes the following System V curses features:

                        @@ -213,20 +214,20 @@ mouse in some environments (notably, xterm under the X window system). This document includes tips for using the mouse.

                        The ncurses package was originated by Pavel Curtis. The original -maintainer of the package is +maintainer of this package is Zeyd Ben-Halim <zmbenhal@netcom.com>. -Eric S. Raymond +Eric S. Raymond <esr@snark.thyrsus.com> -wrote many of the new features in versions after 1.8.1 +wrote many of the new features in versions after 1.8.1 and wrote most of this introduction. -Jürgen Pfeifer -wrote all of the menu and forms code as well as the +Jürgen Pfeifer +wrote all of the menu and forms code as well as the Ada95 binding. Ongoing work is being done by Thomas Dickey and -Jürgen Pfeifer. +Jürgen Pfeifer. Florian La Roche acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. @@ -234,7 +235,7 @@ Contact the current maintainers at bug-ncurses@gnu.org.

                        -This document also describes the panels extension library, +This document also describes the panels extension library, similarly modeled on the SVr4 panels facility. This library allows you to associate backing store with each of a stack or deck of overlapping windows, and provides operations for moving windows around in the stack that change @@ -253,17 +254,17 @@ consistency:

                        window -
                        +
                        A data structure describing a sub-rectangle of the screen (possibly the entire screen). You can write to a window as though it were a miniature screen, scrolling independently of other windows on the physical screen.

                        screens -
                        +
                        A subset of windows which are as large as the terminal screen, i.e., they start at the upper left hand corner and encompass the lower right hand corner. One of these, stdscr, is automatically provided for the programmer.

                        terminal screen -
                        +
                        The package's idea of what the terminal display currently looks like, i.e., what the user sees now. This is a special screen.
                        @@ -384,7 +385,7 @@ capabilities. The curses.h also introduces some #define constants and types of general usefulness: -
                        +
                        bool
                        boolean type, actually a `char' (e.g., bool doneit;)
                        TRUE @@ -587,21 +588,30 @@ is itself a compile-time constant and can be used in initializers.

                        Mouse Interfacing

                        -The ncurses library also provides a mouse interface. Note: -his facility is original to ncurses, it is not part of either +The ncurses library also provides a mouse interface. + +
                        +NOTE: this facility is specific to ncurses, it is not part of either the XSI Curses standard, nor of System V Release 4, nor BSD curses. +System V Release 4 curses contains code with similar interface definitions, +however it is not documented. Other than by disassembling the library, we +have no way to determine exactly how that mouse code works. Thus, we recommend that you wrap mouse-related code in an #ifdef using the feature macro NCURSES_MOUSE_VERSION so it will not be compiled and linked -on non-ncurses systems.

                        - -Presently, mouse event reporting works only under xterm. In the -future, ncurses will detect the presence of gpm(1), Alessandro -Rubini's freeware mouse server for Linux systems, and accept mouse -reports through it.

                        - +on non-ncurses systems. +

                        + +Presently, mouse event reporting works in the following environments: +
                          +
                        • xterm and similar programs such as rxvt. +
                        • Linux console, when configured with gpm(1), Alessandro +Rubini's mouse server. +
                        • OS/2 EMX +
                        +

                        The mouse interface is very simple. To activate it, you use the function mousemask(), passing it as first argument a bit-mask that specifies -what kinds of events you want your program to be able to see. It will +what kinds of events you want your program to be able to see. It will return the bit-mask of events that actually become visible, which may differ from the argument if the mouse device is not capable of reporting some of the event types you specify.

                        @@ -616,13 +626,13 @@ in and make the first one inaccessible).

                        Each call to getmouse() fills a structure (the address of which you'll pass it) with mouse event data. The event data includes zero-origin, screen-relative character-cell coordinates of the mouse pointer. It also -includes an event mask. Bits in this mask will be set, corresponding +includes an event mask. Bits in this mask will be set, corresponding to the event type being reported.

                        The mouse structure contains two additional fields which may be significant in the future as ncurses interfaces to new kinds of pointing device. In addition to x and y coordinates, there is a slot -for a z coordinate; this might be useful with touch-screens that can +for a z coordinate; this might be useful with touch-screens that can return a pressure or duration parameter. There is also a device ID field, which could be used to distinguish between multiple pointing devices.

                        @@ -766,7 +776,10 @@ yourself if need be.

                        Debugging

                        -NOTE: These functions are not part of the standard curses API!

                        + +

                        +NOTE: These functions are not part of the standard curses API! +
                        trace() @@ -780,7 +793,7 @@ in the curses.h file for details. (It is also possible to set a trace level by assigning a trace level value to the environment variable NCURSES_TRACE).
                        _tracef() -
                        +
                        This function can be used to output your own debugging information. It is only available only if you link with -lncurses_g. It can be used the same way as printf(), only it outputs a newline after the end of arguments. @@ -811,8 +824,8 @@ some control bits set before you started your application. Also, they have always been poorly documented, and are likely to hurt your application's usability with other curses libraries.

                        -Bear in mind that refresh() is a synonym for wrefresh(stdscr), -and don't try to mix use of stdscr with use of windows declared +Bear in mind that refresh() is a synonym for wrefresh(stdscr). +Don't try to mix use of stdscr with use of windows declared by newwin(); a refresh() call will blow them off the screen. The right way to handle this is to use subwin(), or not touch stdscr at all and tile your screen with declared @@ -826,7 +839,7 @@ curses support for overlapping windows has been weak, fragile, and poorly documented. The ncurses library is not yet an exception to this rule.

                        -There is a freeware panels library included in the ncurses +There is a panels library included in the ncurses distribution that does a pretty good job of strengthening the overlapping-windows facilities.

                        @@ -835,7 +848,7 @@ Try to avoid using the global variables LINES and COLS. Use your code may be ported to run in an environment with window resizes, in which case several screens could be open with different sizes.

                        -

                        Temporarily Leaving ncurses Mode

                        +

                        Temporarily Leaving NCURSES Mode

                        Sometimes you will want to write a program that spends most of its time in screen mode, but occasionally returns to ordinary `cooked' mode. A common @@ -864,17 +877,30 @@ Here is some sample code for shellout: refresh(); /* restore save modes, repaint screen */ -

                        Using ncurses Under xterm

                        +

                        Using NCURSES under XTERM

                        A resize operation in X sends SIGWINCH to the application running under xterm. -The ncurses library does not catch this signal, because it cannot in -general know how you want the screen re-painted. You will have to write the -SIGWINCH handler yourself.

                        +The ncurses library provides an experimental signal +handler, but in general does not catch this signal, because it cannot +know how you want the screen re-painted. You will usually have to write the +SIGWINCH handler yourself. Ncurses can give you some help.

                        The easiest way to code your SIGWINCH handler is to have it do an endwin, followed by an refresh and a screen repaint you code yourself. The refresh will pick up the new screen size from the -xterm's environment. +xterm's environment.

                        + +That is the standard way, of course (it even works with some vendor's curses +implementations). +Its drawback is that it clears the screen to reinitialize the display, and does +not resize subwindows which must be shrunk. +Ncurses provides an extension which works better, the +resizeterm function. That function ensures that all windows +are limited to the new screen dimensions, and pads stdscr +with blanks if the screen is larger.

                        + +Finally, ncurses can be configured to provide its own SIGWINCH handler, +based on resizeterm.

                        Handling Multiple Terminal Screens

                        @@ -910,14 +936,26 @@ screen-painting of text when you know the text doesn't contain any control characters. Try to make attribute changes infrequent on your screens. Don't use the immedok() option!

                        -

                        Special Features of ncurses

                        +

                        Special Features of NCURSES

                        + +The wresize() function allows you to resize a window in place. +The associated resizeterm() function simplifies the construction +of SIGWINCH handlers, for resizing all windows.

                        + +The define_key() function allows you +to define at runtime function-key control sequences which are not in the +terminal description. +The keyok() function allows you to temporarily +enable or disable interpretation of any function-key control sequence.

                        -When running on PC-clones, ncurses has enhanced support for -the IBM high-half and ROM characters. The A_ALTCHARSET highlight, -enables display of both high-half ACS graphics and the PC ROM graphics -0-31 that are normally interpreted as control characters.

                        +The use_default_colors() function allows you to construct +applications which can use the terminal's default foreground and +background colors as an additional "default" color. +Several terminal emulators support this feature, which is based on ISO 6429.

                        -The wresize() function allows you to resize a window in place.

                        +Ncurses supports up 16 colors, unlike SVr4 curses which defines only 8. +While most terminals which provide color allow only 8 colors, about +a quarter (including XFree86 xterm) support 16 colors.

                        Compatibility with Older Versions

                        @@ -943,7 +981,7 @@ intervals.

                        What happens to the overlapping region depends on what wnoutrefresh() does with its argument -- what portions of the argument window it copies to the virtual screen. Some implementations do "change copy", copying down only -locations in the window that have changed (or been marked changed with +locations in the window that have changed (or been marked changed with wtouchln() and friends). Some implementations do "entire copy", copying all window locations to the virtual screen whether or not they have changed.

                        @@ -978,7 +1016,7 @@ all your updates.

                        Background Erase

                        -If you have been using a very old versions of ncurses (1.8.7 or +If you have been using a very old versions of ncurses (1.8.7 or older) you may be surprised by the behavior of the erase functions. In older versions, erased areas of a window were filled with a blank modified by the window's current attribute (as set by wattrset(), wattron(), @@ -994,7 +1032,7 @@ the XSI Curses standard.

                        XSI Curses Conformance

                        The ncurses library is intended to be base-level conformant with the -XSI Curses standard from X/Open. Many extended-level features (in fact, almost +XSI Curses standard from X/Open. Many extended-level features (in fact, almost all features not directly concerned with wide characters and internationalization) are also supported.

                        @@ -1021,7 +1059,7 @@ visibility stack or pop to the top at runtime, the resulting book-keeping can be tedious and difficult to get right. Hence the panels library.

                        The panel library first appeared in AT&T System V. The -version documented here is the freeware panel code distributed +version documented here is the panel code distributed with ncurses.

                        Compiling With the Panels Library

                        @@ -1132,7 +1170,7 @@ extension that supports easy programming of menu hierarchies with a uniform but flexible interface.

                        The menu library first appeared in AT&T System V. The -version documented here is the freeware menu code distributed +version documented here is the menu code distributed with ncurses.

                        Compiling With the menu Library

                        @@ -1190,7 +1228,7 @@ Both types always have a current item.

                        From a single-valued menu you can read the selected value simply by looking at the current item. From a multi-valued menu, you get the selected set -by looping through the items applying the item_value() +by looping through the items applying the item_value() predicate function. Your menu-processing code can use the function set_item_value() to flag the items in the select set.

                        @@ -1218,9 +1256,9 @@ to display menu items. You can retrieve any format associated with a menu with menu_format(). The default format is rows=16, columns=1.

                        -The actual menu page may be smaller than the format size. This depends +The actual menu page may be smaller than the format size. This depends on the item number and size and whether O_ROWMAJOR is on. This option -(on by default) causes menu items to be displayed in a `raster-scan' +(on by default) causes menu items to be displayed in a `raster-scan' pattern, so that if more than one item will fit horizontally the first couple of items are side-by-side in the top row. The alternative is column-major display, which tries to put the first several items in @@ -1235,7 +1273,7 @@ Each menu has a mark string used to visually tag selected items; see the menu_mark(3x) manual page for details. The mark string length also influences the menu page size.

                        -The function scale_menu() returns the minimum display size +The function scale_menu() returns the minimum display size that the menu code computes from all these factors. There are other menu display attributes including a select attribute, @@ -1283,7 +1321,7 @@ partially displayed.

                        There are explicit requests for scrolling which also change the current item (because the select location does not change, but the -item there does). These are REQ_SCR_DLINE, +item there does). These are REQ_SCR_DLINE, REQ_SCR_ULINE, REQ_SCR_DPAGE, and REQ_SCR_UPAGE.

                        @@ -1303,7 +1341,7 @@ Some requests change the pattern buffer directly: REQ_CLEAR_PATTERN, REQ_BACK_PATTERN, REQ_NEXT_MATCH, REQ_PREV_MATCH. The latter two are useful when pattern buffer input matches more than one item -in a multi-valued menu.

                        +in a multi-valued menu.

                        Each successful scroll or item navigation request clears the pattern buffer. It is also possible to set the pattern buffer explicitly @@ -1342,7 +1380,7 @@ The form library is a curses extension that supports easy programming of on-screen forms for data entry and program control.

                        The form library first appeared in AT&T System V. The -version documented here is the freeware form code distributed +version documented here is the form code distributed with ncurses.

                        Compiling With the form Library

                        @@ -1379,7 +1417,7 @@ form library allows you (the forms designer) to bind each navigation and editing key to any keystroke accepted by curses Fields may have validation conditions on them, so that they check input -data for type and value. The form library supplies a rich set of +data for type and value. The form library supplies a rich set of pre-defined field types, and makes it relatively easy to define new ones.

                        Once its transaction is completed (or aborted), a form may be @@ -1407,7 +1445,7 @@ designed to resemble that of the menu library wherever possible.

                        In forms programs, however, the `process user requests' is somewhat more -complicated than for menus. Besides menu-like navigation operations, +complicated than for menus. Besides menu-like navigation operations, the menu driver loop has to support field editing and data validation.

                        Creating and Freeing Fields and Forms

                        @@ -1415,7 +1453,7 @@ the menu driver loop has to support field editing and data validation.

                        The basic function for creating fields is new_field():

                        -FIELD *new_field(int height, int width,   /* new field size */ 
                        +FIELD *new_field(int height, int width,   /* new field size */
                                          int top, int left,       /* upper left corner */
                                          int offscreen,           /* number of offscreen rows */
                                          int nbuf);               /* number of working buffers */
                        @@ -1434,8 +1472,8 @@ need not be stdscr if you've done an explicit
                         set_form_window() call. 

                        The fifth argument allows you to specify a number of off-screen rows. If -this is zero, the entire field will always be displayed. If it is -nonzero, the form will be scrollable, with only one screen-full (initially +this is zero, the entire field will always be displayed. If it is +nonzero, the form will be scrollable, with only one screen-full (initially the top part) displayed at any given time. If you make a field dynamic and grow it so it will no longer fit on the screen, the form will become scrollable even if the offscreen argument was initially zero.

                        @@ -1519,19 +1557,19 @@ You can retrieve field sizes and locations through:

                         int field_info(FIELD *field,              /* field from which to fetch */
                        -               int *height, *int width,   /* field size */ 
                        +               int *height, *int width,   /* field size */
                                        int *top, int *left,       /* upper left corner */
                                        int *offscreen,            /* number of offscreen rows */
                                        int *nbuf);                /* number of working buffers */
                         
                        -This function is a sort of inverse of new_field(); instead of +This function is a sort of inverse of new_field(); instead of setting size and location attributes of a new field, it fetches them from an existing one.

                        Changing the Field Location

                        -If is possible to move a field's location on the screen:

                        +It is possible to move a field's location on the screen:

                         int move_field(FIELD *field,              /* field to alter */
                        @@ -1569,22 +1607,22 @@ in the field buffer. 

                         int set_field_fore(FIELD *field,          /* field to alter */
                        -                   chtype attr);          /* attribute to set */ 
                        +                   chtype attr);          /* attribute to set */
                         
                         chtype field_fore(FIELD *field);          /* field to query */
                         
                         int set_field_back(FIELD *field,          /* field to alter */
                        -                   chtype attr);          /* attribute to set */ 
                        +                   chtype attr);          /* attribute to set */
                         
                         chtype field_back(FIELD *field);          /* field to query */
                         
                         int set_field_pad(FIELD *field,           /* field to alter */
                        -                 int pad);                /* pad character to set */ 
                        +                 int pad);                /* pad character to set */
                         
                         chtype field_pad(FIELD *field);
                         
                         int set_new_page(FIELD *field,            /* field to alter */
                        -                 int flag);               /* TRUE to force new page */ 
                        +                 int flag);               /* TRUE to force new page */
                         
                         chtype new_page(FIELD *field);            /* field to query */
                         
                        @@ -1604,13 +1642,13 @@ functions:
                         int set_field_opts(FIELD *field,          /* field to alter */
                        -                   int attr);             /* attribute to set */ 
                        +                   int attr);             /* attribute to set */
                         
                         int field_opts_on(FIELD *field,           /* field to alter */
                        -                  int attr);              /* attributes to turn on */ 
                        +                  int attr);              /* attributes to turn on */
                         
                         int field_opts_off(FIELD *field,          /* field to alter */
                        -                   int attr);             /* attributes to turn off */ 
                        +                   int attr);             /* attributes to turn off */
                         
                         int field_opts(FIELD *field);             /* field to query */
                         
                        @@ -1627,19 +1665,19 @@ visited by form navigation keys). Can be used to make labels or derived fields with buffer values alterable by the forms application, not the user.
                        O_PUBLIC
                        Controls whether data is displayed during field entry. If this option is -turned off on a field, the library will accept and edit data in that field, +turned off on a field, the library will accept and edit data in that field, but it will not be displayed and the visible field cursor will not move. You can turn off the O_PUBLIC bit to define password fields.
                        O_EDIT
                        Controls whether the field's data can be modified. When this option is -off, all editing requests except REQ_PREV_CHOICE and +off, all editing requests except REQ_PREV_CHOICE and REQ_NEXT_CHOICE will fail. Such read-only fields may be useful for help messages.
                        O_WRAP
                        Controls word-wrapping in multi-line fields. Normally, when any character of a (blank-separated) word reaches the end of the current line, the entire word is wrapped to the next line (assuming there is one). When this -option is off, the word will be split across the line break. +option is off, the word will be split across the line break.
                        O_BLANK
                        Controls field blanking. When this option is on, entering a character at the first field position erases the entire field (except for the just-entered @@ -1652,7 +1690,7 @@ user's cursor will hang at the end of the field. This option is ignored in dynamic fields that have not reached their size limit.
                        O_NULLOK
                        Controls whether validation is applied to -blank fields. Normally, it is not; the user can leave a field blank +blank fields. Normally, it is not; the user can leave a field blank without invoking the usual validation check on exit. If this option is off on a field, exit from it will invoke a validation check.
                        O_PASSOK @@ -1690,7 +1728,7 @@ form repeatedly, looking for modified fields each time.

                        Calling field_status() on a field not currently selected for input will return a correct value. Calling field_status() on a -field that is currently selected for input may not necessarily give a +field that is currently selected for input may not necessarily give a correct field status value, because entered data isn't necessarily copied to buffer zero before the exit validation check. @@ -1716,7 +1754,7 @@ char *field_userptr(FIELD *field); /* fetch mode of field */ (Properly, this user pointer field ought to have (void *) type. The (char *) type is retained for System V compatibility.)

                        -It is valid to set the user pointer of the default field (with a +It is valid to set the user pointer of the default field (with a set_field_userptr() call passed a NULL field pointer.) When a new field is created, the default-field user pointer is copied to initialize the new field's user pointer.

                        @@ -1742,7 +1780,7 @@ it with this function:

                         int set_max_field(FIELD *field,     /* field to alter (may not be NULL) */
                        -                   int max_size);   /* upper limit on field size */ 
                        +                   int max_size);   /* upper limit on field size */
                         
                        If the field is one-line, max_size is taken to be a column size @@ -1755,9 +1793,9 @@ The following properties of a field change when it becomes dynamic:
                        • If there is no growth limit, there is no final position of the field; therefore O_AUTOSKIP and O_NL_OVERLOAD are ignored. -
                        • Field justification will be ignored (though whatever justification is +
                        • Field justification will be ignored (though whatever justification is set up will be retained internally and can be queried). -
                        • The dup_field() and link_field() calls copy +
                        • The dup_field() and link_field() calls copy dynamic-buffer sizes. If the O_STATIC option is set on one of a collection of links, buffer resizing will occur only when the field is edited through that link. @@ -1770,7 +1808,7 @@ the field; use dynamic_field_info() to get the actual dynamic size. By default, a field will accept any data that will fit in its input buffer. However, it is possible to attach a validation type to a field. If you do this, any attempt to leave the field while it contains data that doesn't -match the validation type will fail. Some validation types also have a +match the validation type will fail. Some validation types also have a character-validity check for each time a character is entered in the field.

                          A field's validation check (if any) is not called when @@ -1853,7 +1891,7 @@ has been entered, it is of course valid. But it is also possible to enter a prefix of a valid string and have it completed for you.

                          By default, if you enter such a prefix and it matches more than one value -in the string list, the prefix will be completed to the first matching +in the string list, the prefix will be completed to the first matching value. But the checkunique argument, if true, requires prefix matches to be unique in order to be valid.

                          @@ -1894,7 +1932,7 @@ int set_field_type(FIELD *field, /* field to alter */ Valid characters consist of an optional leading minus and digits. possibly including a decimal point. If your system supports locale's, the decimal point -character used must be the one defined by your locale. The range check is +character used must be the one defined by your locale. The range check is performed on exit. If the range maximum is less than or equal to the minimum, the range is ignored.

                          @@ -1947,7 +1985,7 @@ to fit.

                          Calling field_buffer() with a null field pointer will raise an error. Calling field_buffer() on a field not currently selected for input will return a correct value. Calling field_buffer() on a -field that is currently selected for input may not necessarily give a +field that is currently selected for input may not necessarily give a correct field buffer value, because entered data isn't necessarily copied to buffer zero before the exit validation check. @@ -2049,9 +2087,9 @@ scrollable field is actually displayed within the menu subwindow. Use these functions:

                          -int data_ahead(FORM *form);               /* form to be queried */ 
                          +int data_ahead(FORM *form);               /* form to be queried */
                           
                          -int data_behind(FORM *form);              /* form to be queried */ 
                          +int data_behind(FORM *form);              /* form to be queried */
                           
                          The function data_ahead() returns TRUE if (a) the current @@ -2084,7 +2122,7 @@ int form_driver(FORM *form, /* form to pass input to */
                        Your input virtualization function needs to take input and then convert it -to either an alphanumeric character (which is treated as data to be +to either an alphanumeric character (which is treated as data to be entered in the currently-selected field), or a forms processing request.

                        The forms driver provides hooks (through input-validation and @@ -2337,7 +2375,7 @@ there are requests that can fetch that value into the field buffer:

                        Of the built-in field types, only TYPE_ENUM has built-in successor -and predecessor functions. When you define a field type of your own +and predecessor functions. When you define a field type of your own (see Custom Validation Types), you can associate our own ordering functions.

                        @@ -2457,13 +2495,13 @@ or queried with these functions:

                         int set_form_opts(FORM *form,             /* form to alter */
                        -                  int attr);              /* attribute to set */ 
                        +                  int attr);              /* attribute to set */
                         
                         int form_opts_on(FORM *form,              /* form to alter */
                        -                 int attr);               /* attributes to turn on */ 
                        +                 int attr);               /* attributes to turn on */
                         
                         int form_opts_off(FORM *form,             /* form to alter */
                        -                  int attr);              /* attributes to turn off */ 
                        +                  int attr);              /* attributes to turn off */
                         
                         int form_opts(FORM *form);                /* form to query */
                         
                        @@ -2500,7 +2538,7 @@ The simplest way to create a custom data type is to compose it from two preexisting ones:

                        -FIELD *link_fieldtype(FIELDTYPE *type1, 
                        +FIELD *link_fieldtype(FIELDTYPE *type1,
                                               FIELDTYPE *type2);
                         
                        @@ -2620,7 +2658,7 @@ int set_fieldtype_arg(FIELDTYPE *type, /* type to alter */ The successor and predecessor arguments will each be passed two arguments; a field pointer, and a pile pointer (as for the validation functions). They -are expected to use the function field_buffer() to read the +are expected to use the function field_buffer() to read the current value, and set_field_buffer() on buffer 0 to set the next or previous value. Either hook may return TRUE to indicate success (a legal next or previous value was set) or FALSE to indicate failure.

                        diff --git a/misc/ncurses.def b/misc/ncurses.def new file mode 100644 index 00000000..13db4bf0 --- /dev/null +++ b/misc/ncurses.def @@ -0,0 +1,452 @@ +LIBRARY ncurses5 INITINSTANCE TERMINSTANCE +DESCRIPTION "NCurses-5-0-990828, module ncurses" +CODE LOADONCALL +DATA LOADONCALL NONSHARED MULTIPLE +EXPORTS + "BC" @662 NONAME + "COLORS" @503 NONAME + "COLOR_PAIR" @36 NONAME + "COLOR_PAIRS" @504 NONAME + "COLS" @511 NONAME + "ESCDELAY" @513 NONAME + "LINES" @510 NONAME + "PAIR_NUMBER" @209 NONAME + "PC" @660 NONAME + "SP" @1003 NONAME + "TABSIZE" @512 NONAME + "UP" @661 NONAME + "_nc_access" @6 NONAME + "_nc_add_to_try" @7 NONAME + "_nc_align_termtype" @8 NONAME + "_nc_background" @9 NONAME + "_nc_baudrate" @10 NONAME + "_nc_cap_hash_table" @805 NONAME + "_nc_capalias_table" @806 NONAME + "_nc_capcmp" @707 NONAME + "_nc_captoinfo" @829 NONAME + "_nc_check_termtype" @15 NONAME + "_nc_comment_end" @819 NONAME + "_nc_comment_start" @818 NONAME + "_nc_copy_entry" @16 NONAME + "_nc_copy_termtype" @22 NONAME + "_nc_curr_col" @816 NONAME + "_nc_curr_file_pos" @817 NONAME + "_nc_curr_line" @815 NONAME + "_nc_curr_token" @803 NONAME + "_nc_do_color" @1037 NONAME + "_nc_do_xmc_glitch" @23 NONAME + "_nc_doalloc" @25 NONAME + "_nc_entry_match" @710 NONAME + "_nc_err_abort" @826 NONAME + "_nc_expand_try" @27 NONAME + "_nc_expanded" @51 NONAME + "_nc_fallback" @625 NONAME + "_nc_find_entry" @809 NONAME + "_nc_find_type_entry" @810 NONAME + "_nc_first_name" @622 NONAME + "_nc_free_entries" @712 NONAME + "_nc_free_termtype" @54 NONAME + "_nc_freeall" @58 NONAME + "_nc_freewin" @59 NONAME + "_nc_get_hash_table" @60 NONAME + "_nc_get_table" @808 NONAME + "_nc_get_token" @811 NONAME + "_nc_get_tty_mode" @63 NONAME + "_nc_get_type" @823 NONAME + "_nc_getenv_num" @65 NONAME + "_nc_has_mouse" @67 NONAME + "_nc_hash_map" @73 NONAME + "_nc_head" @700 NONAME + "_nc_home_terminfo" @84 NONAME + "_nc_info_hash_table" @804 NONAME + "_nc_infoalias_table" @807 NONAME + "_nc_infotocap" @830 NONAME + "_nc_init_acs" @91 NONAME + "_nc_init_entry" @702 NONAME + "_nc_init_keytry" @92 NONAME + "_nc_keep_tic_dir" @93 NONAME + "_nc_key_names" @95 NONAME + "_nc_keypad" @1024 NONAME + "_nc_lib_traceatr" @96 NONAME + "_nc_lib_tracedmp" @97 NONAME + "_nc_lib_tracemouse" @98 NONAME + "_nc_make_oldhash" @103 NONAME + "_nc_makenew" @1025 NONAME + "_nc_memmove" @106 NONAME + "_nc_merge_entry" @704 NONAME + "_nc_msec_cost" @116 NONAME + "_nc_mvcur_init" @1014 NONAME + "_nc_mvcur_resume" @117 NONAME + "_nc_mvcur_wrap" @1015 NONAME + "_nc_name_match" @623 NONAME + "_nc_nulls_sent" @118 NONAME + "_nc_oldnums" @119 NONAME + "_nc_ospeed" @120 NONAME + "_nc_outch" @1026 NONAME + "_nc_outstr" @1033 NONAME + "_nc_panelhook" @127 NONAME + "_nc_panic_mode" @814 NONAME + "_nc_parse_entry" @706 NONAME + "_nc_printf_string" @129 NONAME + "_nc_push_token" @812 NONAME + "_nc_read_entry" @620 NONAME + "_nc_read_entry_source" @709 NONAME + "_nc_read_file_entry" @621 NONAME + "_nc_read_termcap" @130 NONAME + "_nc_remove_key" @132 NONAME + "_nc_remove_string" @137 NONAME + "_nc_render" @1027 NONAME + "_nc_reset_input" @813 NONAME + "_nc_resolve_uses" @711 NONAME + "_nc_ripoffline" @142 NONAME + "_nc_save_str" @703 NONAME + "_nc_screen_chain" @143 NONAME + "_nc_screen_init" @144 NONAME + "_nc_screen_resume" @145 NONAME + "_nc_screen_wrap" @146 NONAME + "_nc_scroll_oldhash" @147 NONAME + "_nc_scroll_optimize" @1029 NONAME + "_nc_scroll_window" @1030 NONAME + "_nc_scrolln" @148 NONAME + "_nc_set_buffer" @152 NONAME + "_nc_set_source" @822 NONAME + "_nc_set_tty_mode" @158 NONAME + "_nc_set_type" @824 NONAME + "_nc_set_writedir" @159 NONAME + "_nc_setupscreen" @1031 NONAME + "_nc_sigaction" @160 NONAME + "_nc_signal_handler" @1034 NONAME + "_nc_slk_format" @161 NONAME + "_nc_slk_initialize" @162 NONAME + "_nc_start_line" @821 NONAME + "_nc_suppress_warnings" @828 NONAME + "_nc_synchook" @1035 NONAME + "_nc_syntax" @820 NONAME + "_nc_syserr_abort" @825 NONAME + "_nc_tail" @701 NONAME + "_nc_tic_dir" @167 NONAME + "_nc_tic_expand" @169 NONAME + "_nc_tic_written" @170 NONAME + "_nc_timed_wait" @1036 NONAME + "_nc_tinfo_fkeys" @172 NONAME + "_nc_trace_buf" @178 NONAME + "_nc_trace_tries" @183 NONAME + "_nc_trace_xnames" @184 NONAME + "_nc_tracebits" @185 NONAME + "_nc_tracing" @1010 NONAME + "_nc_trans_string" @186 NONAME + "_nc_user_definable" @187 NONAME + "_nc_visbuf" @1012 NONAME + "_nc_visbuf2" @188 NONAME + "_nc_vsscanf" @189 NONAME + "_nc_waddch_nosync" @1028 NONAME + "_nc_warning" @827 NONAME + "_nc_wrap_entry" @705 NONAME + "_nc_write_entry" @708 NONAME + "_tracechar" @403 NONAME + "acs_map" @506 NONAME + "addch" @1 NONAME + "addchnstr" @2 NONAME + "addchstr" @3 NONAME + "addnstr" @4 NONAME + "addstr" @5 NONAME + "attr_get" @14 NONAME + "attr_off" @193 NONAME + "attr_on" @211 NONAME + "attr_set" @17 NONAME + "attroff" @11 NONAME + "attron" @12 NONAME + "attrset" @13 NONAME + "baudrate" @18 NONAME + "beep" @19 NONAME + "bkgd" @20 NONAME + "bkgdset" @21 NONAME + "boolcodes" @601 NONAME + "boolfnames" @602 NONAME + "boolnames" @600 NONAME + "border" @24 NONAME + "box" @26 NONAME + "can_change_color" @28 NONAME + "cbreak" @29 NONAME + "chgat" @30 NONAME + "clear" @31 NONAME + "clearok" @32 NONAME + "clrtobot" @33 NONAME + "clrtoeol" @34 NONAME + "color_content" @35 NONAME + "color_set" @234 NONAME + "copywin" @37 NONAME + "cur_term" @515 NONAME + "curs_set" @38 NONAME + "curscr" @501 NONAME + "def_prog_mode" @39 NONAME + "def_shell_mode" @40 NONAME + "define_key" @238 NONAME + "del_curterm" @641 NONAME + "delay_output" @41 NONAME + "delch" @42 NONAME + "deleteln" @45 NONAME + "delscreen" @43 NONAME + "delwin" @44 NONAME + "derwin" @46 NONAME + "doupdate" @47 NONAME + "dupwin" @48 NONAME + "echo" @49 NONAME + "echochar" @50 NONAME + "endwin" @52 NONAME + "erasechar" @53 NONAME + "filter" @55 NONAME + "flash" @56 NONAME + "flushinp" @57 NONAME + "getbkgd" @240 NONAME + "getch" @61 NONAME + "getmouse" @356 NONAME + "getnstr" @62 NONAME + "getstr" @64 NONAME + "getwin" @66 NONAME + "halfdelay" @68 NONAME + "has_colors" @69 NONAME + "has_ic" @70 NONAME + "has_il" @71 NONAME + "has_key" @242 NONAME + "hline" @72 NONAME + "idcok" @74 NONAME + "idlok" @75 NONAME + "immedok" @76 NONAME + "inch" @77 NONAME + "inchnstr" @78 NONAME + "inchstr" @79 NONAME + "init_color" @81 NONAME + "init_pair" @82 NONAME + "initscr" @80 NONAME + "innstr" @83 NONAME + "insch" @85 NONAME + "insdelln" @86 NONAME + "insertln" @87 NONAME + "insnstr" @88 NONAME + "insstr" @89 NONAME + "instr" @90 NONAME + "intrflush" @94 NONAME + "is_linetouched" @100 NONAME + "is_wintouched" @101 NONAME + "isendwin" @99 NONAME + "keybound" @251 NONAME + "keyname" @102 NONAME + "keyok" @263 NONAME + "keypad" @104 NONAME + "killchar" @105 NONAME + "leaveok" @107 NONAME + "longname" @108 NONAME + "mcprint" @266 NONAME + "meta" @109 NONAME + "mouse_trafo" @270 NONAME + "mouseinterval" @360 NONAME + "mousemask" @358 NONAME + "move" @110 NONAME + "mvaddch" @111 NONAME + "mvaddchnstr" @112 NONAME + "mvaddchstr" @113 NONAME + "mvaddnstr" @114 NONAME + "mvaddstr" @115 NONAME + "mvchgat" @121 NONAME + "mvcur" @122 NONAME + "mvdelch" @123 NONAME + "mvderwin" @124 NONAME + "mvgetch" @125 NONAME + "mvgetnstr" @126 NONAME + "mvgetstr" @128 NONAME + "mvhline" @131 NONAME + "mvinch" @133 NONAME + "mvinchnstr" @134 NONAME + "mvinchstr" @135 NONAME + "mvinnstr" @136 NONAME + "mvinsch" @138 NONAME + "mvinsnstr" @139 NONAME + "mvinsstr" @140 NONAME + "mvinstr" @141 NONAME + "mvprintw" @149 NONAME + "mvscanw" @150 NONAME + "mvvline" @151 NONAME + "mvwaddch" @153 NONAME + "mvwaddchnstr" @154 NONAME + "mvwaddchstr" @155 NONAME + "mvwaddnstr" @156 NONAME + "mvwaddstr" @157 NONAME + "mvwchgat" @163 NONAME + "mvwdelch" @164 NONAME + "mvwgetch" @165 NONAME + "mvwgetnstr" @166 NONAME + "mvwgetstr" @168 NONAME + "mvwhline" @171 NONAME + "mvwin" @173 NONAME + "mvwinch" @174 NONAME + "mvwinchnstr" @175 NONAME + "mvwinchstr" @176 NONAME + "mvwinnstr" @177 NONAME + "mvwinsch" @179 NONAME + "mvwinsnstr" @180 NONAME + "mvwinsstr" @181 NONAME + "mvwinstr" @182 NONAME + "mvwprintw" @190 NONAME + "mvwscanw" @191 NONAME + "mvwvline" @192 NONAME + "napms" @194 NONAME + "newpad" @195 NONAME + "newscr" @502 NONAME + "newterm" @196 NONAME + "newwin" @197 NONAME + "nl" @198 NONAME + "nocbreak" @199 NONAME + "nodelay" @200 NONAME + "noecho" @201 NONAME + "nonl" @202 NONAME + "noqiflush" @203 NONAME + "noraw" @204 NONAME + "notimeout" @205 NONAME + "numcodes" @604 NONAME + "numfnames" @605 NONAME + "numnames" @603 NONAME + "ospeed" @663 NONAME + "overlay" @206 NONAME + "overwrite" @207 NONAME + "pair_content" @208 NONAME + "pechochar" @210 NONAME + "pnoutrefresh" @212 NONAME + "prefresh" @213 NONAME + "printw" @214 NONAME + "putp" @215 NONAME + "putwin" @216 NONAME + "qiflush" @217 NONAME + "raw" @218 NONAME + "redrawwin" @219 NONAME + "refresh" @220 NONAME + "reset_prog_mode" @222 NONAME + "reset_shell_mode" @223 NONAME + "resetty" @221 NONAME + "resizeterm" @272 NONAME + "restartterm" @643 NONAME + "ripoffline" @224 NONAME + "savetty" @225 NONAME + "scanw" @226 NONAME + "scr_dump" @227 NONAME + "scr_init" @228 NONAME + "scr_restore" @232 NONAME + "scr_set" @233 NONAME + "scrl" @229 NONAME + "scroll" @230 NONAME + "scrollok" @231 NONAME + "set_curterm" @640 NONAME + "set_term" @236 NONAME + "setscrreg" @235 NONAME + "setupterm" @644 NONAME + "slk_attr" @274 NONAME + "slk_attr_set" @276 NONAME + "slk_attroff" @237 NONAME + "slk_attron" @239 NONAME + "slk_attrset" @241 NONAME + "slk_clear" @243 NONAME + "slk_color" @278 NONAME + "slk_init" @244 NONAME + "slk_label" @245 NONAME + "slk_noutrefresh" @246 NONAME + "slk_refresh" @247 NONAME + "slk_restore" @248 NONAME + "slk_set" @249 NONAME + "slk_touch" @250 NONAME + "standend" @253 NONAME + "standout" @252 NONAME + "start_color" @254 NONAME + "stdscr" @500 NONAME + "strcodes" @608 NONAME + "strfnames" @609 NONAME + "strnames" @606 NONAME + "subpad" @255 NONAME + "subwin" @256 NONAME + "syncok" @257 NONAME + "termattrs" @258 NONAME + "termname" @259 NONAME + "tgetent" @645 NONAME + "tgetflag" @646 NONAME + "tgetnum" @647 NONAME + "tgetstr" @648 NONAME + "tgoto" @649 NONAME + "tigetflag" @260 NONAME + "tigetnum" @261 NONAME + "tigetstr" @262 NONAME + "timeout" @284 NONAME + "tparm" @653 NONAME + "tputs" @655 NONAME + "trace" @405 NONAME + "ttytype" @514 NONAME + "typeahead" @264 NONAME + "unctrl" @361 NONAME + "ungetch" @265 NONAME + "ungetmouse" @357 NONAME + "untouchwin" @267 NONAME + "use_default_colors" @285 NONAME + "use_env" @268 NONAME + "use_extended_names" @286 NONAME + "vidattr" @269 NONAME + "vidputs" @271 NONAME + "vline" @273 NONAME + "vw_printw" @287 NONAME + "vw_scanw" @294 NONAME + "vwprintw" @275 NONAME + "vwscanw" @277 NONAME + "waddch" @279 NONAME + "waddchnstr" @280 NONAME + "waddchstr" @281 NONAME + "waddnstr" @282 NONAME + "waddstr" @283 NONAME + "wattr_get" @291 NONAME + "wattr_off" @293 NONAME + "wattr_on" @292 NONAME + "wattr_set" @297 NONAME + "wattroff" @289 NONAME + "wattron" @288 NONAME + "wattrset" @290 NONAME + "wbkgd" @295 NONAME + "wbkgdset" @296 NONAME + "wborder" @299 NONAME + "wchgat" @301 NONAME + "wclear" @302 NONAME + "wclrtobot" @303 NONAME + "wclrtoeol" @304 NONAME + "wcolor_set" @298 NONAME + "wcursyncup" @305 NONAME + "wdelch" @306 NONAME + "wdeleteln" @307 NONAME + "wechochar" @308 NONAME + "wenclose" @359 NONAME + "werase" @310 NONAME + "wgetch" @312 NONAME + "wgetnstr" @313 NONAME + "wgetstr" @315 NONAME + "whline" @318 NONAME + "winch" @320 NONAME + "winchnstr" @321 NONAME + "winchstr" @322 NONAME + "winnstr" @323 NONAME + "winsch" @325 NONAME + "winsdelln" @326 NONAME + "winsertln" @327 NONAME + "winsnstr" @328 NONAME + "winsstr" @329 NONAME + "winstr" @330 NONAME + "wmouse_trafo" @300 NONAME + "wmove" @338 NONAME + "wnoutrefresh" @339 NONAME + "wprintw" @340 NONAME + "wredrawln" @341 NONAME + "wrefresh" @342 NONAME + "wresize" @343 NONAME + "wscanw" @344 NONAME + "wscrl" @345 NONAME + "wsetscrreg" @346 NONAME + "wstandend" @348 NONAME + "wstandout" @347 NONAME + "wsyncdown" @349 NONAME + "wsyncup" @350 NONAME + "wtimeout" @351 NONAME + "wtouchln" @352 NONAME + "wvline" @354 NONAME diff --git a/misc/ncurses.ref b/misc/ncurses.ref new file mode 100644 index 00000000..cf4de7d5 --- /dev/null +++ b/misc/ncurses.ref @@ -0,0 +1,572 @@ +LIBRARY ncurses2 INITINSTANCE +DESCRIPTION 'NCurses 1.9.9e-1 for OS/2 - base library' +EXPORTS +;************ +;* curses.h * +;************ + + "stdscr" @500 NONAME ; variable + "curscr" @501 NONAME ; variable + "newscr" @502 NONAME ; variable + "COLORS" @503 NONAME ; variable + "COLOR_PAIRS" @504 NONAME ; variable + "color_pairs" @505 NONAME ; variable + "acs_map" @506 NONAME ; variable + "LINES" @510 NONAME ; variable + "COLS" @511 NONAME ; variable + "TABSIZE" @512 NONAME ; variable + "ESCDELAY" @513 NONAME ; variable + "ttytype" @514 NONAME ; variable + "cur_term" @515 NONAME ; variable + + "addch" @1 NONAME ; generated + "addchnstr" @2 NONAME ; generated + "addchstr" @3 NONAME ; generated + "addnstr" @4 NONAME ; generated + "addstr" @5 NONAME ; generated +; "addnwstr" @6 NONAME ; missing +; "addwstr" @7 NONAME ; missing +; "add_wch" @8 NONAME ; missing +; "add_wchnstr" @9 NONAME ; missing +; "add_wchstr" @10 NONAME ; missing + "attroff" @11 NONAME ; generated + "attron" @12 NONAME ; generated + "attrset" @13 NONAME ; generated + "attr_get" @14 NONAME ; generated +; "attr_off" @15 NONAME ; implemented << NO!! +; "attr_on" @16 NONAME ; implemented << NO!! + "attr_set" @17 NONAME ; generated + "baudrate" @18 NONAME ; implemented + "beep" @19 NONAME ; implemented + "bkgd" @20 NONAME ; generated + "bkgdset" @21 NONAME ; generated +; "bkgrndset" @22 NONAME ; missing +; "bkgrnd" @23 NONAME ; missing + "border" @24 NONAME ; generated +; "border_set" @25 NONAME ; missing + "box" @26 NONAME ; generated +; "box_set" @27 NONAME ; missing + "can_change_color" @28 NONAME ; implemented + "cbreak" @29 NONAME ; implemented + "chgat" @30 NONAME ; generated + "clear" @31 NONAME ; generated + "clearok" @32 NONAME ; implemented + "clrtobot" @33 NONAME ; generated + "clrtoeol" @34 NONAME ; generated + "color_content" @35 NONAME ; implemented + "COLOR_PAIR" @36 NONAME ; generated + "copywin" @37 NONAME ; implemented + "curs_set" @38 NONAME ; implemented + "def_prog_mode" @39 NONAME ; implemented + "def_shell_mode" @40 NONAME ; implemented + "delay_output" @41 NONAME ; implemented + "delch" @42 NONAME ; generated + "delscreen" @43 NONAME ; implemented + "delwin" @44 NONAME ; implemented + "deleteln" @45 NONAME ; generated + "derwin" @46 NONAME ; implemented + "doupdate" @47 NONAME ; implemented + "dupwin" @48 NONAME ; implemented + "echo" @49 NONAME ; implemented + "echochar" @50 NONAME ; generated +; "echo_wchar" @51 NONAME ; missing + "endwin" @52 NONAME ; implemented + "erasechar" @53 NONAME ; implemented +; "erase_wchar" @54 NONAME ; missing + "filter" @55 NONAME ; implemented + "flash" @56 NONAME ; implemented + "flushinp" @57 NONAME ; implemented +; "getbkgd" @58 NONAME ; missing +; "getbkgrnd" @59 NONAME ; missing +; "getcchar" @60 NONAME ; missing + "getch" @61 NONAME ; generated + "getnstr" @62 NONAME ; generated +; "getn_wstr" @63 NONAME ; missing + "getstr" @64 NONAME ; generated +; "get_wch" @65 NONAME ; missing + "getwin" @66 NONAME ; not in XPG4 +; "get_wstr" @67 NONAME ; missing + "halfdelay" @68 NONAME ; implemented + "has_colors" @69 NONAME ; implemented + "has_ic" @70 NONAME ; implemented + "has_il" @71 NONAME ; implemented + "hline" @72 NONAME ; generated +; "hline_set" @73 NONAME ; missing + "idcok" @74 NONAME ; implemented + "idlok" @75 NONAME ; implemented + "immedok" @76 NONAME ; implemented + "inch" @77 NONAME ; generated + "inchnstr" @78 NONAME ; generated + "inchstr" @79 NONAME ; generated + "initscr" @80 NONAME ; implemented + "init_color" @81 NONAME ; implemented + "init_pair" @82 NONAME ; implemented + "innstr" @83 NONAME ; generated +; "innwstr" @84 NONAME ; missing + "insch" @85 NONAME ; generated + "insdelln" @86 NONAME ; generated + "insertln" @87 NONAME ; generated + "insnstr" @88 NONAME ; generated + "insstr" @89 NONAME ; generated + "instr" @90 NONAME ; generated +; "ins_nwstr" @91 NONAME ; missing +; "ins_wch" @92 NONAME ; missing +; "ins_wstr" @93 NONAME ; missing + "intrflush" @94 NONAME ; implemented +; "inwstr" @95 NONAME ; missing +; "in_wch" @96 NONAME ; missing +; "in_wchstr" @97 NONAME ; missing +; "in_wchntr" @98 NONAME ; missing + "isendwin" @99 NONAME ; implemented + "is_linetouched" @100 NONAME ; implemented + "is_wintouched" @101 NONAME ; implemented + "keyname" @102 NONAME ; implemented +; "key_name" @103 NONAME ; missing + "keypad" @104 NONAME ; implemented + "killchar" @105 NONAME ; implemented +; "killwchar" @106 NONAME ; missing + "leaveok" @107 NONAME ; implemented + "longname" @108 NONAME ; implemented + "meta" @109 NONAME ; implemented + "move" @110 NONAME ; generated + "mvaddch" @111 NONAME ; generated + "mvaddchnstr" @112 NONAME ; generated + "mvaddchstr" @113 NONAME ; generated + "mvaddnstr" @114 NONAME ; generated + "mvaddstr" @115 NONAME ; generated +; "mvaddnwstr" @116 NONAME ; missing +; "mvaddwstr" @117 NONAME ; missing +; "mvadd_wch" @118 NONAME ; missing +; "mvadd_wchnstr" @119 NONAME ; missing +; "mvadd_wchstr" @120 NONAME ; missing + "mvchgat" @121 NONAME ; generated + "mvcur" @122 NONAME ; implemented + "mvdelch" @123 NONAME ; generated + "mvderwin" @124 NONAME ; implemented + "mvgetch" @125 NONAME ; generated + "mvgetnstr" @126 NONAME ; generated +; "mvgetn_wstr" @127 NONAME ; missing + "mvgetstr" @128 NONAME ; generated +; "mvget_wch" @129 NONAME ; missing +; "mvget_wstr" @130 NONAME ; missing + "mvhline" @131 NONAME ; generated +; "mvhline_set" @132 NONAME ; missing + "mvinch" @133 NONAME ; generated + "mvinchnstr" @134 NONAME ; generated + "mvinchstr" @135 NONAME ; generated + "mvinnstr" @136 NONAME ; generated +; "mvinnwstr" @137 NONAME ; missing + "mvinsch" @138 NONAME ; generated + "mvinsnstr" @139 NONAME ; generated + "mvinsstr" @140 NONAME ; generated + "mvinstr" @141 NONAME ; generated +; "mvins_nwstr" @142 NONAME ; missing +; "mvins_wch" @143 NONAME ; missing +; "mvins_wstr" @144 NONAME ; missing +; "mvinwstr" @145 NONAME ; missing +; "mvin_wch" @146 NONAME ; missing +; "mvin_wchstr" @147 NONAME ; missing +; "mvin_wchntr" @148 NONAME ; missing + "mvprintw" @149 NONAME ; implemented + "mvscanw" @150 NONAME ; implemented + "mvvline" @151 NONAME ; generated +; "mvvline_set" @152 NONAME ; missing + "mvwaddch" @153 NONAME ; generated + "mvwaddchnstr" @154 NONAME ; generated + "mvwaddchstr" @155 NONAME ; generated + "mvwaddnstr" @156 NONAME ; generated + "mvwaddstr" @157 NONAME ; generated +; "mvwaddnwstr" @158 NONAME ; missing +; "mvwaddwstr" @159 NONAME ; missing +; "mvwadd_wch" @160 NONAME ; missing +; "mvwadd_wchnstr" @161 NONAME ; missing +; "mvwadd_wchstr" @162 NONAME ; missing + "mvwchgat" @163 NONAME ; generated + "mvwdelch" @164 NONAME ; generated + "mvwgetch" @165 NONAME ; generated + "mvwgetnstr" @166 NONAME ; generated +; "mvwgetn_wstr" @167 NONAME ; missing + "mvwgetstr" @168 NONAME ; generated +; "mvwget_wch" @169 NONAME ; missing +; "mvwget_wstr" @170 NONAME ; missing + "mvwhline" @171 NONAME ; generated +; "mvwhline_set" @172 NONAME ; missing + "mvwin" @173 NONAME ; implemented + "mvwinch" @174 NONAME ; generated + "mvwinchnstr" @175 NONAME ; generated + "mvwinchstr" @176 NONAME ; generated + "mvwinnstr" @177 NONAME ; generated +; "mvwinnwstr" @178 NONAME ; missing + "mvwinsch" @179 NONAME ; generated + "mvwinsnstr" @180 NONAME ; generated + "mvwinsstr" @181 NONAME ; generated + "mvwinstr" @182 NONAME ; generated +; "mvwins_nwstr" @183 NONAME ; missing +; "mvwins_wch" @184 NONAME ; missing +; "mvwins_wstr" @185 NONAME ; missing +; "mvwinwstr" @186 NONAME ; missing +; "mvwin_wch" @187 NONAME ; missing +; "mvwin_wchnstr" @188 NONAME ; missing +; "mvwin_wchstr" @189 NONAME ; missing + "mvwprintw" @190 NONAME ; implemented + "mvwscanw" @191 NONAME ; implemented + "mvwvline" @192 NONAME ; generated +; "mvwvline_set" @193 NONAME ; missing + "napms" @194 NONAME ; implemented + "newpad" @195 NONAME ; implemented + "newterm" @196 NONAME ; implemented + "newwin" @197 NONAME ; implemented + "nl" @198 NONAME ; implemented + "nocbreak" @199 NONAME ; implemented + "nodelay" @200 NONAME ; implemented + "noecho" @201 NONAME ; implemented + "nonl" @202 NONAME ; implemented + "noqiflush" @203 NONAME ; implemented + "noraw" @204 NONAME ; implemented + "notimeout" @205 NONAME ; implemented + "overlay" @206 NONAME ; implemented + "overwrite" @207 NONAME ; implemented + "pair_content" @208 NONAME ; implemented + "PAIR_NUMBER" @209 NONAME ; generated + "pechochar" @210 NONAME ; implemented +; "pecho_wchar" @211 NONAME ; missing + "pnoutrefresh" @212 NONAME ; implemented + "prefresh" @213 NONAME ; implemented + "printw" @214 NONAME ; implemented + "putp" @215 NONAME ; implemented + "putwin" @216 NONAME ; implemented + "qiflush" @217 NONAME ; implemented + "raw" @218 NONAME ; implemented + "redrawwin" @219 NONAME ; generated + "refresh" @220 NONAME ; generated + "resetty" @221 NONAME ; implemented + "reset_prog_mode" @222 NONAME ; implemented + "reset_shell_mode" @223 NONAME ; implemented + "ripoffline" @224 NONAME ; implemented + "savetty" @225 NONAME ; implemented + "scanw" @226 NONAME ; implemented + "scr_dump" @227 NONAME ; implemented + "scr_init" @228 NONAME ; implemented + "scrl" @229 NONAME ; generated + "scroll" @230 NONAME ; generated + "scrollok" @231 NONAME ; implemented + "scr_restore" @232 NONAME ; implemented + "scr_set" @233 NONAME ; implemented +; "setcchar" @234 NONAME ; missing + "setscrreg" @235 NONAME ; generated + "set_term" @236 NONAME ; implemented + "slk_attroff" @237 NONAME ; implemented +; "slk_attr_off" @238 NONAME ; missing + "slk_attron" @239 NONAME ; implemented +; "slk_attr_on" @240 NONAME ; missing + "slk_attrset" @241 NONAME ; implemented +; "slk_attr_set" @242 NONAME ; missing + "slk_clear" @243 NONAME ; implemented + "slk_init" @244 NONAME ; implemented + "slk_label" @245 NONAME ; implemented + "slk_noutrefresh" @246 NONAME ; implemented + "slk_refresh" @247 NONAME ; implemented + "slk_restore" @248 NONAME ; implemented + "slk_set" @249 NONAME ; implemented + "slk_touch" @250 NONAME ; implemented +; "slk_wset" @251 NONAME ; missing + "standout" @252 NONAME ; generated + "standend" @253 NONAME ; generated + "start_color" @254 NONAME ; implemented + "subpad" @255 NONAME ; implemented + "subwin" @256 NONAME ; implemented + "syncok" @257 NONAME ; implemented + "termattrs" @258 NONAME ; implemented + "termname" @259 NONAME ; implemented + "tigetflag" @260 NONAME ; implemented + "tigetnum" @261 NONAME ; implemented + "tigetstr" @262 NONAME ; implemented +; "timeout" @263 NONAME ; implemented << NO!! + "typeahead" @264 NONAME ; implemented + "ungetch" @265 NONAME ; implemented +; "unget_wch" @266 NONAME ; missing + "untouchwin" @267 NONAME ; generated + "use_env" @268 NONAME ; implemented + "vidattr" @269 NONAME ; implemented +; "vid_attr" @270 NONAME ; missing + "vidputs" @271 NONAME ; implemented +; "vid_puts" @272 NONAME ; missing + "vline" @273 NONAME ; generated +; "vline_set" @274 NONAME ; missing + "vwprintw" @275 NONAME ; implemented +; "vw_printw" @276 NONAME ; implemented << NO!! + "vwscanw" @277 NONAME ; implemented +; "vw_scanw" @278 NONAME ; implemented << NO!! + "waddch" @279 NONAME ; implemented + "waddchnstr" @280 NONAME ; implemented + "waddchstr" @281 NONAME ; generated + "waddnstr" @282 NONAME ; implemented + "waddstr" @283 NONAME ; generated +; "waddwstr" @284 NONAME ; missing +; "wadd_wch" @285 NONAME ; missing +; "wadd_wchnstr" @286 NONAME ; missing +; "wadd_wchstr" @287 NONAME ; missing + "wattron" @288 NONAME ; generated + "wattroff" @289 NONAME ; generated + "wattrset" @290 NONAME ; generated + "wattr_get" @291 NONAME ; generated + "wattr_on" @292 NONAME ; implemented + "wattr_off" @293 NONAME ; implemented +; "wattr_set" @294 NONAME ; implemented << NO!! + "wbkgd" @295 NONAME ; implemented + "wbkgdset" @296 NONAME ; generated +; "wbkgrndset" @297 NONAME ; missing +; "wbkgrnd" @298 NONAME ; missing + "wborder" @299 NONAME ; implemented +; "wborder_set" @300 NONAME ; missing + "wchgat" @301 NONAME ; implemented + "wclear" @302 NONAME ; implemented + "wclrtobot" @303 NONAME ; implemented + "wclrtoeol" @304 NONAME ; implemented + "wcursyncup" @305 NONAME ; implemented + "wdelch" @306 NONAME ; implemented + "wdeleteln" @307 NONAME ; generated + "wechochar" @308 NONAME ; implemented +; "wecho_wchar" @309 NONAME ; missing + "werase" @310 NONAME ; implemented +; "wgetbkgrnd" @311 NONAME ; missing + "wgetch" @312 NONAME ; implemented + "wgetnstr" @313 NONAME ; implemented +; "wgetn_wstr" @314 NONAME ; missing + "wgetstr" @315 NONAME ; generated +; "wget_wch" @316 NONAME ; missing +; "wget_wstr" @317 NONAME ; missing + "whline" @318 NONAME ; implemented +; "whline_set" @319 NONAME ; missing + "winch" @320 NONAME ; generated + "winchnstr" @321 NONAME ; implemented + "winchstr" @322 NONAME ; generated + "winnstr" @323 NONAME ; implemented +; "winnwstr" @324 NONAME ; missing + "winsch" @325 NONAME ; implemented + "winsdelln" @326 NONAME ; implemented + "winsertln" @327 NONAME ; generated + "winsnstr" @328 NONAME ; implemented + "winsstr" @329 NONAME ; generated + "winstr" @330 NONAME ; generated +; "wins_nwstr" @331 NONAME ; missing +; "wins_wch" @332 NONAME ; missing +; "wins_wstr" @333 NONAME ; missing +; "winwstr" @334 NONAME ; missing +; "win_wch" @335 NONAME ; missing +; "win_wchnstr" @336 NONAME ; missing +; "win_wchstr" @337 NONAME ; missing + "wmove" @338 NONAME ; implemented + "wnoutrefresh" @339 NONAME ; implemented + "wprintw" @340 NONAME ; implemented + "wredrawln" @341 NONAME ; implemented + "wrefresh" @342 NONAME ; implemented + "wresize" @343 NONAME ; implemented + "wscanw" @344 NONAME ; implemented + "wscrl" @345 NONAME ; implemented + "wsetscrreg" @346 NONAME ; implemented + "wstandout" @347 NONAME ; generated + "wstandend" @348 NONAME ; generated + "wsyncdown" @349 NONAME ; implemented + "wsyncup" @350 NONAME ; implemented + "wtimeout" @351 NONAME ; implemented + "wtouchln" @352 NONAME ; implemented +; "wunctrl" @353 NONAME ; missing + "wvline" @354 NONAME ; implemented +; "wvline_set" @355 NONAME ; missing + + "getmouse" @356 NONAME + "ungetmouse" @357 NONAME + "mousemask" @358 NONAME + "wenclose" @359 NONAME + "mouseinterval" @360 NONAME + +; from unctrl.h + "unctrl" @361 NONAME + +; publics for tracing + "_tracef" @400 NONAME + "_tracedump" @401 NONAME + "_traceattr" @402 NONAME + "_tracechar" @403 NONAME + "_tracemouse" @404 NONAME + "trace" @405 NONAME + +;********** +;* term.h * +;********** + "boolnames" @600 NONAME ; variable + "boolcodes" @601 NONAME ; variable + "boolfnames" @602 NONAME ; variable + "numnames" @603 NONAME ; variable + "numcodes" @604 NONAME ; variable + "numfnames" @605 NONAME ; variable + "strnames" @606 NONAME ; variable + "strcodes" @608 NONAME ; variable + "strfnames" @609 NONAME ; variable + +; internals + "_nc_read_entry" @620 NONAME + "_nc_read_file_entry" @621 NONAME + "_nc_first_name" @622 NONAME + "_nc_name_match" @623 NONAME + "_nc_read_termcap_entry" @624 NONAME + "_nc_fallback" @625 NONAME + +; entry points + "set_curterm" @640 NONAME + "del_curterm" @641 NONAME + +; entry points +; "putp" @642 NONAME ; already defined + "restartterm" @643 NONAME + "setupterm" @644 NONAME + "tgetent" @645 NONAME + "tgetflag" @646 NONAME + "tgetnum" @647 NONAME + "tgetstr" @648 NONAME + "tgoto" @649 NONAME +; "tigetflag" @650 NONAME ; already defined +; "tigetnum" @651 NONAME ; already defined +; "tigetstr" @652 NONAME ; already defined + "tparm" @653 NONAME + "tparam" @654 NONAME + "tputs" @655 NONAME + +;************* +;* termcap.h * +;************* +; the functions are already defined in term.h + "PC" @660 NONAME + "UP" @661 NONAME + "BC" @662 NONAME + "ospeed" @663 NONAME + +;**************** +;* term_entry.h * +;**************** + "_nc_head" @700 NONAME + "_nc_tail" @701 NONAME + +; alloc_entry.c: elementary allocation code + "_nc_init_entry" @702 NONAME + "_nc_save_str" @703 NONAME + "_nc_merge_entry" @704 NONAME + "_nc_wrap_entry" @705 NONAME + +; parse_entry.c: entry-parsing code + "_nc_parse_entry" @706 NONAME + "_nc_capcmp" @707 NONAME + +; write_entry.c: writing an entry to the file system + "_nc_write_entry" @708 NONAME + +; comp_parse.c: entry list handling + "_nc_read_entry_source" @709 NONAME + "_nc_entry_match" @710 NONAME + "_nc_resolve_uses" @711 NONAME + "_nc_free_entries" @712 NONAME + +;********* +;* tic.h * +;********* +; "_nc_tracing" @800 NONAME ; defined below +; "_nc_tracef" @801 NONAME ; missing +; "_nc_visbuf" @802 NONAME ; defined below + + "_nc_curr_token" @803 NONAME + + "_nc_info_hash_table" @804 NONAME + "_nc_cap_hash_table" @805 NONAME + + "_nc_capalias_table" @806 NONAME + "_nc_infoalias_table" @807 NONAME + "_nc_get_table" @808 NONAME + +; comp_hash.c: name lookup + "_nc_find_entry" @809 NONAME + "_nc_find_type_entry" @810 NONAME + +; comp_scan.c: lexical analysis + "_nc_get_token" @811 NONAME + "_nc_push_token" @812 NONAME + "_nc_reset_input" @813 NONAME + "_nc_panic_mode" @814 NONAME + "_nc_curr_line" @815 NONAME + "_nc_curr_col" @816 NONAME + "_nc_curr_file_pos" @817 NONAME + "_nc_comment_start" @818 NONAME + "_nc_comment_end" @819 NONAME + "_nc_syntax" @820 NONAME + "_nc_start_line" @821 NONAME + +; comp_error.c: warning & abort messages + "_nc_set_source" @822 NONAME + "_nc_get_type" @823 NONAME + "_nc_set_type" @824 NONAME + "_nc_syserr_abort" @825 NONAME + "_nc_err_abort" @826 NONAME + "_nc_warning" @827 NONAME + "_nc_suppress_warnings" @828 NONAME + +; captoinfo.c: capability conversion + "_nc_captoinfo" @829 NONAME + "_nc_infotocap" @830 NONAME + +; comp_main.c: compiler main +; "_nc_progname" @831 NONAME ; no need to export it + + +; ***************** +; NCurses internals -- just for progs/*.exe and the library itself. +; ***************** + +; For broken linkers +; "_nc_screen" @1000 NONAME +; "_nc_alloc_screen" @1001 NONAME +; "_nc_set_screen" @1002 NONAME + +; For not so broken linkers + "SP" @1003 NONAME + +; Who knows what this is for + "_slk_init" @1004 NONAME + "slk_initialize" @1005 NONAME + +; Tracing -- all functions used internally + "_nc_tracing" @1010 NONAME + "_nc_tputs_trace" @1011 NONAME + "_nc_visbuf" @1012 NONAME + +; lib_acs.c + "init_acs" @1013 NONAME + +; lib_mvcur.c + "_nc_mvcur_init" @1014 NONAME + "_nc_mvcur_wrap" @1015 NONAME + "_nc_mvcur_scrolln" @1016 NONAME + +; lib_mouse.c + "_nc_mouse_init" @1017 NONAME + "_nc_mouse_event" @1018 NONAME + "_nc_mouse_inline" @1019 NONAME + "_nc_mouse_parse" @1020 NONAME + "_nc_mouse_wrap" @1021 NONAME + "_nc_mouse_resume" @1022 NONAME + "_nc_max_click_interval" @1023 NONAME + +; elsewhere ... + "_nc_keypad" @1024 NONAME + "_nc_makenew" @1025 NONAME + "_nc_outch" @1026 NONAME + "_nc_render" @1027 NONAME + "_nc_waddch_nosync" @1028 NONAME + "_nc_scroll_optimize" @1029 NONAME + "_nc_scroll_window" @1030 NONAME + "_nc_setupscreen" @1031 NONAME + "_nc_backspace" @1032 NONAME + "_nc_outstr" @1033 NONAME + "_nc_signal_handler" @1034 NONAME + "_nc_synchook" @1035 NONAME + "_nc_timed_wait" @1036 NONAME + "_nc_do_color" @1037 NONAME diff --git a/misc/panel.def b/misc/panel.def new file mode 100644 index 00000000..3d7dc9ca --- /dev/null +++ b/misc/panel.def @@ -0,0 +1,25 @@ +LIBRARY panel5 INITINSTANCE TERMINSTANCE +DESCRIPTION "NCurses-5-0-990828, module panel" +CODE LOADONCALL +DATA LOADONCALL NONSHARED MULTIPLE +EXPORTS + "_nc_calculate_obscure" @16 NONAME + "_nc_free_obscure" @17 NONAME + "_nc_override" @18 NONAME + "_nc_panel_is_linked" @19 NONAME + "_nc_panel_link_bottom" @20 NONAME + "bottom_panel" @7 NONAME + "del_panel" @5 NONAME + "hide_panel" @3 NONAME + "move_panel" @13 NONAME + "new_panel" @8 NONAME + "panel_above" @9 NONAME + "panel_below" @10 NONAME + "panel_hidden" @15 NONAME + "panel_userptr" @12 NONAME + "panel_window" @1 NONAME + "replace_panel" @14 NONAME + "set_panel_userptr" @11 NONAME + "show_panel" @4 NONAME + "top_panel" @6 NONAME + "update_panels" @2 NONAME diff --git a/misc/panel.ref b/misc/panel.ref new file mode 100644 index 00000000..e84045a1 --- /dev/null +++ b/misc/panel.ref @@ -0,0 +1,18 @@ +LIBRARY panel2 INITINSTANCE +DESCRIPTION 'NCurses 1.9.9e-1 for OS/2 - panel library' +EXPORTS + "panel_window" @1 + "update_panels" @2 + "hide_panel" @3 + "show_panel" @4 + "del_panel" @5 + "top_panel" @6 + "bottom_panel" @7 + "new_panel" @8 + "panel_above" @9 + "panel_below" @10 + "set_panel_userptr" @11 + "panel_userptr" @12 + "move_panel" @13 + "replace_panel" @14 + "panel_hidden" @15 diff --git a/misc/run_tic.sh b/misc/run_tic.sh index 9ac65b4d..a5170773 100755 --- a/misc/run_tic.sh +++ b/misc/run_tic.sh @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey 1996 # -# $Id: run_tic.sh,v 1.9 1998/02/11 12:13:50 tom Exp $ +# $Id: run_tic.sh,v 1.10 1998/05/31 00:29:34 mooney Exp $ # This script is used to install terminfo.src using tic. We use a script # because the path checking is too awkward to do in a makefile. # @@ -84,6 +84,16 @@ case "$PATH" in *) PATH=../progs:$IP$bindir:$PATH ;; esac export PATH + +# +# set another env var that doesn't get reset when `shlib' runs, so `shlib' uses +# the PATH we just set. +# +NEWPATH=$PATH +export NEWPATH +PROG_BIN_DIR=$IP$bindir +export PROG_BIN_DIR + TERMINFO=$IP$ticdir ; export TERMINFO umask 022 diff --git a/misc/shlib b/misc/shlib index 1845a62e..ee550622 100755 --- a/misc/shlib +++ b/misc/shlib @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey 1996 # -# $Id: shlib,v 1.4 1998/02/11 12:13:50 tom Exp $ +# $Id: shlib,v 1.5 1998/05/31 00:29:38 mooney Exp $ # Use this script as a wrapper when running executables linked to shared # libraries on systems that use the $LD_LIBRARY_PATH variable and don't embed # the soname's path within the linked executable (such as IRIX), e.g, @@ -55,6 +55,15 @@ # Using a conventional link, with -L and -l options on Linux results in a # statically linked executable, which we don't want at all. # + +# +# Make sure that we use the PATH that was set in run_tic.sh +# +if test X$NEWPATH != X ; then + PATH=$NEWPATH + export PATH +fi + q="" for p in lib ../lib do diff --git a/misc/terminfo.src b/misc/terminfo.src index fedfe67e..ee3db89d 100644 --- a/misc/terminfo.src +++ b/misc/terminfo.src @@ -1,14 +1,18 @@ ######## TERMINAL TYPE DESCRIPTIONS SOURCE FILE # -# Version 10.2.0 +# This version of terminfo.src is distributed with ncurses. +# +# Version 10.2.1 +# $Date: 1999/10/24 00:28:48 $ # terminfo syntax # # Eric S. Raymond (current maintainer) # John Kunze, Berkeley # Craig Leres, Berkeley # -# Please e-mail changes to terminfo@ccil.org. The old termcap@berkeley.edu -# address is no longer valid. +# Please e-mail changes to terminfo@ccil.org; the old termcap@berkeley.edu +# address is no longer valid. The latest version can always be found at +# . # # PURPOSE OF THIS FILE: # @@ -86,7 +90,9 @@ # FILE ORGANIZATION: # # Comments in this file begin with # - they cannot appear in the middle -# of a terminfo/termcap entry. Individual capabilities are commented out by +# of a terminfo/termcap entry (this feature had to be sacrificed in order +# to allow standard terminfo and termcap syntax to be generated cleanly from +# the master format). Individual capabilities are commented out by # placing a period between the colon and the capability name. # # The file is divided up into major sections (headed by lines beginning with @@ -97,10 +103,11 @@ # to see a listing of section headings. The intent of the divisions is # (a) to make it easier to find things, and (b) to order the database so # that important and frequently-encountered terminal types are near the -# front (so that you'll get reasonable search efficiency even if you don't -# use reorder). Minor sections usually correspond to manufacturers or -# standard terminal classes. Parenthesized words following manufacturer -# names are type prefixes or product line names used by that manufacturers. +# front (so that you'll get reasonable search efficiency from a linear +# search of the termcap form even if you don't use reorder). Minor sections +# usually correspond to manufacturers or standard terminal classes. +# Parenthesized words following manufacturer names are type prefixes or +# product line names used by that manufacturers. # # HOW TO READ THE ENTRIES: # @@ -124,9 +131,6 @@ # only support one attribute without magic-cookie lossage. # Their base entry is usually paired with another that # uses magic cookies to support multiple attributes. -# -na No arrow keys - termcap ignores arrow keys which are -# actually there on the terminal, so the user can use -# the arrow keys locally. # -nam No auto-margin - suppress capability # -nl No labels - suppress soft labels # -ns No status line - suppress status line @@ -135,7 +139,7 @@ # -vb Use visible bell () rather than . # -w Wide - in 132 column mode. # If a name has multiple suffixes and one is a line height, that one should -# go first. Thus `aaa-30-s-rv' is recommended over `aaa-s-rv'. +# go first. Thus `aaa-30-s-rv' is recommended over `aaa-s-rv-30'. # # Entries with embedded plus signs are designed to be included through use/tc # capabilities, not used as standalone entries. @@ -194,14 +198,14 @@ # # All the entries in this file have been edited to assume that the tabset # files directory is /usr/share/tabset, in conformance with the File Hierarchy -# Standard for Linux and free BSD systems. Some vendors (notably Sun) use -# /usr/lib/tabset or (more recently) /usr/share/lib/tabset. +# Standard for Linux and open-source BSD systems. Some vendors (notably Sun) +# use /usr/lib/tabset or (more recently) /usr/share/lib/tabset. # -# No curses package we know of uses these files. If their location is an -# issue, you will have to hand-patch the file locations before compiling +# No curses package we know of actually uses these files. If their location +# is an issue, you will have to hand-patch the file locations before compiling # this file. # -# REQUEST FOR CONTACT INFORMATION AND HISTORICAL MATERIAL: +# REQUEST FOR CONTACT INFORMATION AND HISTORICAL MATERIAL # # As the ANSI/ECMA-48 standard and variants take firmer hold, and as # character-cell terminals are increasingly replaced by X displays, much of @@ -249,7 +253,7 @@ # There are no guarantees anywhere. Svaha! # -######## STANDARD AND SPECIAL TYPES +######## ANSI, UNIX CONSOLE, AND SPECIAL TYPES # # This section describes terminal classes and maker brands that are still # quite common. @@ -316,7 +320,7 @@ klone+sgr-dumb|attribute control for ansi.sys displays (no ESC [ 11 m), use=klone+acs, # KOI8-R (RFC1489) acs (alternate character set) -# From: QingLong , 24 Feb 1996. +# From: Qing Long , 24 Feb 1996. klone+koi8acs|alternate character set for ansi.sys displays with KOI8 charset, acsc=+\020\,\021-\036.^_0\215`\004a\237f\234g\232h\222i\220j\205k\203l\202m\204n\212o\213p\216q\0r\217s\214t\206u\207v\210w\211x\201y\230z\231{\267|\274}L~\225, rmacs=\E[10m, smacs=\E[11m, @@ -378,7 +382,7 @@ ansi-mini|any ansi terminal with pessimistic assumptions, # not to require any -- even at 9600 bps. If you encounter problems, # try including the padding specifications. # -# Note: the "as" and "ae" specifications are not implemented here, for +# Note: the :as: and :ae: specifications are not implemented here, for # the available termcap documentation does not make clear WHICH alternate # character set to specify. ANSI 3.64 seems to make allowances for several. # Please make the appropriate adjustments to fit your needs -- that is @@ -468,8 +472,7 @@ ansi|ansi/pc-term compatible with color, u9=\E[c, use=ecma+color, use=klone+sgr, use=ansi-m, -# -# ANSI.SYS entries +#### DOS ANSI.SYS variants # # This completely describes the sequences specified in the DOS 2.1 ANSI.SYS # documentation (except for the keyboard key reassignment feature, which @@ -523,36 +526,34 @@ nansi.sysk|nansisysk|PC-DOS Public Domain NANSI.SYS with keypad redefined for vi #### ANSI console types # -#### BeOS entry for Terminal program. Seems to be almost ANSI -# +#### BeOS +# +# BeOS entry for Terminal program Seems to be almost ANSI beterm|BeOS Terminal, am, eo, mir, msgr, xenl, xon, - colors#8, cols#80, it#8, lines#25, pairs#64, - bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, - clear=\E[H\E[J, cnorm=\E[?25h, cr=^M, + colors#8, cols#80, it#8, lines#25, ncv#5, pairs#64, + bel=^G, bold=\E[1m, clear=\E[H\E[J, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dch=\E[%p1%dP, - dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, - el=\E[K, flash=\E[?5h\E[?5l$<200/>, home=\E[H, - hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, - il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, - kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, - kend=\E[4~, kf1=\E[11~, kf10=\E[20~, kf11=\E[21~, - kf12=\E[22~, kf2=\E[12~, kf3=\E[13~, kf4=\E[14~, - kf5=\E[15~, kf6=\E[16~, kf7=\E[17~, kf8=\E[18~, kf9=\E[19~, - khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, - nel=^M^J, op=\E[m, rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l, - rmso=\E[m, rmul=\E[24m, rs1=\Ec, sc=\E7, setab=\E[4%p1%dm, - setaf=\E[3%p1%dm, setb=\E[%p1%'('%+%cm, - setf=\E[%p1%{30}%+%cm, sgr0=\E[0;10m, smir=\E[4h, - smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%p1%d;%p2%dR, - u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, + dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, + home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, + ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, kbs=^H, + kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kdch1=\E[3~, kend=\E[4~, kf1=\E[11~, kf10=\E[20~, + kf11=\E[21~, kf12=\E[22~, kf2=\E[12~, kf3=\E[13~, + kf4=\E[14~, kf5=\E[15~, kf6=\E[16~, kf7=\E[17~, kf8=\E[18~, + kf9=\E[19~, khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, + kspd=^Z, nel=^M^J, op=\E[m, rc=\E8, rev=\E[7m, ri=\EM, + rmir=\E[4l, rmso=\E[m, rmul=\E[24m, rs1=\Ec, sc=\E7, + setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + setb=\E[%p1%{40}%+%cm, setf=\E[%p1%{30}%+%cm, + sgr0=\E[0;10m, smir=\E[4h, smso=\E[7m, smul=\E[4m, + u6=\E[%i%p1%d;%p2%dR, u7=\E[6n, vpa=\E[%i%p1%dd, -# This entry is good for the 1.2.13 version of the Linux console driver. +#### Linux consoles # -# Note: there are numerous broken linux entries out there, which didn't screw -# up BSD termcap but hose ncurses's smarter cursor-movement optimization. -# One common pathology is an incorrect tab length of 4. + +# This entry is good for the 1.2.13 or later version of the Linux console. # # *************************************************************************** # * * @@ -567,7 +568,7 @@ beterm|BeOS Terminal, # string F26 ="\033[Z" # * * # * This has to use a key slot which is unfortunate (any unused one will * -# # do, F26 is the higher-numbered one). The change ought to be built * +# * do, F26 is the higher-numbered one). The change ought to be built * # * into the kernel tables. * # * * # *************************************************************************** @@ -578,27 +579,30 @@ beterm|BeOS Terminal, # 1.9.9. All linux kernels since 1.2.13 (at least) set the screen size # themselves; this entry assumes that capability. # +# The 2.2.x kernels add a private mode that sets the cursor type; use that to +# get a block cursor for cvvis. +# reported by Frank Heckenbach . linux|linux console, am, bce, eo, mir, msgr, xenl, xon, - it#8, ncv@, + it#8, ncv#2, acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, - bel=^G, civis=\E[?25l, clear=\E[H\E[J, cnorm=\E[?25h, - cr=^M, csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, - cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dch=\E[%p1%dP, - dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, - ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, - flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, - ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, - il1=\E[L, ind=^J, kb2=\E[G, kbs=\177, kcbt=\E[Z, kcub1=\E[D, - kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, - kend=\E[4~, kf1=\E[[A, kf10=\E[21~, kf11=\E[23~, - kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, - kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, - kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, - kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, + bel=^G, civis=\E[?25l\E[?1c, clear=\E[H\E[J, + cnorm=\E[?25h\E[?0c, cr=^M, csr=\E[%i%p1%d;%p2%dr, + cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, + cuu1=\E[A, cvvis=\E[?25h\E[?8c, dch=\E[%p1%dP, dch1=\E[P, + dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, + el=\E[K, el1=\E[1K, flash=\E[?5h\E[?5l$<200/>, home=\E[H, + hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, + il=\E[%p1%dL, il1=\E[L, ind=^J, kb2=\E[G, kbs=\177, + kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, + kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, + kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, + kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, nel=^M^J, rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l, rmso=\E[27m, - rmul=\E[24m, rs1=\Ec, sc=\E7, + rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, smir=\E[4h, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, @@ -615,7 +619,7 @@ linux-c-nc|linux console 1.3.x hack for ncurses only, linux-c|linux console 1.3.6+ with private palette for each virtual console, ccc, colors#8, pairs#64, - initc=\E]P%?%p1%{9}%>%t%p1%{10}%-%p'a'%+%c%e%p1%d%p2%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p3%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p4%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;, + initc=\E]P%?%p1%{9}%>%t%p1%{10}%-%'a'%+%c%e%p1%d%;%p2%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p3%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p4%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;, oc=\E]R, use=linux, @@ -630,11 +634,36 @@ linux-koi8|linux with koi8 alternate character set, acsc=+\020\,\021-\030.^Y0\215`\004a\221f\234g\237h\220i\276j\205k\203l\202m\204n\212o~p\0q\0r\0s_t\206u\207v\211w\210x\201y\230z\231{\267|\274~\224, use=linux, use=klone+koi8acs, -# Another entry for KOI8-r with QingLong's acsc. -# (which one better complies the standard?) +# Another entry for KOI8-r with Qing Long's acsc. +# (which one better complies with the standard?) linux-koi8r|linux with koi8-r alternate character set, + kbs=^H, kcub1=^H, kcud1=^J, use=linux, use=klone+koi8acs, +# From: Matthew Vernon +mach|Mach Console, + am, km, + cols#80, it#8, lines#25, + bel=^G, blink=\E[5m, bold=\E[1m, clear=\Ec, cr=^M, + cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, + cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, + cuu=\E[%p1%dA, cuu1=\E[A, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, + el=\E[K, home=\E[H, ht=^I, il=\E[%p1%dL, il1=\E[L, ind=^J, + kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kdch1=\E[9, kend=\E[Y, kf1=\EOP, kf10=\EOY, kf2=\EOQ, + kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, kf7=\EOV, kf8=\EOW, + kf9=\EOX, khome=\E[H, kich1=\E[@, kll=\E[F, knp=\E[U, + kpp=\E[V, nel=^M^J, rev=\E[7m, rmso=\E[0m, sgr0=\E[0m, + smso=\E[7m, +mach-bold|Mach Console with bold instead of underline, + rmul=\E[0m, smul=\E[1m, + use=mach, + +# Entry for the latin1 and latin2 fonts +linux-lat|linux with latin1 or latin2 alternate character set, + acsc=+\020\,\021-\030.^Y0\333`\004a\013f\370g\361h\260i\316j\211k\214l\206m\203n\305o~p\304q\212r\304s_t\207u\215v\301w\302x\205y\363z\362{\343|\330}\234~\376, + use=linux, + # SCO console and SOS-Syscons console for 386bsd # (scoansi: had unknown capabilities # :Gc=N:Gd=K:Gh=M:Gl=L:Gu=J:Gv=\072:\ @@ -644,18 +673,38 @@ linux-koi8r|linux with koi8-r alternate character set, # :WL=\E[S:WR=\E[T:CL=\E[U:CR=\E[V:\ # I renamed GS/GE/HM/EN/PU/PD/RT and added klone+sgr-dumb, based # on the =\E[12m -- esr) +# +# klone+sgr-dumb is an error since the acsc does not match -TD +# +# In this description based on SCO's keyboard(HW) manpage list of default function key +# values: +# F13-F24 are shifted F1-F12 +# F25-F36 are control F1-F12 +# F37-F48 are shift+control F1-F12 scoansi|SCO Extended ANSI standard crt, am, eo, xon, - cols#80, it#8, lines#25, + colors#8, cols#80, it#8, lines#25, pairs#64, + acsc=0[5566778899\:\:;;<<==>>FFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXX`ja0fxgqh2jYk?lZm@nEqDtCu4vAwBx3~y, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[2J, cub1=\E[D, cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, - ht=^I, ich1=\E[@, il1=\E[L, ind=\E[S, kbs=^H, kcub1=\E[D, - kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kend=\E[F, kf1=\E[M, - kf10=\E[V, kf2=\E[N, kf3=\E[O, kf4=\E[P, kf5=\E[Q, kf6=\E[R, - kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H, knp=\E[G, kpp=\E[I, - ri=\E[T, - use=klone+sgr-dumb, + ht=^I, ich1=\E[@, il1=\E[L, ind=\E[S, invis=\E[8m, kbeg=\E[E, + kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, + kcuu1=\E[A, kend=\E[F, kf1=\E[M, kf10=\E[V, kf11=\E[W, + kf12=\E[X, kf13=\E[Y, kf15=\E[a, kf16=\E[b, kf17=\E[c, + kf18=\E[d, kf19=\E[e, kf2=\E[N, kf20=\E[f, kf21=\E[g, + kf22=\E[h, kf23=\E[i, kf24=\E[j, kf25=\E[k, kf26=\E[l, + kf27=\E[m, kf28=\E[n, kf29=\E[o, kf3=\E[O, kf30=\E[p, + kf31=\E[q, kf32=\E[r, kf33=\E[s, kf34=\E[t, kf35=\E[u, + kf36=\E[v, kf37=\E[w, kf38=\E[x, kf39=\E[y, kf4=\E[P, + kf40=\E[z, kf41=\E[@, kf42=\E[[, kf43=\E[\\, kf44=\E[], + kf45=\E[\^, kf46=\E[_, kf47=\E[`, kf48=\E[{, kf5=\E[Q, + kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H, + kich1=\E[L, knp=\E[G, kpp=\E[I, op=\E[37;40m, rev=\E[7m, + ri=\E[T, rmacs=\E[10m, rmso=\E[m, rmul=\E[m, + setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;12%;m, + sgr0=\E[0;10m, smacs=\E[12m, smso=\E[7m, smul=\E[4m, # This actually describes the generic SVr4 display driver for Intel boxes. # The isn't documented and therefore may not be reliable. @@ -680,7 +729,7 @@ att6386|at386|386at|AT&T WGS 6386 console, knp=\E[U, kpp=\E[V, krmir=\E0, nel=\r\E[S, rc=\E8, rev=\E[7m, ri=\E[T, rin=\E[%p1%dT, rmacs=\E[10m, rmso=\E[m, rmul=\E[m, sc=\E7, - sgr=\E[10m\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p5%t;2%;?%p6%t;1%;%?%p9%t;12%e;10%;%?%p7%t;9%;m, + sgr=\E[10m\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p9%t;12%e;10%;%?%p7%t;9%;m, sgr0=\E[0;10m, smacs=\E[12m, smso=\E[7m, smul=\E[4m, tbc=\E[2g, vpa=\E[%i%p1%dd, use=klone+color, @@ -843,9 +892,40 @@ att7300|unixpc|pc7300|3b1|s4|AT&T UNIX PC Model 7300, rmso=\E[m, rmul=\E[m, sgr0=\E[0;10m, smso=\E[7m, smul=\E[4m, -# From: Stefan Stapelberg , 24 Feb 1997 +# Sent by Stefan Stapelberg , 24 Feb 1997, this is +# from SGI's terminfo database. SGI's entry shows F9-F12 with the codes +# for the application keypad mode. We have added iris-ansi-ap rather than +# change the original to keypad mode. +# # (iris-ansi: added rmam/smam based on init string -- esr) -iris-ansi|IRIS emulating 40 line ANSI terminal (almost VT100), +# +# This entry, and those derived from it, is used in xwsh (also known as +# winterm). Some capabilities that do not fit into the terminfo model +# include the shift- and control-functionkeys: +# +# F1-F12 generate different codes when shift or control modifiers are used. +# For example: +# F1 \E[001q +# shift F1 \E[013q +# control-F1 \E[025q +# +# In application keypad mode, F9-F12 generate codes like vt100 PF1-PF4, i.e., +# \EOP to \EOS. The shifted and control modifiers still do the same thing. +# +# The cursor keys also have different codes: +# control-up \E[162q +# control-down \E[165q +# control-left \E[159q +# control-right \E[168q +# +# shift-up \E[161q +# shift-down \E[164q +# shift-left \E[158q +# shift-right \E[167q +# +# control-tab \[072q +# +iris-ansi|iris-ansi-net|IRIS emulating 40 line ANSI terminal (almost VT100), am, cols#80, it#8, lines#40, bel=^G, bold=\E[1m, clear=\E[H\E[2J, @@ -859,18 +939,18 @@ iris-ansi|IRIS emulating 40 line ANSI terminal (almost VT100), kEND=\E[147q, kHOM=\E[143q, kLFT=\E[158q, kPRT=\E[210q, kRIT=\E[167q, kSPD=\E[218q, kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\177, - kend=\E[146q, kent=^M, kf1=\E[001q, kf10=\EOQ, kf11=\EOR, - kf12=\EOS, kf2=\E[002q, kf3=\E[003q, kf4=\E[004q, - kf5=\E[005q, kf6=\E[006q, kf7=\E[007q, kf8=\E[008q, - kf9=\EOP, khome=\E[H, kich1=\E[139q, knp=\E[154q, - kpp=\E[150q, kprt=\E[209q, krmir=\E[146q, kspd=\E[217q, - nel=\EE, pfkey=\EP101;%p1%d.y%p2%s\E\\, rc=\E8, - rev=\E[7m, ri=\EM, rmam=\E[?7l, rmso=\E[m, rmul=\E[m, sc=\E7, - sgr0=\E[m, smam=\E[?7h, smso=\E[1;7m, smul=\E[4m, + kend=\E[146q, kent=^M, kf1=\E[001q, kf10=\E[010q, + kf11=\E[011q, kf12=\E[012q, kf2=\E[002q, kf3=\E[003q, + kf4=\E[004q, kf5=\E[005q, kf6=\E[006q, kf7=\E[007q, + kf8=\E[008q, kf9=\E[009q, khome=\E[H, kich1=\E[139q, + knp=\E[154q, kpp=\E[150q, kprt=\E[209q, krmir=\E[146q, + kspd=\E[217q, nel=\EE, pfkey=\EP101;%p1%d.y%p2%s\E\\, + rc=\E8, rev=\E[7m, ri=\EM, rmam=\E[?7l, rmso=\E[m, rmul=\E[m, + sc=\E7, sgr0=\E[m, smam=\E[?7h, smso=\E[1;7m, smul=\E[4m, tbc=\E[3g, iris-ansi-ap|IRIS ANSI in application-keypad mode, - is2=\E[?1l\E>\E[?7h, kf10=\E[010q, kf11=\E[011q, - kf12=\E[012q, rmkx=\E>, smkx=\E=, + is2=\E[?1l\E=\E[?7h, kent=\EOM, kf10=\E[010q, + kf11=\E[011q, kf12=\E[012q, kf9=\E[009q, use=iris-ansi, # From the man-page, this is a quasi-vt100 emulator that runs on SGI's IRIX @@ -929,13 +1009,14 @@ ibmpcx|xenix|ibmx|IBM PC xenix console display, # handle this case with the capability, and prefers for better # optimization. Bug: The capability resets attributes. # From: Michael Hunter 30 Jul 1996 +# (removed: ) qnx|qnx4|qnx console, daisy, km, mir, msgr, xhpa, xt, colors#8, cols#80, it#4, lines#25, ncv#3, pairs#8, acsc=O\333a\261j\331k\277l\332m\300n\305o\337q\304s\334t\303u\264v\301w\302x\263, bel=^G, blink=\E{, bold=\E<, civis=\Ey0, clear=\EH\EJ, cnorm=\Ey1, cr=^M, cub1=^H, cud1=^J, cuf1=\EC, - cup=\EY%p1%' '%+%c%p2%' '%+%c, cuu1=\EA, cvvis=\Ey2, + cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, cvvis=\Ey2, dch1=\Ef, dl1=\EF, ed=\EJ, el=\EK, home=\EH, ht=^I, ich1=\Ee, il1=\EE, ind=^J, kBEG=\377\356, kCAN=\377\263, kCMD=\377\267, kCPY=\377\363, kCRT=\377\364, @@ -978,11 +1059,19 @@ qnx|qnx4|qnx console, krmir=\377\313, krpl=\377\362, krst=\377\352, ksav=\377\361, kslt=\377\247, kspd=\377\335, ktbc=\377\344, kund=\377\365, mvpa=\E!%p1%02d, op=\ER, - rep=\Eg%p2%' '%+%c%p1%c, rev=\E(, ri=\EI, rmcup=\Eh\ER, + rep=\Eg%p2%{32}%+%c%p1%c, rev=\E(, ri=\EI, rmcup=\Eh\ER, rmso=\E), rmul=\E], rs1=\ER, setb=\E@%p1%Pb%gb%gf%d%d, - setf=\E@%p1%Pf%gb%gf%d%d, - sgr=%?%p1%t\E<%;%p2%t\E[%;%p3%t\E(%;%p4%t\E{%;%p6%t\E<%;, - sgr0=\E}\E]\E>\E), smcup=\Ei, smso=\E(, smul=\E[, + setf=\E@%p1%Pf%gb%gf%d%d, sgr0=\E}\E]\E>\E), smcup=\Ei, + smso=\E(, smul=\E[, + +# From: Federico Bianchi , 1 Jul 1998 +# (esr: commented out and to avoid warnings.) +# (TD: derive from original qnx4 entry) +qnxt2|qnx 2.15 serial terminal, + am, + civis@, cnorm@, cvvis@, dch1@, ich1@, kRES@, kRPL@, kUND@, kspd@, + rep@, rmcup@, rmso=\E>, setb@, setf@, smcup@, smso=\E<, + use=qnx4, #### NetBSD consoles # @@ -994,15 +1083,15 @@ qnx|qnx4|qnx console, # the :Xs: flag. Then I split :is: into a size-independent and a # size-dependent . Finally, I added / -- esr) -# NOTE: because the 386BSD "vi"/"elvis" seems to have a bug if -# both and are specified (an original VT220 -# shows the same buggy behaviour!), has been taken -# out of this entry. for reference, it should be . +# NOTE: has been taken out of this entry. for reference, it should +# be . For discussion, see ICH/ICH1 VERSUS RMIR/SMIR below. +# (esr: added and to resolve NetBSD Problem Report #4583) pcvtXX|pcvt vt200 emulator (DEC VT220), am, km, mir, msgr, xenl, it#8, vt#3, acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz~~, - bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cr=^M, + bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, + clear=\E[H\E[J, cnorm=\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, @@ -1065,6 +1154,38 @@ pcvt50w|dec vt220 emulation with 50 lines and 132 cols, cols#132, lines#50, is2=\E[1;50r\E[50;1H, use=pcvtXX, +# Terminfo entries to enable the use of the ncurses library in colour on a +# NetBSD-arm32 console (only tested on a RiscPC). +# Created by Dave Millen 22.07.98 +# modified codes for setf/setb to setaf/setab, then to klone+color, corrected +# typo in invis - TD +arm100|arm100-am|Arm(RiscPC) ncurses compatible (for 640x480), + am, bce, msgr, xenl, xon, + cols#80, it#8, lines#30, + acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\E[5m$<2>, bold=\E[1m$<2>, + clear=\E[H\E[J$<50>, cr=^M, csr=\E[%i%p1%d;%p2%dr, + cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, + cuf=\E[%p1%dC, cuf1=\E[C$<2>, + cup=\E[%i%p1%d;%p2%dH$<5>, cuu=\E[%p1%dA, + cuu1=\E[A$<2>, ed=\E[J$<50>, el=\E[K$<3>, el1=\E[1K$<3>, + enacs=\E(B\E)0, home=\E[H, ht=^I, hts=\EH, ind=^J, + invis=\E[8m$<2>, ka1=\E[q, ka3=\E[s, kb2=\E[r, kbs=^H, + kc1=\E[p, kc3=\E[n, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, + kcuu1=\E[A, kent=\E[M, kf0=\E[y, kf1=\E[P, kf10=\E[x, + kf2=\E[Q, kf3=\E[R, kf4=\E[S, kf5=\E[t, kf6=\E[u, kf7=\E[v, + kf8=\E[l, kf9=\E[w, rc=\E8, rev=\E[6m$<2>, ri=\EM$<5>, + rmacs=^O, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m$<2>, + rmul=\E[m$<2>, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, + sc=\E7, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr0=\E[m\017$<2>, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=, + smso=\E[7m$<2>, smul=\E[4m$<2>, tbc=\E[3g, + use=ecma+sgr, use=klone+color, + +arm100-w|arm100-wam|Arm(RiscPC) ncurses compatible (for 1024x768), + cols#132, lines#50, use=arm100, + # NetBSD/x68k console vt200 emulator. This port runs on a 68K machine # manufactured by Sharp for the Japenese market. # From Minoura Makoto , 12 May 1996 @@ -1072,6 +1193,46 @@ x68k|x68k-ite|NetBSD/x68k ITE, cols#96, lines#32, kclr=\E[9~, khlp=\E[28~, use=vt220, +# : +# Entry for the DNARD OpenFirmware console, close to ANSI but not quite. +# +# (still unfinished, but good enough so far.) +ofcons, + bw, + cols#80, lines#30, + bel=^G, blink=\2337;2m, bold=\2331m, clear=^L, cr=^M, + cub=\233%p1%dD, cub1=\233D, cud=\233%p1%dB, cud1=\233B, + cuf=\233%p1%dC, cuf1=\233C, cup=\233%i%p1%d;%p2%dH, + cuu=\233%p1%dA, cuu1=\233A, dch=\233%p1%dP, dch1=\233P, + dim=\2332m, dl=\233%p1%dM, dl1=\233M, ed=\233J, el=\233K, + flash=^G, ht=^I, ich=\233%p1%d@, ich1=\233@, il=\233%p1%dL, + il1=\233L, ind=^J, invis=\2338m, kbs=^H, kcub1=\233D, + kcud1=\233B, kcuf1=\233C, kcuu1=\233A, kdch1=\233P, + kf1=\2330P, kf10=\2330M, kf2=\2330Q, kf3=\2330W, + kf4=\2330x, kf5=\2330t, kf6=\2330u, kf7=\2330q, kf8=\2330r, + kf9=\2330p, knp=\233/, kpp=\233?, nel=^M^J, rev=\2337m, + rmso=\2330m, rmul=\2330m, sgr0=\2330m, + +# NetBSD "wscons" emulator in vt220 mode +# These are micro-minimal and probably need to be redone for real +# after the manner of the pcvt entries. +wsvt25|NetBSD wscons in 25 line DEC VT220 mode, + cols#80, lines#25, use=vt220, + +wsvt25m|NetBSD wscons in 25 line DEC VT220 mode with Meta, + km, + cols#80, lines#25, use=vt220, + +# `rasterconsole' provided by 4.4BSD, NetBSD and OpenBSD on SPARC, and +# DECstation/pmax. +rcons|BSD rasterconsole, + use=sun-il, +# Color version of above. Color currenly only provided by NetBSD. +rcons-color|BSD rasterconsole with ANSI color, + bce, + colors#8, pairs#64, + op=\E[m, setab=\E[4%dm, setaf=\E[3%dm, use=rcons, + #### FreeBSD console entries # # From: Andrey Chernov 29 Mar 1996 @@ -1097,22 +1258,23 @@ x68k|x68k-ite|NetBSD/x68k ITE, # Note that this disables standout with color. cons25w|ansiw|ansi80x25-raw|freebsd console (25-line raw mode), am, bce, bw, eo, msgr, npc, - colors#8, cols#80, it#8, lines#25, ncv#5, pairs#64, + colors#8, cols#80, it#8, lines#25, ncv#21, pairs#64, bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, - cr=^M, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B, - cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, - cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, - dim=\E[30;1m, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, - home=\E[H, hpa=\E[%i%p1%d`, ht=^I, ich=\E[%p1%d@, - ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=\E[S, - indn=\E[%p1%dS, kb2=\E[E, kbs=^H, kcbt=\E[Z, kcub1=\E[D, - kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\177, kend=\E[F, - kf1=\E[M, kf10=\E[V, kf11=\E[W, kf12=\E[X, kf2=\E[N, - kf3=\E[O, kf4=\E[P, kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T, - kf9=\E[U, khome=\E[H, kich1=\E[L, knp=\E[G, kpp=\E[I, - nel=\E[E, op=\E[x, rev=\E[7m, ri=\E[T, rin=\E[%p1%dT, - rmso=\E[m, rs1=\E[x\E[m\Ec, setab=\E[4%p1%dm, - setaf=\E[3%p1%dm, sgr0=\E[m, smso=\E[7m, vpa=\E[%i%p1%dd, + cnorm=\E[=0C, cr=^M, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, + cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + cvvis=\E[=1C, dch=\E[%p1%dP, dch1=\E[P, dim=\E[30;1m, + dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, + hpa=\E[%i%p1%d`, ht=^I, ich=\E[%p1%d@, ich1=\E[@, + il=\E[%p1%dL, il1=\E[L, ind=\E[S, indn=\E[%p1%dS, kb2=\E[E, + kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, + kcuu1=\E[A, kdch1=\177, kend=\E[F, kf1=\E[M, kf10=\E[V, + kf11=\E[W, kf12=\E[X, kf2=\E[N, kf3=\E[O, kf4=\E[P, kf5=\E[Q, + kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H, + kich1=\E[L, knp=\E[G, kpp=\E[I, nel=\E[E, op=\E[x, rev=\E[7m, + ri=\E[T, rin=\E[%p1%dT, rmso=\E[m, rs1=\E[x\E[m\Ec, + setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[m, + smso=\E[7m, vpa=\E[%i%p1%dd, cons25|ansis|ansi80x25|freebsd console (25-line ansi mode), acsc=-\030.^Y0\333`\004a\260f\370g\361h\261i\025j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263y\363z\362~\371, use=cons25w, @@ -1199,30 +1361,34 @@ oldpc3|oldibmpc3|old IBM PC BSD/386 Console, # "stty rows NN", e.g. to use 24 lines. # (Color support from Kevin Rosenberg , 2 May 1996) # Bug: The capability resets attributes. -bsdos|BSD/OS console, - am, bw, eo, km, xon, - colors#8, cols#80, it#8, lines#25, pairs#64, - bel=^G, blink=\E[5m, bold=\E[1m, clear=\Ec, cr=^M, - cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, - cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, - cuu=\E[%p1%dA, cuu1=\E[A, dim=\E[=8F, dl=\E[%p1%dM, - dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I, il=\E[%p1%dL, - il1=\E[L, ind=^J, kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, - kcuu1=\E[A, khome=\E[H, kich1=\E[L, kll=\E[F, knp=\E[G, - kpp=\E[I, nel=^M^J, op=\E[x, rc=\E8, rev=\E[7m, rmso=\E[0m, - sc=\E7, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[0m, - smso=\E[7m, -bsdos-bold|IBM PC BSD/386 Console with bold instead of underline, - rmul=\E[0m, smul=\E[1m, - use=bsdos, - -# If you are BSDI, you want the following entries, for the moment. -# In release 2.0 they will probably phase out the pc3 and ibmpc3 names -pc3|IBM PC BSD/386 Console, - use=bsdos, -ibmpc3|pc3-bold|IBM PC BSD/386 Console with bold instead of underline, - smul=\E[1m, - use=bsdos-bold, +bsdos-pc-nobold|BSD/OS PC console w/o bold, + am, eo, km, xon, + cols#80, it#8, lines#25, + bel=^G, clear=\Ec, cr=^M, cub=\E[%p1%dD, cub1=^H, + cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I, + il=\E[%p1%dL, il1=\E[L, ind=^J, kbs=^H, kcub1=\E[D, + kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, kich1=\E[L, + kll=\E[F, knp=\E[G, kpp=\E[I, nel=^M^J, rc=\E8, sc=\E7, + sgr=\E[0;10%?%p1%t;7%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m%?%p5%t\E[=8F%;, + use=klone+sgr, use=klone+color, +bsdos-pc|IBM PC BSD/OS Console, + sgr=\E[0;10%?%p1%t;7%;%?%p2%t;1%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, use=bsdos-pc-nobold, + +# Old names for BSD/OS PC console used in releases before 4.1. +pc3|BSD/OS on the PC Console, + use=bsdos-pc-nobold, +ibmpc3|pc3-bold|BSD/OS on the PC Console with bold instead of underline, + use=bsdos-pc, + +# BSD/OS on the SPARC +bsdos-sparc|Sun SPARC BSD/OS Console, + use=sun, + +# BSD/OS on the PowerPC +bsdos-ppc|PowerPC BSD/OS Console, + use=bsdos-pc, #### DEC VT100 and compatibles # @@ -1242,8 +1408,7 @@ ibmpc3|pc3-bold|IBM PC BSD/386 Console with bold instead of underline, # its name to Boundless Technologies; see http://www.boundless.com. # -# (The , , and capabilities aren't in DEC's official -# entry -- esr) +# (// capabilities aren't in DEC's official entry -- esr) vt52|dec vt52, cols#80, it#8, lines#24, acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, @@ -1908,6 +2073,83 @@ z340-nam|zstem vt340 terminal emulator 132col 42line (no automatic margins), rs2=\E>\E[?3h\E[?4l\E[?5l\E[?7l\E[?8h\E[1;42r\E[42;1H, use=z340, +# CRT is shareware. It implements some xterm features, including mouse. +crt|crt-vt220|CRT 2.3 emulating VT220, + bce, msgr, + colors#8, pairs#64, + hts=\EH, op=\E[39;49m, setab=\E[4%p1%dm, + setaf=\E[3%p1%dm, setb=\E[4%p1%dm, setf=\E[3%p1%dm, + u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, + use=vt220, + +# This entry is for Tera Term Pro version 2.3, for MS-Windows 95/NT written by +# T. Teranishi dated Mar 10, 1998. It is a free software terminal emulator +# (communication program) which supports: +# +# - Serial port connections. +# - TCP/IP (telnet) connections. +# - VT100 emulation, and selected VT200/300 emulation. +# - TEK4010 emulation. +# - File transfer protocols (Kermit, XMODEM, ZMODEM, B-PLUS and +# Quick-VAN). +# - Scripts using the "Tera Term Language". +# - Japanese and Russian character sets. +# +# The program does not come with terminfo or termcap entries. However, the +# emulation (testing with vttest and ncurses) is reasonably close to vt100 (no +# vt52 or doublesize character support; blinking is done with color). Besides +# the HPA, VPA extensions it also implements CPL and CNL. +# +# All of the function keys can be remapped. This description shows the default +# mapping, as installed. Both vt100 PF1-PF4 keys and quasi-vt220 F1-F4 keys +# are supported. F13-F20 are obtained by shifting F3-F10. The editing keypad +# is laid out like vt220, rather than the face codes on the PC keyboard, i.e, +# kfnd Insert +# kslt Delete +# kich1 Home +# kdch1 PageUp +# kpp End +# knp PageDown +# +# ANSI colors are implemented, but cannot be combined with video attributes +# except for reverse. +# +# No fonts are supplied with the program, so the acsc string is chosen to +# correspond with the default Microsoft terminal font. +# +# Tera Term recognizes some xterm sequences, including those for setting and +# retrieving the window title, and for setting the window size (i.e., using +# "resize -s"), though it does not pass SIGWINCH to the application if the +# user resizes the window with the mouse. +teraterm|Tera Term Pro, + km, xon@, + ncv#43, vt@, + acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, + blink=\E[5m, bold=\E[1m, civis=\E[?25l, clear=\E[H\E[J, + cnorm=\E[?25h, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, + cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, + dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, + flash=\E[?5h\E[?5l$<200/>, hpa=\E[%i%p1%dG, + il=\E[%p1%dL, il1=\E[L, kdch1=\E[3~, kf1=\E[11~, + kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, + kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, + kf18=\E[32~, kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, + kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, kfnd=\E[1~, kich1=\E[2~, knp=\E[6~, + kpp=\E[5~, kslt=\E[4~, op=\E[100m, rev=\E[7m, ri=\EM, + rmso=\E[27m, rmul=\E[24m, sgr0=\E[m, smso=\E[7m, + smul=\E[4m, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, + vpa=\E[%i%p1%dd, + use=klone+color, use=vt100, + +# Tested with WinNT 4.0, the telnet application assumes the screensize is +# 25x80. This entry uses the 'Terminal' font, to get line-drawing characters. +ms-vt100|MS telnet imitating dec vt100, + lines#25, + acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, + tbc@, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c, + use=vt100, + #### X terminal emulators # # You can add the following line to your .Xdefaults to change the terminal type @@ -1940,6 +2182,8 @@ x10term|vs100-x10|xterm terminal emulator (X10 window system), smso=\E[7m, smul=\E[4m, # Compatible with the R5 xterm # (from the XFree86 3.2 distribution, removed) +# added khome/kend, rmir/smir, rmul/smul based on the R5 xterm code - TD +# corrected typos in rs2 string - TD xterm-r5|xterm R5 version, am, km, msgr, xenl, cols#80, it#8, lines#24, @@ -1951,21 +2195,25 @@ xterm-r5|xterm R5 version, el=\E[K, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~, - kdl1=\E[31~, kel=\E[8~, kf0=\EOq, kf1=\E[11~, kf10=\E[21~, - kf11=\E[23~, kf12=\E[24~, kf2=\E[12~, kf3=\E[13~, - kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, - kf9=\E[20~, khome=\E[7~, kich1=\E[2~, kil1=\E[30~, - knp=\E[6~, kpp=\E[5~, rc=\E8, rev=\E[7m, ri=\EM, - rmkx=\E[?1l\E>, rmso=\E[m, - rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, sc=\E7, + kdl1=\E[31~, kel=\E[8~, kend=\E[4~, kf0=\EOq, kf1=\E[11~, + kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf2=\E[12~, + kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~, + kil1=\E[30~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, rc=\E8, + rev=\E[7m, ri=\EM, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[m, + rmul=\E[m, + rs2=\E>\E[?1;3;4;5;6l\E[4l\E[?7h\E[m\E[r\E[2J\E[H, + sc=\E7, sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m, - sgr0=\E[m, smkx=\E[?1h\E=, smso=\E[7m, tbc=\E[3g, + sgr0=\E[m, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, + smul=\E[4m, tbc=\E[3g, # Compatible with the R6 xterm # (from XFree86 3.2 distribution, and added, removed) +# added khome/kend - TD xterm-r6|xterm-old|xterm X11R6 version, am, km, mir, msgr, xenl, cols#80, it#8, lines#24, - acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, @@ -1980,19 +2228,20 @@ xterm-r6|xterm-old|xterm X11R6 version, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kfnd=\E[1~, - kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kslt=\E[4~, meml=\El, - memu=\Em, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, + kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, kslt=\E[4~, + meml=\El, memu=\Em, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m, rs2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, sc=\E7, sgr0=\E[m, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g, + u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, # This is the base xterm entry for the xterm supplied with XFree86 3.2 & up. # The name has been changed and some aliases have been removed. xterm-xf86-v32|xterm terminal emulator (XFree86 3.2 Window System), am, bce, km, mir, msgr, xenl, colors#8, cols#80, it#8, lines#24, pairs#64, - acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, @@ -2023,7 +2272,8 @@ xterm-xf86-v32|xterm terminal emulator (XFree86 3.2 Window System), sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, - tbc=\E[3g, vpa=\E[%i%p1%dd, + tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, + vpa=\E[%i%p1%dd, # This is the stock xterm entry supplied with XFree86 3.3, which uses VT100 # codes for F1-F4 except while in VT220 mode. @@ -2031,24 +2281,40 @@ xterm-xf86-v33|xterm terminal emulator (XFree86 3.3 Window System), kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, use=xterm-xf86-v32, -# This beta version will probably be released in XFree86 4.0 in 1998. +# This version was released in XFree86 3.3.3 (November 1998). # Besides providing printer support, it exploits a new feature that allows # xterm to use terminfo-based descriptions with the titeInhibit resource. -xterm-xf86-v40|xterm terminal emulator (XFree86 4.0 Window System), +xterm-xf86-v333|xterm terminal emulator (XFree86 3.3.3 Window System), mc5i, - mc0=\E[i, mc4=\E[4i, mc5=\E[5i, rmcup=\E[?1047l\E[?1048l, - rs1=\Ec, smcup=\E[?1048h\E[?1047h, + blink=\E[5m, ich1@, invis=\E[8m, + is2=\E[!p\E[?3;4l\E[4l\E>, kdch1=\E[3~, kend=\E[4~, + kfnd@, khome=\E[1~, kslt@, mc0=\E[i, mc4=\E[4i, mc5=\E[5i, + rmcup=\E[?1047l\E[?1048l, rs1=\Ec, + rs2=\E[!p\E[?3;4l\E[4l\E>, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, + smcup=\E[?1048h\E[?1047h, use=xterm-xf86-v33, +# This beta version will probably be released in XFree86 4.0. +xterm-xf86-v40|xterm terminal emulator (XFree86 4.0 Window System), + ka1=\EOH, ka3=\E[5~, kb2=\EOE, kc1=\EOF, kc3=\E[6~, + kdch1=\177, kend=\EOF, khome=\EOH, rmcup=\E[?1049l, + smcup=\E[?1049h, + use=xterm-xf86-v333, + +xterm-xfree86|xterm-new|xterm terminal emulator (XFree86 4.0 Window System), + use=xterm-xf86-v40, + # From: David J. MacKenzie , 14 Nov 1997 xterm-xi|xterm on XI Graphics Accelerated X under BSD/OS 3.1, rmso=\E[m, rmul=\E[m, use=xterm-xf86-v33, -# This is one of the variants from XFree86 3.3 (T.Dickey) +# This is one of the variants of XFree86 3.3 xterm, updated for 4.0 (T.Dickey) xterm-16color|xterm with 16 colors like aixterm, colors#16, ncv#32, pairs#256, - setab@, setaf@, + setab=\E[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm, + setaf=\E[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm, setb=%p1%{8}%/%{6}%*%{4}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m, setf=%p1%{8}%/%{6}%*%{3}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m, use=xterm-xf86-v40, @@ -2065,9 +2331,9 @@ xterm-16color|xterm with 16 colors like aixterm, xterm-8bit|xterm terminal emulator 8-bit controls (X Window System), am, bce, km, mc5i, mir, msgr, xenl, colors#8, cols#80, it#8, lines#24, pairs#64, - acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, - bel=^G, bold=\2331m, cbt=\233Z, civis=\233?25l, - clear=\233H\2332J, cnorm=\233?25h, cr=^M, + acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\2335m, bold=\2331m, cbt=\233Z, + civis=\233?25l, clear=\233H\2332J, cnorm=\233?25h, cr=^M, csr=\233%i%p1%d;%p2%dr, cub=\233%p1%dD, cub1=^H, cud=\233%p1%dB, cud1=^J, cuf=\233%p1%dC, cuf1=\233C, cup=\233%i%p1%d;%p2%dH, cuu=\233%p1%dA, cuu1=\233A, @@ -2075,36 +2341,39 @@ xterm-8bit|xterm terminal emulator 8-bit controls (X Window System), dl=\233%p1%dM, dl1=\233M, ech=\233%p1%dX, ed=\233J, el=\233K, el1=\2331K, enacs=\E(B\E)0, flash=\233?5h\233?5l, home=\233H, hpa=\233%i%p1%dG, - ht=^I, hts=\210, ich=\233%p1%d@, ich1=\233@, il=\233%p1%dL, - il1=\233L, ind=^J, + ht=^I, hts=\210, ich=\233%p1%d@, il=\233%p1%dL, il1=\233L, + ind=^J, invis=\2338m, is2=\E7\E G\233r\233m\233?7h\233?1;3;4;6l\2334l\E8\E>, ka1=\217w, ka3=\217u, kb2=\217y, kbeg=\217E, kbs=^H, kc1=\217q, kc3=\217s, kcub1=\217D, kcud1=\217B, - kcuf1=\217C, kcuu1=\217A, kdch1=\2333~, kend=\217F, + kcuf1=\217C, kcuu1=\217A, kdch1=\2333~, kend=\2334~, kent=\217M, kf1=\23311~, kf10=\23321~, kf11=\23323~, kf12=\23324~, kf13=\23325~, kf14=\23326~, kf15=\23328~, kf16=\23329~, kf17=\23331~, kf18=\23332~, kf19=\23333~, kf2=\23312~, kf20=\23334~, kf3=\23313~, kf4=\23314~, kf5=\23315~, kf6=\23317~, kf7=\23318~, kf8=\23319~, - kf9=\23320~, kfnd=\2331~, khome=\217H, kich1=\2332~, - kmous=\233M, knp=\2336~, kpp=\2335~, kslt=\2334~, - mc0=\233i, mc4=\2334i, mc5=\2335i, meml=\El, memu=\Em, - op=\23339;49m, rc=\E8, rev=\2337m, ri=\215, rmacs=^O, - rmam=\233?7l, rmcup=\2332J\233?47l\E8, rmir=\2334l, - rmkx=\233?1l\E>, rmso=\23327m, rmul=\23324m, rs1=\Ec, + kf9=\23320~, khome=\2331~, kich1=\2332~, kmous=\233M, + knp=\2336~, kpp=\2335~, mc0=\233i, mc4=\2334i, mc5=\2335i, + meml=\El, memu=\Em, op=\23339;49m, rc=\E8, rev=\2337m, + ri=\215, rmacs=^O, rmam=\233?7l, rmcup=\233?1049l, + rmir=\2334l, rmkx=\233?1l\E>, rmso=\23327m, rmul=\23324m, + rs1=\Ec, rs2=\E7\E[62"p\E G\233r\233m\233?7h\233?1;3;4;6l\2334l\E8\E>, sc=\E7, setab=\2334%p1%dm, setaf=\2333%p1%dm, setb=\2334%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, setf=\2333%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, - sgr=\2330%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, - sgr0=\233m^O, smacs=^N, smam=\233?7h, smcup=\E7\233?47h, + sgr=\2330%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, + sgr0=\233m^O, smacs=^N, smam=\233?7h, smcup=\233?1049h, smir=\2334h, smkx=\233?1h\E=, smso=\2337m, smul=\2334m, - tbc=\2333g, vpa=\233%i%p1%dd, + tbc=\2333g, u6=\233[%i%d;%dR, u7=\E[6n, u8=\233[?1;2c, + u9=\E[c, vpa=\233%i%p1%dd, + +xterm-24|vs100|xterms|xterm terminal emulator (X Window System), + lines#24, use=xterm, -# This is xterm for ncurses. It mainly adds mappings for more high-half -# characters. Note that these will only work for fixed-width fonts. -xterm|vs100|xterms|xterm terminal emulator (X Window System), - acsc=++\,\,--..00``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, +# This is xterm for ncurses. +xterm|xterm terminal emulator (X Window System), + acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, kmous=\E[M, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, use=xterm-r6, @@ -2115,17 +2384,18 @@ xterm|vs100|xterms|xterm terminal emulator (X Window System), xterm+sl|access X title line and icon name, hs, wsl#40, - dsl=\E]0;\007, fsl=^G, tsl=\E]0;, + dsl=\E]0;\007, fsl=^G, tsl=\E]0;, use=xterm, xterm+sl-twm|access X title line (pacify twm-descended window managers), hs, wsl#40, - dsl=\E]2;\007, fsl=^G, tsl=\E]2;, + dsl=\E]2;\007, fsl=^G, tsl=\E]2;, use=xterm, # # The following xterm variants don't depend on your base version # +# xterm with bold instead of underline xterm-bold|xterm terminal emulator (X11R6 Window System) standout w/bold, - smso=\E[1m, + smso=\E[7m, smul=\E[1m, use=xterm, # (kterm: this had extension capabilities ":KJ:TY=ascii:" -- esr) # (kterm should not invoke DEC Graphics as the alternate character set @@ -2149,6 +2419,8 @@ xterm1|xterm terminal emulator ignoring the alternate screen buffer, # before ECMA-64 color support was folded into the main-line xterm release. # This entry is straight from color_xterm's maintainer. # From: Jacob Mandelson , 09 Nov 1996 +# The README's with the distribution also say that it supports SGR 21, 24, 25 +# and 27, but they are not present in the terminfo or termcap. color_xterm|cx|cx100|color_xterm color terminal emulator for X, am, km, mir, msgr, xenl, colors#8, cols#80, it#8, lines#65, pairs#64, @@ -2176,6 +2448,15 @@ color_xterm|cx|cx100|color_xterm color terminal emulator for X, smcup=\E[?1;41s\E[?1;41h\E=, smir=\E[4h, smso=\E[7m, smul=\E[4m, +# The 'nxterm' distributed with Redhat Linux is a slight rehack of +# xterm-sb_right-ansi-3d, which implements ANSI colors, but does not support +# SGR 39 or 49. SGR 0 does reset colors (along with everything else). This +# description is "compatible" with color_xterm, rxvt and XFree86 xterm, except +# that each of those implements the home, end, delete keys differently. +nxterm|xterm-color|generic color xterm, + ncv@, + op=\E[m, use=xterm-r6, use=klone+color, + # From: Thomas Dickey 04 Oct 1997 # Updated: Oezguer Kesim 02 Nov 1997 # Notes: @@ -2188,6 +2469,9 @@ color_xterm|cx|cx100|color_xterm color terminal emulator for X, # ech=\E[%p1%dX, # but the latter does not work correctly. # +# The distributed terminfo says it implements hpa and vpa, but they are not +# implemented correctly, using relative rather than absolute positioning. +# # rxvt is normally configured to look for "xterm" or "xterm-color" as $TERM. # Since rxvt is not really compatible with xterm, it should be configured as # "rxvt" (monochrome) and "rxvt-color". @@ -2217,8 +2501,8 @@ rxvt-basic|rxvt terminal base (X Window System), kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kfnd=\E[1~, khome=\E[7~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, kslt=\E[4~, rc=\E8, - rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[?47l\E8, rmir=\E[4l, - rmkx=\E>, rmso=\E[27m, rmul=\E[24m, + rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8, + rmir=\E[4l, rmkx=\E>, rmso=\E[27m, rmul=\E[24m, rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E>, s0ds=\E(B, s1ds=\E(0, sc=\E7, sgr0=\E[0m\017, smacs=^N, @@ -2229,6 +2513,41 @@ rxvt|rxvt terminal emulator (X Window System), op=\E[39;49m, setab=\E[%p1%{40}%+%dm, setaf=\E[%p1%{30}%+%dm, sgr0=\E[m\017, use=rxvt-basic, +# These (xtermc and xtermm) are distributed with Solaris. They refer to a +# variant of xterm which is apparently no longer supported, but are interesting +# because they illustrate SVr4 curses mouse controls - T.Dickey +xtermm|xterm terminal emulator (monocrome), + am, km, mir, msgr, xenl, + btns#3, cols#80, it#8, lines#24, + acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=@, bold=\E[1m, clear=\E[H\E[2J, cr=^M, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\E[1D, + cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, + el=\E[K, el1=\E[1K$<3>, enacs=\E(B\E)0, getm=\E[%p1%dY, + home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, + il=\E[%p1%dL, il1=\E[L, ind=^J, ka1=\EOq, ka3=\EOs, kb2=\EOr, + kbs=^H, kc1=\EOp, kc3=\EOn, kcub1=\EOD, kcud1=\EOB, + kcuf1=\EOC, kcuu1=\EOA, kend=\E[Y, kent=\EOM, kf0=\EOy, + kf1=\EOP, kf10=\EOY, kf11=\EOZ, kf12=\EOA, kf2=\EOQ, + kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, kf7=\EOV, kf8=\EOW, + kf9=\EOX, khome=\E[H, kmous=\E[^_, knp=\E[U, kpp=\E[V, + rc=\E8, reqmp=\E[492Z, rev=\E[7m, ri=\EM, rmacs=^O, + rmcup=\E@0\E[?4r, rmso=\E[m, + rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, + rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr0=\E[m\017, smacs=^N, smcup=\E@0\E[?4s\E[?4h\E@1, + smso=\E[7m, tbc=\E[3g, + +xtermc|xterm terminal emulator (color), + colors#8, ncv#7, pairs#64, + op=\E[100m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, + setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, + use=xtermm, + # From: David J. MacKenzie 20 Apr 1995 # Here's a termcap entry I've been using for xterm_color, which comes # with BSD/OS 2.0, and the X11R6 contrib tape too I think. Besides the @@ -2259,7 +2578,7 @@ hpterm|X-hpterm|hp X11 terminal emulator, pln=\E&f%p1%dk%p2%l%dd0L%p2%s, rev=\E&dB, ri=\ET, rmacs=^O, rmir=\ER, rmkx=\E&s0A, rmln=\E&j@, rmso=\E&d@, rmul=\E&d@, - sgr=\E&d%?%p7%t%'s'%c%;%p1%p3%|%p6%|%{2}%*%p2%{4}%*%+%p4%+%p5%{8}%*%+%'@'%+%c%?%p9%t%'\016'%c%e%'\017'%c%;, + sgr=\E&d%?%p7%t%{115}%c%;%p1%p3%|%p6%|%{2}%*%p2%{4}%*%+%p4%+%p5%{8}%*%+%{64}%+%c%?%p9%t%'\016'%c%e%'\017'%c%;, sgr0=\E&d@, smacs=^N, smir=\EQ, smkx=\E&s1A, smln=\E&jB, smso=\E&dJ, smul=\E&dD, tbc=\E3, vpa=\E&a%p1%dY, @@ -2287,7 +2606,6 @@ xterms-sun|small (80x24) xterm with sunFunctionKeys true, cols#80, lines#24, use=xterm-sun, # This is for the extensible terminal emulator on the X11R6 contrib tape. -# (emu: I changed / to / -- esr) emu|emu native mode, mir, msgr, xon, colors#15, cols#80, it#8, lines#24, pairs#64, vt#200, @@ -2308,11 +2626,11 @@ emu|emu native mode, kf7=\EF07, kf8=\EF08, kf9=\EF09, kfnd=\Efind, kich1=\Eins, knp=\Enext, kpp=\Eprior, kslt=\Esel, oc=\Es0;\Er0;, rev=\ES\ET, ri=\EF, rmacs=\0, rmir=\EX, rmso=\ES, rmul=\ES, - rs2=\ES\Es0;\Er0;, setb=\Es%i%p1%d;, setf=\Er%i%p1%d;, - sgr0=\ES, smacs=\0, smir=\EY, smso=\ES\ET, smul=\ES\EV, - tbc=\Ej, + rs2=\ES\Es0;\Er0;, setab=\Es%i%p1%d;, + setaf=\Er%i%p1%d;, sgr0=\ES, smacs=\0, smir=\EY, + smso=\ES\ET, smul=\ES\EV, tbc=\Ej, -######## MGR +#### MGR # # MGR is a Bell Labs window system lighter-weight than X. # These entries describe MGR's xterm-equivalent. @@ -2380,7 +2698,7 @@ eterm|gnu emacs term.el terminal emulation, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, - dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\\E[J, + dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, home=\E[H, ht=^I, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=^J, rev=\E[7m, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmso=\E[m, rmul=\E[m, @@ -2397,22 +2715,22 @@ screen|VT 100/ANSI X3.64 virtual terminal, colors#8, cols#80, it#8, lines#24, pairs#64, acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, - clear=\E[H\E[J, cnorm=\E[?25h, cr=^M, + clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM, cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, - dl1=\E[M, ed=\E[J, el=\E[K, enacs=\E(B\E)0, flash=\Eg, - home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, - il1=\E[L, ind=^J, is2=\E)0, kbs=^H, kcub1=\EOD, kcud1=\EOB, - kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~, kf1=\EOP, kf10=\E[21~, - kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS, - kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, - khome=\E[1~, kich1=\E[2~, kll=\E[4~, knp=\E[6~, kpp=\E[5~, - nel=\EE, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmir=\E[4l, - rmkx=\E[?1l\E>, rmso=\E[23m, rmul=\E[24m, rs2=\Ec, sc=\E7, - sgr0=\E[m, smacs=^N, smir=\E[4h, smkx=\E[?1h\E=, - smso=\E[3m, smul=\E[4m, tbc=\E[3g, + dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0, + flash=\Eg, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, + il=\E[%p1%dL, il1=\E[L, ind=^J, is2=\E)0, kbs=^H, kcub1=\EOD, + kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~, kf1=\EOP, + kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, + kf4=\EOS, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, + kf9=\E[20~, khome=\E[1~, kich1=\E[2~, kll=\E[4~, knp=\E[6~, + kpp=\E[5~, nel=\EE, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, + rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[23m, rmul=\E[24m, + rs2=\Ec, sc=\E7, sgr0=\E[m, smacs=^N, smir=\E[4h, + smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g, use=ecma+color, screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols, @@ -2448,6 +2766,90 @@ screen3|older VT 100/ANSI X3.64 virtual terminal, sc=\E7, sgr0=\E[m, smir=\E[4h, smkx=\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g, +# Francesco Potorti : +# NCSA telnet is one of the most used telnet clients for the Macintosh. It has +# been maintained until recently by the National Center for Supercomputer +# Applications, and it is feature rich, stable and free. It can be downloaded +# from www.ncsa.edu. This terminfo description file is based on xterm-vt220, +# xterm+sl, and the docs at NCSA. It works well. +# +# NCSA Telnet 2.6 for Macintosh in vt220 8-bit emulation mode +# The terminal options should be set as follows: +# Xterm sequences ON +# use VT wrap mode ON +# use Emacs arrow keys OFF +# CTRL-COMND is Emacs meta ON +# 8 bit mode ON +# answerback string: "ncsa-vt220-8" +# setup keys: all disabled +# +# Application mode is not used. +# +# Other special mappings: +# Apple VT220 +# HELP Find +# HOME Insert here +# PAGEUP Remove +# DEL Select +# END Prev Screen +# PAGEDOWN Next Screen +# +# Though it supports ANSI color, NCSA Telnet uses color to represent blinking +# text. +# +# The status-line manipulation is a mapping of the xterm-compatible control +# sequences for setting the window-title. So you must use tsl and fsl in +# pairs, since the latter ends the string that is loaded to the window-title. +ncsa-m|ncsa-vt220-8|NCSA Telnet 2.6 for Macintosh in vt220-8 mode, + am, hs, km, mir, msgr, xenl, + acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, + clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, + cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, + dsl=\E]0;\007, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E)0, + flash=\E[?5h\E[?5l, fsl=^G, home=\E[H, ht=^I, hts=\EH, + ich=\E[%p1%d@, if=/usr/share/tabset/vt100, + il=\E[%p1%dL, il1=\E[L, ind=\n$<150*>, + is2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>, kbs=^H, + kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kdch1=\E[4~, kend=\E[5~, kf1=\E[17~, kf10=\E[28~, + kf11=\E[29~, kf12=\E[31~, kf13=\E[32~, kf14=\E[33~, + kf15=\E[34~, kf2=\E[18, kf3=\E[19~, kf4=\E[20~, kf5=\E[21~, + kf6=\E23~, kf7=\E[24~, kf8=\E[25~, kf9=\E[26~, khlp=\E[1~, + khome=\E[2~, knp=\E[6~, kpp=\E[3~, mc4=\E[4i, mc5=\E[5i, + rc=\E8, rev=\E[7m, rf=/usr/share/tabset/vt100, ri=\EM, + rmacs=^O, rmam=\E[?7l, rmcup=\E[2J\E8, rmir=\E[4l, + rmso=\E[27m, rmul=\E[24m, + rs2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>, sc=\E7, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;, + sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7, + smir=\E[4h, smso=\E[7m, smul=\E[4m, tbc=\E[3g, tsl=\E]0;, + u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?62;1;6c, u9=\E[c, +ncsa|NCSA Telnet 2.7 for Macintosh in vt220-8 mode, + use=ncsa-m, use=klone+color, +ncsa-ns|NCSA Telnet 2.7 for Macintosh in vt220-8 mode, + hs@, + dsl@, fsl@, tsl@, use=ncsa, +ncsa-m-ns|NCSA Telnet 2.6 for Macintosh in vt220-8 mode, + hs@, + dsl@, fsl@, tsl@, use=ncsa-m, +# alternate -TD: +# The documented function-key mapping refers to the Apple Extended Keyboard +# (e.g., NCSA Telnet's F1 corresponds to a VT220 F6). We use the VT220-style +# codes, however, since the numeric keypad (VT100) PF1-PF4 are available on +# some keyboards and many applications require these as F1-F4. +# +ncsa-vt220|NCSA Telnet using vt220-compatible function keys, + kf1=\EOP, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, + kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, + kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\EOQ, + kf20=\E[34~, kf3=\EOR, kf4=\EOS, kf6=\E[17~, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, + use=ncsa, + #### Pilot Pro Palm-Top # # From: Jason Downs , 15 Jun 1997 (Top Gun Telnet's author) @@ -2459,7 +2861,7 @@ pilot|tgtelnet|Top Gun Telnet on the Palm Pilot Professional, ind=^J, kbs=^H, kcub1=^H, kcud1=^J, knp=^L, kpp=^K, nel=\Em~\s, rmso=\EB, smso=\Eb, -######## WORKSTATION CONSOLES +######## COMMERCIAL WORKSTATION CONSOLES # #### Alpha consoles @@ -2606,7 +3008,7 @@ psterm-fast|NeWS psterm fast version (flaky ctrl chars), rmso=^No, rmul=^Nu, sc=^], sgr0=^N*, smcup=^Ot, smir=^Oi, smso=^Oo, smul=^Ou, tsl=^Ol, -#### NeXT Consoles +#### NeXT consoles # # Use `glasstty' for the Workspace application # @@ -2625,7 +3027,7 @@ nextshell|NeXT Shell application, bel=^G, cr=^M, cub1=^H, cud1=^J, ht=^I, kbs=^H, kcub1=^H, kcud1=^J, nel=^M^J, -### Sony NEWS workstations +#### Sony NEWS workstations # # (news-unk: this had :KB=news: -- esr) @@ -2696,9 +3098,6 @@ nwp512|news|nwp514|news40|vt100-bm|sony vt100 emulator 40 lines, # # (nwp512-a: this had :TY=ascii: and the alias vt100-bm --esr) nwp512-a|nwp514-a|news-a|news42|news40-a|sony vt100 emulator 42 line, - - -s, lines#42, is2=\E[?7h\E[?1l\E[?3l\E7\E[1;42r\E8, use=news-old-unk, # @@ -2767,6 +3166,7 @@ nwp517-w|nwp-517-w|nwp-517 vt200 132 cols 50 rows, # # This ships with Sun's CDE in Solaris 2.5 +# Corrected Sun Aug 9 1998 by Alexander V. Lukyanov dtterm|CDE desktop terminal, am, mir, msgr, xenl, xon, colors#8, cols#80, it#8, lines#24, lm#0, pairs#64, @@ -2778,10 +3178,10 @@ dtterm|CDE desktop terminal, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, - flash=\E[?5h$<200>\E[?5l, home=\E[H, ht=^I, hts=\EH, - ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=\ED, - invis=\E[8m, is2=\E F\E>\E[?1l\E[?7h\E[?45l, kbs=^H, - kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + enacs=\E(B\E)0, flash=\E[?5h$<200>\E[?5l, home=\E[H, + ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, + ind=\ED, invis=\E[8m, is2=\E F\E>\E[?1l\E[?7h\E[?45l, + kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, @@ -2796,7 +3196,7 @@ dtterm|CDE desktop terminal, sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smir=\E[4h, smso=\E[2;7m, smul=\E[4m, tbc=\E[3g, -### Non-Unix Consoles +#### Non-Unix Consoles # # Except for the "-emx" suffixes, these are as distributed with EMX 0.9b, @@ -2866,6 +3266,19 @@ mono-emx|stupid monochrome ansi terminal with only one kind of emphasis, kich1=\0R, kll=\0O, knp=\0Q, kpp=\0I, nel=^M^J, rev=\E[7m, sgr0=\E[0m, +# Use this for cygwin32 (tested with beta 19.1) +# underline is colored bright magenta +# shifted kf1-kf12 are kf11-kf22 +cygwin|ansi emulation for cygwin32, + kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, + kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, + kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, + kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, + khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, rmam@, smam@, + use=ansi.sys, + # This entry fits the Windows NT console when the _POSIX_TERM environment # variable is set to 'on'. While the Windows NT POSIX console is seldom used, # the Telnet client supplied with both the Windows for WorkGroup 3.11 TCP/IP @@ -3048,7 +3461,7 @@ hp262x|HP 262x terminals, kcuu1=\EA, kdch1=\EP, kdl1=\EM, ked=\EJ, kel=\EK, khome=\Eh, kich1=\EQ, kil1=\EL, kind=\ES, knp=\EU, kpp=\EV, kri=\ET, krmir=\ER, rev=\E&dB, rmkx=\E&s0A, rmso=\E&d@, rmul=\E&d@, - sgr=\E&d%'@'%?%p1%t%'B'%|%;%?%p2%t%'D'%|%;%?%p3%t%'B'%|%;%?%p4%t%'A'%|%;%c, + sgr=\E&d%{64}%?%p1%t%{66}%|%;%?%p2%t%{68}%|%;%?%p3%t%{66}%|%;%?%p4%t%{65}%|%;%c, sgr0=\E&d@, smkx=\E&s1A, smso=\E&dB, smul=\E&dD, # Note: no on HPs since that homes to top of memory, not screen. @@ -3255,7 +3668,7 @@ hp2645|hp45|HP 2645 series, ked=\EJ, kel=\EK, khome=\Eh, khts=\E1, kich1=\EQ, kil1=\EL, kind=\ES, knp=\EU, kpp=\EV, kri=\ET, krmir=\ER, rev=\E&dB, rmkx=\E&s0A, - sgr=\E&d%'@'%?%p1%t%'B'%|%;%?%p2%t%'D'%|%;%?%p3%t%'B'%|%;%?%p4%t%'A'%|%;%?%p5%t%'H'%|%;%?%p6%t%'B'%|%;%c, + sgr=\E&d%{64}%?%p1%t%{66}%|%;%?%p2%t%{68}%|%;%?%p3%t%{66}%|%;%?%p4%t%{65}%|%;%?%p5%t%{72}%|%;%?%p6%t%{66}%|%;%c, sgr0=\E&d@, smkx=\E&s1A, smul=\E&dD, use=hpgeneric, # You should use this terminal at 4800 baud or less. @@ -3279,7 +3692,7 @@ hp2382a|hp2382|hewlett packard 2382a, acsc@, pln=\E&f0a%p1%dk%p2%l%Pa%?%ga%t%ga%d%e1%;d0L%?%ga%!%t %;%p2%s, rmacs@, - sgr=\E&d%{0}%Pa%?%p4%t%{1}%ga%+%Pa%;%?%p1%p3%|%p6%|%t%{2}%ga%+%Pa%;%?%p2%p6%|%t%{4}%ga%+%Pa%;%?%p1%p5%|%t%{8}%ga%+%Pa%;%?%p7%t%?%ga%ts%ga%'@'%+%e%'S'%;%e%?%ga%t%ga%'@'%+%e%'@'%;%;%c, + sgr=\E&d%{0}%Pa%?%p4%t%{1}%ga%+%Pa%;%?%p1%p3%|%p6%|%t%{2}%ga%+%Pa%;%?%p2%p6%|%t%{4}%ga%+%Pa%;%?%p1%p5%|%t%{8}%ga%+%Pa%;%?%p7%t%?%ga%ts%ga%{64}%+%e%{83}%;%e%?%ga%t%ga%{64}%+%e%{64}%;%;%c, sgr0=\E&d@, smacs@, use=hp+labels, use=scrhp, @@ -3307,7 +3720,7 @@ newhp|generic entry for new hewlett packard terminals, pfloc=\E&f1a%p1%dk0d%p2%l%dL%p2%s, pfx=\E&f2a%p1%dk0d%p2%l%dL%p2%s, rev=\E&dB, ri=\ET, rmacs=^O, rmir=\ER, rmso=\E&d@, rmul=\E&d@, rs1=\Eg, - sgr=\E&d%{0}%Pa%?%p4%t%{1}%ga%+%Pa%;%?%p1%p3%|%p6%|%t%{2}%ga%+%Pa%;%?%p2%p6%|%t%{4}%ga%+%Pa%;%?%p1%p5%|%t%{8}%ga%+%Pa%;%?%p7%t%?%ga%ts%ga%'@'%+%e%'S'%;%e%?%ga%t%ga%'@'%+%e%'@'%;%;%c%?%p9%t\016%e\017%;, + sgr=\E&d%{0}%Pa%?%p4%t%{1}%ga%+%Pa%;%?%p1%p3%|%p6%|%t%{2}%ga%+%Pa%;%?%p2%p6%|%t%{4}%ga%+%Pa%;%?%p1%p5%|%t%{8}%ga%+%Pa%;%?%p7%t%?%ga%ts%ga%{64}%+%e%{83}%;%e%?%ga%t%ga%{64}%+%e%{64}%;%;%c%?%p9%t\016%e\017%;, sgr0=\E&d@\017, smacs=^N, smir=\EQ, smso=\E&dJ, smul=\E&dD, tbc=\E3, use=newhpkeyboard, @@ -3345,7 +3758,7 @@ hp2621b|hp 2621b with old style keyboard, lh#1, lm#48, lw#8, nlab#8, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA, khome=\Eh, kind=\ET, kll=\EF, kri=\ES, - pln=\E&f0a%p1%dk%p2%l%Pa%?%ga%t%ga%d%e1%;d3L%?%ga%!%t%{32}%c%;%p2%s\E%'o'%p1%+%c\r, + pln=\E&f0a%p1%dk%p2%l%Pa%?%ga%t%ga%d%e1%;d3L%?%ga%!%t%{32}%c%;%p2%s\E%{111}%p1%+%c\r, smln=\E&jB, use=hp2621, @@ -3491,7 +3904,7 @@ hp2|hpex2|hewlett-packard extended capabilities newer version, pfx=\E&f2a%p1%dk%p2%l%dL%p2%s, pln=\E&f%p1%dk%p2%l%dd0L%p2%s, rmir=\ER, rmkx=\E&s0A, rmln=\E&j@, rmso=\E&d@, rmul=\E&d@, - sgr=\E&d%?%p7%t%'s'%c%;%p1%p3%|%p6%|%{2}%*%p2%{4}%*%+%p4%+%p5%{8}%*%+%'@'%+%c%?%p9%t%'\016'%c%e%'\017'%c%;, + sgr=\E&d%?%p7%t%{115}%c%;%p1%p3%|%p6%|%{2}%*%p2%{4}%*%+%p4%+%p5%{8}%*%+%{64}%+%c%?%p9%t%'\016'%c%e%'\017'%c%;, sgr0=\E&d@, smir=\EQ, smkx=\E&s1A, smln=\E&jB, smso=\E&dB, smul=\E&dD, tbc=\E3, vpa=\E&a%p1%dY, @@ -3576,22 +3989,22 @@ hp700-wy|HP700/41 emulating wyse30, sgr0=\EG0$<10/>, smir=\Eq, smso=\EG4$<10/>, smul=\EG8$<10/>, tbc=\E0, vpa=\E[%p1%{32}%+%c, # (hp70092: added empty to avoid warnings re / --esr) -hp70092|hp70092a|hp70092A|HP 700/92, +hp70092|hp70092a|hp70092A|70092|HP 700/92, am, da, db, xhp, cols#80, lh#2, lines#24, lm#0, lw#8, nlab#8, - acsc=, bel=^G, blink=\E&dA, bold=\E&dB, cbt=\Ei, - clear=\E&a0y0C\EJ, cr=^M, cub1=^H, cud1=\EB, cuf1=\EC, - cup=\E&a%p1%dy%p2%dC, cuu1=\EA, dch1=\EP, dim=\E&dH, - dl1=\EM, el=\EK, hpa=\E&a%p1%dC, ht=^I, hts=\E1, il1=\EL, - kbs=^H, kclr=\EJ, kctab=\E2, kcub1=\ED, kcud1=\EB, kcuf1=\EC, - kcuu1=\EA, kdch1=\EP, kdl1=\EM, ked=\EJ, kel=\EK, kf1=\Ep, - kf2=\Eq, kf3=\Er, kf4=\Es, kf5=\Et, kf6=\Eu, kf7=\Ev, kf8=\Ew, - khome=\Eh, khts=\E1, kich1=\EQ, kil1=\EL, kind=\ES, kll=\EF, - knp=\EU, kpp=\EV, kri=\ET, krmir=\ER, ktbc=\E3, rev=\E&dB, - ri=\ET, rmacs=^O, rmir=\ER, rmkx=\E&s0A, rmln=\E&j@, - rmso=\E&d@, rmul=\E&d@, sgr0=\E&d@, smacs=^N, smir=\EQ, - smkx=\E&s1A, smln=\E&jB, smso=\E&dJ, smul=\E&dD, tbc=\E3, - vpa=\E&a%p1%dY, + acsc=0cjgktlrmfn/q\,t5u6v8w7x., bel=^G, blink=\E&dA, + bold=\E&dB, cbt=\Ei, clear=\E&a0y0C\EJ, cr=^M, cub1=^H, + cud1=\EB, cuf1=\EC, cup=\E&a%p1%dy%p2%dC, cuu1=\EA, + dch1=\EP, dim=\E&dH, dl1=\EM, el=\EK, hpa=\E&a%p1%dC, ht=^I, + hts=\E1, il1=\EL, kbs=^H, kclr=\EJ, kctab=\E2, kcub1=\ED, + kcud1=\EB, kcuf1=\EC, kcuu1=\EA, kdch1=\EP, kdl1=\EM, + ked=\EJ, kel=\EK, kf1=\Ep, kf2=\Eq, kf3=\Er, kf4=\Es, kf5=\Et, + kf6=\Eu, kf7=\Ev, kf8=\Ew, khome=\Eh, khts=\E1, kich1=\EQ, + kil1=\EL, kind=\ES, kll=\EF, knp=\EU, kpp=\EV, kri=\ET, + krmir=\ER, ktbc=\E3, rev=\E&dB, ri=\ET, rmacs=^O, rmir=\ER, + rmkx=\E&s0A, rmln=\E&j@, rmso=\E&d@, rmul=\E&d@, + sgr0=\E&d@, smacs=^N, smir=\EQ, smkx=\E&s1A, smln=\E&jB, + smso=\E&dJ, smul=\E&dD, tbc=\E3, vpa=\E&a%p1%dY, bobcat|sbobcat|HP 9000 model 300 console, am, da, db, mir, xhp, @@ -3654,8 +4067,8 @@ dku7003|Honeywell Bull DKU 7003 all features described, # `diagnostic feature' that sending them a ^G while pin 22 (`Ring Indicator') # was being held to ground would trigger a send of the top line on the screen. # A quick fix might be to drop back to a cheesy 4-wire cable with pin 22 -# hanging in the air. -# +# hanging in the air. (Thanks to Eric Fischer, , +# for clearing up this point.) adm1a|adm1|lsi adm1a, am, @@ -3727,10 +4140,49 @@ adm11|LSI ADM-11, use=adm+sgr, # From: Andrew Scott Beals # Corrected by Olaf Siebert , 11 May 1995 +# Supervisor mode info by Ari Wuolle, , 27 Aug 1996 # (adm12: removed obsolete ":kn:ma=j^Jk^P^K^Pl ^R^L^L :". This formerly had # =\Eq but that looked wrong; this is from Dave Yost # via BRL. That entry asserted , but I've left that out because # neither earlier nor later ADMSs have it -- esr) +# +# You will need to get into the supervisor setup before you can set +# baudrate etc. for your ADM-12+. Press Shift-Ctrl-Setup and you should +# see a lot more setup options. +# +# While in supervisor setup you can also use following codes: +# +# Ctrl-P Personality character selections (configure for example what +# arrow keys send, if I recall correctly) +# Ctrl-T tabs 1-80 use left&right to move and up to set and +# Ctrl-V tabs 81-158 down to clear tab. Shift-Ctrl-M sets right margin at cursor +# Ctrl-B Binary setup (probably not needed. I think that everything can +# be set using normal setup) +# Ctrl-A Answerback mode (enter answerback message) +# Ctrl-U User friendly mode (normal setup) +# Ctrl-D Defaults entire setup and function keys from EPROM tables +# Ctrl-S Save both setup and functions keys. Takes from 6 to 10 seconds. +# Ctrl-R Reads both setup and functions keys from NVM. +# Shift-Ctrl-X Unlock keyboard and cancel received X-OFF status +# +# ADM-12+ supports hardware handshaking, but it is DTR/CTS as opposed to +# RTS/CTS used nowadays with virtually every modem and computer. 19200 +# bps works fine with hardware flow control. +# +# The following null-modem cable should fix this and enable you to use +# RTS/CTS handshaking (which Linux supports, use CRTSCTS setting). Also +# set ADM-12+ for DTR handshaking from supervisor setup. +# +# PC Serial ADM-12+ +# -------- ------- +# 2 - 3 +# 3 - 2 +# 4 - 5 +# 5 - 20 +# 6,8 - 4 +# 7 - 7 +# 20 - 6,8 +# adm12|lsi adm12, am, mir, cols#80, it#8, lines#24, @@ -3968,8 +4420,13 @@ adm1178|1178|lsi adm1178, #### Prime # -# Yes, Prime makes terminals. These entries were posted by Kevin J. Cummings -# on 14 Dec 1992 and lightly edited by esr. +# Yes, Prime made terminals. These entries were posted by Kevin J. Cummings +# on 14 Dec 1992 and lightly edited by esr. +# Prime merged with ComputerVision in the late 1980s; you can reach them at: +# +# ComputerVision Services +# 500 Old Connecticut Path +# Framingham, Mass. # # Standout mode is dim reverse-video. @@ -3978,12 +4435,13 @@ pt100|pt200|wren|fenix|prime pt100/pt200, cols#80, it#8, lines#24, cbt=\E[Z, clear=\E?, cr=^M, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\ED, cuf=\E[%p1%dC, cuf1=\E[C, - cup=\E0%p1%'!'%+%c%p2%'!'%+%c, cuu=\E[%p1%dA, cuu1=\EM, - dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[M, ed=\E[J\E[r, - el=\E[K\E[t, flash=\E$$<200/>\E$P, home=\E$B, ht=^I, - il1=\E[L\E[t, ind=^J, kbs=^H, kcub1=\E[D, kcud1=\E[B, - kcuf1=\E[C, kcuu1=\E[A, khome=\E$A, nel=^M^J, rmcup=, - rmir=\E[4l, rmkx=\E[>13l, rmso=\E[m, rmul=\E[m, sgr0=\E[m, + cup=\E0%p1%{33}%+%c%p2%{33}%+%c, cuu=\E[%p1%dA, + cuu1=\EM, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[M, + ed=\E[J\E[r, el=\E[K\E[t, flash=\E$$<200/>\E$P, + home=\E$B, ht=^I, il1=\E[L\E[t, ind=^J, kbs=^H, kcub1=\E[D, + kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E$A, nel=^M^J, + rmcup=, rmir=\E[4l, rmkx=\E[>13l, rmso=\E[m, rmul=\E[m, + sgr0=\E[m, smcup=\E[>1l\E[>2l\E[>16l\E[4l\E[>9l\E[20l\E[>3l\E[>7h\E[>12l\E[1Q, smir=\E[4h, smkx=\E[>13h, smso=\E[2;7m, smul=\E[4m, pt100w|pt200w|wrenw|fenixw|prime pt100/pt200 in 132-column mode, @@ -4024,6 +4482,9 @@ pt250w|Prime PT250 in 132-column mode, # model is the qvt520, which is vt420-compatible. # # There are some ancient printing Qume terminals under `Daisy Wheel Printers' +# +# If you inherit a Qume without docs, try Ctrl-Shift-Setup to enter its +# setup mode. Shift-s should be a configuration save to NVRAM. qvt101|qvt108|qume qvt 101 and QVT 108, xmc#1, use=qvt101+, @@ -4412,7 +4873,7 @@ tvi924|televideo tvi924, kf6=^AF\r, kf7=^AG\r, kf8=^AH\r, kf9=^AI\r, khome=^^, kich1=\EQ, kil1=\EE, lf0=F1, lf1=F2, lf10=F11, lf2=F3, lf3=F4, lf4=F5, lf5=F6, lf6=F7, lf7=F8, lf8=F9, lf9=F10, - pfkey=\E|%p1%'1'%+%c%p2%s\031, ri=\Ej, tbc=\E3, tsl=\Ef, use=adm+sgr, + pfkey=\E|%p1%{49}%+%c%p2%s\031, ri=\Ej, tbc=\E3, tsl=\Ef, use=adm+sgr, # TVI925 DIP switches. In each of these, D = Down and U = Up, # @@ -4801,7 +5262,7 @@ tvi970-2p|televideo 970 with using 2 pages of memory, # padding is needed, but adapted from the tvi920c termcap. The and # strings are klutzy, but at least use no screen space. # (tvipt: removed obsolete ":ma=^Kk^Ll^R^L:". I wish we knew , -# its absence means =\Ev isn't save to use. -- esr) +# its absence means =\Ev isn't safe to use. -- esr) # From: Gene Rochlin 9/19/84. # The ////, and caps are from BRL, which says: # F1 and F2 should be programmed as ^A and ^B; required for UNIFY. @@ -4823,8 +5284,8 @@ tvi9065|televideo 9065, blink=\EG2, bold=\EG\,, cbt=\EI, civis=\E.0, clear=^Z, cnorm=\E.3, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^V, cuf=\E[%p1%dC, cuf1=^L, - cup=\E=%p1%' '%+%c%p2%' '%+%c, cuu=\E[%p1%dA, cuu1=^K, - cvvis=\E.2, dch=\E[%p1%dP, dch1=\EW, dim=\EGp, + cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu=\E[%p1%dA, + cuu1=^K, cvvis=\E.2, dch=\E[%p1%dP, dch1=\EW, dim=\EGp, dl=\E[%p1%dM, dl1=\ER, dsl=\E_30\r, ech=\E[%p1%d@, ed=\EY, el=\ET, flash=\Eb$<15>\Ed, fsl=^M, home=^^, ht=^I, hts=\E1, ich=\E[%p1%d@, if=/usr/share/tabset/stdcrt, @@ -4837,10 +5298,10 @@ tvi9065|televideo 9065, kf2=^AA\r, kf3=^AB\r, kf4=^AC\r, kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, khome=^^, ll=\E[25;1H, mc0=\E[0;0i, mc4=\Ea, mc5=\E`, nel=^M^J, - pfkey=\E|%p1%'0'%+%c3%p2%s\031, - pfloc=\E|%p1%'0'%+%c2%p2%s\031, - pfx=\E|%p1%'0'%+%c1%p2%s\031, - pln=\E_%p1%'?'%+%c%p2%s\r, prot=\E&, + pfkey=\E|%p1%{48}%+%c3%p2%s\031, + pfloc=\E|%p1%{48}%+%c2%p2%s\031, + pfx=\E|%p1%{48}%+%c1%p2%s\031, + pln=\E_%p1%{63}%+%c%p2%s\r, prot=\E&, rep=\E[%p2%db%p1%c, rev=\EG4, rf=/usr/share/tabset/stdcrt, ri=\Ej, rin=\E[%p1%dT, rmacs=\E%, rmam=\E[=7l, rmcup=\E.3\Er\E[1;25r\E[25;0H, @@ -4899,7 +5360,7 @@ vi50adm|visual 50 in adm3a mode, vi55|Visual 55, am, mir, msgr, cols#80, it#8, lines#24, - clear=\Ev, csr=\E_%p1%'A'%+%c%p2%'A'%+%c, cub1=^H, + clear=\Ev, csr=\E_%p1%{65}%+%c%p2%{65}%+%c, cub1=^H, cud1=^J, cuf1=\EC, cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, dch1=\Ew, dl1=\EM, ed=\EJ, el=\EK, home=\EH, ht=^I, il1=\EL, is2=\Ev\E_AX\Eb\EW\E9P\ET, kbs=^H, kcub1=\ED, @@ -5057,8 +5518,8 @@ wy30|wyse30|Wyse 30, kf1=^A@\r, kf2=^AA\r, kf3=^AB\r, kf4=^AC\r, kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, khome=^^, kich1=\EQ, kil1=\EE, knp=\EK, kpp=\EJ, krpl=\Er, ll=^^^K, mc0=\EP, mc4=^T, - mc5=^X, nel=^M^J, pfx=\Ez%p1%'?'%+%c%p2%s\177, - pln=\Ez%p1%'/'%+%c%p2%s\r, prot=\E`7\E), ri=\Ej$<3>, + mc5=^X, nel=^M^J, pfx=\Ez%p1%{63}%+%c%p2%s\177, + pln=\Ez%p1%{47}%+%c%p2%s\r, prot=\E`7\E), ri=\Ej$<3>, rmacs=\EH^C, rmir=\Er, rmln=\EA11, rmso=\E(, sgr=%?%p1%p5%p8%|%|%t\E`7\E)%e\E(%;%?%p9%t\EH\002%e\EH\003%;, sgr0=\E(\EH\003, smacs=\EH^B, smir=\Eq, smln=\EA10, @@ -5073,7 +5534,7 @@ wy30-mc|wyse30-mc|wyse 30 with magic cookies, ma@, xmc#1, blink=\EG2, dim=\EGp, prot=\EG0\E), rmacs=\EG0\EH\003, rmcup=\EG0, rmso=\EG0, - sgr=\EG%'0'%?%p2%p6%|%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c%?%p8%t\E)%e\E(%;%?%p9%t\EH\002%e\EH\003%;, + sgr=\EG%{48}%?%p2%p6%|%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c%?%p8%t\E)%e\E(%;%?%p9%t\EH\002%e\EH\003%;, sgr0=\EG0\E(\EH\003, smacs=\EG0\EH\002, smcup=, smso=\EG4, use=wy30, use=adm+sgr, @@ -5110,8 +5571,8 @@ wy50|wyse50|Wyse 50, kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, khome=^^, kich1=\EQ, kil1=\EE, knp=\EK, kpp=\EJ, kprt=\EP, krpl=\Er, ll=^^^K, mc0=\EP, mc4=^T, mc5=^X, nel=^M^J, - pfx=\Ez%p1%'?'%+%c%p2%s\177, - pln=\Ez%p1%'/'%+%c%p2%s\r, prot=\E`7\E), rev=\E`6\E), + pfx=\Ez%p1%{63}%+%c%p2%s\177, + pln=\Ez%p1%{47}%+%c%p2%s\r, prot=\E`7\E), rev=\E`6\E), ri=\Ej, rmacs=\EH^C, rmir=\Er, rmln=\EA11, rmso=\E(, sgr=%?%p1%p3%|%t\E`6\E)%e%p5%p8%|%t\E`7\E)%e\E(%;%?%p9%t\EH\002%e\EH\003%;, sgr0=\E(\EH\003, smacs=\EH^B, smir=\Eq, smln=\EA10, @@ -5130,7 +5591,7 @@ wy50-mc|wyse50-mc|wyse 50 with magic cookies, ma@, xmc#1, blink=\EG2, dim=\EGp, prot=\EG0\E), rev=\EG4, rmacs=\EG0\EH\003, rmcup=\EG0, rmso=\EG0, - sgr=\EG%'0'%?%p2%p6%|%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c%?%p8%t\E)%e\E(%;%?%p9%t\EH\002%e\EH\003%;, + sgr=\EG%{48}%?%p2%p6%|%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c%?%p8%t\E)%e\E(%;%?%p9%t\EH\002%e\EH\003%;, sgr0=\EG0\E(\EH\003, smacs=\EG0\EH\002, smcup=, smso=\EGt, use=wy50, use=adm+sgr, @@ -5142,6 +5603,7 @@ wy50-w|wyse50-w|wyse 50 132-column, wy50-wvb|wyse50-wvb|wyse 50 132-column visible bell, bel@, use=wy50-w, + # # The Wyse 350 is a Wyse 50 with color. # Unfortunately this means that it has magic cookies. @@ -5184,11 +5646,11 @@ wy350|wyse350|Wyse 350, kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, khome=^^, kich1=\EQ, kil1=\EE, knp=\EK, kpp=\EJ, kprt=\EP, krpl=\Er, ll=^^^K, mc0=\EP, mc4=^T, mc5=^X, nel=^M^J, oc=\E%?, op=\EG0, - pfx=\Ez%p1%'?'%+%c%p2%s\177, - pln=\Ez%p1%'/'%+%c%p2%s\r, prot=\EG0\E), ri=\Ej, + pfx=\Ez%p1%{63}%+%c%p2%s\177, + pln=\Ez%p1%{47}%+%c%p2%s\r, prot=\EG0\E), ri=\Ej, rmacs=\EG0\EH\003, rmir=\Er, rmln=\EA11, setb=, - setf=%?%p1%{0}%=%t%{76}%e%p1%{1}%=%t%{64}%e%p1%{2}%=%t%{8}%e%p1%{3}%=%t%{72}%e%p1%{4}%=%t%{4}%e%p1%{5}%=%t%{68}%e%p1%{6}%=%t%{12}%e%p1%{7}%=%t%{0}%;%PC\EG%gC%gA%+%'0'%+%c, - sgr=%{0}%?%p4%t%{2}%|%;%?%p7%t%{1}%|%;%PA\EG%?%gC%t%gC%e%{0}%?%p1%t%{4}%|%;%?%p2%t%{8}%|%;%?%p3%t%{4}%|%;%?%p5%t%{64}%|%;%;%gA%+%'0'%+%c%?%p8%t\E)%e\E(%;%?%p9%t\EH\002%e\EH\003%;, + setf=%?%p1%{0}%=%t%{76}%e%p1%{1}%=%t%{64}%e%p1%{2}%=%t%{8}%e%p1%{3}%=%t%{72}%e%p1%{4}%=%t%{4}%e%p1%{5}%=%t%{68}%e%p1%{6}%=%t%{12}%e%p1%{7}%=%t%{0}%;%PC\EG%gC%gA%+%{48}%+%c, + sgr=%{0}%?%p4%t%{2}%|%;%?%p7%t%{1}%|%;%PA\EG%?%gC%t%gC%e%{0}%?%p1%t%{4}%|%;%?%p2%t%{8}%|%;%?%p3%t%{4}%|%;%?%p5%t%{64}%|%;%;%gA%+%{48}%+%c%?%p8%t\E)%e\E(%;%?%p9%t\EH\002%e\EH\003%;, sgr0=\EG0\E(\EH\003%{0}%PA%{0}%PC, smacs=\EG0\EH\002, smir=\Eq, smln=\EA10, tbc=\E0, tsl=\EF, use=adm+sgr, @@ -5241,13 +5703,13 @@ wy120|wyse120|wy150|wyse150|Wyse 120/150, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, khome=^^, kich1=\EQ, kil1=\EE, knp=\EK, kpp=\EJ, kprt=\EP, krpl=\Er, ll=^^^K, mc0=\EP, mc4=^T, mc5=\Ed#, nel=\r\n$<3>, - pfloc=\EZ2%p1%'?'%+%c%p2%s\177, - pfx=\EZ1%p1%'?'%+%c%p2%s\177, - pln=\Ez%p1%'/'%+%c%p2%s\r, prot=\E), ri=\Ej$<2>, + pfloc=\EZ2%p1%{63}%+%c%p2%s\177, + pfx=\EZ1%p1%{63}%+%c%p2%s\177, + pln=\Ez%p1%{47}%+%c%p2%s\r, prot=\E), ri=\Ej$<2>, rmacs=\EcD, rmam=\Ed., rmcup=\Ew1, rmir=\Er, rmln=\EA11, rmxon=\Ec20, rs1=\E~!\E~4$<30>, rs2=\EeF\E`\:$<70>, rs3=\EwG\Ee($<100>, - sgr=%?%p8%t\E)%e\E(%;%?%p9%t\EcE%e\EcD%;\EG%'0'%?%p2%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c, + sgr=%?%p8%t\E)%e\E(%;%?%p9%t\EcE%e\EcD%;\EG%{48}%?%p2%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c, sgr0=\E(\EH\003\EG0\EcD, smacs=\EcE, smam=\Ed/, smcup=\Ew0, smir=\Eq, smln=\EA10, smso=\EGt, smxon=\Ec21, tbc=\E0, tsl=\EF, @@ -5324,13 +5786,13 @@ wy60|wyse60|Wyse 60, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, khome=^^, kich1=\EQ, kil1=\EE, knp=\EK, kpp=\EJ, kprt=\EP, krpl=\Er, ll=\E{^K, mc0=\EP, mc4=^T, mc5=\Ed#, nel=\r\n$<3>, - pfloc=\EZ2%p1%'?'%+%c%p2%s\177, - pfx=\EZ1%p1%'?'%+%c%p2%s\177, - pln=\Ez%p1%'/'%+%c%p2%s\r, prot=\E), ri=\Ej$<7>, + pfloc=\EZ2%p1%{63}%+%c%p2%s\177, + pfx=\EZ1%p1%{63}%+%c%p2%s\177, + pln=\Ez%p1%{47}%+%c%p2%s\r, prot=\E), ri=\Ej$<7>, rmacs=\EcD, rmam=\Ed., rmclk=\E`c, rmcup=\Ew1, rmir=\Er, rmln=\EA11, rmxon=\Ec20, rs1=\E~!\E~4$<150>, rs2=\EeG$<150>, rs3=\EwG\Ee($<200>, - sgr=%?%p8%t\E)%e\E(%;%?%p9%t\EcE%e\EcD%;\EG%'0'%?%p2%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c, + sgr=%?%p8%t\E)%e\E(%;%?%p9%t\EcE%e\EcD%;\EG%{48}%?%p2%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c, sgr0=\E(\EH\003\EG0\EcD, smacs=\EcE, smam=\Ed/, smcup=\Ew0, smir=\Eq, smln=\EA10, smso=\EGt, smxon=\Ec21, tbc=\E0, tsl=\EF, @@ -5418,6 +5880,99 @@ wy99gt-vb|wyse99gt-vb|Wyse 99gt visible bell, wy99gt-w-vb|wy99gt-wvb|wyse99gt-wvb|Wyse 99gt 132-column visible bell, bel@, use=wy99gt-w, + +# Can't set tabs! Other bugs (ANSI mode only): +# - can't redefine function keys (anyway, key redefinition in ANSI mode +# is too much complex to be described); +# - meta key can't be described (the terminal forgets it when reset); +# The xon-xoff handshaking can't be disabled while in ansi personality, so +# emacs can't work at speed greater than 9600 baud. No padding is needed at +# this speed. +# dch1 has been commented out because it causes annoying glittering when +# vi deletes one character at the beginning of a line with tabs in it. +# dch makes sysgen(1M) have a horrible behaviour when deleting +# a screen and makes screen(1) behave badly, so it is disabled too. The nice +# thing is that vi goes crazy if smir-rmir are present and both dch-dch1 are +# not, so smir and rmir are commented out as well. +# From: Francesco Potorti` , 24 Aug 1998 +wy99-ansi|Wyse WY-99GT in ansi mode (int'l PC keyboard), + am, km, mc5i, mir, msgr, xenl, + cols#80, it#8, lines#25, vt#3, + acsc=``aaffggjjkkllmmnnooqqssttuuvvwwxx{{||}}~~, + bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, + clear=\E[H\E[J$<200>, cnorm=\E[34h\E[?25h, cr=^M, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD$<1>, + cub1=\010$<1>, cud=\E[%p1%dB, cud1=\ED, + cuf=\E[%p1%dC$<1>, cuf1=\E[C$<1>, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM, + cvvis=\E[34l\E[?25h, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, + ech=\E[%p1%dX, ed=\E[J$<8*>, el=\E[K$<1>, el1=\E[1K$<1>, + enacs=\E)0, flash=\E[?5h$<30/>\E[?5l, home=\E[H, + hpa=\E[%i%p1%dG, ht=^I, ich=\E[%p1%d@, il=\E[%p1%dL, + il1=\E[L, ind=\n$<1>, invis=\E[8m, + is2=\E7\E[1r\E8\E[2;3;4;13;20;34;39;36l\E[12;16;34h\E[?1;3;4;5;10;18l\E[?7;8;25h\E>\E[?5W\E(B\017\E[4i, + kbs=^H, kcbt=\E[z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, + kcuu1=\EOA, kf1=\EOP, kf10=\E[21~, kf11=\E[23~, + kf12=\E[24~, kf17=\E[K, kf18=\E[31~, kf19=\E[32~, kf2=\EOQ, + kf20=\E[33~, kf21=\E[34~, kf22=\E[35~, kf23=\E[1~, + kf24=\E[2~, kf3=\EOR, kf4=\EOS, kf5=\E[M, kf6=\E[17~, + kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, ll=\E[24E, mc0=\E[?19h, + mc4=\E[4i, mc5=\E[5i, nel=\EE, prot=\E[1"q, rc=\E8, + rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l, rmir=\E[4l, + rmkx=\E[?1l, rmso=\E[27m, rmul=\E[24m, + rs2=\E[61"p\E[40h\E[?6l\E[1r\E[2;3;4;13;20;34;39;36l\E[12;16;34h\E[?1;3;4;5;10;18l\E[?7;8;25h\E>\E[?5W\E(B\017\E[24E\E[4i, + sc=\E7, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%O%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m\E[%?%p8%t1%;"q%?%p9%t\016%e\017%;, + sgr0=\E[m\017\E["q, smacs=^N, smam=\E[?7h, smir=\E[4h, + smkx=\E[?1h, smso=\E[7m, smul=\E[4m, vpa=\E[%i%p1%dd, + +# This is the american terminal. Here tabs work fine. +# From: Francesco Potorti` , 24 Aug 1998 +wy99a-ansi|Wyse WY-99GT in ansi mode (US PC keyboard), + hts=\EH, is3=\E[?5l, rs3=\E[?5l, tbc=\E[3g, + use=wy99-ansi, + +# This terminal (firmware version 02) has a lot of bugs: +# - can't set tabs; +# - other bugs in ANSI modes (see above). +# This description disables handshaking when using cup. This is because +# GNU emacs doesn't like Xon-Xoff handshaking. This means the terminal +# cannot be used at speeds greater than 9600 baud, because at greater +# speeds handshaking is needed even for character sending. If you use +# DTR handshaking, you can use even greater speeds. +# From: Francesco Potorti` , 24 Aug 1998 +wy99f|wy99fgt|wy-99fgt|Wyse WY-99GT (int'l PC keyboard), + am, bw, hs, km, mc5i, mir, msgr, xon, + cols#80, it#8, lines#25, wsl#46, + acsc='x+y.wI~_vj(k'l&m%n)o9q*s8t-u.v\,w+x=, bel=^G, + blink=\EG2, cbt=\EI, civis=\E`0, clear=\E'\E(\032, + cnorm=\E`4\E`1, cr=^M, cub1=^H, cud1=\Ej, cuf1=^L, + cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, + cvvis=\E`2\E`1, dch1=\EW, dim=\EGp, dl1=\ER, dsl=\EF\r, + ed=\EY$<8*>, el=\ET$<8>, enacs=\Ec@1J$<2000>, + flash=\E\^1$<30/>\E\^0, fsl=^M, home=^^, ht=^I, il1=\EE, + ind=^J, invis=\EG3, + is2=\Eu\Ee6\EC\EDF\Ec21\Ec31\Ec62\Ec72\Ee;\016\E'\EeL\E`9\E\^0\E`1\E`4\Ee.\E`\:\Ee1\EG0\E(\Ed/\Ee4\Ed*\EO\E`I\Er\Ee"\EcD\024, + ka1=^^, ka3=\EJ, kbs=^H, kc1=\ET, kc3=\EK, kcbt=\EI, kcub1=^H, + kcud1=^J, kcuf1=^L, kcuu1=^K, kf1=^A@\r, kf10=^AI\r, + kf11=^AJ\r, kf12=^AK\r, kf13=^A`\r, kf14=^Aa\r, kf15=^Ab\r, + kf16=^Ac\r, kf17=^Ad\r, kf18=^Ae\r, kf19=^Af\r, kf2=^AA\r, + kf20=^Ag\r, kf21=^Ah\r, kf22=^Ai\r, kf23=^Aj\r, kf24=^Ak\r, + kf3=^AB\r, kf4=^AC\r, kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, + kf8=^AG\r, kf9=^AH\r, kprt=\EP, mc0=\EP, mc4=^T, mc5=\Ed#, + nel=^_, prot=\E), rev=\EG4, ri=\Ej, rmacs=\EcD, rmam=\Ed., + rmcup=\Ec21\Ec31, rmir=\Er, rmso=\EG0, rmxon=\Ec20\Ec30, + rs2=\Eu\E~4\Ee6\EC\EDF\Ec21\Ec31\Ec62\Ec72\Ee;\016\E'\EeL\E`9\E\^0\E`1\E`4\Ee.\E`\:\Ee)\Ew\EwG\Ew0\Ee1\EG0\E(\Ed/\Ee4\Ed*\EO\E`I\Er\Ee"\Ec@0B\EcD\024, + sgr=\E(\EG%{48}%?%p1%p3%O%t%{4}%+%;%?%p2%t%{8}%+%;%?%p4%t%{2}%+%;%?%p5%t%{64}%+%;%?%p7%t%{1}%+%;%c%?%p8%t\E)%;%?%p9%t\EcE%e\EcD%;, + sgr0=\E(\EG0, smacs=\EcE, smam=\Ed/, smcup=\Ec20\Ec30, + smir=\Eq, smso=\EG4, smxon=\Ec21\Ec31, tsl=\EF, + +# This is the american terminal. Here tabs work. +# From: Francesco Potorti` , 24 Aug 1998 +wy99fa|wy99fgta|wy-99fgta|Wyse WY-99GT (US PC keyboard), + hts=\E1, tbc=\E0, + use=wy99f, + # # The Wyse 160 is combination of the WY-60 and the WY-99gt. # The reset strings are slow and the pad times very depending @@ -5458,13 +6013,13 @@ wy160|wyse160|Wyse 160, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, khome=^^, kich1=\EQ, kil1=\EE, knp=\EK, kpp=\EJ, kprt=\EP, krpl=\Er, ll=\E{^K, mc0=\EP, mc4=^T, mc5=\Ed#, nel=\r\n$<1>, - pfloc=\EZ2%p1%'?'%+%c%p2%s\177, - pfx=\EZ1%p1%'?'%+%c%p2%s\177, - pln=\Ez%p1%'/'%+%c%p2%s\r, prot=\E), ri=\Ej$<1>, + pfloc=\EZ2%p1%{63}%+%c%p2%s\177, + pfx=\EZ1%p1%{63}%+%c%p2%s\177, + pln=\Ez%p1%{47}%+%c%p2%s\r, prot=\E), ri=\Ej$<1>, rmacs=\EcD, rmam=\Ed., rmclk=\E`c, rmcup=\Ew0, rmir=\Er, rmln=\EA11, rmxon=\Ec20, rs1=\E~!\E~4$<70>, rs2=\E`\:$<100>, rs3=\EwG\Ee($<140>, - sgr=%?%p8%t\E)%e\E(%;%?%p9%t\EcE%e\EcD%;\EG%'0'%?%p2%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c, + sgr=%?%p8%t\E)%e\E(%;%?%p9%t\EcE%e\EcD%;\EG%{48}%?%p2%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c, sgr0=\E(\EH\003\EG0\EcD, smacs=\EcE, smam=\Ed/, smcup=\Ew1, smir=\Eq, smln=\EA10, smso=\EGt, smxon=\Ec21, tbc=\E0, tsl=\EF, @@ -5728,13 +6283,13 @@ wy325|wyse325|Wyse epc, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, khome=^^, kich1=\Eq, kil1=\EE, knp=\EK, kpp=\EJ, kprt=\EP, krpl=\Er, ll=^^^K, mc0=\EP, mc4=^T, mc5=\Ed#, - pfloc=\EZ2%p1%'?'%+%c%p2%s\177, - pfx=\EZ1%p1%'?'%+%c%p2%s\177, - pln=\Ez%p1%'/'%+%c%p2%s\r, prot=\E), ri=\Ej$<2>, + pfloc=\EZ2%p1%{63}%+%c%p2%s\177, + pfx=\EZ1%p1%{63}%+%c%p2%s\177, + pln=\Ez%p1%{47}%+%c%p2%s\r, prot=\E), ri=\Ej$<2>, rmacs=\EcD, rmam=\Ed., rmcup=\Ew0, rmir=\Er, rmln=\EA11, rs1=\E~!\E~4$<30>, rs2=\EeF\E`\:$<70>, rs3=\EwG\Ee($<100>, - sgr=%?%p8%t\E)%e\E(%;%?%p9%t\EcE%e\EcD%;\EG%'0'%?%p2%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c, + sgr=%?%p8%t\E)%e\E(%;%?%p9%t\EcE%e\EcD%;\EG%{48}%?%p2%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c, sgr0=\E(\EH\003\EG0\EcD, smacs=\EcE, smam=\Ed/, smcup=\Ew1, smir=\Eq, smln=\EA10, smso=\EGt, tbc=\E0, tsl=\EF, @@ -7237,6 +7792,122 @@ att630|AT&T 630 windowing terminal, att630-24|5630-24|5630DMD-24|630MTG-24|AT&T 630 windowing terminal 24 lines, lines#24, use=att630, +# This is the att700 entry for 700 native emulation of the AT&T 700 +# terminal. Comments are relative to changes from the 605V2 entry and +# att730 on which the entry is based. Comments show the terminfo +# capability name, termcap name, and description. +# +# Here is what's going onm in the init string: +# ESC [ 50;4| set 700 native mode (really is 605) +# x ESC [ 56;ps| set lines to 24: ps=0; 40: ps=1 (plus status line) +# ESC [ 53;0| set GenFlow to Xon/Xoff +# ESC [ 8 ;0| set CR on NL +# x ESC [ ? 3 l/h set workspace: 80 col(l); 132 col(h) +# ESC [ ? 4 l jump scroll +# ESC [ ? 5 l/h video: normal (l); reverse (h) +# ESC [ ?13 l Labels on +# ESC [ ?15 l parity check = no +# ESC [ 13 l monitor mode off +# ESC [ 20 l LF on NL (not CRLF on NL) +# ESC [ ? 7 h autowrap on +# ESC [ 12 h local echo off +# ESC ( B GO = ASCII +# ESC ) 0 G1 = Special Char & Line Drawing +# ESC [ ? 31 l Set 7 bit controls +# +# Note: Most terminals, especially the 600 family use Reverse Video for +# standout mode. DEC also uses reverse video. The VT100 uses bold in addition +# Assume we should stay with reverse video for 70.. However, the 605V2 exits +# standout mode with \E[m (all normal attributes). The 730 entry simply +# exits reverse video which would leave other current attributes intact. It +# was assumed the 730 entry to be more correct so rmso has changed. The +# 605V2 has no sequences to turn individual attributes off, thus its setting +# and the rmso/smso settings from the 730. +# +# Note: For the same reason as above in rmso I changed exit under-score mode +# to specifically turn off underscore, rather than return to all normal +# attributes +# +# Note: The following pkey_xmit is taken from the 605V2 which contained the +# capability as pfxl. It was changed here to pfx since pfxl +# will only compile successfully with Unix 4.0 tic. Also note that pfx only +# allows strings to be parameters and label values must be programmed as +# constant strings. Supposedly the pfxl of Version 4.0 allows both labels +# and strings to be parameters. The 605V2 pfx entry should be examined later +# in this regard. For reference the 730 pfxl entry is shown here for comparison +# 730 pfx entry: +# pfxl=\E[%?%p1%{25}%<%t%p1%e%p1%{24}%-%;%d;%p2%l%02d%?%p1%{25}%<%tq\s\s\s +# SYS\s\s\s\s\sF%p1%:-2d\s\s%e;0;3q%;%p2%s, +# +# (for 4.0 tic) +# pfxl=\E[%p1%d;%p2%l%02dq%?%p1%{9}%<%t F%p1%1d %;%p2%s, +# +# (for <4.0 tic) +# pfx=\E[%p1%d;%p2%l%02dq%?%p1%{9}%<%t F%p1%1d %;%p2%s, +# +# From the AT&T 705 Multi-tasking terminal user's guide Page 8-8,8-9 +# +# Port1 Interface +# +# modular 10 pin Connector +# Left side Right side +# Pin 1 2 3 4 5 6 7 8 9 10 +# +# Key (notch) at bottom +# +# Pin 1 DSR +# 3 DCD +# 4 DTR +# 5 Sig Ground +# 6 RD +# 7 SD +# 8 CTS +# 9 RTS +# 10 Frame Ground +# +# The manual is 189 pages and is loaded with details about the escape codes, +# etc..... Available from AT&T CIC 800-432-6600... +# ask for Document number 999-300-660.. +# +att700|AT&T 700 24x80 column display w/102key keyboard, + am, eslok, hs, mir, msgr, xenl, xon, + cols#80, it#8, lh#2, lines#24, lw#8, nlab#8, wsl#80, + acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, + clear=\E[H\E[J, cnorm=\E[?25h\E[?12l, cr=^M, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, + cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, + dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, + enacs=\E(B\E)0, flash=\E[?5h$<200>\E[?5l, fln=4\,4, + fsl=\E8, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, + il=\E[%p1%dL, il1=\E[L, ind=\ED, invis=\E[8m, + is2=\E[50;4|\E[53;0|\E[8;0|\E[?4;13;15l\E[13;20l\E[?7h\E[12h\E(B\E)0\E[?31l\E[0m\017, + is3=\E(B\E)0, kLFT=\E[ A, kRIT=\E[ @, kbs=^H, kcbt=\E[Z, + kclr=\E[2J, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kdch1=\E[P, kdl1=\E[M, kend=\E[24;1H, kf1=\EOc, kf10=\ENp, + kf11=\ENq, kf12=\ENr, kf13=\ENs, kf14=\ENt, kf15=\EOC, + kf16=\EOD, kf17=\EOE, kf18=\EOF, kf19=\EOG, kf2=\EOd, + kf20=\EOH, kf21=\EOI, kf22=\EOJ, kf23=\ENO, kf24=\ENP, + kf25=\ENQ, kf26=\ENR, kf27=\ENS, kf28=\ENT, kf29=\EOq, + kf3=\EOe, kf30=\EOr, kf31=\EOs, kf32=\EOt, kf33=\EOu, + kf34=\EOv, kf35=\EOw, kf36=\EOx, kf37=\EOy, kf38=\EOu, + kf39=\EOv, kf4=\EOf, kf40=\EOl, kf41=\EOq, kf42=\EOr, + kf43=\EOs, kf44=\EOp, kf45=\EOn, kf46=\EOM, kf5=\EOg, + kf6=\EOh, kf7=\EOi, kf8=\EOj, kf9=\ENo, khome=\E[H, + kich1=\E[@, kil1=\E[L, knp=\E[U, kpp=\E[V, ll=\E[24H, + mc0=\E[i, mc4=\E[?4i, mc5=\E[?5i, nel=\EE, + pfx=\E[%p1%d;%p2%l%02dq%?%p1%{9}%<%t F%p1%1d %;%p2%s, + pln=\E[%p1%d;0;0;0q%p2%:-16.16s, rc=\E8, + rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, ri=\EM, rmacs=^O, + rmir=\E[4l, rmln=\E[2p, rmso=\E[27m, rmul=\E[24m, + rmxon=\E[53;3|, rs1=\Ec\E[?3;5l\E[56;0|, sc=\E7, + sgr=\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p4%t;5%;%?%p3%p1%|%t;7%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, + sgr0=\E[m\017, smacs=^N, smir=\E[4h, smln=\E[p, smso=\E[7m, + smul=\E[4m, smxon=\E[53;0|, tbc=\E[3g, + tsl=\E7\E[99;%i%p1%dx, + # This entry was modified 3/13/90 by JWE. # fixes include additions of , correcting , and modification # of . (See comments below) @@ -7493,7 +8164,7 @@ att505-24|pt505-24|gs5430-24|AT&T PT505 or 5430 GETSET version 1 24 lines, tt505-22|pt505-22|gs5430-22|AT&T PT505 or 5430 GETSET version 1 22 lines, lines#22, use=att505, # -# -------------------- TERMINFO FILE CAN BE SPLIT HERE ----------------------- +#### ------------------ TERMINFO FILE CAN BE SPLIT HERE --------------------- # This cut mark helps make life less painful for people running ncurses tic # on machines with relatively little RAM. The file can be broken in half here # cleanly and compiled in sections -- no `use' references cross this cut @@ -7723,7 +8394,7 @@ annarbor4080|aa4080|ann arbor 4080, am, cols#80, lines#40, bel=^G, clear=\014$<2>, cr=^M, cub1=^H, cud1=^J, cuf1=^_, - cup=\017%p2%{10}%/%{16}%*%p2%{10}%m%+%c%p1%?%p1%{19}%>%t%{12}%+%;%'@'%+%c, + cup=\017%p2%{10}%/%{16}%*%p2%{10}%m%+%c%p1%?%p1%{19}%>%t%{12}%+%;%{64}%+%c, cuu1=^N, home=^K, ht=^I, hts=^]^P1, ind=^J, kbs=^^, kcub1=^H, kcud1=^J, kcuf1=^_, kcuu1=^N, khome=^K, tbc=^\^P^P, @@ -7963,6 +8634,7 @@ aaa-rv-unk|ann arbor unknown type, # Hauppauge, NY 11788-3762 # Vox: (800)-231-5445 # Fax: (516)-342-7378 +# Web: http://boundless.com # # Their voice mail used to describe the place as "SunRiver (formerly ADDS)". # In 1995 Boundless acquired DEC's terminals business. @@ -8031,7 +8703,7 @@ vp3a+|viewpoint3a+|adds viewpoint 3a+, cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, ed=\EY$<80>, el=\ET, home=^^, ht=^I, ind=^J, kbs=^H, kcub1=^H, kcud1=^J, kcuf1=^L, kcuu1=^K, khome=^^, nel=^M^J, rmso=\E(, - sgr=\E0%'@'%?%p1%tQ%|%;%?%p2%t%'`'%|%;%?%p3%tP%|%;%?%p4%t%{2}%|%;%?%p5%t%{1}%|%;%?%p7%tD%|%;%c\E), + sgr=\E0%{64}%?%p1%tQ%|%;%?%p2%t%{96}%|%;%?%p3%tP%|%;%?%p4%t%{2}%|%;%?%p5%t%{1}%|%;%?%p7%tD%|%;%c\E), sgr0=\E(, smso=\E0Q\E), vp60|viewpoint60|addsvp60|adds viewpoint60, use=regent40, @@ -8065,7 +8737,7 @@ adds980|a980|adds consul 980, am, cols#80, lines#24, bel=^G, clear=\014$<1>\013@, cr=^M, cub1=^H, cud1=^J, - cuf1=\E^E01, cup=\013%p1%'@'%+%c\E\005%p2%2d, + cuf1=\E^E01, cup=\013%p1%{64}%+%c\E\005%p2%2d, dl1=\E\017$<13>, il1=\E\016$<13>, ind=^J, kf0=\E0, kf1=\E1, kf2=\E2, kf3=\E3, kf4=\E4, kf5=\E5, kf6=\E6, kf7=\E7, kf8=\E8, kf9=\E9, rmso=^O, sgr0=^O, smso=^Y^^^N, @@ -8136,7 +8808,7 @@ cit101e|C. Itoh CIT-101e, # Background: light; Keyclicks: silent; Auto wraparound: on; CRT saver: # on. I also set up mine for parity (but you may not need it). Then # save the setup with ^S. -# +# (cit101e-rv: added empty to suppress a tic warning. --esr) cit101e-rv|Citoh CIT-101e (sets reverse video), am, eo, mir, msgr, xenl, xon, cols#80, it#8, lines#24, @@ -8152,11 +8824,11 @@ cit101e-rv|Citoh CIT-101e (sets reverse video), is2=\E<\E>\E[?1l\E[?3l\E[?4l\E[?5h\E[?7h\E[?8h\E[3g\E[>5g\E(B\E[m\E[20l\E[1;24r\E[24;1H, kbs=\177, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, nel=\EE, rc=\E8, - rev=\E[7m, ri=\EM, rin=\E[%p1%dT, rmir=\E[4l, rmso=\E[m, - rmul=\E[m, rs1=\Ec\E[?7h\E[>5g, sc=\E7, sgr0=\E[m, - smcup=\E[>5g\E[?7h\E[?5h, smir=\E[4h, smso=\E[7m, - smul=\E[4m, tbc=\E[3g, u6=\E[%i%p1%d;%p2%dR, u7=\E[6n, - u8=\E[?6c, u9=\E[c, + rev=\E[7m, ri=\EM, rin=\E[%p1%dT, rmcup=, rmir=\E[4l, + rmso=\E[m, rmul=\E[m, rs1=\Ec\E[?7h\E[>5g, sc=\E7, + sgr0=\E[m, smcup=\E[>5g\E[?7h\E[?5h, smir=\E[4h, + smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%p1%d;%p2%dR, + u7=\E[6n, u8=\E[?6c, u9=\E[c, cit101e-n|CIT-101e w/o am, am@, cvvis=\E[?1l\E[?4l\E[?7l, kbs=^H, kcub1=^H, kcud1=^J, use=cit101e, @@ -8864,11 +9536,184 @@ contel301|contel321|c301|c321|Contel Business Systems C-301 or C-321, # the terminals group at Data General was shut down in 1991; all these # terminals have thus been discontinued. # +# DG terminals have function keys that respond to the SHIFT and CTRL keys, +# e.g., SHIFT-F1 generates a different code from F1. To number the keys +# sequentially, first the unmodified key codes are listed as F1 through F15. +# Then their SHIFT versions are listed as F16 through F30, their CTRL versions +# are listed as F31 through F45, and their CTRL-SHIFT versions are listed as +# F46 through F60. This is done in the private "includes" below whose names +# start with "dgkeys+". +# +# DG terminals generally support 8 bit characters. For each of these terminals +# two descriptions are supplied: +# 1) A default description for 8 bits/character communications, which +# uses the default DG international character set and keyboard codes. +# 2) A description with suffix "-7b" for 7 bits/character communications. +# This description must use the NON-DEFAULT native keyboard language. + +# Unmodified fkeys (kf1-kf11), Shift fkeys (kf12-kf22), Ctrl fkeys (kf23-kf33), +# Ctrl/Shift fdkeys (kf34-kf44). + +dgkeys+8b|Private entry describing DG terminal 8-bit ANSI mode special keys, + ka1=\233020z, ka3=\233021z, kc1=\233022z, kc3=\233023z, + kclr=\2332J, kcub1=\233D, kcud1=\233B, kcuf1=\233C, + kcuu1=\233A, kel=\233K, kf1=\233001z, kf10=\233010z, + kf11=\233011z, kf12=\233012z, kf13=\233013z, + kf14=\233014z, kf15=\233000z, kf16=\233101z, + kf17=\233102z, kf18=\233103z, kf19=\233104z, + kf2=\233002z, kf20=\233105z, kf21=\233106z, + kf22=\233107z, kf23=\233108z, kf24=\233109z, + kf25=\233110z, kf26=\233111z, kf27=\233112z, + kf28=\233113z, kf29=\233114z, kf3=\233003z, + kf30=\233100z, kf31=\233201z, kf32=\233202z, + kf33=\233203z, kf34=\233204z, kf35=\233205z, + kf36=\233206z, kf37=\233207z, kf38=\233208z, + kf39=\233209z, kf4=\233004z, kf40=\233210z, + kf41=\233211z, kf42=\233212z, kf43=\233213z, + kf44=\233214z, kf45=\233200z, kf46=\233301z, + kf47=\233302z, kf48=\233303z, kf49=\233304z, + kf5=\233005z, kf50=\233305z, kf51=\233306z, + kf52=\233307z, kf53=\233308z, kf54=\233309z, + kf55=\233310z, kf56=\233311z, kf57=\233312z, + kf58=\233313z, kf59=\233314z, kf6=\233006z, + kf60=\233300z, kf7=\233007z, kf8=\233008z, kf9=\233009z, + khome=\233H, kprt=\233i, + +dgkeys+7b|Private entry describing DG terminal 7-bit ANSI mode special keys, + ka1=\E[020z, ka3=\E[021z, kc1=\E[022z, kc3=\E[023z, + kclr=\E[2J, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kel=\E[K, kf1=\E[001z, kf10=\E[010z, kf11=\E[011z, + kf12=\E[012z, kf13=\E[013z, kf14=\E[014z, kf15=\E[000z, + kf16=\E[101z, kf17=\E[102z, kf18=\E[103z, kf19=\E[104z, + kf2=\E[002z, kf20=\E[105z, kf21=\E[106z, kf22=\E[107z, + kf23=\E[108z, kf24=\E[109z, kf25=\E[110z, kf26=\E[111z, + kf27=\E[112z, kf28=\E[113z, kf29=\E[114z, kf3=\E[003z, + kf30=\E[100z, kf31=\E[201z, kf32=\E[202z, kf33=\E[203z, + kf34=\E[204z, kf35=\E[205z, kf36=\E[206z, kf37=\E[207z, + kf38=\E[208z, kf39=\E[209z, kf4=\E[004z, kf40=\E[210z, + kf41=\E[211z, kf42=\E[212z, kf43=\E[213z, kf44=\E[214z, + kf45=\E[200z, kf46=\E[301z, kf47=\E[302z, kf48=\E[303z, + kf49=\E[304z, kf5=\E[005z, kf50=\E[305z, kf51=\E[306z, + kf52=\E[307z, kf53=\E[308z, kf54=\E[309z, kf55=\E[310z, + kf56=\E[311z, kf57=\E[312z, kf58=\E[313z, kf59=\E[314z, + kf6=\E[006z, kf60=\E[300z, kf7=\E[007z, kf8=\E[008z, + kf9=\E[009z, khome=\E[H, kprt=\E[i, + +dgkeys+11|Private entry describing 11 minimal-subset DG mode special keys, + kclr=^L, kcub1=^Y, kcud1=^Z, kcuf1=^X, kcuu1=^W, kel=^K, + kf1=^^q, kf10=^^z, kf11=^^{, kf12=^^a, kf13=^^b, kf14=^^c, + kf15=^^d, kf16=^^e, kf17=^^f, kf18=^^g, kf19=^^h, kf2=^^r, + kf20=^^i, kf21=^^j, kf22=^^k, kf23=^^1, kf24=^^2, kf25=^^3, + kf26=^^4, kf27=^^5, kf28=^^6, kf29=^^7, kf3=^^s, kf30=^^8, + kf31=^^9, kf32=^^\:, kf33=^^;, kf34=^^!, kf35=^^", kf36=^^#, + kf37=^^$, kf38=^^%, kf39=^^&, kf4=^^t, kf40=^^', kf41=^^(, + kf42=^^), kf43=^^*, kf44=^^+, kf5=^^u, kf6=^^v, kf7=^^w, + kf8=^^x, kf9=^^y, khome=^H, + +dgkeys+15|Private entry describing 15 DG mode special keys, + kHOM=^^^H, kLFT=^^^Y, kRIT=^^^X, ka1=^^\\, ka3=^^], kc1=^^\^, + kc3=^^_, kf1=^^q, kf10=^^z, kf11=^^{, kf12=^^|, kf13=^^}, + kf14=^^~, kf15=^^p, kf16=^^a, kf17=^^b, kf18=^^c, kf19=^^d, + kf2=^^r, kf20=^^e, kf21=^^f, kf22=^^g, kf23=^^h, kf24=^^i, + kf25=^^j, kf26=^^k, kf27=^^l, kf28=^^m, kf29=^^n, kf3=^^s, + kf30=^^`, kf31=^^1, kf32=^^2, kf33=^^3, kf34=^^4, kf35=^^5, + kf36=^^6, kf37=^^7, kf38=^^8, kf39=^^9, kf4=^^t, kf40=^^\:, + kf41=^^;, kf42=^^<, kf43=^^=, kf44=^^>, kf45=^^0, kf46=^^!, + kf47=^^", kf48=^^#, kf49=^^$, kf5=^^u, kf50=^^%, kf51=^^&, + kf52=^^', kf53=^^(, kf54=^^), kf55=^^*, kf56=^^+, kf57=^^\,, + kf58=^^-, kf59=^^., kf6=^^v, kf60=^^\s, kf7=^^w, kf8=^^x, + kf9=^^y, + +# Data General color terminals use the "Tektronix" color model. The total +# number of colors varies with the terminal model, as does support for +# attributes used in conjunction with color. + +# Removed u7, u8 definitions since they conflict with tack: +# Preserve user-defined colors in at least some cases. +# u7=^^Fh, +# Default is ACM mode. +# u8=^^F}20^^Fi^^F}21, +# +dgunix+fixed|Fixed color info for DG D430C terminals in DG-UNIX mode, + bce, + colors#16, ncv#53, pairs#256, + op=\036Ad\036Bd, + setab=\036B%p1%?%p1%{8}%<%t%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%;%{48}%+%c, + setaf=\036A%p1%?%p1%{8}%<%t%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%;%{48}%+%c, + setb=\036B%p1%{48}%+%c, setf=\036A%p1%{48}%+%c, + +dg+fixed|Fixed color info for DG D430C terminals in DG mode, + use=dgunix+fixed, + +# Video attributes are coordinated using static variables set by "sgr", then +# checked by "op", "seta[bf]", and "set[bf]" to refresh the attribute settings. +# (D=dim, U=underline, B=blink, R=reverse.) +dg+color8|Color info for Data General D220 and D230C terminals in ANSI mode, + bce, + colors#8, ncv#16, pairs#64, + op=\E[%?%gD%t2;%;%?%gU%t4;%;%?%gB%t5;%;%?%gR%t7;%;m, + setab=\E[4%p1%d%?%gD%t;2%;%?%gU%t;4%;%?%gB%t;5%;%?%gR%t;7%;m, + setaf=\E[3%p1%d%?%gD%t;2%;%?%gU%t;4%;%?%gB%t;5%;%?%gR%t;7%;m, + setb=\E[4%p1%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%d%?%gD%t;2%;%?%gU%t;4%;%?%gB%t;5%;%?%gR%t;7%;m, + setf=\E[3%p1%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%d%?%gD%t;2%;%?%gU%t;4%;%?%gB%t;5%;%?%gR%t;7%;m, + +dg+color|Color info for Data General D470C terminals in ANSI mode, + colors#16, ncv#53, pairs#256, + setab=\E[%?%p1%{8}%<%t4%p1%e=%p1%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%;%d%?%gD%t;2%;%?%gU%t;4%;%?%gB%t;5%;%?%gR%t;7%;m, + setaf=\E[%?%p1%{8}%<%t3%p1%e<%p1%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%;%d%?%gD%t;2%;%?%gU%t;4%;%?%gB%t;5%;%?%gR%t;7%;m, + setb=\E[%?%p1%{8}%<%t4%e=%;%p1%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%d%?%gD%t;2%;%?%gU%t;4%;%?%gB%t;5%;%?%gR%t;7%;m, + setf=\E[%?%p1%{8}%<%t3%e<%;%p1%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%d%?%gD%t;2%;%?%gU%t;4%;%?%gB%t;5%;%?%gR%t;7%;m, + use=dg+color8, + +dgmode+color8|Color info for Data General D220/D230C terminals in DG mode, + bce, + colors#8, ncv#16, pairs#64, + op=\036Ad\036Bd, + setab=\036B%p1%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%{48}%+%c, + setaf=\036A%p1%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%{48}%+%c, + setb=\036B%p1%{48}%+%c, setf=\036A%p1%{48}%+%c, + +dgmode+color|Color info for Data General D470C terminals in DG mode, + colors#16, pairs#256, + setab=\036B%p1%?%p1%{8}%<%t%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%;%{48}%+%c, + setaf=\036A%p1%?%p1%{8}%<%t%{2}%&%?%p1%{1}%&%t%{4}%|%;%?%p1%{4}%&%t%{1}%|%;%;%{48}%+%c, + use=dgmode+color8, + +dgunix+ccc|Configurable color info for DG D430C terminals in DG-UNIX mode, + bce, ccc, + colors#52, ncv#53, pairs#26, + initp=\036RG0%p1%02X%p2%{256}%*%{1001}%/%02X%p3%{256}%*%{1001}%/%02X%p4%{256}%*%{1001}%/%02X%p5%{256}%*%{1001}%/%02X%p6%{256}%*%{1001}%/%02X%p7%{256}%*%{1001}%/%02X, + oc=\036RG01A00FF00000000\036RG01B00000000FF00\036RG01C007F00000000\036RG01D000000007F00, + op=\036RF4831A\036RF2E31B\036RF1D31C\036RF3F31D, + scp=\036RG2%p1%02X, + +# Colors are in the order: normal, reverse, dim, dim + reverse. +dg+ccc|Configurable color info for DG D430C terminals in DG mode, + bce, ccc, + colors#52, ncv#53, pairs#26, + initp=\036RG0%p1%{16}%/%{48}%+%c%p1%{16}%m%{48}%+%c%p2%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p3%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p4%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p5%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p6%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p7%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c, + oc=\036RG01\:00??00000000\036RG01;00000000??00\036RG01<007?00000000\036RG01=000000007?00, + op=\036RF4831\:\036RF2>31;\036RF1=31<\036RF3?31=, + scp=\036RG2%p1%{16}%/%{48}%+%c%p1%{16}%m%{48}%+%c, + +# The generic DG terminal type (an 8-bit-clean subset of the 6053) +# Initialization string 1 sets: +# ^R - vertical scrolling enabled +# ^C - blinking enabled +dg-generic|Generic Data General terminal in DG mode, + am, bw, msgr, xon, + cols#80, lines#24, + bel=^G, blink=^N, clear=^L, cr=^M, cub1=^Y, cud1=^Z, cuf1=^X, + cup=\020%p2%c%p1%c, cuu1=^W, dim=^\, el=^K, ind=^J, is1=^R^C, + mc0=^Q, nel=^J, rmso=^], rmul=^U, sgr0=^O^U^], smso=^\, + smul=^T, + use=dgkeys+11, # According to the 4.4BSD termcap file, the dg200 should be the # termcap equivalent of \020%p2%{128}%+%c%p1%{128}%+%c (in termcap # notation that's "^P%r%+\200%+\200"). Those \200s are suspicious, # maybe they were originally nuls (which would fit). + dg200|data general dasher 200, am, bw, cols#80, lines#24, @@ -8878,6 +9723,7 @@ dg200|data general dasher 200, kf2=^^r, kf3=^^s, kf4=^^t, kf5=^^u, kf6=^^v, kf7=^^w, kf8=^^x, kf9=^^y, khome=^H, lf0=f10, nel=^J, rmso=^^E, rmul=^U, smso=^^D, smul=^T, + # Data General 210/211 (and 410?) from Lee Pearson (umich!lp) via BRL dg210|dg-ansi|Data General 210/211, am, @@ -8927,7 +9773,7 @@ dg460-ansi|Data General Dasher 460 in ANSI-mode, # This also matches a posted description of something called a `Dasher 100' # so there's a dg100 alias here. # (dg6053: the 4.4BSD file had , , . -- esr) -dg6053|dg100|data general 6053, +dg6053-old|dg100|data general 6053, am, bw, ul, cols#80, lines#24, bel=^G, clear=^L, cnorm=^L, cr=^M, cub1=^Y, cud1=^Z, cuf1=^X, @@ -8937,6 +9783,478 @@ dg6053|dg100|data general 6053, kf7=^^x, kf8=^^y, kf9=^^z, khome=^H, rmcup=^L, rmso=\0^^E, rmul=^U, smcup=^L^R, smso=\0\0\0\0\0\036D, smul=^T, +# (Some performance can be gained over the generic DG terminal type) +dg6053|6053|6053-dg|dg605x|605x|605x-dg|d2|d2-dg|Data General DASHER 6053, + xon@, + home=^P\0\0, ll=^P\0^W, use=dg-generic, + +# Like 6053, but adds reverse video and more keypad and function keys. +d200|d200-dg|Data General DASHER D200, + bold=^^D^T, home@, ll@, rev=^^D, rmso=^^E^], + sgr=\036%?%p1%p3%|%p6%|%tD%eE%;%?%p2%p6%|%t\024%e\025%;%?%p4%t\016%e\017%;%?%p1%p5%|%t\034%e\035%;, + sgr0=\017\025\035\036E, smso=^^D^\, + use=dgkeys+15, use=dg6053, + +# DASHER D210 series terminals in ANSI mode. +# Reverse video, no insert/delete character/line, 7 bits/character only. +# +# Initialization string 1 sets: +# <0 - scrolling enabled +# <1 - blink enabled +# <4 - print characters regardless of attributes +d210|d214|Data General DASHER D210 series, + am, bw, msgr, xon, + cols#80, lines#24, + bel=^G, blink=\E[5m, bold=\E[4;7m, clear=\E[2J, cr=^M, + cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B, + cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, + cuu=\E[%p1%dA, cuu1=\E[A, dim=\E[2m, ed=\E[J, el=\E[K, + el1=\E[1K, home=\E[H, ind=^J, is1=\E[<0;<1;<4l, + ll=\E[H\E[A, nel=^J, rev=\E[7m, rmso=\E[m, rmul=\E[m, + sgr=\E[%?%p1%p3%|%p6%|%t7;%;%?%p4%t5;%;%?%p2%p6%|%t4;%;%?%p1%p5%|%t2;%;m, + sgr0=\E[m, smso=\E[2;7m, smul=\E[4m, + use=dgkeys+7b, + +# DASHER D210 series terminals in DG mode. +# Like D200, but adds clear to end-of-screen and needs XON/XOFF. +d210-dg|d214-dg|Data General DASHER D210 series in DG mode, + xon, + ed=^^FF, use=d200-dg, + +# DASHER D211 series terminals in ANSI mode. +# Like the D210, but with 8-bit characters and local printer support. +# +# Initialization string 2 sets: +# \E[2;1;1;1v +# 2;1 - 8 bit operations +# 1;1 - 8 bit (international) keyboard language +# \E(B - default primary character set (U.S. ASCII) +# \E)4 - default secondary character set (international) +# ^O - primary character set +# +d211|d215|Data General DASHER D211 series, + km, + is2=\E[2;1;1;1v\E(B\E)4\017, mc0=\E[i, use=dgkeys+8b, use=d210, + +# Initialization string 2 sets: +# \E[2;0;1;0v +# 2;0 - 7 bit operations +# 1;0 - 7 bit (native) keyboard language +# \E(0 - default character set (the keyboard native language) +# ^O - primary character set +d211-7b|d215-7b|Data General DASHER D211 series in 7 bit mode, + km@, + is2=\E[2;0;1;0v\E(0\017, use=dgkeys+7b, use=d211, + +# Like the D210 series, but adds support for 8-bit characters. +# +# Reset string 2 sets: +# ^^N - secondary character set +# ^^FS0> - 8 bit international character set +# ^^O - primary character set +# ^^FS00 - default character set (matching the native keyboard language) +# +d211-dg|d215-dg|Data General DASHER D211 series in DG mode, + km, + rs2=\036N\036FS0>\036O\036FS00, use=d210-dg, + +d216-dg|d216e-dg|d216+dg|d216e+dg|d217-dg|Data General DASHER D216 series in DG mode, + use=d211-dg, + +# Enhanced DG mode with changes to be more UNIX compatible. +d216-unix|d216e-unix|d216+|d216e+|Data General DASHER D216+ in DG-UNIX mode, + mc5i, + it#8, + acsc=a\177j$k"l!m#n)q+t'u&v(w%x*, blink=^^PI, + clear=^^PH, cub1=^^PD, cud1=^^PB, cuf1=^^PC, cuu1=^^PA, + el=^^PE, home=^^PF, hpa=\020%p1%c\177, ht=^I, ind=^J, + is1=\022\003\036P@1, is3=\036Fz0, kHOM=^^Pf, kLFT=^^Pd, + kPRT=^^P1, kRIT=^^Pc, kclr=^^PH, kcub1=^^PD, kcud1=^^PB, + kcuf1=^^PC, kcuu1=^^PA, kel=^^PE, khome=^^PF, kprt=^^P0, + mc0=\036F?9, mc4=^^Fa, mc5=^^F`, rmacs=\036FS00, + rs2=\036N\036FS0E\036O\036FS00, + sgr=\036%?%p1%p3%|%p6%|%tD%eE%;%?%p2%p6%|%t\024%e\025%;\036P%?%p4%tI%eJ%;%?%p1%p5%|%t\034%e\035%;\036FS%?%p9%t11%e00%;, + sgr0=\036PJ\025\035\036E\036FS00, smacs=\036FS11, + vpa=\020\177%p1%c, + use=dgkeys+15, use=d216-dg, +d216-unix-25|d216+25|Data General DASHER D216+ in DG-UNIX mode with 25 lines, + lines#25, + is3=\036Fz2, use=d216+, + +d217-unix|Data General DASHER D217 in DG-UNIX mode, + use=d216-unix, +d217-unix-25|Data General DASHER D217 in DG-UNIX mode with 25 lines, + use=d216-unix-25, + +# DASHER D220 color terminal in ANSI mode. +# Like the D470C but with fewer colors and screen editing features. +# +# Initialization string 1 sets: +# \E[<0;<1;<4l +# <0 - scrolling enabled +# <1 - blink enabled +# <4 - print characters regardless of attributes +# \E[m - all attributes off +# Reset string 1 sets: +# \Ec - initial mode defaults (RIS) +# +d220|Data General DASHER D220, + mc5i@, + dl@, dl1@, il@, il1@, is1=\E[<0;<1;<4l\E[m, mc4@, mc5@, rs1=\Ec, use=dg+color8, use=d470c, + +d220-7b|Data General DASHER D220 in 7 bit mode, + mc5i@, + dl@, dl1@, il@, il1@, is1=\E[<0;<1;<4l\E[m, mc4@, mc5@, rs1=\Ec, use=dg+color8, use=d470c-7b, + +# Initialization string 3 sets: +# - default cursor (solid rectangle) +# Reset string 2 sets: +# ^^N - secondary character set +# ^^FS0> - 8 bit international character set +# ^^O - primary character set +# ^^FS00 - default character set (matching the native keyboard language) +# +d220-dg|Data General DASHER D220 color terminal in DG mode, + mc5i@, + dl1@, home@, il1@, is2@, is3=\036FQ2, ll@, mc4@, mc5@, rs1@, + rs2=\036N\036FS0>\036O\036FS00, + use=dgmode+color8, use=d470c-dg, + +# DASHER D230C color terminal in ANSI mode. +# Like the D220 but with minor ANSI compatibility improvements. +# +d230c|d230|Data General DASHER D230C, + blink=\E[5;50m, bold=\E[4;7;50m, dim=\E[2;50m, nel=^M^J, + rev=\E[7;50m, rmkx=\E[2;1v, rmso=\E[50m, rmul=\E[50m, + sgr=\E[50%?%p1%p3%|%p6%|%t;7%{1}%e%{0}%;%PR%?%p4%t;5%{1}%e%{0}%;%PB%?%p2%p6%|%t;4%{1}%e%{0}%;%PU%?%p1%p5%|%t;2%{1}%e%{0}%;%PDm\E)%?%p9%t6\016%e4\017%;, + sgr0=\E[50m\E)4\017, smkx=\E[2;0v, smso=\E[2;7;50m, + smul=\E[4;50m, + use=dgkeys+7b, use=d220, + +d230c-dg|d230-dg|Data General DASHER D230C in DG mode, + use=d220-dg, + +# DASHER D400/D450 series terminals. +# These add intelligent features like insert/delete to the D200 series. +# +# Initialization string 2 sets: +# ^^FQ2 - default cursor (solid rectangle) +# ^^FW - character protection disabled +# ^^FJ - normal (80 column) mode +# ^^F\^ - horizontal scrolling enabled (for alignment) +# ^^FX004? - margins at columns 0 and 79 +# ^^F] - horizontal scrolling disabled +# ^^O - primary character set +# ^^FS00 - default character set (the keyboard native language) +# - (should reset scrolling regions, but that glitches the screen) +# Reset string 1 sets: +# ^^FA - all terminal defaults except scroll rate +# Reset string 2 sets: +# ^^F] - horizontal scrolling disabled +# ^^FT0 - jump scrolling +# +d400|d400-dg|d450|d450-dg|Data General DASHER D400/D450 series, + mc5i, + acsc=j$k"l!m#n)q+t'u&v(w%x*, civis=\036FQ0, + cnorm=\036FQ2, dch1=^^K, dl1=^^FI, + enacs=\036N\036FS11\036O, home=^^FG, hpa=\020%p1%c\177, + ich1=^^J, il1=^^FH, + is2=\036FQ2\036FW\036FJ\036F\^\036FX004?\036F]\036O\036FS00, + ll=\036FG\027, mc4=^^Fa, mc5=^^F`, ri=^^I, rmacs=^^O, + rs1=^^FA, rs2=\036F]\036FT0, + sgr=\036%?%p1%p3%|%p6%|%tD%eE%;%?%p2%p6%|%t\024%e\025%;%?%p4%t\016%e\017%;%?%p1%p5%|%t\034%e\035%;\036%?%p9%tN%eO%;, + sgr0=\017\025\035\036E\036O, smacs=^^N, + vpa=\020\177%p1%c, use=d210-dg, + +# DASHER D410/D460 series terminals in ANSI mode. +# These add a large number of intelligent terminal features. +# +# Initialization string 1 sets: +# \E[<0;<1;<2;<4l +# <0 - scrolling enabled +# <1 - blink enabled +# <2 - horizontal scrolling enabled (for alignment) +# <4 - print characters regardless of attributes +# \E[5;0v - normal (80 column) mode +# \E[1;1;80w - margins at columns 1 and 80 +# \E[1;6;<2h +# 1 - print all characters even if protected +# 6 - character protection disabled +# <2 - horizontal scrolling disabled +# - (should reset scrolling regions, but that glitches the screen) +# +# Initialization string 2 sets: +# \E[3;2;2;1;1;1v +# 3;2 - default cursor (solid rectangle) +# 2;1 - 8 bit operations +# 1;1 - international keyboard language +# \E(B - default primary character set (U.S. ASCII) +# \E)4 - default secondary character set (international) +# ^O - primary character set +# +# Reset string 1 sets: +# \Ec - initial mode defaults (RIS) +# \E[<2h - horizontal scrolling disabled +# +# Reset string 2 sets: +# \E[4;0;2;1;1;1v +# 4;0 - jump scrolling +# 2;1 - 8 bit operations +# 1;1 - 8 bit (international) keyboard language +# \E(B - default primary character set (U.S. ASCII) +# \E)4 - default secondary character set (international) +# +d410|d411|d460|d461|Data General DASHER D410/D460 series, + mc5i, + acsc=j$k"l!m#n)q+t'u&v(w%x*, civis=\E[3;0v, + cnorm=\E[3;2v, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, + dl1=\E[M, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, + is1=\E[<0;<1;<2;<4l\E[5;0v\E[1;1;80w\E[1;6;<2h, + is2=\E[3;2;2;1;1;1v\E(B\E)4\017, mc4=\E[4i, mc5=\E[5i, + ri=\EM, rmacs=\E)4\017, rs1=\Ec\E[<2h, + rs2=\E[4;0;2;1;1;1v\E(B\E)4, + sgr=\E[%?%p1%p3%|%p6%|%t7;%;%?%p4%t5;%;%?%p2%p6%|%t4;%;%?%p1%p5%|%t2;%;m\E)%?%p9%t6\016%e4\017%;, + sgr0=\E[m\E)4\017, smacs=\E)6\016, + use=d211, + +# Initialization string 2 sets: +# \E[3;2;2;0;1;0v +# 3;2 - default cursor (solid rectangle) +# 2;0 - 7 bit operations +# 1;0 - 7 bit (native) keyboard language +# \E(0 - default character set (the keyboard native language) +# ^O - primary character set +# +# Reset string 2 sets: +# \E[4;0;2;0;1;0v +# 4;0 - jump scrolling +# 2;0 - 7 bit operations +# 1;0 - 7 bit (native) keyboard language +# \E(0 - default character set (the keyboard native language) +# +d410-7b|d411-7b|d460-7b|d461-7b|Data General DASHER D410/D460 series in 7 bit mode, + km@, + enacs=\E)6, is2=\E[3;2;2;0;1;0v\E(0\017, rmacs=^O, + rs2=\E[4;0;2;0;1;0v\E(0, + sgr=\E[%?%p1%p3%|%p6%|%t7;%;%?%p4%t5;%;%?%p2%p6%|%t4;%;%?%p1%p5%|%t2;%;m%?%p9%t\016%e\017%;, + sgr0=\E[m\017, smacs=^N, + use=dgkeys+7b, use=d410, + +d410-dg|d460-dg|d411-dg|d461-dg|Data General DASHER D410/D460 series in DG mode, + km, + enacs@, rmacs=\036FS00, + sgr=\036%?%p1%p3%|%p6%|%tD%eE%;%?%p2%p6%|%t\024%e\025%;%?%p4%t\016%e\017%;%?%p1%p5%|%t\034%e\035%;\036FS%?%p9%t11%e00%;, + sgr0=\017\025\035\036E\036FS00, smacs=\036FS11, + use=d400-dg, + +# DASHER D410/D460 series terminals in wide (126 columns) ANSI mode. +# +# Initialization string 1 sets: +# \E[<0;<1;<2;<4l +# <0 - scrolling enabled +# <1 - blink enabled +# <2 - horizontal scrolling enabled (for alignment) +# <4 - print characters regardless of attributes +# \E[5;1v - compressed (135 column) mode +# \E[1;1;126 - margins at columns 1 and 126 +# \E[1;6;<2h +# 1 - print all characters even if protected +# 6 - character protection disabled +# <2 - horizontal scrolling disabled +# - (should reset scrolling regions, but that glitches the screen) +# +# Reset string 1 sets: +# \Ec - initial mode defaults (RIS) +# \E[5;1v - compressed (135 column) mode +# \E[1;1;126w - margins at columns 1 and 126 +# \E[<2h - horizontal scrolling disabled +# +d410-w|d411-w|d460-w|d461-w|Data General DASHER D410/D460 series in wide mode, + cols#126, + is1=\E[<0;<1;<2;<4l\E[5;1v\E[1;1;126w\E[1;6;<2h, + rs1=\Ec\E[5;1v\E[1;1;126w\E[<2h, + use=d410, + +d410-7b-w|d411-7b-w|d460-7b-w|d461-7b-w|Data General DASHER D410/D460 series in wide 7 bit mode, + cols#126, + is1=\E[<0;<1;<2;<4l\E[5;1v\E[1;1;126w\E[1;6;<2h, + rs1=\Ec\E[5;1v\E[1;1;126w\E[<2h, + use=d410-7b, + +d412-dg|d462-dg|d462e-dg|d412+dg|d462+dg|d413-dg|d463-dg|Data General DASHER D412/D462 series in DG mode, + use=d410-dg, + +# These add intelligent features like scrolling regions. +d412-unix|d462-unix|d412+|d462+|Data General DASHER D412+/D462+ series in Unix mode, + civis=\036FQ0, clear=^^FE, cnorm=\036FQ5, + cup=\036FP%p2%2.2X%p1%2.2X, dch1=^^K, dl1=^^FI, + home=^^FG, hpa=\036FP%p1%2.2XFF, ich1=^^J, il1=^^FH, + is2=\036FQ5\036FW\036FJ\036F\^\036FX004F\036O\036FS00, + ll=\036FG\036PA, mc0=^A, rc=\036F}11, ri=^^I, + rs1=\036FA\036FT0, rs2=\036P@1, sc=\036F}10, + vpa=\036FPFF%p1%2.2X, + wind=\036FB%?%p1%t%p1%2.2X0%;%p2%p1%-%{1}%+%2.2X0%?%{23}%p2%>%t000%;\036FX%p3%2.2X%p4%2.2X, use=d216+, +d412-unix-w|d462-unix-w|d412+w|d462+w|Data General DASHER D412+/D462+ series in wide Unix mode, + cols#132, + is2=\036FQ5\036FW\036FK\036F\^\036FX0083\036O\036FS00, + rs2=\036P@1\036FK\036FX0083, + wind=\036FB%?%p1%t%p1%2.2X1%;%p2%p1%-%{1}%+%2.2X1%?%{23}%p2%>%t001%;\036FX%p3%2.2X%p4%2.2X, use=d412-unix, +d412-unix-25|d462-unix-25|d412+25|d462+25|Data General DASHER D412+/D462+ series in Unix mode with 25 lines, + lines#25, + is3=\036Fz2, + wind=\036FB%?%p1%t%p1%2.2X0%;%p2%p1%-%{1}%+%2.2X0%?%{24}%p2%>%t000%;\036FX%p3%2.2X%p4%2.2X, use=d462+, +d412-unix-s|d462-unix-s|d412+s|d462+s|Data General DASHER D412+/D462+ in Unix mode with status line, + eslok, hs, + clear=\036FG\036PH, fsl=\036F}01\022, + is3=\036Fz2\036F}00\036FB180000\036F}01, ll@, + tsl=\036F}00\036FP%p1%2.2X18\036PG, + wind=\036FB%?%p1%t%p1%2.2X0%;%p2%p1%-%{1}%+%2.2X0%?%{23}%p2%>%t%{23}%p2%-%2.2X0%;000\036FX%p3%2.2X%p4%2.2X, use=d462+, + +# Relative cursor motions are confined to the current window, +# which is not what the scrolling region specification expects. +# Thus, relative vertical cursor positioning must be deleted. +d412-unix-sr|d462-unix-sr|d412+sr|d462+sr|Data General DASHER D412+/D462+ in Unix mode with scrolling region, + csr=\036FB%?%p1%t%p1%2.2X0%;%p2%p1%-%{1}%+%2.2X0%?%{23}%p2%>%t000%;, + cud1@, cuu1@, ll@, + use=d462+, + +d413-unix|d463-unix|Data General DASHER D413/D463 series in DG-UNIX mode, + use=d412-unix, +d413-unix-w|d463-unix-w|Data General DASHER D413/D463 series in wide DG-UNIX mode, + use=d412-unix-w, +d413-unix-25|d463-unix-25|Data General DASHER D413/D463 series in DG-UNIX mode with 25 lines, + use=d412-unix-25, +d413-unix-s|d463-unix-s|Data General DASHER D413/D463 in DG-UNIX mode with status line, + use=d412-unix-s, +d413-unix-sr|d463-unix-sr|Data General DASHER D413/D463 in DG-UNIX mode with scrolling region, + use=d412-unix-sr, + +d414-unix|d464-unix|Data General D414/D464 in DG-UNIX mode, + use=d413-unix, +d414-unix-w|d464-unix-w|Data General D414/D464 in wide DG-UNIX mode, + use=d413-unix-w, +d414-unix-25|d464-unix-25|Data General D414/D464 in DG-UNIX mode with 25 lines, + use=d413-unix-25, +d414-unix-s|d464-unix-s|Data General D414/D464 in DG-UNIX mode with status line, + use=d413-unix-s, +d414-unix-sr|d464-unix-sr|Data General D414/D464 in DG-UNIX mode with scrolling region, + use=d413-unix-sr, + +d430c-dg|d430-dg|Data General D430C in DG mode, + use=d413-dg, use=dg+fixed, +d430c-dg-ccc|d430-dg-ccc|Data General D430C in DG mode with configurable colors, + use=d413-dg, use=dg+ccc, + +d430c-unix|d430-unix|Data General D430C in DG-UNIX mode, + use=d413-unix, use=dgunix+fixed, +d430c-unix-w|d430-unix-w|Data General D430C in wide DG-UNIX mode, + use=d413-unix-w, use=dgunix+fixed, +d430c-unix-25|d430-unix-25|Data General D430C in DG-UNIX mode with 25 lines, + use=d413-unix-25, use=dgunix+fixed, +d430c-unix-s|d430-unix-s|Data General D430C in DG-UNIX mode with status line, + use=d413-unix-s, use=dgunix+fixed, +d430c-unix-sr|d430-unix-sr|Data General D430C in DG-UNIX mode with scrolling region, + use=d413-unix-sr, use=dgunix+fixed, +d430c-unix-ccc|d430-unix-ccc|Data General D430C in DG-UNIX mode with configurable colors, + use=d413-unix, use=dgunix+ccc, +d430c-unix-w-ccc|d430-unix-w-ccc|Data General D430C in wide DG-UNIX mode with configurable colors, + use=d413-unix-w, use=dgunix+ccc, +d430c-unix-25-ccc|d430-unix-25-ccc|Data General D430C in DG-UNIX mode with 25 lines and configurable colors, + use=d413-unix-25, use=dgunix+ccc, +d430c-unix-s-ccc|d430-unix-s-ccc|Data General D430C in DG-UNIX mode with status line and configurable colors, + use=d413-unix-s, use=dgunix+ccc, +d430c-unix-sr-ccc|d430-unix-sr-ccc|Data General D430C in DG-UNIX mode with scrolling region and configurable colors, + use=d413-unix-sr, use=dgunix+ccc, + +# DASHER D470C color terminal in ANSI mode. +# Like the D460 but with 16 colors and without a compressed mode. +# +# Initialization string 1 sets: +# \E[<0;<1;<2;<4l +# <0 - scrolling enabled +# <1 - blink enabled +# <2 - horizontal scrolling enabled (for alignment) +# <4 - print characters regardless of attributes +# \E[1;1;80w - margins at columns 1 and 80 +# \E[1;6;<2h +# 1 - print all characters even if protected +# 6 - character protection disabled +# <2 - horizontal scrolling disabled +# - (should reset scrolling regions, but that glitches the screen) +# +d470c|d470|Data General DASHER D470C, + is1=\E[<0;<1;<2;<4l\E[1;1;80w\E[1;6;<2h, + sgr=\E[%?%p1%p3%|%p6%|%t7;%{1}%e%{0}%;%PR%?%p4%t5;%{1}%e%{0}%;%PB%?%p2%p6%|%t4;%{1}%e%{0}%;%PU%?%p1%p5%|%t2;%{1}%e%{0}%;%PDm\E)%?%p9%t6\016%e4\017%;, + use=dg+color, use=d460, + +d470c-7b|d470-7b|Data General DASHER D470C in 7 bit mode, + is1=\E[<0;<1;<2;<4l\E[1;1;80w\E[1;6;<2h, + sgr=\E[%?%p1%p3%|%p6%|%t7;%{1}%e%{0}%;%PR%?%p4%t5;%{1}%e%{0}%;%PB%?%p2%p6%|%t4;%{1}%e%{0}%;%PU%?%p1%p5%|%t2;%{1}%e%{0}%;%PDm%?%p9%t\016%e\017%;, + use=dg+color, use=d460-7b, + +# Initialization string 2 sets: +# ^^FQ2 - default cursor (solid rectangle) +# ^^FW - character protection disabled +# ^^F\^ - horizontal scrolling enabled (for alignment) +# ^^FX004? - margins at columns 0 and 79 +# ^^F] - horizontal scrolling disabled +# ^^O - primary character set +# ^^FS00 - default character set (the keyboard native language) +# - (should reset scrolling regions, but that glitches the screen) +# +d470c-dg|d470-dg|Data General DASHER D470C in DG mode, + is2=\036FQ2\036FW\036F\^\036FX004?\036F]\036O\036FS00, + use=dgmode+color, use=d460-dg, + +# DASHER D555 terminal in ANSI mode. +# Like a D411, but has an integrated phone. +d555|Data General DASHER D555, + use=d411, +d555-7b|Data General DASHER D555 in 7-bit mode, + use=d411-7b, +d555-w|Data General DASHER D555 in wide mode, + use=d411-w, +d555-7b-w|Data General DASHER D555 in wide 7-bit mode, + use=d411-7b-w, +d555-dg|Data General DASHER D555 series in DG mode, + use=d411-dg, + +# DASHER D577 terminal in ANSI mode. +# Like a D411, but acts as a keyboard for serial printers ("KSR" modes). +d577|Data General DASHER D577, + use=d411, +d577-7b|Data General DASHER D577 in 7-bit mode, + use=d411-7b, +d577-w|Data General DASHER D577 in wide mode, + use=d411-w, +d577-7b-w|Data General DASHER D577 in wide 7-bit mode, + use=d411-7b-w, + +d577-dg|d578-dg|Data General DASHER D577/D578 series in DG mode, + use=d411-dg, + +# DASHER D578 terminal. +# Like a D577, but without compressed mode; like a D470C in this respect. +# +# Initialization string 1 sets: +# \E[<0;<1;<2;<4l +# <0 - scrolling enabled +# <1 - blink enabled +# <2 - horizontal scrolling enabled (for alignment) +# <4 - print characters regardless of attributes +# \E[1;1;80w - margins at columns 1 and 80 +# \E[1;6;<2h +# 1 - print all characters even if protected +# 6 - character protection disabled +# <2 - horizontal scrolling disabled +# - (should reset scrolling regions, but that glitches the screen) +# +d578|Data General DASHER D578, + is1=\E[<0;<1;<2;<4l\E[1;1;80w\E[1;6;<2h, use=d577, +d578-7b|Data General DASHER D578 in 7-bit mode, + is1=\E[<0;<1;<2;<4l\E[1;1;80w\E[1;6;<2h, + use=d577-7b, + #### Datamedia (dm) # # Datamedia was headquartered in Nashua, New Hampshire in 1993. @@ -8954,7 +10272,7 @@ dg6053|dg100|data general 6053, # only company and no longer make terminals. However, the operator there # told me that she had once spoken to a customer looking for Datamedia # terminals who'd mentioned a Datamedia in New Jersey. This is backed up -# by comp.terminals poosting describing the ID plate on the back of a +# by comp.terminals posting describing the ID plate on the back of a # "Datamedia 3000" terminal. Was this an earlier incarnation of Axent? # Inquiring minds want to know... # @@ -9068,9 +10386,9 @@ dt80-sas|Datamedia DT803/DTX for SAS usage, cols#80, lines#24, acsc=``a1fxgqh0jYk?lZm@nEooppqDrrsstCu4vAwBx3yyzz{{||}}~~, bel=^G, clear=^L, cr=^M, - csr=\E=%p1%' '%+%c%' '%c\E#1\E=%p2%' '%+%c%' '%c\E#2, + csr=\E=%p1%{32}%+%c%{32}%c\E#1\E=%p2%{32}%+%c%{32}%c\E#2, cub1=^H, cud1=\EB, cuf1=^\, - cup=\E=%p2%' '%+%c%p1%' '%+%c, cuu1=^_, dl1=\EM, ed=^K, + cup=\E=%p2%{32}%+%c%p1%{32}%+%c, cuu1=^_, dl1=\EM, ed=^K, el=^], ff=^L, home=^Y, ht=^I, hts=\E'1, il1=\EL, ind=\EB, is2=\E)0\E<\EP\E'0\E$2, kclr=^L, kcub1=^H, kcud1=^J, kcuf1=^\, kcuu1=^_, ked=^K, kel=^], khome=^Y, mc4=^O, mc5=^N, @@ -9503,9 +10821,10 @@ ha8686|harris 8686, #### Hazeltine # -# Hazeltine appears to be out of the business now (1995). These guys were -# co-owners of the Terminal Brain Damage Hall Of Fame along with Harris. -# They have a hazeltine.com domain and can be reached at: +# Hazeltine appears to be out of the terminal business as of 1995. These +# guys were co-owners of the Terminal Brain Damage Hall Of Fame along with +# Harris. They have a hazeltine.com domain (but no web page there ) and can +# be reached at: # # Hazeltine # 450 East Pulaski Road @@ -9519,6 +10838,10 @@ ha8686|harris 8686, # P.O. Box 2076 # Fairfield, NJ 07007-2078 # +# They're now (1998) a subsidiary of General Electric, operating under the +# marque "GEC-Marconi Hazeltine" and doing military avionics. Web page +# at . +# # Since is blank, when you want to erase something you # are out of luck. You will have to do ^L's a lot to @@ -9544,7 +10867,7 @@ hz1500|hazeltine 1500, am, hz, cols#80, lines#24, bel=^G, clear=~^\, cr=^M, cub1=^H, cud1=~^K, cuf1=^P, - cup=~\021%p2%p2%?%{30}%>%t%{32}%+%;%'`'%+%c%p1%'`'%+%c, + cup=~\021%p2%p2%?%{30}%>%t%{32}%+%;%{96}%+%c%p1%{96}%+%c, cuu1=~^L, dl1=~\023$<40>, ed=~\030$<10>, el=~^O, home=~^R, il1=~\032$<40>, ind=^J, kcub1=^H, kcud1=^J, kcuf1=^P, kcuu1=~^L, khome=~^R, rmso=~^Y, smso=~^_, @@ -9657,23 +10980,18 @@ ibm327x|line mode IBM 3270 style, gn, clear=^M^J, el=^M, home=^M, -# Beware! The 3101 entry IBM shipped with AIX 3 is *wrong*. Losers... -# From: J.B. Nicholson-Owens 8 Mar 94 -# (ibm3101: removed, no such file -- esr) ibm3101|i3101|IBM 3101-10, am, xon, cols#80, lines#24, bel=^G, clear=\EK, cr=^M, cub1=^H, cud1=^J, cuf1=\EC, cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, ed=\EJ, - el=\EI, home=\EH, ht=^I, hts=\E0, ind=^J, kbs=^H, kcub1=\ED, - kcud1=\EB, kcuf1=\EC, kcuu1=\EA, nel=^M^J, tbc=\E1, -# Received from the IBM terminals division (given to DRB) -# June 1988 for PS/2 OS 2.2.3 cut -ibm3151|i3151|IBM 3151, - rmso=\E4@, rmul=\E4@, - sgr=\E4%{64}%?%p1%{0}%>%p1%{4}%<%&%t%{8}%|%;%?%p1%{7}%=%t%{16}%|%;%?%p2%t%{1}%|%;%?%p3%t%{4}%|%;%?%p4%t%{2}%|%;%c, - sgr0=\E4@, smso=\E4A, smul=\E4B, - use=ibm3163, + el=\EI, home=\EH, hts=\E0, ind=^J, kcub1=\ED, kcud1=\EB, + kcuf1=\EC, kcuu1=\EA, nel=^M^J, tbc=\EH, +ibm3151|IBM 3151 display, + is2=\E S, rmacs=\E>B, rmcup=\E>B, rs2=\E S, s0ds=\E>B, + sgr=\E4%{64}%?%p1%t%{65}%|%;%?%p2%t%{66}%|%;%?%p3%t%{65}%|%;%?%p4%t%{68}%|%;%?%p5%t%{64}%|%;%?%p6%t%{72}%|%;%?%p7%t%{80}%|%;%c%?%p9%t\E>A%e\E>B%;, + sgr0=\E4@\E>B, smacs=\E>A, smcup=\E>B, + use=ibm3162, # From: Mark Easter 29 Oct 1992 # I've commented out or translated some IBM extensions. ibm3161|ibm3163|wy60-316X|wyse60-316X|IBM 3161/3163 display, @@ -9685,32 +11003,63 @@ ibm3161|ibm3163|wy60-316X|wyse60-316X|IBM 3161/3163 display, cuu1=\EA, dch1=\EQ, dl1=\EO, ed=\EJ, el=\EI, home=\EH, ind=^J, invis=\E4P, kbs=^H, kcbt=\E2, kclr=\EL\r, kctab=\E1, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA, kdch1=\EQ, - kdl1=\EO, ked=\EJ, kel=\EI, kf1=\Ea\r, kf10=\Ej\r, + kdl1=\EO, ked=\EJ, kel=\EI, kend=\E2, kf1=\Ea\r, kf10=\Ej\r, kf11=\Ek\r, kf12=\El\r, kf13=\E!a\r, kf14=\E!b\r, kf15=\E!c\r, kf16=\E!d\r, kf17=\E!e\r, kf18=\E!f\r, kf19=\E!g\r, kf2=\Eb\r, kf20=\E!h\r, kf21=\E!i\r, kf22=\E!j\r, kf23=\E!k\r, kf24=\E!l\r, kf3=\Ec\r, kf4=\Ed\r, kf5=\Ee\r, kf6=\Ef\r, kf7=\Eg\r, kf8=\Eh\r, kf9=\Ei\r, khome=\EH, khts=\E0, kich1=\EP \010, kil1=\EN, - ktbc=\E 1, rev=\E4A, rmcup=\E>A, rmso=\E4@, rmul=\E4@, - sgr=\E4%'@'%?%p1%t%'A'%|%;%?%p2%t%'B'%|%;%?%p3%t%'A'%|%;%?%p4%t%'D'%|%;%?%p5%t%'@'%|%;%?%p6%t%'H'%|%;%?%p7%t%'P'%|%;%c%?%p9%t\E>A%e\E<@%;, + knp=\EI, kpp=\EL, ktbc=\E 1, mc4=^P^T, mc5=^P^R, rev=\E4A, + rmcup=\E>A, rmso=\E4@, rmul=\E4@, + sgr=\E4%{64}%?%p1%t%{65}%|%;%?%p2%t%{66}%|%;%?%p3%t%{65}%|%;%?%p4%t%{68}%|%;%?%p5%t%{64}%|%;%?%p6%t%{72}%|%;%?%p7%t%{80}%|%;%c%?%p9%t\E>A%e\E<@%;, sgr0=\E4@\E<@, smcup=\E>A, smso=\E4A, smul=\E4B, -# How the 3164 sgr string works: -# %{32} # push space for no special video characteristics -# %?%p2%t%{1}%|%; # if p2 set, then OR the 1 bit for reverse -# %?%p3%t%{4}%|%; # if p3 set, then OR the 4 bit for blink -# %?%p4%t%{2}%|%; # if p4 set, then OR the 2 bit for underline -# %c # pop Pa1 -# %{39}%p1%- # calculate 32 + (7 - p1) for foreground -# %c # pop Pa2 -# %{64} # use only black background for now -# %c # pop Pa3 +ibm3161-C|IBM 3161-C NLS terminal using cartridge, + rmcup=\E>B, s0ds=\E>B, s1ds=\E>A, smcup=\E>B, + use=ibm3161, +ibm3162|IBM 3162 display, + blink=\E4$a, bold=\E4(a, il1=\EN, invis=\E40a, rev=\E4!a, + rmso=\E4>b, rmul=\E4=b, sgr0=\E4@, smso=\E4!a, smul=\E4"a, + use=ibm3161-C, + ibm3164|i3164|IBM 3164, - blink=\E4D, bold=\E4H, - sgr=\E4%{32}%?%p2%t%{1}%|%;%?%p3%t%{4}%|%;%?%p4%t%{2}%|%;%c%{39}%p1%-%c%{64}%c, - sgr0=\E4@, - use=ibm3163, + msgr, + colors#8, pairs#64, + rmcup=\E!9(N\E>B, s0ds=\E>B, s1ds=\E>A, + setb=\E4 %p1%{64}%+%c, + setf=\E4%?%p1%t %p1%{32}%+%c%e!'%;@, + smcup=\E!9/N\E>B, use=ibm3161, + +ibm5151|wy60-AT|wyse60-AT|IBM 5151 Monochrome display, + am, bw, msgr, xon, + cols#80, it#8, lines#25, + acsc=j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263, + bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=^M, + cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, + cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, + cuu=\E[%p1%dA, cuu1=\E[A, dch1=\E[P, dl=\E[%p1%dM, + dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, home=\E[H, + hpa=\E[%i%p1%dG, il=\E[%p1%dL, il1=\E[L, ind=\E[S, + indn=\E[%p1%dS, invis=\E[8m, is2=\Ec, kbs=^H, kcbt=\E[Z, + kclr=\E[144q, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, + kcuu1=\E[A, kdch1=\E[P, ked=\E[148q, kel=\E[142q, + kend=\E[146q, kf0=\E[010q, kf1=\E[001q, kf10=\E[010q, + kf11=\E[011q, kf12=\E[012q, kf13=\E[013q, kf14=\E[014q, + kf15=\E[015q, kf16=\E[016q, kf17=\E[017q, kf18=\E[018q, + kf19=\E[019q, kf2=\E[002q, kf20=\E[020q, kf21=\E[021q, + kf22=\E[022q, kf23=\E[023q, kf24=\E[024q, kf25=\E[025q, + kf26=\E[026q, kf27=\E[027q, kf28=\E[028q, kf29=\E[029q, + kf3=\E[003q, kf30=\E[030q, kf31=\E[031q, kf32=\E[032q, + kf33=\E[033q, kf34=\E[034q, kf35=\E[035q, kf36=\E[036q, + kf4=\E[004q, kf5=\E[005q, kf6=\E[006q, kf7=\E[007q, + kf8=\E[008q, kf9=\E[009q, khome=\E[H, kich1=\E[139q, + kil1=\E[140q, kind=\E[151q, knp=\E[154q, kpp=\E[150q, + kri=\E[155q, krmir=\E[4l, rc=\E[u, rev=\E[7m, ri=\E[T, + rin=\E[%p1%dT, rmir=\E[4l, rmso=\E[m, rmul=\E[m, rs2=\Ec, + sc=\E[s, + sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;m, + sgr0=\E[0m, smir=\E[4h, smso=\E[7m, smul=\E[4m, ibmaed|IBM Experimental display, am, eo, msgr, @@ -9724,7 +11073,7 @@ ibm-apl|apl|IBM apl terminal simulator, lines#25, use=dm1520, # (ibmmono: this had an unknown `sb' boolean, I changed it to `bs'. # Also it had ":I0=f10:" which pretty obviously should be "l0=f10" -- esr) -ibmmono|ibm5151|IBM workstation monochrome, +ibmmono|IBM workstation monochrome, eslok, hs, bold=\EZ, dl1=\EM, dsl=\Ej\EY8 \EI\Ek, fsl=\Ek, il1=\EL, invis=\EF\Ef0;\Eb0;, kbs=^H, kf0=\E<, kf1=\ES, kf2=\ET, @@ -9732,10 +11081,13 @@ ibmmono|ibm5151|IBM workstation monochrome, khome=\EH, kich1=\0, kind=\EE, knp=\EE, kpp=\Eg, kri=\EG, lf0=f10, rev=\Ep, ri=\EA, rmso=\Ez, rmul=\Ew, sgr0=\Ew\Eq\Ez\EB, smso=\EZ, smul=\EW, tsl=\Ej\EY8%+ \Eo, use=ibm3101, -ibmega|ibm5154|IBM Enhanced Color Display, +ibmega|IBM Enhanced Color Display, cr=^M, cud1=^J, ht=^I, ind=^J, kbs=^H, kcub1=^H, kcud1=^J, nel=^M^J, use=ibmmono, +ibm5154|IBM 5154 Color display, + colors#8, pairs#64, + bold@, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=ibm5151, ibmega-c|ibm5154-c|IBM Enhanced Color Display with standout and underline, rmso=\EB, rmul=\EB, smso=\EF\Ef3;, smul=\EF\Ef2;, use=ibmmono, @@ -9748,75 +11100,77 @@ ibmvga|IBM VGA display, nel=^M^J, use=ibmega, # ibmapa* and ibmmono entries come from ACIS 4.3 distribution -rtpc|ibmapa16|ibm6155|IBM 6155 Extended Monochrome Graphics Display, +rtpc|ibmapa16|IBM 6155 Extended Monochrome Graphics Display, lines#32, dsl=\Ej\EY@ \EI\Ek, tsl=\Ej\EY@%+ \Eo, use=ibmmono, +ibm6155|IBM 6155 Black & White display, + blink@, bold@, use=ibm5151, # Advanced Monochrome (6153) and Color (6154) Graphics Display: -ibmapa8c|ibmapa8|ibm6154|ibm6153|IBM 6153/4 Advanced Graphics Display, +ibmapa8c|ibmapa8|IBM 6154 Advanced Graphics Display, lines#31, dsl=\Ej\EY? \EI\Ek, tsl=\Ej\EY?%+ \Eo, use=ibmmono, ibmapa8c-c|ibm6154-c|IBM 6154 Advanced Color Graphics Display, lines#31, dim=\EF\Ef7;, dsl=\Ej\EY? \EI\Ek, tsl=\Ej\EY?%+ \Eo, use=ibmega-c, -# From: Marc Pawliger -# also in /usr/lpp/bos/bsdsysadmin. -# (hft-c: this entry had :kb=\E[D:kf=\E[C: on the line with ku/kd/kh; this was -# pretty obviously mislabeled for :le: and :nd:; also ":ul=\E[4m:" was clearly -# a typo for ":us=\E[4m:"; also ":el=\E[K:" was a typo for ":ce=\E[K:". -# I also added / based on the terminal reset string. -# There was an unknown boolean ":ht:" which I assume was meant to set hardware -# tabs, so I have inserted it#8. Finally, :ac=^N: paired with the :ae: looked -# like a typo for :as=^N:; finally, added empty to quiet tic -- esr) -ibm8512|ibm8513|hft-c|IBM High Function Terminal, +ibm6154|IBM 6154 Color displays, + blink@, bold=\E[12m, s0ds=\E[10m, s1ds=\E[11m, s2ds=\E[12m, + sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;12%;m, + sgr0=\E[0;10m, + use=ibm5154, +ibm6153|IBM 6153 Black & White display, + blink@, bold=\E[12m, s0ds=\E[10m, s1ds=\E[11m, s2ds=\E[12m, + sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;12%;m, + sgr0=\E[0;10m, + use=ibm5151, +ibm6153-90|IBM 6153 Black & White display, + cols#90, lines#36, + blink@, bold@, use=ibm5151, +ibm6153-40|IBM 6153 Black & White display, + cols#40, lines#12, use=ibm6153-90, +ibm8512|ibm8513|IBM color VGA Terminal, am, mir, msgr, cols#80, it#8, lines#25, - acsc=, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cub1=\E[D, - cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, - dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, - home=\E[H, il=\E[%p1%dL, il1=\E[L, is2=\Eb\E[m\017\E[?7h, - kcud1=\E[B, kcuu1=\E[A, kf0=\E[010q, kf1=\E[001q, - kf2=\E[002q, kf3=\E[003q, kf4=\E[004q, kf5=\E[005q, - kf6=\E[006q, kf7=\E[007q, kf8=\E[008q, kf9=\E[009q, - khome=\E[H, rc=\E[u, rev=\E[7m, rmacs=^O, rmam=\E[?7l, - rmcup=\E[20h, rmdc=\E[4l, rmir=\E[4l, rmso=\E[m, rmul=\E[m, + acsc=jjkkllmmnnqqttuuvvwwxx, blink=\E[5m, bold=\E[1m, + clear=\E[H\E[2J, cub1=\E[D, cud1=^J, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dl=\E[%p1%dM, dl1=\E[M, + ech=\E[%p1%dX, ed=\E[J, el=\E[K, home=\E[H, il=\E[%p1%dL, + il1=\E[L, is2=\Eb\E[m\017\E[?7h, kcud1=\E[B, kcuu1=\E[A, + kf0=\E[010q, kf1=\E[001q, kf2=\E[002q, kf3=\E[003q, + kf4=\E[004q, kf5=\E[005q, kf6=\E[006q, kf7=\E[007q, + kf8=\E[008q, kf9=\E[009q, khome=\E[H, rc=\E[u, rev=\E[7m, + rmacs=^O, rmam=\E[?7l, rmcup=\E[20h, rmdc=\E[4l, + rmir=\E[4l, rmso=\E[m, rmul=\E[m, rs1=\Eb\E[m\017\E[?7h\E[H\E[J, sc=\E[s, sgr0=\E[m, smacs=^N, smam=\E[?7h, smcup=\E[20;4l\E[?7h\Eb, smdc=\E[4h, smir=\E[4h, smso=\E[7m, smul=\E[4m, -hft|AIWS High Function Terminal, - am, xon, - cols#80, lines#25, - bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=^M, - cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, - cuu1=\E[A, dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, - ht=^I, ich1=\E[@, il1=\E[L, ind=^J, invis=\E[8m, kbs=^H, - kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, - kf1=\E[001q, kf2=\E[002q, kf3=\E[003q, kf4=\E[004q, - kf5=\E[005q, kf6=\E[006q, kf7=\E[007q, kf8=\E[008q, - kf9=\E[009q, khome=\E[H, knp=\E[153q, kpp=\E[159q, - ktbc=\E[010q, rev=\E[7m, rmir=\E6, rmso=\E[m, rmul=\E[m, - sgr0=\E[m, smir=\E6, smso=\E[7m, smul=\E[4m, + use=ibm8503, +hft-c|HFT with Color, + colors#8, pairs#64, + acsc=jjkkllmmnnqqttuuvvwwxx, s0ds=\E(B, s1ds=\E(0, + setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[0m\E(B, + use=ibm5151, +hft-c-old|HFT with Color PC850, + colors#8, pairs#64, + setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=ibm5151, ibm-system1|system1|ibm system/1 computer, am, xt, cols#80, lines#24, bel=^G, clear=^Z, cub1=^H, cuf1=^\, cup=\005%p1%{32}%+%c%p2%{32}%+%c, cuu1=^^, home=^K, ind=^J, - -# From: -ibm5081|ibmmpel|IBM 5081 1024x1024 256/4096 color display, - eslok, hs, - lines#33, - dsl=\Ej\EYA \EI\Ek, fsl=\Ek, tsl=\Ej\EYA%+ \Eo, use=ibmmono, -ibm5081-c|ibmmpel-c|IBM 5081 1024x1024 256/4096 enhanced color display, +ibm5081|hft|IBM Megapel Color display, + acsc=jjkkllmmnnqqttuuvvwwxx, blink@, bold@, s0ds=\E(B, + s1ds=\E(0, sgr0=\E[0m\E(B, + use=ibm5154, +ibm5081-c|ibmmpel-c|IBM 5081 1024x1024 256/4096 Megapel enhanced color display, eslok, hs, lines#33, dsl=\Ej\EYA \EI\Ek, fsl=\Ek, tsl=\Ej\EYA%+ \Eo, use=ibmega-c, -ibm8514|IBM 8514 color display, +ibm8503|ibm8507|ibm8604|IBM 8503 B & W VGA display, + use=hft-c, +ibm8514|IBM 8514/a color VGA display, eslok, hs, - lines#41, - cr=^M, cud1=^J, dsl=\Ej\EYI \EI\Ek, fsl=\Ek, ht=^I, ind=^J, - kbs=^H, kcub1=^H, kcud1=^J, nel=^M^J, tsl=\Ej\EYI%+ \Eo, - use=ibmega, + dsl=\Ej\EYI \EI\Ek, fsl=\Ek, tsl=\Ej\EYI%+ \Eo, use=hft, ibm8514-c|IBM 8514 color display with standout and underline, eslok, hs, lines#41, @@ -9825,10 +11179,17 @@ ibm8514-c|IBM 8514 color display with standout and underline, use=ibmega-c, # -# AIX entries. IBM ships these with AIX 3. +# AIX entries. IBM ships these with AIX 3.2.5. # AIX extension caps are commented out, # except for box1 which has been translated to an string. # +aixterm|IBM Aixterm Terminal Eemulator, + eslok, hs, + acsc=jjkkllmmnnqqttuuvvwwxx, bold=\E[1m, dsl=\E[?E, + fsl=\E[?F, ri@, s0ds=\E(B, s1ds=\E(0, + sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;m, + sgr0=\E[0;10m\E(B, tsl=\E[?%p1%dT, + use=ibm6154, aixterm-m|IBM AIXterm Monochrome Terminal Emulator, eslok, hs, acsc=jjkkllmmnnqqttuuvvwwxx, bold=\E[1m, dsl=\E[?E, @@ -9842,6 +11203,8 @@ aixterm-m-old|old IBM AIXterm Monochrome Terminal Emulator, sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m, tsl=\E[?%p1%dT, use=ibm6153, +jaixterm|IBM Kanji Aixterm Terminal Eemulator, + acsc@, use=aixterm, jaixterm-m|IBM Kanji AIXterm Monochrome Terminal Emulator, acsc@, use=aixterm-m, @@ -9878,6 +11241,285 @@ infoton, bel=^G, clear=^L, cr=^M, cub1=^Z, cud1=^J, cuf1=^Y, cuu1=^\, ed=^K, ind=^J, ll=^H^\, +# The ICL6402 was actually the Kokusai Display System 6402. +# The 6404 was the KDS7372 (color version of the 6402). +# +# ICL6404 control codes follow: +# +#code function +#~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +#ctrl-A set SOM position at cursor position +#ctrl-G Bell +#ctrl-H Backspace +#ctrl-I Horiz tab +#ctrl-J Linefeed +#ctrl-K Cursor up +#ctrl-L Cursor right +#ctrl-M Carriage return +#ctrl-N Disable xon/xoff to host +#ctrl-O Enable xon/xoff to host +#ctrl-R Enable bidirectional mode +#ctrl-T Disable bidirectional mode +#ctrl-V Cursor down +#ctrl-Z Clear unprotected data to insert char +#ctrl-^ Cursor home +#ctrl-_ Newline +# +#ESC lead-in char for multiple character command +# +#ESC space R execute power on sequence +#ESC ! p1 p2 define scroll region: +# p1 = scroll top line: 20h - 37h +# p1 = scroll bottom line: 20h - 37h +#ESC " unlock keyboard +#ESC # lock keyboard +#ESC $ Semi-graphics mode on +#ESC % Semi-graphics mode off +#ESC & protect mode on +#ESC ' protect mode off +#ESC ( write protect mode off (full intensity) +#ESC ) write protect mode on (half intensity) +# +#ESC * clear screen +#ESC + clear unprotected data to insert char +#ESC , clear unprotected data to half intensity spaces +#ESC - p1 p2 p3 p4 address cursor to page, row, column: +# p1 = page number 0 - 3 +# p2 = row 20h - 7fh +# p3 = column (lo) 20h - 7fh +# p4 = column (hi) 20h - 21h (only 132 col) +#ESC . p1 set cursor style: +# p1 = 0 invisible cursor +# p1 = 1 block blinking cursor +# p1 = 2 block steady cursor +# p1 = 3 underline blinking cursor +# p1 = 4 underline steady cursor +#ESC / transmit cursor location (page, row, column) +#ESC 0 p1 p2 p3 p4 program edit key: +# p1 = edit key code: '@'-'S', '`'-'s' +# p2 p3 p4 = program data (3 bytes) +# +#ESC 1 set tab +#ESC 2 clear tab at cursor +#ESC 3 clear all tabs +#ESC 4 send unprotect line to cursor +#ESC 5 send unprotect page to cursor +#ESC 6 send line to cursor +#ESC 7 send page to cursor +#ESC 8 n set scroll mode: +# n = 0 set jump scroll +# n = 1 set smooth scroll +#ESC 9 n control display: +# n = 0 display off +# n = 1 display on +#ESC : clear unprotected data to null +#ESC ; clear unprotected data to insert char +# +#ESC < keyclick on +#ESC = p1 p2 address cursor to row, column +# p1 = row 20h - 7fh +# p2 = column (lo) 20h - 7fh +# p3 = column (hi) 20h - 21h (only 132 col) +#ESC > keyclick off +#ESC ? transmit cursor location (row, column) +# +#ESC @ copy print mode on +#ESC A copy print mode off +#ESC B block mode on +#ESC C block mode off (conversation mode) +#ESC D F set full duplex +#ESC D H set half duplex +#ESC E line insert +#ESC F p1 p2 set page colour (p1 = f/grnd, p2 = b/grnd) +# 0 = black, 1 = red, 2 = green, 3 = yellow +# 4 = blue, 5 = magenta, 6 = cyan, 7 = white +#ESC G n set serial field attribute (n = 30h - 3Fh) +#ESC H n full graphics mode: +# n = 0 exit full graphics mode +# n = 1 enter full graphics mode +#ESC I back tab +#ESC J back page +#ESC K forward page +# +#ESC L unformatted page print +#ESC M L move window left (132 col mode only) +#ESC M R move window right (132 col mode only) +#ESC N set page edit (clear line edit) +#ESC O set line edit (clear page edit) +#ESC P formatted page print +#ESC Q character insert +#ESC R line delete +#ESC S send message unprotected only +#ESC T erase line to insert char +#ESC U set monitor mode (see ESC X, ESC u) +# +#ESC V n select video attribute mode: +# n = 0 serial field attribute mode +# n = 1 parallel character attribute mode +#ESC V 2 n define line attribute: +# n = 0 single width single height +# n = 1 single width double height +# n = 2 double width single height +# n = 3 double width double height +#ESC V 3 n select character font: +# n = 0 system font +# n = 1 user defined font +#ESC V 4 n select screen mode: +# n = 0 page screen mode +# n = 1 virtual screen mode +#ESC V 5 n control mouse mode: +# n = 0 disable mouse +# n = 1 enable sample mode +# n = 2 send mouse information +# n = 3 enable request mode +#ESC W character delete +#ESC X clear monitor mode (see ESC U, ESC u) +#ESC Y erase page to insert char +# +#ESC Z n send user/status line: +# n = 0 send user line +# n = 1 send status line +# n = 2 send terminal ID +#ESC [ p1 p2 p3 set character attribute (parallel char mode): +# p1: 0 = normal +# 1 = blank +# 2 = blink +# 3 = blink blank (= blank) +# 4 = reverse +# 5 = reverse blank +# 6 = reverse blink +# 7 = reverse blink blank (= reverse blank) +# 8 = underline +# 9 = underline blank +# : = underline blink +# ; = underline blink blank +# < = reverse underline +# = = reverse underline blank +# > = reverse underline blink +# ? = reverse underline blink blank +# p2, p3: f/grnd, b/grnd colour +# (see ESC F for colours) +# use ZZ for mono, eg. +# ESC [ 0 Z Z for normal +# ESC [ 4 Z Z for inverse etc. +# +#ESC \ n set page size: +# n = 1 24 lines/page +# n = 2 48 lines/page +# n = 3 72 lines/page +# n = 4 96 lines/page +#ESC ] n set Wordstar mode: +# n = 0 normal (KDS7372) mode +# n = 1 Wordstar mode +# +#ESC b set foreground colour screen +# +#ESC c n enter self-test mode: +# n = 0 exit self test mode +# n = 1 ROM test +# n = 2 RAM test +# n = 3 NVRAM test +# n = 4 screen display test +# n = 5 main/printer port test +# n = 6 mouse port test +# n = 7 graphics board test +# n = 8 graphics memory test +# n = 9 display all 'E' +# n = : display all 'H' +#ESC d set background colour screen +# +#ESC e n program insert char (n = insert char) +#ESC f text CR load user status line with 'text' +# +#ESC g display user status line on 25th line +#ESC h display system status line on 25th line +#ESC i tab +#ESC j reverse linefeed +#ESC k n duplex/local edit mode: +# n = 0 duplex edit mode +# n = 1 local edit mode +#ESC l n select virtual screen: +# n = 0 screen 1 +# n = 1 screen 2 +#ESC m save current config to NVRAM +#ESC n p1 select display screen: +# p1 = 0 screen 1 +# p1 = 1 screen 2 +# p1 = 2 screen 3 +# p1 = 3 screen 4 +#ESC o p1 p2 set characters/line and attribute: +# p1 = 0 80 chars/line +# +#ESC o p1 p2 set characters/line and attribute: +# p1 = 0 80 chars/line +# p1 = 1 132 chars/line +# p2 = 0 single width single height +# p2 = 1 single width double height +# p2 = 2 double width single height +# p2 = 3 double width double height +# +#ESC q insert mode on +#ESC r edit mode on +#ESC s send message all +#ESC t erase line to null +#ESC u clear monitor mode (see ESC U, ESC X) +#ESC v autopage mode on +#ESC w autopage mode off +#ESC x p1 p2 p3 define delimiter code... +#ESC y erase page to null +# +#ESC z 2 p1 p2 p3 p4 draw quadrangle: +# p1 = starting row +# p2 = starting column +# p3 = end row +# p4 = end column +# +#ESC { p1 p2 p3 p4 configure main port +# (baud, stop bits, parity, word length) +# +#ESC | p1 p2 text Ctrl-Y program function key with 'text': +# p1 = function key code: +# '1' - ';' normal f1- f11 +# '<' - 'F' shifted f1 - f11 +# p2 = program mode: +# 1 = FDX +# 2 = LOC +# 3 = HDX +# Ctrl-Y = terminator +# (use Ctrl-P to escape ^P, ^Y ) +# +#ESC } p1 p2 p3 p4 configure printer port +# (baud, stop bits, parity, word length) +#ESC ~ send system status +# +# Codes and info from Peter Disdale 12 May 1997 +# +# Entry is by esr going solely on above information and is UNTESTED. +# This actually looks a lot like a Televideo 9xx. +# This entry uses page 0 and is monochrome; I'm not brave enough to try +# to make color work without a test terminal. The capability is a guess. +# The initialization string sets conversation mode, blinking underline cursor, +# full duplex, parallel attribute mode, display user status line, white +# foreground, black background, normal highlight. +# +icl6404|kds7372|icl6402|kds6402|ICL 6404 aka Kokusai Display Systems 7372, + am, hs, + cols#80, lines#24, + bel=^G, blink=\E[2ZZ, cbt=\EI, civis=\E.0, clear=\E*, + cnorm=\E.3, cr=^M, + csr=\E!%+%p1%{32}%+%p2%{32} cud1=\026, cuf1=^L, + cup=\E=%p1%{32}%+%c%p2%{80}%m%{32}%+%c%p2%{80}%>%{32}%+%c, + cuu1=^K, cvvis=\E.1, dch=\EW, dl1=\ER, home=^^, ht=^I, hts=\E1, + il1=\EE, invis=\E[1ZZ, is1=\EC\E.3\EDF\EV1\Eg\E[0ZZ, + nel=^_, rev=\E[4ZZ, rmir=\Er, + rmso=\E[%gh%{4}%^%Ph%gh%dZZ, + rmul=\E[%gh%{8}%^%Ph%gh%dZZ, rs2=\Eo1, + sgr=\E[%{0}%?%p1%t%{4}%|%;%?%p2%t%{8}%|%;%?%p3%t%{4}%|%;%?%p4%t%{2}%|%;%?%p7%t%{1}%|%;ZZ, + sgr0=\E[0ZZ, smir=\Eq, smso=\E[8ZZ, smul=\E[8ZZ, tbc=\E3, +icl6404-w|kds7372-w|ICL 6404 aka Kokusai Display Systems 7372 132 cols, + rs2=\Eo1, + use=icl6404, + #### Interactive Systems Corp # # ISC used to sell OEMed and customized hardware to support ISC UNIX. @@ -9918,6 +11560,19 @@ intext2|intextii|INTERACTIVE modified owl 1251, #### Kimtron (abm, kt) # +# Kimtron seems to be history, but as March 1998 these people are still +# offering repair services for Kimtron equipment: +# +# Com/Pair Monitor Service +# 1105 N. Cliff Ave. +# Sioux Falls, South Dakota 57103 +# +# WATS voice: 1-800/398-4946 +# POTS fax: +1 605/338-8709 +# POTS voice: +1 605/338-9650 +# Email: +# Internet/Web: +# # Kimtron entries include (undocumented) codes for: enter dim mode, # enter bold mode, enter reverse mode, turn off all attributes. # @@ -10085,10 +11740,10 @@ prism2|MDC Prism-2, am, bw, msgr, cols#80, lines#24, bel=^G, clear=\014$<20>, cr=^M, cub1=^H, cud1=^J, cuf1=^F, - cup=\013%p1%' '%+%c\020%p2%{10}%/%{16}%*%p2%{10}%m%+%Pc%?%{17}%gc%=%{19}%gc%=%|%gc%!%|%t%{1}%gc%+%c%{8}%e%gc%;%c, + cup=\013%p1%{32}%+%c\020%p2%{10}%/%{16}%*%p2%{10}%m%+%Pc%?%{17}%gc%=%{19}%gc%=%|%gc%!%|%t%{1}%gc%+%c%{8}%e%gc%;%c, cuu1=^Z, ed=\EJ, el=\EK, home=^A, hpa=\020%p1%{10}%/%{16}%*%p1%{10}%m%+%Pc%?%{17}%gc%=%{19}%gc%=%|%gc%!%|%t%{1}%gc%+%c%{8}%e%gc%;%c, - ind=^J, kbs=^H, khome=^A, vpa=\013%p1%' '%+%c, + ind=^J, kbs=^H, khome=^A, vpa=\013%p1%{32}%+%c, # p4: Prism-4 # ----------- @@ -10105,15 +11760,15 @@ prism4|p4|P4|MDC Prism-4, cols#80, lines#24, wsl#72, xmc#1, bel=^G, blink=^CB, civis=^]\344, clear=\014$<20>, cnorm=^]\342, cr=^M, cub1=^H, cud1=^J, cuf1=^F, - cup=\013%p1%' '%+%c\020%p2%{10}%/%{16}%*%p2%{10}%m%+%Pc%?%{17}%gc%=%{19}%gc%=%|%gc%!%|%t%{1}%gc%+%c%{8}%e%gc%;%c, + cup=\013%p1%{32}%+%c\020%p2%{10}%/%{16}%*%p2%{10}%m%+%Pc%?%{17}%gc%=%{19}%gc%=%|%gc%!%|%t%{1}%gc%+%c%{8}%e%gc%;%c, cuu1=^Z, dim=^CA, dsl=\035\343\035\345, ed=\EJ, el=\EK, fsl=^]\345, home=^A, hpa=\020%p1%{10}%/%{16}%*%p1%{10}%m%+%Pc%?%{17}%gc%=%{19}%gc%=%|%gc%!%|%t%{1}%gc%+%c%{8}%e%gc%;%c, ind=^J, invis=^CH, kbs=^H, khome=^A, mc0=\EU, mc4=\ET, mc5=\ER, rev=^CD, rmso=^C\s, rmul=^C\s, - sgr=\003%'@'%?%p1%p3%|%t%{4}%+%;%?%p2%t%{16}%+%;%?%p4%t%{2}%+%;%?%p5%t%{1}%+%;%?%p7%t%{8}%+%;%c%?%p9%t\016%e\017%;, + sgr=\003%{64}%?%p1%p3%|%t%{4}%+%;%?%p2%t%{16}%+%;%?%p4%t%{2}%+%;%?%p5%t%{1}%+%;%?%p7%t%{8}%+%;%c%?%p9%t\016%e\017%;, sgr0=^C\s, smso=^CD, smul=^CP, tsl=^]\343, - vpa=\013%p1%' '%+%c, + vpa=\013%p1%{32}%+%c, # p5: Prism-5 # ----------- @@ -10338,7 +11993,7 @@ act4|microterm|microterm act iv, am, cols#80, lines#24, bel=^G, clear=\014$<12/>, cr=^M, cub1=^H, cud1=^K, cuf1=^X, - cup=\024%p1%{24}%+%c%p2%p2%?%'/'%>%t%'0'%+%;%'P'%+%c, + cup=\024%p1%{24}%+%c%p2%p2%?%{47}%>%t%{48}%+%;%{80}%+%c, cuu1=^Z, dch1=\004$<.1*/>, dl1=\027$<2.3*/>, ed=\037$<2.2*/>, el=\036$<.1*/>, home=^], il1=\001<2.3*/>, ind=^J, kcub1=^H, kcud1=^K, kcuf1=^X, @@ -10361,7 +12016,7 @@ mime|mime1|mime2|mimei|mimeii|microterm mime1, am, cols#80, it#8, lines#24, vt#9, bel=^G, clear=^]^C, cr=^M, cub1=^H, cud1=^J, cuf1=^X, - cup=\024%p1%{24}%+%c%p2%p2%?%{32}%>%t%'0'%+%;%'P'%+%c, + cup=\024%p1%{24}%+%c%p2%p2%?%{32}%>%t%{48}%+%;%{80}%+%c, cuu1=^Z, dl1=\027$<80>, ed=^_, el=^^, home=^], ht=\011$<2>, il1=\001$<80>, ind=^J, is2=^S\E^Q, kcub1=^H, kcud1=^K, kcuf1=^X, kcuu1=^Z, ri=\022$<3>, uc=^U, @@ -10469,6 +12124,494 @@ ergo4000|microterm ergo 4000, # There is an NCR4103 terminal that's just a re-badged Wyse-50. # +# The following vendor-supplied termcaps were captured from the Boundless +# Technologies site, 8 March 1998. I removed all-upper-case names that were +# identical, except for case, to lower-case ones. I also uncommented the acsc +# capabilities.X +# +# The Intecolor emulation of the NCR 2900/260C color terminal is basicly a +# DEC vt200/300 with color capabilities added. +ncr260intan|NCR Intecolor emulation of the 2900_260C with an ANSI keyboard, + colors#8, pairs#64, + op=\E[0m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=ncr260vt300an, +# The Intecolor emulation of the NCR 2900/260C color terminal is basicly a +# DEC vt200/300 with color capabilities added. +ncr260intwan|NCR Intecolor emulation of the 2900_260C with an ANSI keyboard, + colors#8, pairs#64, + op=\E[0m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=ncr260vt300wan, +# The Intecolor emulation of the NCR 2900/260C color terminal is basicly a DEC +# vt200/300 with color capabilities added. +ncr260intpp|NCR Intecolor emulation of the 2900_260C with a PC+ keyboard, + colors#8, pairs#64, + op=\E[0m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=ncr260vt300pp, +# The Intecolor emulation of the NCR 2900/260C color terminal is basicly a +# DEC vt200/300 with color capabilities added. +ncr260intwpp|NCR Intecolor emulation of the 2900_260C with a PC+ keyboard in 132 column mode, + colors#8, pairs#64, + op=\E[0m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=ncr260vt300wpp, +# This definition for ViewPoint supports several attributes. This means +# that it has magic cookies (extra spaces where the attributes begin). +# Some applications do not function well with magic cookies. The System +# Administrator's Shell in NCR Unix SVR4 1.03 is one such application. +# If supporting various attributes is not vital, 'xmc#1' and the extra +# attributes can be removed. +# Mapping to ASCII character set ('acsc' capability) can also be +# restored if needed. +ncr260vppp|NCR 2900_260 viewpoint, + am, bw, hs, km, mc5i, mir, msgr, xon, + cols#80, lines#24, nlab#32, xmc#1, + acsc=07a?h;j5k3l2m1n8q\:t4u9v=w0x6, bel=^G, blink=\EG2, + cbt=\EI, civis=\E`0, clear=\014$<40>, cnorm=\E`5, + cr=\r$<2>, cub1=\010$<2>, cud1=\n$<2>, cuf1=\006$<2>, + cup=\EY%p1%{32}%+%c%p2%{32}%+%c$<5>, cuu1=\032$<2>, + cvvis=\E`5, dch1=\EW$<2>, dim=\EGp, dl1=\El$<2>, dsl=\E`c, + ed=\Ek$<2>, el=\EK$<2>, fsl=^M, home=\036$<2>, ht=^I, + hts=\E1, il1=\EM$<2>, ind=\n$<2>, invis=\EG1, + is2=\Ee6\E~%$<100>\E+\E`\:\Ed/\E`1\EO\Ee4\Ec@0@\Ec@1A\EcB0\EcC1\Ee7$<100>, + kDC=\El, kEND=\Ek, kHOM=^A, kPRT=\E7, kRIT=^F, ka1=^A, ka3=\EJ, + kbs=^H, kc1=\ET, kc3=\EJ, kcub1=^U, kcud1=^J, kcuf1=^F, + kcuu1=^Z, kdch1=\EW, kend=\EK, kf1=^B1\r, kf10=^B\:\r, + kf11=^B;\r, kf12=^B<\r, kf13=^B=\r, kf14=^B>\r, kf15=^B?\r, + kf16=^B@\r, kf17=^B!\r, kf18=^B"\r, kf19=^B#\r, kf2=^B2\r, + kf20=^B$\r, kf21=\002%^M, kf22=^B&\r, kf23=^B'\r, + kf24=^B(\r, kf25=^B)\r, kf26=^B*\r, kf27=^B+\r, + kf28=^B\,\r, kf29=^B-\r, kf3=^B3\r, kf30=^B.\r, kf31=^B/\r, + kf32=^B0\r, kf4=^B4\r, kf5=^B5\r, kf6=^B6\r, kf7=^B7\r, + kf8=^B8\r, kf9=^B9\r, khome=^A, kich1=\Eq, knp=\EJ, kpp=\EJ, + kprt=\EP, ll=\001$<5>, mc0=\EP$<100>, mc4=^T, mc5=^R, + mrcup=\Ew@%p1%{48}%+%c%p2%{32}%+%c%p3%{32}%+%c$<5>, + nel=\037$<2>, rev=\EG4, ri=\Ej$<2>, rmacs=\EcB0\EH\003, + rmir=\Er, rmso=\EG0, rmul=\EG0, rmxon=\Ec20, + rs2=\Ee6\E~%$<100>\E+\E`\:\Ed/\E`1\EO\Ee4\Ec@0@\Ec@1A\EcB0\EcC1\Ee7$<100>, + sgr0=\EG0\EH\003, smacs=\EcB1\EH\002, smir=\Eq, + smso=\EG4, smul=\EG8, smxon=\Ec21, tsl=\EF, +ncr260vpwpp|NCR 2900_260 viewpoint wide mode, + cols#132, + cup=\Ea%i%p1%dR%p2%dC$<30>, + is2=\Ee6\E~%$<100>\E+\E`;\Ed/\E`1\EO\Ee4\Ec@0@\Ec@1A\EcB0\EcC1\Ee7$<100>, + rs2=\Ee6\E~%$<100>\E+\E`;\Ed/\E`1\EO\Ee4\Ec@0@\Ec@1A\EcB0\EcC1\Ee7$<100>, + use=ncr260vppp, +ncr260vt100an|NCR 2900_260 vt100 with ansi kybd, + am, hs, mir, msgr, xenl, xon, + cols#80, lines#24, nlab#32, + acsc=``aaffggjjkkllmmnnooqqssttuuvvwwxx~~, bel=^G, + blink=\E[5m, bold=\E[1m, civis=\E[?25l, + clear=\E[2J\E[1;1H$<20>, cnorm=\E[?25h, cr=\r$<1>, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD$<5>, + cub1=\E[D$<5>, cud=\E[%p1%dB$<5>, cud1=\E[B$<5>, + cuf=\E[%p1%dC$<5>, cuf1=\E[C$<5>, + cup=\E[%i%p1%d;%p2%dH$<10>, cuu=\E[%p1%dA$<5>, + cuu1=\E[A$<5>, dch=\E[%p1%dP$<5>, dch1=\E[1P$<5>, + dl=\E[%p1%dM$<5>, dl1=\E[M$<5>, dsl=\E[0$~\E[1$~, + ech=\E[%p1%dX, ed=\E[0J$<5>, el=\E[0K$<3>, el1=\E[1K$<3>, + fsl=\E[0$}, home=\E[H$<1>, hpa=\E[%p1%dG$<40>, ht=^I, + hts=\EH, ich=\E[%p1%d@$<5>, il=\E[%p1%dL$<5>, + il1=\E[L$<5>, ind=\ED$<5>, indn=\E[%p1%dE$<5>, + invis=\E[8m, + is2=\E[!p\E[?7;19;67h\E[?1;3;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + ka1=\EOw, ka3=\EOu, kb2=\EOy, kbs=^H, kc1=\EOq, kc3=\EOs, + kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, + kdch1=\E[3~, kent=\EOM, kf1=\EOP, kf2=\EOQ, kf3=\EOR, + kf4=\EOS, kfnd=\E[1~, khlp=\E[28~, kich1=\E[2~, knp=\E[6~, + kpp=\E[5~, krdo=\E[29~, kslt=\E[4~, nel=\EE$<5>, rc=\E8, + rev=\E[7m, ri=\EM$<5>, rmacs=^O, rmir=\E[4l, + rmkx=\E[?1l\E>, rmso=\E[0m, rmul=\E[0m, + rs2=\E[!p\E[?7;19;67h\E[?1;3;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + sc=\E7, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;$<20>, + sgr0=\E[0m\017$<20>, smacs=^N, smir=\E[4h, + smkx=\E[?1h\E=, smso=\E[1;7m, smul=\E[4m, tbc=\E[3g, + tsl=\E[2$~\E[1$}, vpa=\E[%p1%dd$<40>, +ncr260vt100wan|NCR 2900_260 vt100 wide mode ansi kybd, + cols#132, + cup=\E[%i%p1%d;%p2%dH$<30>, + is2=\E[!p\E[?3;7;19;67h\E[?1;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + rs2=\E[!p\E[?3;7;19;67h\E[?1;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + use=ncr260vt100an, +ncr260vt100pp|NCR 2900_260 vt100 with PC+ kybd, + is2=\E[!p\E[?7;19;67h\E[?1;3;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + ka1=\E[H, ka3=\EOu, kb2=\E[V, kc3=\E[U, kcub1=\E[D, + kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[4~, + kend=\E[5~, khome=\E[2~, kich1=\E[1~, knp=\E[6~, kpp=\E[3~, + lf1=pf1, lf2=pf2, lf3=pf3, lf4=pf4, rmkx=\E>, + rs2=\E[!p\E[?7;19;67h\E[?1;3;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + smkx=\E=, + use=ncr260vt100an, +ncr260vt100wpp|NCR 2900_260 vt100 wide mode pc+ kybd, + cols#132, + cup=\E[%i%p1%d;%p2%dH$<30>, + is2=\E[!p\E[?3;7;19;67h\E[?1;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + rs2=\E[!p\E[?3;7;19;67h\E[?1;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + use=ncr260vt100pp, +ncr260vt200an|NCR 2900_260 vt200 with ansi kybd, + am, hs, mir, msgr, xenl, xon, + cols#80, lines#24, nlab#32, + acsc=``aaffggjjkkllmmnnooqqssttuuvvwwxx~~, bel=^G, + blink=\E[5m, bold=\E[1m, civis=\E[?25l, + clear=\E[2J\E[1;1H$<20>, cnorm=\E[?25h, cr=\r$<1>, + csr=\E[%i%p1%d;%p2%dr$<5>, cub=\E[%p1%dD$<5>, + cub1=\E[D$<5>, cud=\E[%p1%dB$<5>, cud1=\E[B$<5>, + cuf=\E[%p1%dC$<5>, cuf1=\E[C$<5>, + cup=\E[%i%p1%d;%p2%dH$<10>, cuu=\E[%p1%dA$<5>, + cuu1=\E[A$<5>, dch=\E[%p1%dP$<5>, dch1=\E[1P$<5>, + dl=\E[%p1%dM$<5>, dl1=\E[M$<5>, dsl=\E[0$~\E[1$~, + ech=\E[%p1%dX$<5>, ed=\E[0J, el=\E[0K$<5>, el1=\E[1K$<5>, + fsl=\E[0$}, home=\E[H, hpa=\E[%p1%dG$<40>, ht=^I, hts=\EH, + ich=\E[%p1%d@$<5>, il=\E[%p1%dL$<5>, il1=\E[L$<5>, + ind=\ED$<5>, indn=\E[%p1%dE$<5>, invis=\E[8m, + is2=\E[!p\E[?7;19;67h\E[?1;3;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + ka1=\EOw, ka3=\EOu, kb2=\EOy, kbs=^H, kc1=\EOq, kc3=\EOs, + kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, + kdch1=\E[3~, kent=\EOM, kf0=\EOy, kf1=\EOP, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, + kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, + kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf21=\E[31~, + kf22=\E[32~, kf23=\E[33~, kf24=\E[34~, kf25=\E[35~, + kf26=\E[1~, kf27=\E[2~, kf28=\E[3~, kf29=\E[4~, kf3=\EOR, + kf30=\E[5~, kf31=\E[6~, kf32=\E[7~, kf33=\E[8~, kf34=\E[9~, + kf35=\E[10~, kf4=\EOS, kf5=\E[M, kf6=\E[17~, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, kfnd=\E[1~, khlp=\E[28~, + kich1=\E[2~, knp=\E[6~, kpp=\E[5~, krdo=\E[29~, kslt=\E[4~, + mc0=\E[i, mc4=\E[4i, mc5=\E[5i, nel=\EE, rc=\E8, rev=\E[7m, + ri=\EM$<5>, rmacs=\017$<20>, rmam=\E[?7l, rmir=\E[4l, + rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m, + rs2=\E[!p\E[?7;19;67h\E[?1;3;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + sc=\E7, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;$<20>, + sgr0=\E[0m\017$<20>, smacs=\016$<20>, smam=\E[?7h, + smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, + tbc=\E[3g, tsl=\E[2$~\E[1$}, vpa=\E[%p1%dd$<40>, +ncr260vt200wan|NCR 2900_260 vt200 wide mode ansi kybd, + cols#132, + cup=\E[%i%p1%d;%p2%dH$<30>, + is2=\E[!p\E[?3;7;19;67h\E[?4l\E(B\E)0\017\E[2J\E[1;1H$<200>, + rs2=\E[!p\E[?3;7;19;67h\E[?4l\E(B\E)0\017\E[2J\E[1;1H$<200>, + use=ncr260vt200an, +ncr260vt200pp|NCR 2900_260 vt200 with pc+ kybd, + ka1=\E[H, ka3=\EOu, kb2=\E[V, kc3=\E[U, kcub1=\E[D, + kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[4~, + kend=\E[1~, khome=\E[H, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, + lf1=pf1, lf2=pf2, lf3=pf3, lf4=pf4, rmkx=\E>, smkx=\E=, + use=ncr260vt200an, +ncr260vt200wpp|NCR 2900_260 vt200 wide mode pc+ kybd, + cols#132, + cup=\E[%i%p1%d;%p2%dH$<30>, + is2=\E[!p\E[?3;7;19;67h\E[?1;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + rs2=\E[!p\E[?3;7;19;67h\E[?1;4l\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + use=ncr260vt200pp, +ncr260vt300an|NCR 2900_260 vt300 with ansi kybd, + am, hs, mir, msgr, xenl, xon, + cols#80, lines#24, nlab#32, + acsc=``aaffggjjkkllmmnnooqqssttuuvvwwxx~~, bel=^G, + blink=\E[5m, bold=\E[1m, civis=\E[?25l, + clear=\E[2J\E[1;1H$<20>, cnorm=\E[?25h, cr=\r$<1>, + csr=\E[%i%p1%d;%p2%dr$<5>, cub=\E[%p1%dD$<5>, + cub1=\E[D$<5>, cud=\E[%p1%dB$<5>, cud1=\E[B$<5>, + cuf=\E[%p1%dC$<5>, cuf1=\E[C$<5>, + cup=\E[%i%p1%d;%p2%dH$<10>, cuu=\E[%p1%dA$<5>, + cuu1=\E[A$<5>, dch=\E[%p1%dP$<5>, dch1=\E[1P$<5>, + dl=\E[%p1%dM$<5>, dl1=\E[M$<5>, dsl=\E[0$~\E[1$~, + ech=\E[%p1%dX$<5>, ed=\E[0J, el=\E[0K$<5>, el1=\E[1K$<5>, + fsl=\E[0$}, home=\E[H, hpa=\E[%p1%dG$<40>, ht=^I, hts=\EH, + ich=\E[%p1%d@$<5>, il=\E[%p1%dL$<5>, il1=\E[L$<5>, + ind=\ED$<5>, indn=\E[%p1%dE$<5>, invis=\E[8m, + is2=\E[!p\E[?7;19;67h\E[?1;3;4l\E[1;0%w\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + ka1=\EOw, ka3=\EOu, kb2=\EOy, kbs=^H, kc1=\EOq, kc3=\EOs, + kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, + kdch1=\E[3~, kent=\EOM, kf0=\EOy, kf1=\EOP, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, + kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, + kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf21=\E[31~, + kf22=\E[32~, kf23=\E[33~, kf24=\E[34~, kf25=\E[35~, + kf26=\E[1~, kf27=\E[2~, kf28=\E[3~, kf29=\E[4~, kf3=\EOR, + kf30=\E[5~, kf31=\E[6~, kf32=\E[7~, kf33=\E[8~, kf34=\E[9~, + kf35=\E[10~, kf4=\EOS, kf5=\E[M, kf6=\E[17~, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, kfnd=\E[1~, khlp=\E[28~, + kich1=\E[2~, knp=\E[6~, kpp=\E[5~, krdo=\E[29~, kslt=\E[4~, + mc0=\E[i, mc4=\E[4i, mc5=\E[5i, nel=\EE, rc=\E8, rev=\E[7m, + ri=\EM$<5>, rmacs=\017$<20>, rmam=\E[?7l, rmir=\E[4l, + rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m, + rs2=\E[!p\E[?7;19;67h\E[?1;3;4l\E[1;0%w\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + sc=\E7, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;$<20>, + sgr0=\E[0m\017$<20>, smacs=\016$<20>, smam=\E[?7h, + smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, + tbc=\E[3g, tsl=\E[2$~\E[1$}, vpa=\E[%p1%dd$<40>, +ncr260vt300wan|NCR 2900_260 vt300 wide mode ansi kybd, + cols#132, + cup=\E[%i%p1%d;%p2%dH$<30>, + is2=\E[!p\E[?3;7;19;67h\E[?4l\E[1;0%w\E(B\E)0\017\E[2J\E[1;1H$<200>, + rs2=\E[!p\E[?3;7;19;67h\E[?4l\E[1;0%w\E(B\E)0\017\E[2J\E[1;1H$<200>, + use=ncr260vt300an, +ncr260vt300pp|NCR 2900_260 vt300 with pc+ kybd, + ka1=\E[H, ka3=\EOu, kb2=\E[V, kc3=\E[U, kcub1=\E[D, + kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[4~, + kend=\E[1~, khome=\E[H, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, + lf1=pf1, lf2=pf2, lf3=pf3, lf4=pf4, rmkx=\E>, smkx=\E=, + use=ncr260vt300an, +NCR260VT300WPP|ncr260vt300wpp|NCR 2900_260 vt300 wide mode pc+ kybd, + cols#132, + cup=\E[%i%p1%d;%p2%dH$<30>, + is2=\E[!p\E[?3;7;19;67h\E[?1;4l\E[1;0%w\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + rs2=\E[!p\E[?3;7;19;67h\E[?1;4l\E[1;0%w\E(B\E)0\017\E[2J\E[1;1H\E>$<200>, + use=ncr260vt300pp, +# This terminfo file contains color capabilities for the Wyse325 emulation of +# the NCR 2900/260C color terminal. Because of the structure of the command +# (escape sequence) used to set color attributes, one of the fore/background +# colors must be preset to a given value. I have set the background color to +# black. The user can change this setup by altering the last section of the +# 'setf' definition. The escape sequence to set color attributes is +# ESC d y 1 +# In addition, the background color can be changed through the desk accessories. +# The capablitiy 'op' sets colors to green on black (default combination). +# +# NOTE: The NCR Unix System Administrator's Shell will not function properly +# if the 'pairs' capability is defined. Un-Comment the 'pairs' +# capability and recompile if you wish to have it included. +# +ncr260wy325pp|NCR 2900_260 wyse 325, + am, bw, hs, km, mc5i, mir, msgr, xon, + colors#16, cols#80, lines#24, ncv#33, nlab#32, + acsc=07a?h;j5k3l2m1n8q\:t4u9v=w0x6, bel=^G, blink=\EG2, + cbt=\EI, civis=\E`0, clear=\E*$<10>, cnorm=\E`1, cr=^M, + cub1=\010$<5>, cud1=\n$<5>, cuf1=\014$<5>, + cup=\E=%p1%{32}%+%c%p2%{32}%+%c$<10>, cuu1=\013$<5>, + cvvis=\E`5, dch1=\EW$<50>, dl1=\ER$<5>, dsl=\E`c, + ed=\Ey$<5>, el=\Et$<5>, fsl=^M, home=\036$<5>, ht=^I, + hts=\E1, il1=\EE$<5>, ind=\n$<5>, invis=\EG1, + is2=\Ee6\Ed/\Ee1\Ed*\Er\EO\E`1\E`\:\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + kDC=\ER, kEND=\EY, kHOM=\E{, kNXT=\EK, kPRT=\E7, kPRV=\EJ, + kRIT=^L, ka1=^^, kb2=\EJ, kbs=^H, kc1=\ET, kc3=\EK, kcbt=\EI, + kcub1=^H, kcud1=^J, kcuf1=^L, kcuu1=^K, kdch1=\EW, kend=\ET, + kf1=^A@\r, kf10=^AI\r, kf11=^AJ\r, kf12=^AK\r, kf13=^AL\r, + kf14=^AM\r, kf15=^AN\r, kf16=^AO\r, kf17=^A`\r, kf18=^Aa\r, + kf19=^Ab\r, kf2=^AA\r, kf20=^Ac\r, kf21=^Ad\r, kf22=^Ae\r, + kf23=^Af\r, kf24=^Ag\r, kf25=^Ah\r, kf26=^Ai\r, kf27=^Aj\r, + kf28=^Ak\r, kf29=^Al\r, kf3=^AB\r, kf30=^Am\r, kf31=^An\r, + kf32=^Ao\r, kf4=^AC\r, kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, + kf8=^AG\r, kf9=^AH\r, khome=^^, kich1=\Eq, knp=\EK, kpp=\EJ, + kprt=\EP, mc0=\EP, mc4=^T, mc5=^R, + mrcup=\Ew@%p1%{48}%+%c%p2%{32}%+%c%p3%{32}%+%c$<10>, + nel=\037$<5>, rev=\EG4, ri=\Ej$<5>, rmacs=\EH\003\EcB0, + rmam=\Ed., rmir=\Er, rmso=\EG0, rmul=\EG0, rmxon=\Ec20, + rs2=\Ee6\Ed/\Ee1\Ed*\Er\EO\E`1\E`\:\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + setb=\s, + setf=%?%p1%{0}%=%t%{49}%e%p1%{1}%=%t%{50}%e%p1%{2}%=%t%{51}%e%p1%{3}%=%t%{52}%e%p1%{4}%=%t%{53}%e%p1%{5}%=%t%{54}%e%p1%{6}%=%t%{55}%e%p1%{7}%=%t%{64}%e%p1%{8}%=%t%{57}%e%p1%{9}%=%t%{58}%e%p1%{10}%=%t%{59}%e%p1%{11}%=%t%{60}%e%p1%{12}%=%t%{61}%e%p1%{13}%=%t%{62}%e%p1%{14}%=%t%{63}%e%p1%{15}%=%t%{56}%;\Edy%c11$<100>, + sgr0=\EG0\EcB0\EcD$<15>, smacs=\EH\002\EcB1, smam=\Ed/, + smir=\Eq, smso=\EGt, smul=\EG8, smxon=\Ec21, tbc=\E0, + tsl=\EF, +ncr260wy325wpp|NCR 2900_260 wyse 325 wide mode, + cols#132, + cup=\Ea%i%p1%dR%p2%dC$<30>, + is2=\Ee6\Ed/\Ee1\Ed*\Er\EO\E`1\E`;\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + rs2=\Ee6\Ed/\Ee1\Ed*\Er\EO\E`1\E`;\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + use=ncr260wy325pp, +# This definition for Wyse 350 supports several attributes. This means +# that it has magic cookies (extra spaces where the attributes begin). +# Some applications do not function well with magic cookies. The System +# Administrator's Shell in NCR Unix SVR4 1.03 is one such application. +# If supporting various attributes is not vital, 'xmc#1' and the extra +# attributes can be removed. +# Mapping to ASCII character set ('acsc' capability) can also be +# restored if needed. +# In addition, color capabilities have been added to this file. The drawback, +# however, is that the background color has to be black. The foreground colors +# are numbered 0 through 15. +# +# NOTE: The NCR Unix System Administrator's Shell does not function properly +# with the 'pairs' capability defined as below. If you wish to +# have it included, Un-comment it and recompile (using 'tic'). +# +ncr260wy350pp|NCR 2900_260 wyse 350, + am, bw, hs, km, mc5i, mir, msgr, xon, + colors#16, cols#80, lines#24, ncv#33, nlab#32, xmc#1, + acsc=07a?h;j5k3l2m1n8q\:t4u9v=w0x6, bel=^G, blink=\EG2, + cbt=\EI, civis=\E`0, clear=\E+$<20>, cnorm=\E`1, cr=^M, + cub1=\010$<5>, cud1=\n$<5>, cuf1=\014$<5>, + cup=\E=%p1%{32}%+%c%p2%{32}%+%c$<40>, cuu1=\013$<5>, + cvvis=\E`5, dch1=\EW$<50>, dim=\EGp, dl1=\ER$<5>, dsl=\E`c, + ed=\Ey$<5>, el=\Et$<5>, fsl=^M, home=\036$<10>, ht=^I, + hts=\E1, il1=\EE$<5>, ind=\n$<5>, invis=\EG1, + is2=\Ee6\Ed/\Ee1\Ed*\Er\EO\E`1\E`\:\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + kDC=\ER, kEND=\EY, kHOM=\E{, kPRT=\E7, kRIT=^L, ka1=^^, kbs=^H, + kc1=\ET, kc3=\EK, kcbt=\EI, kcub1=^H, kcud1=^J, kcuf1=^L, + kcuu1=^K, kdch1=\EW, kend=\ET, kf1=^A@\r, kf10=^AI\r, + kf11=^AJ\r, kf12=^AK\r, kf13=^AL\r, kf14=^AM\r, kf15=^AN\r, + kf16=^AO\r, kf17=^A`\r, kf18=^Aa\r, kf19=^Ab\r, kf2=^AA\r, + kf20=^Ac\r, kf21=^Ad\r, kf22=^Ae\r, kf23=^Af\r, kf24=^Ag\r, + kf25=^Ah\r, kf26=^Ai\r, kf27=^Aj\r, kf28=^Ak\r, kf29=^Al\r, + kf3=^AB\r, kf30=^Am\r, kf31=^An\r, kf32=^Ao\r, kf4=^AC\r, + kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, + khome=^^, kich1=\Eq, knp=\EK, kpp=\EJ, kprt=\EP, + mc0=\EP$<10>, mc4=^T, mc5=^R, + mrcup=\Ew@%p1%{48}%+%c%p2%{32}%+%c%p3%{32}%+%c$<20>, + nel=\037$<5>, rev=\EG4, ri=\Ej$<5>, rmacs=\EH\003\EcB0, + rmam=\Ed., rmir=\Er, rmso=\EG0, rmul=\EG0, rmxon=\Ec20, + rs2=\Ee6\Ed/\Ee1\Ed*\Er\EO\E`1\E`\:\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + setb=\s, + setf=%?%p1%{0}%=%t%{49}%e%p1%{1}%=%t%{50}%e%p1%{2}%=%t%{51}%e%p1%{3}%=%t%{52}%e%p1%{4}%=%t%{53}%e%p1%{5}%=%t%{54}%e%p1%{6}%=%t%{55}%e%p1%{7}%=%t%{102}%e%p1%{8}%=%t%{97}%e%p1%{9}%=%t%{98}%e%p1%{10}%=%t%{99}%e%p1%{11}%=%t%{101}%e%p1%{12}%=%t%{106}%e%p1%{13}%=%t%{110}%e%p1%{14}%=%t%{111}%e%p1%{15}%=%t%{56}%;\Em0%c$<100>, + sgr0=\EG0\EH\003\EcD, smacs=\EH\002\EcB1, smam=\Ed/, + smir=\Eq, smso=\EGt, smul=\EG8, smxon=\Ec21, tbc=\E0, + tsl=\EF, +ncr260wy350wpp|NCR 2900_260 wyse 350 wide mode, + cols#132, + cup=\Ea%i%p1%dR%p2%dC$<30>, + is2=\Ee6\Ed/\Ee1\Ed*\Er\EO\E`1\E`;\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<200>, + rs2=\Ee6\Ed/\Ee1\Ed*\Er\EO\E`1\E`;\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<200>, + use=ncr260wy350pp, +# This definition for Wyse 50+ supports several attributes. This means +# that it has magic cookies (extra spaces where the attributes begin). +# Some applications do not function well with magic cookies. The System +# Administrator's Shell in NCR Unix SVR4 1.03 is one such application. +# If supporting various attributes is not vital, 'xmc#1' and the extra +# attributes can be removed. +# Mapping to ASCII character set ('acsc' capability) can also be +# restored if needed. +# (ncr260wy50+pp: originally contained commented-out +# , as well as the commented-out one there -- esr) +ncr260wy50+pp|NCR 2900_260 wyse 50+, + am, bw, hs, km, mc5i, mir, msgr, xon, + cols#80, lines#24, nlab#32, xmc#1, + acsc=0wa_h[jukslrmqnxqzttuyv]wpxv, bel=^G, blink=\EG2, + cbt=\EI$<5>, civis=\E`0, clear=\E+$<20>, cnorm=\E`1, cr=^M, + cub1=\010$<5>, cud1=\n$<5>, cuf1=\014$<5>, + cup=\E=%p1%{32}%+%c%p2%{32}%+%c$<30>, cuu1=\013$<5>, + cvvis=\E`5, dch1=\EW$<50>, dim=\EGp, dl1=\ER$<5>, dsl=\E`c, + ed=\EY$<5>, el=\ET$<5>, fsl=^M, home=\036$<10>, + ht=\011$<5>, hts=\E1$<5>, il1=\EE$<5>, ind=\n$<5>, + invis=\EG1, + is2=\Ee6\E~"$<100>\E+\Ed/\Ee1\Ed*\Er\EO\E`1\E`\:\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + kDC=\ER, kEND=\EY, kHOM=\E{, kPRT=\E7, kRIT=^L, ka1=^^, kbs=^H, + kc1=\ET, kc3=\EK, kcbt=\EI, kcub1=^H, kcud1=^J, kcuf1=^L, + kcuu1=^K, kdch1=\EW, kend=\ET, kf1=^A@\r, kf10=^AI\r, + kf11=^AJ\r, kf12=^AK\r, kf13=^AL\r, kf14=^AM\r, kf15=^AN\r, + kf16=^AO\r, kf17=^A`\r, kf18=^Aa\r, kf19=^Ab\r, kf2=^AA\r, + kf20=^Ac\r, kf21=^Ad\r, kf22=^Ae\r, kf23=^Af\r, kf24=^Ag\r, + kf25=^Ah\r, kf26=^Ai\r, kf27=^Aj\r, kf28=^Ak\r, kf29=^Al\r, + kf3=^AB\r, kf30=^Am\r, kf31=^An\r, kf32=^Ao\r, kf4=^AC\r, + kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, + khome=^^, kich1=\Eq, knp=\EK, kpp=\EJ, kprt=\EP, + mc0=\EP$<10>, mc4=^T, mc5=^R, + mrcup=\Ew@%p1%{48}%+%c%p2%{32}%+%c%p3%{32}%+%c$<10>, + nel=\037$<5>, rev=\EG4, ri=\Ej$<5>, rmacs=\EH^C, rmam=\Ed., + rmir=\Er, rmso=\EG0, rmul=\EG0, rmxon=\Ec20, + rs2=\Ee6\E~"$<100>\E+\Ed/\Ee1\Ed*\Er\EO\E`1\E`\:\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + sgr0=\EG0\EH\003$<15>, smacs=\EH^B, smam=\Ed/, smir=\Eq, + smso=\EGt, smul=\EG8, smxon=\Ec21, tbc=\E0$<5>, tsl=\EF, +ncr260wy50+wpp|NCR 2900_260 wyse 50+ wide mode, + cols#132, + cup=\Ea%i%p1%dR%p2%dC$<30>, + is2=\Ee6\E~"$<100>\E+\Ed/\Ee1\Ed*\Er\EO\E`1\E`;\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<200>, + rs2=\Ee6\E~"$<100>\E+\Ed/\Ee1\Ed*\Er\EO\E`1\E`;\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<200>, + use=ncr260wy50+pp, +ncr260wy60pp|NCR 2900_260 wyse 60, + am, bw, hs, km, mc5i, mir, msgr, xon, + cols#80, lines#24, nlab#32, + acsc=07a?h;j5k3l2m1n8q\:t4u9v=w0x6, bel=^G, blink=\EG2, + cbt=\EI$<15>, civis=\E`0, clear=\E*$<100>, cnorm=\E`1, + cr=^M, cub1=\010$<5>, cud1=\n$<5>, cuf1=\014$<5>, + cup=\E=%p1%{32}%+%c%p2%{32}%+%c$<10>, cuu1=\013$<5>, + cvvis=\E`5, dch1=\EW$<50>, dl1=\ER$<5>, dsl=\E`c, + ed=\Ey$<5>, el=\Et$<5>, fsl=^M, home=\036$<25>, + ht=\011$<15>, hts=\E1$<15>, il1=\EE$<5>, ind=\n$<5>, + invis=\EG1, + is2=\Ee6\E~4$<100>\E+\Ed/\Ee1\Ed*\Er\EO\E`1\E`\:\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + kDC=\ER, kEND=\EY, kHOM=\E{, kNXT=\EK, kPRT=\E7, kPRV=\EJ, + kRIT=^L, ka1=^^, kb2=\EJ, kbs=^H, kc1=\ET, kc3=\EK, + kcbt=\EI$<15>, kcub1=^H, kcud1=^J, kcuf1=^L, kcuu1=^K, + kdch1=\EW, kend=\ET, kf1=^A@\r, kf10=^AI\r, kf11=^AJ\r, + kf12=^AK\r, kf13=^AL\r, kf14=^AM\r, kf15=^AN\r, kf16=^AO\r, + kf17=^A`\r, kf18=^Aa\r, kf19=^Ab\r, kf2=^AA\r, kf20=^Ac\r, + kf21=^Ad\r, kf22=^Ae\r, kf23=^Af\r, kf24=^Ag\r, kf25=^Ah\r, + kf26=^Ai\r, kf27=^Aj\r, kf28=^Ak\r, kf29=^Al\r, kf3=^AB\r, + kf30=^Am\r, kf31=^An\r, kf32=^Ao\r, kf4=^AC\r, kf5=^AD\r, + kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, khome=^^, + kich1=\Eq, knp=\EK, kpp=\EJ, kprt=\EP, mc0=\EP, mc4=^T, mc5=^R, + mrcup=\Ew@%p1%{48}%+%c%p2%{32}%+%c%p3%{32}%+%c$<30>, + nel=\037$<5>, rev=\EG4, ri=\Ej$<5>, rmacs=\EH^C, rmam=\Ed., + rmir=\Er, rmso=\EG0, rmul=\EG0, rmxon=\Ec20, + rs2=\Ee6\E~4$<100>\E+\Ed/\Ee1\Ed*\Er\EO\E`1\E`\:\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + sgr0=\EG0\EcB0\EcD$<15>, smacs=\EH^B, smam=\Ed/, + smir=\Eq, smso=\EGt, smul=\EG8, smxon=\Ec21, tbc=\E0$<15>, + tsl=\EF, +ncr260wy60wpp|NCR 2900_260 wyse 60 wide mode, + cols#132, + cup=\Ea%i%p1%dR%p2%dC$<30>, + is2=\Ee6\E~4$<100>\E+\Ed/\Ee1\Ed*\Er\EO\E`1\E`;\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + rs2=\Ee6\E~4$<100>\E+\Ed/\Ee1\Ed*\Er\EO\E`1\E`;\E`@\E~!\E"\Ee4\Ex@\E`9\Ee7$<100>, + use=ncr260wy60pp, +ncr160vppp|NCR 2900_160 viewpoint, + use=ncr260vppp, +ncr160vpwpp|NCR 2900_160 viewpoint wide mode, + use=ncr260vpwpp, +ncr160vt100an|NCR 2900_160 vt100 with ansi kybd, + use=ncr260vt100an, +ncr160vt100pp|NCR 2900_160 vt100 with PC+ kybd, + use=ncr260vt100pp, +ncr160vt100wan|NCR 2900_160 vt100 wide mode ansi kybd, + use=ncr260vt100wan, +ncr160vt100wpp|NCR 2900_160 vt100 wide mode pc+ kybd, + use=ncr260vt100wpp, +ncr160vt200an|NCR 2900_160 vt200 with ansi kybd, + use=ncr260vt200an, +ncr160vt200pp|NCR 2900_160 vt200 with pc+ kybd, + use=ncr260vt200pp, +ncr160vt200wan|NCR 2900_160 vt200 wide mode ansi kybd, + use=ncr260vt200wan, +ncr160vt200wpp|NCR 2900_160 vt200 wide mode pc+ kybd, + use=ncr260vt200wpp, +ncr160vt300an|NCR 2900_160 vt300 with ansi kybd, + use=ncr260vt300an, +ncr160vt300pp|NCR 2900_160 vt300 with pc+ kybd, + use=ncr260vt300pp, +ncr160vt300wan|NCR 2900_160 vt300 wide mode ansi kybd, + use=ncr260vt300wan, +ncr160vt300wpp|NCR 2900_160 vt300 wide mode pc+ kybd, + use=ncr260vt300wpp, +ncr160wy50+pp|NCR 2900_160 wyse 50+, + use=ncr260wy50+pp, +ncr160wy50+wpp|NCR 2900_160 wyse 50+ wide mode, + use=ncr260wy50+wpp, +ncr160wy60pp|NCR 2900_160 wyse 60, + use=ncr260wy60pp, +ncr160wy60wpp|NCR 2900_160 wyse 60 wide mode, + use=ncr260wy60wpp, +ncrvt100an|ncrvt100pp|NCR vt100 for the 2900 terminal, + am, hs, mc5i, mir, msgr, xon, + cols#80, it#8, lines#24, nlab#32, + acsc=``aaffgghhiijjkkllmmnnqqttuuvvwwxxyyzz~~, + bel=^G, blink=\E[5m$<30>, bold=\E[1m$<30>, + clear=\E[2J\E[1;1H$<300>, cr=^M, + csr=\E[%i%p1%d;%p2%dr$<100>, cub=\E[%p1%dD$<30>, + cub1=\E[D$<2>, cud=\E[%p1%dB$<30>, cud1=\E[B$<2>, + cuf=\E[%p1%dC$<30>, cuf1=\E[C$<2>, + cup=\E[%i%p1%d;%p2%dH$<100>, cuu=\E[%p1%dA$<30>, + cuu1=\E[A$<2>, dch=\E[%p1%dP$<40>, dch1=\E[1P$<10>, + dl=\E[%p1%dM$<70>, dl1=\E[M$<40>, dsl=\E[31l$<25>, + ed=\E[0J$<300>, el=\E[0K$<30>, el1=\E[1K$<30>, + enacs=\E(B\E)0$<40>, fsl=1$<10>, home=\E[H$<2>$<80>, + ht=^I, hts=\EH, il=\E[%p1%dL$<80>, il1=\E[B\E[L$<80>, + ind=\ED, + is2=\E[12h\E[?10l\E%/0n\E[P\031\E[?3l\E(B\E)0$<200>, + kLFT=\E[D, kRIT=\E[C, ka1=\E[H, kbs=^H, kcub1=\E[D, + kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kent=^M, kf1=\EOP, + kf2=\EOQ, kf3=\EOR, kf4=\EOS, mc0=\E[i$<100>, nel=\EE, + rc=\E8, rev=\E[7m$<30>, ri=\EM$<50>, rmacs=\017$<90>, + rmir=\E[4l$<80>, rmso=\E[0m$<30>, rmul=\E[0m$<30>, + rs2=\Ec\E[12;31h\E[?3;4;5;10l\E[?6;7;19;25h\E[33;34l\E[0m\E(B\E)0\E%/0n\E[P\031$<200>, + sc=\E7, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;$<100>, + sgr0=\017\E[0m$<120>, smacs=\016$<90>, smir=\E[4h$<80>, + smso=\E[7m$<30>, smul=\E[4m$<30>, tbc=\E[3g$<40>, + tsl=\E[>+1$<70>, +ncrvt100wan|NCRVT100WPP|ncrvt100wpp|NCR VT100 emulation of the 2900 terminal, + cols#132, + is2=\E[12h\E[?10l\E%/0n\E[P\031\E[?3h\E(B\E)0$<200>, + rs2=\Ec\E[12;31h\E[?4;5;10l\E?3;6;7;19;25h\E[33;34l\E[0m\E(B\E)0\E%/0n\E[P\031$<200>, + use=ncrvt100an, +# +# Vendor-supplied NCR termcaps end here + # NCR7900 DIP switches: # # Switch A: @@ -10515,13 +12658,13 @@ ncr7900i|ncr7900|ncr 7900 model 1, is2=\E0@\010\E3\E4\E7, kcub1=^U, kcud1=^J, kcuf1=^F, kcuu1=^Z, khome=^A, ll=^A, mc4=^T, mc5=^R, rev=\E0P, rmso=\E0@, rmul=\E0@, - sgr=\E0%p5%'@'%+%p4%{2}%*%+%p3%{16}%*%+%p2%{32}%*%+%p1%{17}%*%+%c, + sgr=\E0%p5%{64}%+%p4%{2}%*%+%p3%{16}%*%+%p2%{32}%*%+%p1%{17}%*%+%c, sgr0=\E0@, smso=\E0Q, smul=\E0`, ncr7900iv|ncr 7900 model 4, am, bw, eslok, hs, cols#80, lines#24, bel=^G, clear=^L, cr=^M, cub1=^H, cud1=^J, - cup=\013%p1%'@'%+%c\E\005%p2%02d, dl1=\E^O, dsl=\Ey1, + cup=\013%p1%{64}%+%c\E\005%p2%02d, dl1=\E^O, dsl=\Ey1, fsl=\Ek\Ey5, home=\013@\E^E00, il1=\E^N, ind=^J, kbs=^H, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA, kf1=\ES, kf2=\ET, kf3=\EU, kf4=\EV, kf5=\EW, kf6=\EP, kf7=\EQ, kf8=\ER, @@ -10537,9 +12680,9 @@ ncr7901|ncr 7901 model, hpa=\020%p1%{10}%/%{16}%*%p1%{10}%m%+%c, ind=^J, is2=\E4^O, kclr=^L, kcub1=^U, kcud1=^J, kcuf1=^F, kcuu1=^Z, khome=^H, ll=^A, mc4=^T, mc5=^R, rev=\E0P, rmso=^O, rmul=^O, - sgr=\E0%p5%'@'%+%p4%{2}%*%+%p3%{16}%*%+%p2%{32}%*%+%p1%{17}%*%+%c\016, + sgr=\E0%p5%{64}%+%p4%{2}%*%+%p3%{16}%*%+%p2%{32}%*%+%p1%{17}%*%+%c\016, sgr0=^O, smso=\E0Q\016, smul=\E0`\016, - vpa=\013%p1%'@'%+%c, + vpa=\013%p1%{64}%+%c, #### Perkin-Elmer (Owl) # @@ -11238,8 +13381,8 @@ scanset|sc410|sc415|Tymshare Scan Set, # # If you saw a Byte Magazine cover with a terminal on it during the early # 1980s, it was probably one of these. Carl Helmers liked them because -# they could crank 19.2 and were cheap (that is, until he tried to program -# one...) +# they could crank 19.2 and were cheap (that is, he liked them until he tried +# to program one...) # # Missing in vc303a and vc303 descriptions: they scroll 2 lines at a time @@ -11308,13 +13451,32 @@ kaypro|kaypro2|kaypro II, el=^X, home=^^, il1=\EE, ind=^J, kcud1=^J, kcuf1=^L, kcuu1=^K, # From IBM, Thu May 5 19:35:27 1983 -# (ibmpc: commented out =\200R because we don't know -- esr) -ibmpc|ibm-pc|ibm5051|5051|IBM Personal Computer (no ANSI.SYS), +# (commented out =\200R because we don't know -- esr) +ibm-pc|ibm5051|5051|IBM Personal Computer (no ANSI.SYS), am, cols#80, lines#24, bel=^G, clear=^L^K, cr=^M^^, cub1=^], cud1=^J, cuf1=^\, cuu1=^^, home=^K, ind=\n$<10>, kcud1=^_, +ibmpc|wy60-PC|wyse60-PC|IBM PC/XT running PC/IX, + am, bw, eo, hs, km, msgr, ul, + cols#80, it#8, lines#24, + acsc=j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263, + bel=^G, blink=\E[5m, bold=\E[1m, clear=\Ec, cr=^M, + cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B, + cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, + cuu=\E[%p1%dA, cuu1=\E[A, ech=\E[%p1%dX, ed=\E[J, el=\E[K, + home=\E[H, hpa=\E[%i%p1%dG, ind=\E[S\E[B, + indn=\E[%p1%dS\E[%p1%dB, invis=\E[30;40m, kbs=^H, + kcbt=^], kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kdch1=\177, kend=\E[Y, kf1=\240, kf10=\251, kf2=\241, + kf3=\242, kf4=\243, kf5=\244, kf6=\245, kf7=\246, kf8=\247, + kf9=\250, khome=\E[H, kich1=\E[^H, knp=\E[U, ll=\E[24;1H, + nel=^M, rev=\E[7m, ri=\E[T\E[A, rin=\E[%p1%dT\E[%p1%dA, + rmso=\E[m, rmul=\E[m, + sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m, + sgr0=\E[m, smso=\E[7m, smul=\E[4m, + #### Apple II # # Apple II firmware console first, then various 80-column cards and @@ -11680,6 +13842,12 @@ amiga-h|Hans Verkuil's Amiga ANSI, rmul=\2330m, rs1=\Ec, sgr0=\2330m, smacs=^N, smcup=\233?7l, smso=\2337m, smul=\2334m, +# From: Henning 'Faroul' Peters , 25 Sep 1999 +amiga-8bit|Amiga ANSI using 8-bit controls, + acsc=, dl=\233%p1%dM, dl1=\233M, il=\233%p1%dL, il1=\233L, + ind=\204, indn@, ri=\215, rin@, + use=amiga-h, + # Commodore B-128 microcomputer from Doug Tyrol # I'm trying to write a termcap for a commodore b-128, and I'm # having a little trouble. I've had to map most of my control characters @@ -11738,7 +13906,7 @@ osborne|osborne1|osborne I in 80-column mode, cols#80, lines#24, clear=^Z, cub1=\010$<4>, cud1=^J, cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, - dch1=\\EW$<4/>, dl1=\ER, el=\ET, il1=\EE, is2=^Z, kbs=^H, + dch1=\EW$<4/>, dl1=\ER, el=\ET, il1=\EE, is2=^Z, kbs=^H, kcub1=^H, kcud1=^J, kcuf1=^L, kcuu1=^K, rmir=, rmso=\E), rmul=\Em, smir=\EQ, smso=\E(, smul=\El, # @@ -11918,6 +14086,46 @@ m2-nam|minitel|minitel-2|minitel-2-nam|France Telecom Minitel 2 mode te'le'infor smacs=^N, smir=\E[4h, smso=\E[7m, smul=\E[4m, tsl=^_@A, u6=\E[%i%d;%dR, u7=\E[6n, +# From: Alexandre Montaron , 18 Jun 1998 +# +minitel1|minitel 1, + am, bw, eslok, hs, hz, msgr, + colors#8, cols#40, lines#24, pairs#8, + acsc=+.\,\,./f0g1, bel=^G, blink=\EH, civis=^T, clear=^L, + cnorm=^Q, cr=^M, cub1=^H, cud1=^J, cuf1=^I, + cup=\037%p1%{65}%+%c%p2%{65}%+%c, cuu1=^K, el=^X, + enacs=^Y, fsl=^J, home=^^, ind=^J, + is2=\E;`ZQ\E\:iC\E\:iE\021, nel=^M^J, op=\EG, + rep=%p1%c\022%p2%{63}%+%c, rev=\E], ri=^K, rmso=\E\\, + setf=\E%?%p1%{1}%=%tD%e%p1%{3}%=%tF%e%p1%{4}%=%tA%e%p1%{6}%=%tC%e%p1%{64}%+%c%;, + sgr=%?%p1%t\E]%;%?%p3%t\E]%;%?%p4%t\EH%;, + sgr0=\EI\E\\, smso=\E], tsl=\037@%p1%{65}%+%c, +# is2=Fnct TE, Fnct MR, Fnct CM et pour finir: curseur ON. +minitel1b|minitel 1-bistandard (in 40cols mode), + mir, + cub=\E[%p1%dD, cud=\E[%p1%dB, cuf=\E[%p1%dC, + cuu=\E[%p1%dA, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, + dl1=\E[M, ed=\E[J, el1=\E[1K, il=\E[%p1%dL, il1=\E[L, + is1=\E;iYA\E;jYC, kclr=\E[2J, kctab=^I, kcub1=\E[D, + kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[P, kdl1=\E[M, + kel=^X, khome=\E[H, kich1=\E[4h, kil1=\E[L, rmir=\E[4l, + smir=\E[4h, smkx=\E;iYA\E;jYC, + use=minitel1, +# posait des problemes (logout en sortant de vi). +minitel1b-80|minitel 1-bistandard (standard teleinformatique), + am@, bw@, hz@, + colors@, cols#80, it#8, pairs@, + blink=\E[5m, bold=\E[1m, civis=\037@A\024\n, + clear=\E[H\E[2J, cnorm=\037@A\021\n, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, el=\E[K, home=\E[H, + ht=^I, ind=\ED, is1@, is2@, kent=\EOM, kf0=\EOp, kf1=\EOq, + kf2=\EOr, kf3=\EOs, kf4=\EOt, kf5=\EOu, kf6=\EOv, kf7=\EOw, + kf8=\EOx, kf9=\EOy, nel=\EE, op@, rc=\E8, rep@, rev=\E[7m, + ri=\EM, rmkx@, rmso=\E[27m, rmul=\E[24m, sc=\E7, setf@, + sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;m, + sgr0=\E[m, smkx@, smso=\E[7m, smul=\E[4m, + use=minitel1b, + ######## OBSOLETE VDT TYPES # # These terminals are *long* dead -- these entries are retained for @@ -12286,7 +14494,7 @@ delta|dd5000|delta data 5000, am, cols#80, lines#27, bel=^G, clear=^NR, cub1=^H, cud1=^J, cuf1=^Y, - cup=\017%p1%p1%{16}%m%{2}%*%-%'9'%+%c%p2%p2%{16}%m%{2}%*%-%'9'%+%c, + cup=\017%p1%p1%{16}%m%{2}%*%-%{57}%+%c%p2%p2%{16}%m%{2}%*%-%{57}%+%c, cuu1=^Z, dch1=^NV, el=^NU, home=^NQ, ind=^J, #### Digital Data Research (ddr) @@ -13528,11 +15736,9 @@ versaterm|versaterm vt100 emulator for the macintosh, # From: Rick Thomas # (xtalk: I added / based on the init string. -# I also removed and the trailing \s characters from the highlight -# changers, I don't believe these on a VT100-emulating PC display -- esr) xtalk|IBM PC with xtalk communication program (versions up to 3.4), am, mir, msgr, xon, - cols#80, it#8, lines#24, vt#3, + cols#80, it#8, lines#24, vt#3, xmc#1, acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, clear=\E[H\E[J$<50>, cr=^M, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C$<2>, @@ -13544,9 +15750,9 @@ xtalk|IBM PC with xtalk communication program (versions up to 3.4), kcuu1=\EOA, kent=\EOM, kf0=\EOy, kf1=\EOP, kf10=\EOx, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOt, kf6=\EOu, kf7=\EOv, kf8=\EOl, kf9=\EOw, ri=\EM$<5>, rmacs=^O, rmam=\E[?7l, - rmkx=\E[?1l\E>, rmso=\E[m, + rmkx=\E[?1l\E>, rmso=\E[m\s, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sgr0=\E[m, - smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m, + smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m\s, tbc=\E[3g, # The official PC terminal emulator program of the AT&T Product Centers. @@ -13707,7 +15913,7 @@ dwk|dwk-vt|dwk terminal, cols#80, it#8, lines#24, acsc=+\^\,Q-S.M0\177`+a\:f'g#h#i#jXkClJmFnNo~qUs_tEuPv\\wKxW~_, bel=^G, clear=\EH\EJ, cr=^M, cub1=^H, cud1=^J, cuf1=\EC, - cup=\EY%p1%' '%+%c%p2%' '%+%c, cuu1=\EA, dch1=\EP, + cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, dch1=\EP, ed=\EJ, el=\EK, home=\EH, ht=^I, ich1=\EQ, ind=^J, kbs=\177, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA, kdch1=\Ee, kf1=\Ef1, kf10=\Ef0, kf2=\Ef2, kf3=\Ef3, kf4=\Ef4, kf5=\Ef5, @@ -13766,13 +15972,13 @@ opus3n1+|Esprit Opus3n1+ in wy60 mode with ANSI arrow keys, kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, khome=^^, kich1=\EQ, kil1=\EE, knp=\EK, kpp=\EJ, kprt=\EP, krpl=\Er, mc0=\EP, mc4=^T, mc5=^R, nel=\r\n$<3>, - pfloc=\EZ2%p1%'?'%+%c%p2%s\177, - pfx=\EZ1%p1%'?'%+%c%p2%s\177, - pln=\Ez%p1%'/'%+%c%p2%s\r, prot=\E), ri=\Ej$<7>, + pfloc=\EZ2%p1%{63}%+%c%p2%s\177, + pfx=\EZ1%p1%{63}%+%c%p2%s\177, + pln=\Ez%p1%{47}%+%c%p2%s\r, prot=\E), ri=\Ej$<7>, rmacs=\EH^C, rmam=\Ed., rmcup=, rmir=\Er, rmln=\EA11, rmxon=\Ec20, rs1=\E~!\E~4$<150>, rs2=\EeF$<150>, rs3=\EwG\Ee($<150>, - sgr=%?%p8%t\E)%e\E(%;%?%p9%t\EH\002%e\EH\003%;\EG%'0'%?%p2%p6%|%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c, + sgr=%?%p8%t\E)%e\E(%;%?%p9%t\EH\002%e\EH\003%;\EG%{48}%?%p2%p6%|%t%{8}%|%;%?%p1%p3%|%p6%|%t%{4}%|%;%?%p4%t%{2}%|%;%?%p1%p5%|%t%{64}%|%;%?%p7%t%{1}%|%;%c, sgr0=\E(\EH\003\EG0\EcD, smacs=\EH^B, smam=\Ed/, smcup=\Ezz&\E[A\177\Ezz'\E[B\177\Ezz(\E[D\177\Ezz)\E[C\177\Ezz<\E[Q\177, smir=\Eq, smln=\EA10, smxon=\Ec21, tbc=\E0, tsl=\Ez(, @@ -13784,11 +15990,10 @@ teletec|Teletec Datascreen, bel=^G, clear=^L, cr=^M, cub1=^H, cud1=^J, cuf1=^_, cuu1=^K, home=^^, ind=^J, # From: Mark Dornfeld -# This termcap is for the LANPAR Technologies VISION 3220 -# terminal. The function key definitions k0-k5 represent the -# edit keypad: FIND, INSERT HERE, REMOVE, SELECT, PREV SCREEN, -# NEXT SCREEN. The key definitions k6-k9 represent the PF1 to -# PF4 keys. +# This description is for the LANPAR Technologies VISION 3220 +# terminal from 1984/85. The function key definitions k0-k5 represent the +# edit keypad: FIND, INSERT HERE, REMOVE, SELECT, PREV SCREEN, +# NEXT SCREEN. The key definitions k6-k9 represent the PF1 to PF4 keys. # (v3220: removed obsolete ":kn#10:", # I added / based on the init string -- esr) v3220|LANPAR Vision II model 3220/3221/3222, @@ -14733,7 +16938,7 @@ v3220|LANPAR Vision II model 3220/3221/3222, # that it was messing up someone's 3270 emulator. # * Added some longname fields in order to avoid warning messages from # older tic implementations. -# * According to ctrlseqs.ms, xterm has a full vt100 graphics set. Use +# * According to ctlseqs.ms, xterm has a full vt100 graphics set. Use # it! (This gives us pi, greater than, less than, and a few more.) # * Freeze for ncurses-1.9.6 release. # 9.10.1 (Sat Oct 21 22:18:09 EDT 1995): @@ -14972,16 +17177,21 @@ v3220|LANPAR Vision II model 3220/3221/3222, # * Removed rmir/smir from tv92B. # # 10.2.0 (Sat Feb 28 12:47:36 EST 1998): -# * Added Thomas Dickey's acsc string for linux. -# * Merged in BeOS, iris-color, hds200, xterm-xf86-v40, xterm-8bit, -# and emx entries. +# * add hds200 description (Walter Skorski) +# * add beterm entry (Fred Fish) +# * add Thomas Dickey's xterm-xf86-v40, xterm-8bit, xterm-16color, +# iris-color entries. +# * add emx entries. # * Replaced unixpc entry with Benjamin Sittler's corrected version. # * Replaced xterm/rxvt/emu/syscons entries with Thomas Dickey's # versions. +# * remove sgr string from qnx based on report by Xiaodan Tang # * Added u8/u9, removed rmul/smul from sun-il. -# * 4.2 tic allows us to use \0 instead of \200 now. +# * 4.2 tic displays \0 rather than \200. +# * add linux-koi8r to replace linux-koi8 (which uses a corrupt acsc, +# apparently based on cp-866). # * Merged in Pavel Roskin's acsc for linux-koi8 -# * Corrected some erroneous \\\s to \. +# * Corrected some erroneous \\'s to \. # * 4.2 ncurses has been changed to use setaf/setab, consistent w/SysV. # * II -> ii in pcvtXX, screen, xterm. # * Removed \n chars following ANSI escapes in sgr & friends. @@ -14992,10 +17202,154 @@ v3220|LANPAR Vision II model 3220/3221/3222, # * Added Sony NEWS workstation entries and cit101e-rv. # * Reverted `amiga'; to Kent Polk's version, as I'm told # the Verkuil entry messes up with Amiga Telnet. +# 10.2.1 (Sun Mar 8 18:32:04 EST 1998): +# * Corrected attributions in 10.2.0 release notes. +# * Scanned the Shuford archive for new terminfos and information. +# * Removed sgr from qnx entry (Thomas Dickey). +# * Added entries for ICL and Kokusai Data Systems terminals. +# * Incorporated NCR terminfos from the Boundless Technology FTP site. +# * Incorporated att700 from the Boundless Technology FTP site. +# * Miscellaneous contact-address and Web-page updates. +# +# 1998/5/9 +# * 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 ). +# +# 1998/7/4 +# * merge changes from current XFree86 xterm terminfo descriptions. +# +# 1998/7/25 +# * Added minitel1 entries from Alexander Montaron. +# * Added qnxt2 from Federico Bianchi. +# * Added arm100 terminfo entries from Dave Millen. +# +# 1998/8/6 +# * Added ncsa telnet entries from Francesco Potorti +# +# 1998/8/15 +# * modify ncsa telnet entry to reflect color, other capabilities based on +# examination of the source code - T.Dickey. +# +# 1998/8/22 +# * Corrected some erroneous \\'s to \ (eterm, osborne) - TD. +# +# 1998/8/29 +# * 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. +# * correct a typo in icl6404 entry. +# * add xtermm and xtermc +# +# 1998/9/26 +# * format most %'char' sequences to %{number} +# * adapt IBM AIX 3.2.5 terminfo - T.Dickey +# * merge Data General terminfo from Hasufin - TD +# +# 1998/10/10 +# * update xterm-xfree86 to current (patch 84), for is2/rs2 changes - TD +# * correct initialization string in xterm-r5, add misc other features +# to correspond with xterm patch 84 - TD +# +# 1998/12/19 +# * update xterm-xfree86 to current (patch 90), smcur/rmcur changes - TD +# * add Mathew Vernon's mach console entries +# * corrections for ncsa function-keys (report by Larry Virden) +# +# 1998/12/19 +# * change linux to use ncv#2, since underline does not work with color - TD +# +# 1999/1/9 +# * add kbt to iris-ansi, document other shift/control functionkeys - TD +# * correct iris-ansi and iris-ansi-ap with respect to normal vs keypad +# application modes, change kent to use the correct keypad code - TD +# +# 1999/1/10 +# * add entry for Tera Term - TD +# +# 1999/1/23 +# * minor improvements for teraterm entry - TD +# * rename several entries used by BSDI: bsdos to bsdos-pc-nobold, +# and bsdos-bold to bsdos-pc (Jeffrey C Honig) +# +# 1999/2/20 +# * resolve ambiguity of kend/kll/kslt and khome/kfnd/kich1 strings in +# xterm and ncsa 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 +# +# 1999/3/13 +# * adjust xterm-xfree86 khome/kend to match default PC-style keyboard +# tables - TD +# * add 'crt' entry - TD +# * correct typos in 'linux-c' entry - TD +# +# 1999/3/14 +# * update entries for BSD/OS console to use klone+sgr and klone+color +# (Jeffrey C Honig) +# +# 1999/3/27 +# * adjust xterm-xfree86 miscellaneous keypad keys, as per patch #94 - TD. +# +# 1999/4/10 +# * add linux-lat, from RedHat patches to ncurses 4.2 +# +# 1999/4/17 +# * add complete set of default function-key definitions for scoansi - TD. +# +# 1999/7/3 +# * add cnorm, cvvis for Linux 2.2 kernels +# +# 1999/7/24 +# * add kmous to xterm-r5 -TD +# * correct entries xterm+sl and xterm+sl-twm, which were missing the +# parent "use" clause -TD +# +# 1999/7/31 +# * corrected cnorm, added el1 in 'screen' description -TD +# +# 1999/8/14 +# * add ms-vt100 -TD +# +# 1999/8/21 +# * corrections to beterm entry -TD +# +# 1999/8/28 +# * add cygwin entry -TD +# +# 1999/9/4 +# * minor corrections for beterm entry -TD +# +# 1999/9/18 +# * add acsc string to HP 70092 terminfo entry -Joerg Wunsch +# +# 1999/9/25 +# * add amiga-8bit entry +# * add console entries from NetBSD: ofcons, wsvt25, wsvt25m, rcons, +# rcons-color, based on +# ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/termcap/termcap.src +# * add alias for iris-ansi-net +# +# 1999/10/2 +# * corrected scoansi entry's acsc, some function keys, add color -TD +# +# 1999/10/23 +# * add cnorm, cvvis to cons25w, and modify ncv to add 'dim' -TD +# * reorder ncsa entries to make ncsa-vt220 use the alternate function +# key mapping, leaving Potorti's entries more like he named them -TD +# * remove enter/exit am-mode from cygwin -TD # -# The following sets edit modes for GNU EMACS +# The following sets edit modes for GNU EMACS. # Local Variables: # fill-prefix:"\t" # fill-column:75 +# comment-column:0 +# comment-start-skip:"^#+" +# comment-start:"# " +# compile-command:"tic -c terminfo.master" # End: ######## SHANTIH! SHANTIH! SHANTIH! diff --git a/mk-1st.awk b/mk-1st.awk index c35933bd..e22d414f 100644 --- a/mk-1st.awk +++ b/mk-1st.awk @@ -1,4 +1,4 @@ -# $Id: mk-1st.awk,v 1.35 1998/02/11 12:13:53 tom Exp $ +# $Id: mk-1st.awk,v 1.39 1998/05/09 21:54:02 tom Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -39,7 +39,7 @@ # depend (optional dependencies for all objects, e.g, ncurses_cfg.h) # subset ("none", "base", "base+ext_funcs" or "termlib") # target (cross-compile target, if any) -# DoLinks ("yes" or "no", flag to add symbolic links) +# DoLinks ("yes", "reverse" or "no", flag to add symbolic links) # rmSoLocs ("yes" or "no", flag to add extra clean target) # overwrite ("yes" or "no", flag to add link to libcurses.a # @@ -50,34 +50,43 @@ # function symlink(src,dst) { if ( src != dst ) { - printf "rm -f %s; ", dst - printf "$(LN_S) %s %s; ", src, dst + if ( DoLinks == "reverse" ) { + printf "rm -f %s; ", src + printf "$(LN_S) %s %s; ", dst, src + } else { + printf "rm -f %s; ", dst + printf "$(LN_S) %s %s; ", src, dst + } } } function sharedlinks(directory, add) { if ( end_name != lib_name ) { - abi_name = sprintf("%s.$(ABI_VERSION)", lib_name); + if ( DoLinks == "yes" ) { + abi_name = sprintf("%s.$(ABI_VERSION)", lib_name); + } else { + abi_name = end_name; + } if (add) { printf "\tcd %s && (", directory - symlink(end_name, abi_name); + if ( abi_name != end_name ) { + symlink(end_name, abi_name); + } symlink(abi_name, lib_name); printf ")\n" } else { - printf "\t-@rm -f %s/%s\n", directory, abi_name + if ( abi_name != end_name ) { + printf "\t-@rm -f %s/%s\n", directory, abi_name + } printf "\t-@rm -f %s/%s\n", directory, lib_name } } } function removelinks() { if ( end_name != lib_name ) { - printf "\trm -f ../lib/%s ../lib/%s\n", abi_name, end_name - } - } -function installed_name() { - if ( DO_LINKS == "yes" ) { - return sprintf("%s.$(REL_VERSION)", lib_name); - } else { - return lib_name; + if ( abi_name != end_name ) { + printf "\t-rm -f ../lib/%s\n", abi_name + } + printf "\t-rm -f ../lib/%s\n", end_name } } BEGIN { @@ -137,12 +146,20 @@ END { { if ( DoLinks == "yes" ) { end_name = sprintf("%s.$(REL_VERSION)", lib_name); + } else if ( DoLinks == "reverse") { + tmp_name = sprintf("%s.$(ABI_VERSION)", lib_name); + end_name = lib_name; + lib_name = tmp_name; } else { end_name = lib_name; } printf "../lib/%s : $(%s_OBJS)\n", lib_name, OBJS print "\t-@rm -f $@" - printf "\t$(MK_SHARED_LIB) $(%s_OBJS)\n", OBJS + if ( subset == "termlib") { + printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(TINFO_LIST)\n", OBJS + } else { + printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(SHLIB_LIST)\n", OBJS + } sharedlinks("../lib", 1) print "" if ( end_name != lib_name ) { @@ -153,15 +170,19 @@ END { print "install.libs \\" printf "install.%s :: $(INSTALL_PREFIX)$(libdir) ../lib/%s\n", name, end_name printf "\t@echo installing ../lib/%s as $(INSTALL_PREFIX)$(libdir)/%s \n", lib_name, end_name - printf "\t-@rm -f $(INSTALL_PREFIX)$(libdir)/%s \n", end_name - printf "\t$(INSTALL_LIB) ../lib/%s $(INSTALL_PREFIX)$(libdir)/%s \n", lib_name, end_name + if ( DoLinks == "reverse") { + printf "\t-@rm -f $(INSTALL_PREFIX)$(libdir)/%s \n", lib_name + printf "\t$(INSTALL_LIB) ../lib/%s $(INSTALL_PREFIX)$(libdir)/%s \n", lib_name, lib_name + } else { + printf "\t-@rm -f $(INSTALL_PREFIX)$(libdir)/%s \n", end_name + printf "\t$(INSTALL_LIB) ../lib/%s $(INSTALL_PREFIX)$(libdir)/%s \n", lib_name, end_name + } sharedlinks("$(INSTALL_PREFIX)$(libdir)", 1) if ( overwrite == "yes" && name == "ncurses" ) { ovr_name = sprintf("libcurses%s", suffix) - printf "\t@echo linking %s to %s\n", ovr_name, lib_name - printf "\t-@rm -f $(INSTALL_PREFIX)$(libdir)/%s \n", ovr_name - printf "\t(cd $(INSTALL_PREFIX)$(libdir) && $(LN_S) %s %s)\n", lib_name, ovr_name + printf "\t@echo linking %s to %s\n", lib_name, ovr_name + printf "\tcd $(INSTALL_PREFIX)$(libdir) && (rm -f %s; $(LN_S) %s %s; )\n", ovr_name, lib_name, ovr_name } if ( ldconfig != "" ) { printf "\t- test -z \"$(INSTALL_PREFIX)\" && %s\n", ldconfig @@ -232,22 +253,21 @@ END { } print "" print "clean ::" - printf "\trm -f ../lib/%s\n", lib_name + printf "\t-rm -f ../lib/%s\n", lib_name print "" print "mostlyclean::" - printf "\trm -f $(%s_OBJS)\n", OBJS + printf "\t-rm -f $(%s_OBJS)\n", OBJS print "" print "clean ::" - printf "\trm -f $(%s_OBJS)\n", OBJS removelinks(); } else if ( found == 2 ) { print "" print "mostlyclean::" - printf "\trm -f $(%s_OBJS)\n", OBJS + printf "\t-rm -f $(%s_OBJS)\n", OBJS print "" print "clean ::" - printf "\trm -f $(%s_OBJS)\n", OBJS + printf "\t-rm -f $(%s_OBJS)\n", OBJS } } diff --git a/mk-2nd.awk b/mk-2nd.awk index 9240b470..2d998b0c 100644 --- a/mk-2nd.awk +++ b/mk-2nd.awk @@ -1,4 +1,4 @@ -# $Id: mk-2nd.awk,v 1.10 1998/02/11 12:13:53 tom Exp $ +# $Id: mk-2nd.awk,v 1.11 1998/10/17 21:54:21 Alexander.V.Lukyanov Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -89,9 +89,12 @@ BEGIN { atsign="@" printf "\t@echo 'compiling %s (%s)'\n", $1, model } - if ( $3 == "." || srcdir == "." ) - printf "\t%scd ../%s; $(%s) $(CFLAGS_%s) -c ../%s/%s%s", atsign, model, compile, MODEL, name, $1, suffix - else + if ( $3 == "." || srcdir == "." ) { + dir = $3 "/" + sub("^\\$\\(srcdir\\)/","",dir); + sub("^\\./","",dir); + printf "\t%scd ../%s; $(%s) $(CFLAGS_%s) -c ../%s/%s%s%s", atsign, model, compile, MODEL, name, dir, $1, suffix + } else printf "\t%scd ../%s; $(%s) $(CFLAGS_%s) -c %s/%s%s", atsign, model, compile, MODEL, $3, $1, suffix } else { printf "%s", $1 diff --git a/ncurses/MKkeyname.awk b/ncurses/MKkeyname.awk deleted file mode 100644 index 98ea404f..00000000 --- a/ncurses/MKkeyname.awk +++ /dev/null @@ -1,54 +0,0 @@ -# $Id: MKkeyname.awk,v 1.12 1997/11/15 22:16:55 tom Exp $ -BEGIN { - print "/* generated by MKkeyname.awk */" - print "" - print "#include " - print "#include " - print "#include " - print "#include " - print "#include " - print "" - print "struct kn {" - print "\tconst char *name;" - print "\tint code;" - print "};" - print "" - print "const struct kn key_names[] = {" -} - -/^[^#]/ { -# printf "\t{ \"%s\",%*s%s },\n", $1, 16-length($1), " ", $1; - printf "\t{ \"%s\",%s },\n", $1, $1; - } - -END { - print "};" - print "" - print "const char *keyname(int c)" - print "{" - print "int i, size = sizeof(key_names)/sizeof(struct kn);" - print "static char name[5];" - print "char *p;" - print "" - print "\tfor (i = 0; i < size; i++)" - print "\t\tif (key_names[i].code == c)" - print "\t\t\treturn key_names[i].name;" - print "\tif (c >= 256) return \"UNKNOWN KEY\";" - print "\tp = name;" - print "\tif (c >= 128) {" - print "\t\tstrcpy(p, \"M-\");" - print "\t\tp += 2;" - print "\t\tc -= 128;" - print "\t}" - print "\tif (c < 0)" - print "\t\tsprintf(p, \"%d\", c);" - print "\telse if (c < 32)" - print "\t\tsprintf(p, \"^%c\", c + '@');" - print "\telse if (c == 127)" - print "\t\tstrcpy(p, \"^?\");" - print "\telse" - print "\t\tsprintf(p, \"%c\", c);" - print "\treturn name;" - print "}" - print "" -} diff --git a/ncurses/Makefile.in b/ncurses/Makefile.in index 132b98ea..bed5ee95 100644 --- a/ncurses/Makefile.in +++ b/ncurses/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.46 1998/02/11 12:13:57 tom Exp $ +# $Id: Makefile.in,v 1.63 1999/09/01 22:35:53 tom Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -84,7 +84,7 @@ CPPFLAGS = -I../ncurses -I$(srcdir) @CPPFLAGS@ \ CCFLAGS = $(CPPFLAGS) $(CFLAGS) -HOSTCC = @CC@ +HOSTCC = @BUILD_CC@ HOSTCCFLAGS = @CFLAGS@ $(CPPFLAGS) HOSTLDFLAGS = @LDFLAGS@ @LIBS@ @@ -98,8 +98,12 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ -SHLIB_LIST = @SHLIB_LIST@ +SHLIB_DIRS = -L../lib -L$(libdir) +SHLIB_LIST = $(SHLIB_DIRS) @SHLIB_LIST@ +TINFO_LIST = $(SHLIB_DIRS) @TINFO_LIST@ + MK_SHARED_LIB = @MK_SHARED_LIB@ + REL_VERSION = @cf_cv_rel_version@ ABI_VERSION = @cf_cv_abi_version@ @@ -118,7 +122,7 @@ AUTO_SRC = \ ./comp_captab.c \ ./expanded.c \ ./fallback.c \ - keys.tries \ + init_keytry.h \ ./lib_keyname.c \ ./lib_gen.c \ ./codes.c \ @@ -126,7 +130,7 @@ AUTO_SRC = \ ./unctrl.c TEST_DEPS = @LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@ -TEST_ARGS = -L../lib -lncurses +TEST_ARGS = -L../lib -lncurses@DFT_ARG_SUFFIX@ TEST_LDFLAGS = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@ TEST_PROGS = \ @@ -135,6 +139,11 @@ TEST_PROGS = \ hashmap$x \ lib_mvcur$x +base = $(srcdir)/base +serial = $(srcdir)/tty +tinfo = $(srcdir)/tinfo +trace = $(srcdir)/trace + ################################################################################ all :: $(AUTO_SRC) ../lib $(LIBRARIES) @@ -145,49 +154,49 @@ $(INSTALL_PREFIX)$(libdir) : ../lib : ; mkdir $@ -./fallback.c : $(srcdir)/MKfallback.sh - sh $(srcdir)/MKfallback.sh $(FALLBACK_LIST) >$@ +./fallback.c : $(tinfo)/MKfallback.sh + sh $(tinfo)/MKfallback.sh $(FALLBACK_LIST) >$@ -./lib_gen.c : $(srcdir)/MKlib_gen.sh ../include/curses.h - sh $(srcdir)/MKlib_gen.sh "$(CPP)" "$(AWK)" <../include/curses.h >$@ +./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h + sh $(base)/MKlib_gen.sh "$(CPP)" "$(AWK)" <../include/curses.h >$@ -../include/nomacros.h : $(srcdir)/MKlib_gen.sh ../include/curses.h - sh $(srcdir)/MKlib_gen.sh "$(CPP)" "$(AWK)" <../include/curses.h | \ +../include/nomacros.h : $(base)/MKlib_gen.sh ../include/curses.h + sh $(base)/MKlib_gen.sh "$(CPP)" "$(AWK)" <../include/curses.h | \ fgrep undef >$@ -keys.tries: make_keys$x $(srcdir)/keys.list - ./make_keys $(srcdir)/keys.list > keys.tries +init_keytry.h: make_keys$x $(tinfo)/keys.list + ./make_keys $(tinfo)/keys.list > $@ make_keys$x : \ - $(srcdir)/make_keys.c \ + $(tinfo)/make_keys.c \ ./names.c - $(HOSTCC) -o $@ $(HOSTCCFLAGS) $(srcdir)/make_keys.c $(HOSTLDFLAGS) + $(HOSTCC) -o $@ $(HOSTCCFLAGS) $(tinfo)/make_keys.c $(HOSTLDFLAGS) make_hash$x : \ - $(srcdir)/comp_hash.c \ + $(tinfo)/comp_hash.c \ ../include/hashsize.h - $(HOSTCC) -o $@ $(HOSTCCFLAGS) -DMAIN_PROGRAM $(srcdir)/comp_hash.c $(HOSTLDFLAGS) + $(HOSTCC) -o $@ $(HOSTCCFLAGS) -DMAIN_PROGRAM $(tinfo)/comp_hash.c $(HOSTLDFLAGS) -./expanded.c : $(srcdir)/MKexpanded.sh - sh $(srcdir)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) +./expanded.c : $(serial)/MKexpanded.sh + sh $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@ ./comp_captab.c: \ make_hash$x \ ../include/hashsize.h \ - $(srcdir)/MKcaptab.awk - sh $(srcdir)/MKcaptab.awk $(AWK) $(srcdir)/../include/Caps > $@ + $(tinfo)/MKcaptab.awk + sh $(tinfo)/MKcaptab.awk $(AWK) $(srcdir)/../include/Caps > $@ -./lib_keyname.c: $(srcdir)/keys.list $(srcdir)/MKkeyname.awk - $(AWK) -f $(srcdir)/MKkeyname.awk $(srcdir)/keys.list > $@ +./lib_keyname.c: $(tinfo)/keys.list $(base)/MKkeyname.awk + $(AWK) -f $(base)/MKkeyname.awk $(tinfo)/keys.list > $@ -./names.c ./codes.c: $(srcdir)/MKnames.awk - $(AWK) -f $(srcdir)/MKnames.awk $(srcdir)/../include/Caps +./names.c ./codes.c: $(tinfo)/MKnames.awk + $(AWK) -f $(tinfo)/MKnames.awk $(srcdir)/../include/Caps cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr >./names.c cat namehdr boolcodes numcodes strcodes codeftr >./codes.c -rm -f namehdr nameftr codeftr boolnames boolfnames boolcodes numnames numfnames numcodes strnames strfnames strcodes -./unctrl.c: $(srcdir)/MKunctrl.awk - echo | $(AWK) -f $(srcdir)/MKunctrl.awk >$@ +./unctrl.c: $(base)/MKunctrl.awk + echo | $(AWK) -f $(base)/MKunctrl.awk >$@ tags: ctags *.[ch] @@ -201,8 +210,8 @@ mostlyclean :: clean :: mostlyclean -rm -f $(AUTO_SRC) - -rm -f make_keys - -rm -f make_hash + -rm -f make_keys$x + -rm -f make_hash$x distclean :: clean -rm -f Makefile @@ -218,21 +227,21 @@ realclean :: distclean # These rules build test-programs for the modules that have test-drivers test_progs : $(TEST_PROGS) -captoinfo$x : $(srcdir)/captoinfo.c $(TEST_DEPS) - @ECHO_LINK@ $(CC) -o $@ $(CCFLAGS) -DMAIN $(srcdir)/captoinfo.c $(TEST_LDFLAGS) +captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS) + @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS) -hardscroll$x : $(srcdir)/hardscroll.c $(TEST_DEPS) - @ECHO_LINK@ $(CC) -o $@ $(CCFLAGS) -DSCROLLDEBUG $(srcdir)/hardscroll.c $(TEST_LDFLAGS) +hardscroll$x : $(serial)/hardscroll.c $(TEST_DEPS) + @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DSCROLLDEBUG $(serial)/hardscroll.c $(TEST_LDFLAGS) -hashmap$x : $(srcdir)/hashmap.c $(TEST_DEPS) - @ECHO_LINK@ $(CC) -o $@ $(CCFLAGS) -DHASHDEBUG $(srcdir)/hashmap.c $(TEST_LDFLAGS) +hashmap$x : $(serial)/hashmap.c $(TEST_DEPS) + @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DHASHDEBUG $(serial)/hashmap.c $(TEST_LDFLAGS) -lib_mvcur$x : $(srcdir)/lib_mvcur.c $(TEST_DEPS) \ +lib_mvcur$x : $(serial)/lib_mvcur.c $(TEST_DEPS) \ ../@DFT_OBJ_SUBDIR@/dump_entry.o - @ECHO_LINK@ $(CC) -o $@ $(CCFLAGS) -DNCURSES_TEST -I$(srcdir)/../progs $(srcdir)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry.o $(TEST_LDFLAGS) + @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DNCURSES_TEST -I$(serial)/../../progs $(serial)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry.o $(TEST_LDFLAGS) ../@DFT_OBJ_SUBDIR@/dump_entry.o: - cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry.o: + cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry.o ############################################################################### # The remainder of this file is automatically generated during configuration diff --git a/ncurses/README b/ncurses/README index be4b8b00..aade721a 100644 --- a/ncurses/README +++ b/ncurses/README @@ -1,19 +1,2 @@ For discussion of the package internals, see hackguide.html in the misc directory. - -Here are some -D options you might need to compile with. -The 'configure' script gets most other definitions right automatically. - --DHAVE_SIGACTION if the sigaction function is present - --DHAVE_USLEEP if the usleep function is present - --DSVR4_ACTION if (e.g., svr4) you need _POSIX_SOURCE to have sigaction - --DSVR4_TERMIO if (e.g., svr4) you need _POSIX_SOURCE to have termio - --DOPT_MVCUR if you want mvcur() to cost its actions or you have a - terminal that doesn't have direct cursor addressing. - -There are several problems with strict POSIX systems so extra flags -or #define's may be needed. diff --git a/ncurses/SigAction.h b/ncurses/SigAction.h index efa3df22..9b5a31a8 100644 --- a/ncurses/SigAction.h +++ b/ncurses/SigAction.h @@ -32,7 +32,7 @@ ****************************************************************************/ /* - * $Id: SigAction.h,v 1.4 1998/02/11 12:13:55 tom Exp $ + * $Id: SigAction.h,v 1.5 1999/06/19 23:00:54 tom Exp $ * * This file exists to handle non-POSIX systems which don't have , * and usually no sigaction() nor @@ -41,6 +41,14 @@ #ifndef _SIGACTION_H #define _SIGACTION_H +#ifndef HAVE_SIGACTION +#define HAVE_SIGACTION 0 +#endif + +#ifndef HAVE_SIGVEC +#define HAVE_SIGVEC 0 +#endif + #if HAVE_SIGACTION #if !HAVE_TYPE_SIGACTION diff --git a/ncurses/base/MKkeyname.awk b/ncurses/base/MKkeyname.awk new file mode 100644 index 00000000..aaeb4743 --- /dev/null +++ b/ncurses/base/MKkeyname.awk @@ -0,0 +1,74 @@ +# $Id: MKkeyname.awk,v 1.17 1999/02/18 11:18:06 tom Exp $ +############################################################################## +# Copyright (c) 1999 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +BEGIN { + print "/* generated by MKkeyname.awk */" + print "" + print "#include " + print "#include " + print "#include " + print "#include " + print "#include " + print "" + print "const struct kn _nc_key_names[] = {" +} + +/^[^#]/ { + printf "\t{ \"%s\", %s },\n", $1, $1; + } + +END { + printf "\t{ 0, 0 }};\n" + print "" + print "NCURSES_CONST char *keyname(int c)" + print "{" + print "int i;" + print "static char name[20];" + print "char *p;" + print "" + print "\tfor (i = 0; _nc_key_names[i].name != 0; i++)" + print "\t\tif (_nc_key_names[i].code == c)" + print "\t\t\treturn (NCURSES_CONST char *)_nc_key_names[i].name;" + print "\tif (c >= 256) return \"UNKNOWN KEY\";" + print "\tp = name;" + print "\tif (c >= 128) {" + print "\t\tstrcpy(p, \"M-\");" + print "\t\tp += 2;" + print "\t\tc -= 128;" + print "\t}" + print "\tif (c < 0)" + print "\t\tsprintf(p, \"%d\", c);" + print "\telse if (c < 32)" + print "\t\tsprintf(p, \"^%c\", c + '@');" + print "\telse if (c == 127)" + print "\t\tstrcpy(p, \"^?\");" + print "\telse" + print "\t\tsprintf(p, \"%c\", c);" + print "\treturn (NCURSES_CONST char *)name;" + print "}" +} diff --git a/ncurses/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh similarity index 100% rename from ncurses/MKlib_gen.sh rename to ncurses/base/MKlib_gen.sh diff --git a/ncurses/MKunctrl.awk b/ncurses/base/MKunctrl.awk similarity index 97% rename from ncurses/MKunctrl.awk rename to ncurses/base/MKunctrl.awk index 5fef6682..0f441924 100644 --- a/ncurses/MKunctrl.awk +++ b/ncurses/base/MKunctrl.awk @@ -1,4 +1,4 @@ -# $Id: MKunctrl.awk,v 1.5 1998/02/11 12:13:55 tom Exp $ +# $Id: MKunctrl.awk,v 1.6 1998/06/06 18:18:07 tom Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -32,11 +32,11 @@ BEGIN { print "/* generated by MKunctrl.awk */" - print + print "" print "#include " - print + print "" print "#undef unctrl" - print + print "" } END { print "NCURSES_CONST char *unctrl(register chtype ch)" diff --git a/ncurses/base/README b/ncurses/base/README new file mode 100644 index 00000000..ffa16963 --- /dev/null +++ b/ncurses/base/README @@ -0,0 +1,7 @@ +-- $Id: README,v 1.1 1998/11/14 22:58:22 tom Exp $ + +The functions in this directory are the generic (not device-specific) modules +of ncurses. + +As a rule, these modules should not depend directly on term.h references and +associated terminfo function and variables. diff --git a/ncurses/define_key.c b/ncurses/base/define_key.c similarity index 91% rename from ncurses/define_key.c rename to ncurses/base/define_key.c index 20dd3e73..52dc6927 100644 --- a/ncurses/define_key.c +++ b/ncurses/base/define_key.c @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: define_key.c,v 1.2 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: define_key.c,v 1.4 1999/02/21 13:03:55 tom Exp $") int define_key(char *str, int keycode) @@ -41,14 +41,19 @@ define_key(char *str, int keycode) T((T_CALLED("define_key(%s,%d)"), _nc_visbuf(str), keycode)); if (keycode > 0) { - if (has_key(keycode)) { - if (_nc_remove_key(&(SP->_keytry), keycode)) + if (str != 0) { + define_key(str, 0); + } else if (has_key(keycode)) { + while (_nc_remove_key(&(SP->_keytry), keycode)) code = OK; } if (str != 0) { (void) _nc_add_to_try(&(SP->_keytry), str, keycode); code = OK; } + } else { + while (_nc_remove_string(&(SP->_keytry), str)) + code = OK; } returnCode(code); } diff --git a/ncurses/base/keybound.c b/ncurses/base/keybound.c new file mode 100644 index 00000000..c9aa0229 --- /dev/null +++ b/ncurses/base/keybound.c @@ -0,0 +1,45 @@ +/**************************************************************************** + * Copyright (c) 1999 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1999 * + ****************************************************************************/ + +#include + +MODULE_ID("$Id: keybound.c,v 1.1 1999/02/19 11:55:56 tom Exp $") + +/* + * Returns the count'th string definition which is associated with the + * given keycode. The result is malloc'd, must be freed by the caller. + */ + +char *keybound(int code, int count) +{ + return _nc_expand_try(SP->_key_ok, code, &count, 0); +} diff --git a/ncurses/keyok.c b/ncurses/base/keyok.c similarity index 93% rename from ncurses/keyok.c rename to ncurses/base/keyok.c index a0947d9e..a1385769 100644 --- a/ncurses/keyok.c +++ b/ncurses/base/keyok.c @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: keyok.c,v 1.2 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: keyok.c,v 1.3 1999/02/19 11:29:48 tom Exp $") /* * Enable (or disable) ncurses' interpretation of a keycode by adding (or @@ -47,22 +47,25 @@ MODULE_ID("$Id: keyok.c,v 1.2 1998/02/11 12:13:54 tom Exp $") int keyok(int c, bool flag) { int code = ERR; + int count = 0; char *s; T((T_CALLED("keyok(%d,%d)"), c, flag)); if (flag) { - if ((s = _nc_expand_try(SP->_key_ok, c, 0)) != 0 + while ((s = _nc_expand_try(SP->_key_ok, c, &count, 0)) != 0 && _nc_remove_key(&(SP->_key_ok), c)) { _nc_add_to_try(&(SP->_keytry), s, c); free(s); code = OK; + count = 0; } } else { - if ((s = _nc_expand_try(SP->_keytry, c, 0)) != 0 + while ((s = _nc_expand_try(SP->_keytry, c, &count, 0)) != 0 && _nc_remove_key(&(SP->_keytry), c)) { _nc_add_to_try(&(SP->_key_ok), s, c); free(s); code = OK; + count = 0; } } returnCode(code); diff --git a/ncurses/lib_addch.c b/ncurses/base/lib_addch.c similarity index 96% rename from ncurses/lib_addch.c rename to ncurses/base/lib_addch.c index 859c9caa..101d75ef 100644 --- a/ncurses/lib_addch.c +++ b/ncurses/base/lib_addch.c @@ -41,7 +41,7 @@ #include #include -MODULE_ID("$Id: lib_addch.c,v 1.39 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: lib_addch.c,v 1.42 1999/07/24 20:01:05 tom Exp $") /* * Ugly microtweaking alert. Everything from here to end of module is @@ -133,12 +133,7 @@ int waddch_literal(WINDOW *win, chtype ch) line = win->_line+win->_cury; - if (line->firstchar == _NOCHANGE) - line->firstchar = line->lastchar = x; - else if (x < line->firstchar) - line->firstchar = x; - else if (x > line->lastchar) - line->lastchar = x; + CHANGED_CELL(line,x); line->text[x++] = ch; @@ -174,8 +169,8 @@ int waddch_nosync(WINDOW *win, const chtype ch) /* the workhorse function -- add a character to the given window */ { int x, y; - int t; - const char *s; + int t = 0; + const char *s = 0; if ((ch & A_ALTCHARSET) || ((t = TextOf(ch)) > 127) diff --git a/ncurses/lib_addstr.c b/ncurses/base/lib_addstr.c similarity index 89% rename from ncurses/lib_addstr.c rename to ncurses/base/lib_addstr.c index 42e4a21d..9ac55e42 100644 --- a/ncurses/lib_addstr.c +++ b/ncurses/base/lib_addstr.c @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: lib_addstr.c,v 1.14 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_addstr.c,v 1.16 1998/06/28 00:38:29 tom Exp $") int waddnstr(WINDOW *win, const char *const astr, int n) @@ -76,11 +76,12 @@ waddchnstr(WINDOW *win, const chtype *const astr, int n) short y = win->_cury; short x = win->_curx; int code = OK; +struct ldat *line; T((T_CALLED("waddchnstr(%p,%p,%d)"), win, astr, n)); if (!win) - returnCode(ERR); + returnCode(ERR); if (n < 0) { const chtype *str; @@ -93,20 +94,9 @@ int code = OK; if (n == 0) returnCode(code); - if (win->_line[y].firstchar == _NOCHANGE) - { - win->_line[y].firstchar = x; - win->_line[y].lastchar = x+n-1; - } - else - { - if (x < win->_line[y].firstchar) - win->_line[y].firstchar = x; - if (x+n-1 > win->_line[y].lastchar) - win->_line[y].lastchar = x+n-1; - } - - memcpy(win->_line[y].text+x, astr, n*sizeof(*astr)); + line = &(win->_line[y]); + memcpy(line->text+x, astr, n*sizeof(*astr)); + CHANGED_RANGE(line, x, x+n-1); _nc_synchook(win); returnCode(code); diff --git a/ncurses/lib_beep.c b/ncurses/base/lib_beep.c similarity index 94% rename from ncurses/lib_beep.c rename to ncurses/base/lib_beep.c index 042aa971..3428aaf6 100644 --- a/ncurses/lib_beep.c +++ b/ncurses/base/lib_beep.c @@ -42,7 +42,7 @@ #include #include /* beep, flash */ -MODULE_ID("$Id: lib_beep.c,v 1.5 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_beep.c,v 1.7 1999/10/22 21:39:09 tom Exp $") /* * beep() @@ -54,16 +54,20 @@ MODULE_ID("$Id: lib_beep.c,v 1.5 1998/02/11 12:13:55 tom Exp $") int beep(void) { + int res = ERR; + T((T_CALLED("beep()"))); /* FIXME: should make sure that we are not in altchar mode */ if (bell) { TPUTS_TRACE("bell"); - return(putp(bell)); + res = putp(bell); + _nc_flush(); } else if (flash_screen) { TPUTS_TRACE("flash_screen"); - return(putp(flash_screen)); + res = putp(flash_screen); + _nc_flush(); } - else - returnCode(ERR); + + returnCode(res); } diff --git a/ncurses/lib_bkgd.c b/ncurses/base/lib_bkgd.c similarity index 100% rename from ncurses/lib_bkgd.c rename to ncurses/base/lib_bkgd.c diff --git a/ncurses/lib_box.c b/ncurses/base/lib_box.c similarity index 100% rename from ncurses/lib_box.c rename to ncurses/base/lib_box.c diff --git a/ncurses/lib_chgat.c b/ncurses/base/lib_chgat.c similarity index 100% rename from ncurses/lib_chgat.c rename to ncurses/base/lib_chgat.c diff --git a/ncurses/lib_clear.c b/ncurses/base/lib_clear.c similarity index 100% rename from ncurses/lib_clear.c rename to ncurses/base/lib_clear.c diff --git a/ncurses/lib_clearok.c b/ncurses/base/lib_clearok.c similarity index 100% rename from ncurses/lib_clearok.c rename to ncurses/base/lib_clearok.c diff --git a/ncurses/lib_clrbot.c b/ncurses/base/lib_clrbot.c similarity index 78% rename from ncurses/lib_clrbot.c rename to ncurses/base/lib_clrbot.c index 9dac8c27..cec34161 100644 --- a/ncurses/lib_clrbot.c +++ b/ncurses/base/lib_clrbot.c @@ -40,39 +40,35 @@ #include -MODULE_ID("$Id: lib_clrbot.c,v 1.13 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_clrbot.c,v 1.14 1998/06/28 00:36:26 tom Exp $") int wclrtobot(WINDOW *win) { int code = ERR; -chtype blank; -chtype *ptr, *end; -short y, startx; T((T_CALLED("wclrtobot(%p)"), win)); if (win) { - startx = win->_curx; - - T(("clearing from y = %d to y = %d with maxx = %d", win->_cury, win->_maxy, win->_maxx)); - - for (y = win->_cury; y <= win->_maxy; y++) { - end = &win->_line[y].text[win->_maxx]; - - blank = _nc_background(win); - for (ptr = &win->_line[y].text[startx]; ptr <= end; ptr++) - *ptr = blank; - - if (win->_line[y].firstchar > startx - || win->_line[y].firstchar == _NOCHANGE) - win->_line[y].firstchar = startx; - - win->_line[y].lastchar = win->_maxx; - - startx = 0; - } - _nc_synchook(win); - code = OK; + short y; + short startx = win->_curx; + chtype blank = _nc_background(win); + + T(("clearing from y = %d to y = %d with maxx = %d", win->_cury, win->_maxy, win->_maxx)); + + for (y = win->_cury; y <= win->_maxy; y++) { + struct ldat *line = &(win->_line[y]); + chtype *ptr = &(line->text[startx]); + chtype *end = &(line->text[win->_maxx]); + + CHANGED_TO_EOL(line, startx, win->_maxx); + + while (ptr <= end) + *ptr++ = blank; + + startx = 0; + } + _nc_synchook(win); + code = OK; } returnCode(code); } diff --git a/ncurses/lib_clreol.c b/ncurses/base/lib_clreol.c similarity index 73% rename from ncurses/lib_clreol.c rename to ncurses/base/lib_clreol.c index a418c509..0c752227 100644 --- a/ncurses/lib_clreol.c +++ b/ncurses/base/lib_clreol.c @@ -41,54 +41,51 @@ #include -MODULE_ID("$Id: lib_clreol.c,v 1.14 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_clreol.c,v 1.15 1998/06/28 00:32:20 tom Exp $") int wclrtoeol(WINDOW *win) { int code = ERR; -chtype blank; -chtype *ptr, *end; -short y, x; T((T_CALLED("wclrtoeol(%p)"), win)); if (win) { + chtype blank; + chtype *ptr, *end; + struct ldat *line; + short y = win->_cury; + short x = win->_curx; - y = win->_cury; - x = win->_curx; + /* + * If we have just wrapped the cursor, the clear applies to the + * new line, unless we are at the lower right corner. + */ + if (win->_flags & _WRAPPED + && y < win->_maxy) { + win->_flags &= ~_WRAPPED; + } - /* - * If we have just wrapped the cursor, the clear applies to the new - * line, unless we are at the lower right corner. - */ - if (win->_flags & _WRAPPED - && y < win->_maxy) { - win->_flags &= ~_WRAPPED; - } - - /* - * There's no point in clearing if we're not on a legal position, - * either. - */ - if (win->_flags & _WRAPPED - || y > win->_maxy - || x > win->_maxx) - returnCode(ERR); - - blank = _nc_background(win); - end = &win->_line[y].text[win->_maxx]; - - for (ptr = &win->_line[y].text[x]; ptr <= end; ptr++) - *ptr = blank; - - if (win->_line[y].firstchar > win->_curx - || win->_line[y].firstchar == _NOCHANGE) - win->_line[y].firstchar = win->_curx; - - win->_line[y].lastchar = win->_maxx; - - _nc_synchook(win); - code = OK; + /* + * There's no point in clearing if we're not on a legal + * position, either. + */ + if (win->_flags & _WRAPPED + || y > win->_maxy + || x > win->_maxx) + returnCode(ERR); + + blank = _nc_background(win); + line = &win->_line[y]; + CHANGED_TO_EOL(line, x, win->_maxx); + + ptr = &(line->text[x]); + end = &(line->text[win->_maxx]); + + while (ptr <= end) + *ptr++ = blank; + + _nc_synchook(win); + code = OK; } returnCode(code); } diff --git a/ncurses/lib_color.c b/ncurses/base/lib_color.c similarity index 77% rename from ncurses/lib_color.c rename to ncurses/base/lib_color.c index cf86420d..297a14c3 100644 --- a/ncurses/lib_color.c +++ b/ncurses/base/lib_color.c @@ -41,13 +41,7 @@ #include -MODULE_ID("$Id: lib_color.c,v 1.24 1998/02/11 12:13:58 tom Exp $") - -/* - * Only 8 ANSI colors are defined; the ISO 6429 control sequences work only - * for 8 values (0-7). - */ -#define MAX_ANSI_COLOR 8 +MODULE_ID("$Id: lib_color.c,v 1.36 1999/10/03 00:20:37 Philippe.Blain Exp $") /* * These should be screen structure members. They need to be globals for @@ -89,33 +83,82 @@ static const color_t hls_palette[] = {0, 50, 100}, /* COLOR_WHITE */ }; -int start_color(void) +/* + * SVr4 curses is known to interchange color codes (1,4) and (3,6), possibly + * to maintain compatibility with a pre-ANSI scheme. The same scheme is + * also used in the FreeBSD syscons. + */ +static int toggled_colors(int c) { - T((T_CALLED("start_color()"))); + if (c < 16) { + static const int table[] = + { 0, 4, 2, 6, 1, 5, 3, 7, + 8, 12, 10, 14, 9, 13, 11, 15}; + c = table[c]; + } + return c; +} + +static void set_background_color(int bg, int (*outc)(int)) +{ + if (set_a_background) + { + TPUTS_TRACE("set_a_background"); + tputs(tparm(set_a_background, bg), 1, outc); + } + else + { + TPUTS_TRACE("set_background"); + tputs(tparm(set_background, toggled_colors(bg)), 1, outc); + } +} -#ifdef orig_pair - if (orig_pair != NULL) +static void set_foreground_color(int fg, int (*outc)(int)) +{ + if (set_a_foreground) + { + TPUTS_TRACE("set_a_foreground"); + tputs(tparm(set_a_foreground, fg), 1, outc); + } + else { + TPUTS_TRACE("set_foreground"); + tputs(tparm(set_foreground, toggled_colors(fg)), 1, outc); + } +} + +static bool set_original_colors(void) +{ + if (orig_pair != 0) { TPUTS_TRACE("orig_pair"); putp(orig_pair); + return TRUE; } -#endif /* orig_pair */ -#ifdef orig_colors - if (orig_colors != NULL) + else if (orig_colors != NULL) { TPUTS_TRACE("orig_colors"); putp(orig_colors); + return TRUE; } -#endif /* orig_colors */ -#if defined(orig_pair) && defined(orig_colors) - if (!orig_pair && !orig_colors) - returnCode(ERR); -#endif /* defined(orig_pair) && defined(orig_colors) */ + return FALSE; +} + +int start_color(void) +{ + T((T_CALLED("start_color()"))); + + if (set_original_colors() != TRUE) + { + set_foreground_color(COLOR_WHITE, _nc_outch); + set_background_color(COLOR_BLACK, _nc_outch); + } + if (max_pairs != -1) COLOR_PAIRS = SP->_pair_count = max_pairs; else returnCode(ERR); - SP->_color_pairs = typeCalloc(unsigned short, max_pairs); + if ((SP->_color_pairs = typeCalloc(unsigned short, max_pairs)) == 0) + returnCode(ERR); SP->_color_pairs[0] = PAIR_OF(COLOR_WHITE, COLOR_BLACK); if (max_colors != -1) COLORS = SP->_color_count = max_colors; @@ -123,32 +166,24 @@ int start_color(void) returnCode(ERR); SP->_coloron = 1; - SP->_color_table = malloc(sizeof(color_t) * COLORS); -#ifdef hue_lightness_saturation + if ((SP->_color_table = typeMalloc(color_t, COLORS)) == 0) + returnCode(ERR); if (hue_lightness_saturation) memcpy(SP->_color_table, hls_palette, sizeof(color_t) * COLORS); else -#endif /* hue_lightness_saturation */ memcpy(SP->_color_table, cga_palette, sizeof(color_t) * COLORS); - if (orig_colors) - { - TPUTS_TRACE("orig_colors"); - putp(orig_colors); - } - T(("started color: COLORS = %d, COLOR_PAIRS = %d", COLORS, COLOR_PAIRS)); returnCode(OK); } -#ifdef hue_lightness_saturation /* This function was originally written by Daniel Weaver */ static void rgb2hls(short r, short g, short b, short *h, short *l, short *s) /* convert RGB to HLS system */ { short min, max, t; - + if ((min = g < r ? g : r) > b) min = b; if ((max = g > r ? g : r) < b) max = b; @@ -178,7 +213,6 @@ static void rgb2hls(short r, short g, short b, short *h, short *l, short *s) *h = t % 360; } -#endif /* hue_lightness_saturation */ /* * Extension (1997/1/18) - Allow negative f/b values to set default color @@ -186,6 +220,8 @@ static void rgb2hls(short r, short g, short b, short *h, short *l, short *s) */ int init_pair(short pair, short f, short b) { + unsigned result; + T((T_CALLED("init_pair(%d,%d,%d)"), pair, f, b)); if ((pair < 1) || (pair >= COLOR_PAIRS)) @@ -207,16 +243,37 @@ int init_pair(short pair, short f, short b) returnCode(ERR); /* - * FIXME: when a pair's content is changed, replace its colors - * (if pair was initialized before a screen update is performed - * replacing original pair colors with the new ones) + * When a pair's content is changed, replace its colors (if pair was + * initialized before a screen update is performed replacing original + * pair colors with the new ones). */ - - SP->_color_pairs[pair] = PAIR_OF(f,b); + result = PAIR_OF(f,b); + if (SP->_color_pairs[pair] != 0 + && SP->_color_pairs[pair] != result) { + int y, x; + attr_t z = COLOR_PAIR(pair); + + for (y = 0; y <= curscr->_maxy; y++) { + struct ldat *ptr = &(curscr->_line[y]); + bool changed = FALSE; + for (x = 0; x <= curscr->_maxx; x++) { + if ((ptr->text[x] & A_COLOR) == z) { + /* Set the old cell to zero to ensure it will be + updated on the next doupdate() */ + ptr->text[x] = 0; + CHANGED_CELL(ptr,x); + changed = TRUE; + } + } + if (changed) + _nc_make_oldhash(y); + } + } + SP->_color_pairs[pair] = result; if (initialize_pair) { - const color_t *tp = hue_lightness_saturation ? hls_palette : cga_palette; + const color_t *tp = hue_lightness_saturation ? hls_palette : cga_palette; T(("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)", pair, @@ -239,37 +296,32 @@ int init_pair(short pair, short f, short b) int init_color(short color, short r, short g, short b) { T((T_CALLED("init_color(%d,%d,%d,%d)"), color, r, g, b)); -#ifdef initialize_color + if (initialize_color == NULL) returnCode(ERR); -#endif /* initialize_color */ if (color < 0 || color >= COLORS) returnCode(ERR); if (r < 0 || r > 1000 || g < 0 || g > 1000 || b < 0 || b > 1000) returnCode(ERR); -#ifdef hue_lightness_saturation if (hue_lightness_saturation) rgb2hls(r, g, b, &SP->_color_table[color].red, &SP->_color_table[color].green, &SP->_color_table[color].blue); else -#endif /* hue_lightness_saturation */ { SP->_color_table[color].red = r; SP->_color_table[color].green = g; SP->_color_table[color].blue = b; } -#ifdef initialize_color if (initialize_color) { TPUTS_TRACE("initialize_color"); putp(tparm(initialize_color, color, r, g, b)); } -#endif /* initialize_color */ returnCode(OK); } @@ -282,8 +334,7 @@ bool can_change_color(void) bool has_colors(void) { T((T_CALLED("has_colors()"))); - returnCode (((orig_pair != NULL || orig_colors != NULL) - && (max_colors != -1) && (max_pairs != -1) + returnCode (((max_colors != -1) && (max_pairs != -1) && (((set_foreground != NULL) && (set_background != NULL)) || ((set_a_foreground != NULL) @@ -294,7 +345,7 @@ bool has_colors(void) int color_content(short color, short *r, short *g, short *b) { T((T_CALLED("color_content(%d,%p,%p,%p)"), color, r, g, b)); - if (color < 0 || color > COLORS) + if (color < 0 || color >= COLORS) returnCode(ERR); if (r) *r = SP->_color_table[color].red; @@ -307,7 +358,7 @@ int pair_content(short pair, short *f, short *b) { T((T_CALLED("pair_content(%d,%p,%p)"), pair, f, b)); - if ((pair < 0) || (pair > COLOR_PAIRS)) + if ((pair < 0) || (pair >= COLOR_PAIRS)) returnCode(ERR); if (f) *f = ((SP->_color_pairs[pair] >> C_SHIFT) & C_MASK); if (b) *b = (SP->_color_pairs[pair] & C_MASK); @@ -315,29 +366,10 @@ int pair_content(short pair, short *f, short *b) returnCode(OK); } -/* - * SVr4 curses is known to interchange color codes (1,4) and (3,6), possibly - * to maintain compatibility with a pre-ANSI scheme. The same scheme is - * also used in the FreeBSD syscons. - */ -static int toggled_colors(int c) -{ - if (c < 16) { - static const int table[] = - { 0, 4, 2, 6, 1, 5, 3, 7, - 8, 12, 10, 14, 9, 13, 11, 15}; - c = table[c]; - } - return c; -} - -void _nc_do_color(int pair, bool reverse, int (*outc)(int)) +void _nc_do_color(int pair, bool reverse, int (*outc)(int)) { short fg, bg; - if (reverse) - pair = -pair; - if (pair == 0) { if (orig_pair) @@ -345,6 +377,16 @@ void _nc_do_color(int pair, bool reverse, int (*outc)(int)) TPUTS_TRACE("orig_pair"); tputs(orig_pair, 1, outc); } + else if (set_color_pair) + { + TPUTS_TRACE("set_color_pair"); + tputs(tparm(set_color_pair, pair), 1, outc); + } + else + { + set_foreground_color(COLOR_WHITE, outc); + set_background_color(COLOR_BLACK, outc); + } } else { @@ -366,42 +408,21 @@ void _nc_do_color(int pair, bool reverse, int (*outc)(int)) if (fg == C_MASK || bg == C_MASK) { - if (orig_pair) - { - TPUTS_TRACE("orig_pair"); - tputs(orig_pair, 1, outc); - } - else + if (set_original_colors() != TRUE) { - TPUTS_TRACE("orig_colors"); - tputs(orig_colors, 1, outc); + if (fg == C_MASK) + set_foreground_color(COLOR_WHITE, outc); + if (bg == C_MASK) + set_background_color(COLOR_BLACK, outc); } } if (fg != C_MASK) { - if (set_a_foreground && fg <= MAX_ANSI_COLOR) - { - TPUTS_TRACE("set_a_foreground"); - tputs(tparm(set_a_foreground, fg), 1, outc); - } - else - { - TPUTS_TRACE("set_foreground"); - tputs(tparm(set_foreground, toggled_colors(fg)), 1, outc); - } + set_foreground_color(fg, outc); } if (bg != C_MASK) { - if (set_a_background && bg <= MAX_ANSI_COLOR) - { - TPUTS_TRACE("set_a_background"); - tputs(tparm(set_a_background, bg), 1, outc); - } - else - { - TPUTS_TRACE("set_background"); - tputs(tparm(set_background, toggled_colors(bg)), 1, outc); - } + set_background_color(bg, outc); } } } diff --git a/ncurses/base/lib_colorset.c b/ncurses/base/lib_colorset.c new file mode 100644 index 00000000..d9fc5c28 --- /dev/null +++ b/ncurses/base/lib_colorset.c @@ -0,0 +1,56 @@ +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Juergen Pfeifer 1998 * + ****************************************************************************/ + +/* +** lib_colorset.c +** +** The routine wcolor_set(). +** +*/ + +#include +#include + +MODULE_ID("$Id: lib_colorset.c,v 1.5 1999/05/16 17:13:43 juergen Exp $") + +int wcolor_set(WINDOW *win, short color_pair_number, void *opts) +{ + T((T_CALLED("wcolor_set(%p,%d)"), win, color_pair_number)); + if (win && !opts && (color_pair_number >= 0) && (color_pair_number < COLOR_PAIRS)) { + T(("... current %ld", (long) PAIR_NUMBER(win->_attrs))); + toggle_attr_on(win->_attrs,COLOR_PAIR(color_pair_number)); + returnCode(OK); + } else + returnCode(ERR); +} + + diff --git a/ncurses/lib_delch.c b/ncurses/base/lib_delch.c similarity index 81% rename from ncurses/lib_delch.c rename to ncurses/base/lib_delch.c index 6dc6fef4..0169d31a 100644 --- a/ncurses/lib_delch.c +++ b/ncurses/base/lib_delch.c @@ -40,35 +40,29 @@ #include -MODULE_ID("$Id: lib_delch.c,v 1.7 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: lib_delch.c,v 1.8 1998/06/28 00:28:17 tom Exp $") int wdelch(WINDOW *win) { int code = ERR; -chtype *temp1, *temp2; -chtype *end; -chtype blank = _nc_background(win); T((T_CALLED("wdelch(%p)"), win)); if (win) { - end = &win->_line[win->_cury].text[win->_maxx]; - temp2 = &win->_line[win->_cury].text[win->_curx + 1]; - temp1 = temp2 - 1; - - while (temp1 < end) - *temp1++ = *temp2++; - - *temp1 = blank; - - win->_line[win->_cury].lastchar = win->_maxx; - - if (win->_line[win->_cury].firstchar == _NOCHANGE - || win->_line[win->_cury].firstchar > win->_curx) - win->_line[win->_cury].firstchar = win->_curx; - - _nc_synchook(win); - code = OK; + chtype blank = _nc_background(win); + struct ldat *line = &(win->_line[win->_cury]); + chtype *end = &(line->text[win->_maxx]); + chtype *temp2 = &(line->text[win->_curx + 1]); + chtype *temp1 = temp2 - 1; + + CHANGED_TO_EOL(line, win->_curx, win->_maxx); + while (temp1 < end) + *temp1++ = *temp2++; + + *temp1 = blank; + + _nc_synchook(win); + code = OK; } returnCode(code); } diff --git a/ncurses/lib_delwin.c b/ncurses/base/lib_delwin.c similarity index 100% rename from ncurses/lib_delwin.c rename to ncurses/base/lib_delwin.c diff --git a/ncurses/lib_dft_fgbg.c b/ncurses/base/lib_dft_fgbg.c similarity index 100% rename from ncurses/lib_dft_fgbg.c rename to ncurses/base/lib_dft_fgbg.c diff --git a/ncurses/lib_echo.c b/ncurses/base/lib_echo.c similarity index 96% rename from ncurses/lib_echo.c rename to ncurses/base/lib_echo.c index 569ab1a1..4ccf97ff 100644 --- a/ncurses/lib_echo.c +++ b/ncurses/base/lib_echo.c @@ -42,9 +42,8 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_echo.c,v 1.2 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: lib_echo.c,v 1.3 1998/10/12 13:15:33 Alexander.V.Lukyanov Exp $") int echo(void) { diff --git a/ncurses/lib_endwin.c b/ncurses/base/lib_endwin.c similarity index 91% rename from ncurses/lib_endwin.c rename to ncurses/base/lib_endwin.c index efcc188e..31b6e516 100644 --- a/ncurses/lib_endwin.c +++ b/ncurses/base/lib_endwin.c @@ -42,7 +42,7 @@ #include #include -MODULE_ID("$Id: lib_endwin.c,v 1.14 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_endwin.c,v 1.17 1999/06/12 23:01:46 tom Exp $") int endwin(void) @@ -50,11 +50,12 @@ endwin(void) T((T_CALLED("endwin()"))); if (SP) { - SP->_endwin = TRUE; - SP->_mouse_wrap(SP); - _nc_screen_wrap(); - _nc_mvcur_wrap(); /* wrap up cursor addressing */ + SP->_endwin = TRUE; + SP->_mouse_wrap(SP); + _nc_screen_wrap(); + _nc_mvcur_wrap(); /* wrap up cursor addressing */ + returnCode(reset_shell_mode()); } - returnCode(reset_shell_mode()); + returnCode(ERR); } diff --git a/ncurses/lib_erase.c b/ncurses/base/lib_erase.c similarity index 100% rename from ncurses/lib_erase.c rename to ncurses/base/lib_erase.c diff --git a/ncurses/lib_flash.c b/ncurses/base/lib_flash.c similarity index 94% rename from ncurses/lib_flash.c rename to ncurses/base/lib_flash.c index 49751acc..d0d607f6 100644 --- a/ncurses/lib_flash.c +++ b/ncurses/base/lib_flash.c @@ -42,7 +42,7 @@ #include #include /* beep, flash */ -MODULE_ID("$Id: lib_flash.c,v 1.2 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_flash.c,v 1.4 1999/10/22 21:39:06 tom Exp $") /* * flash() @@ -54,16 +54,20 @@ MODULE_ID("$Id: lib_flash.c,v 1.2 1998/02/11 12:13:55 tom Exp $") int flash(void) { + int res = ERR; + T((T_CALLED("flash()"))); /* FIXME: should make sure that we are not in altchar mode */ if (flash_screen) { TPUTS_TRACE("flash_screen"); - returnCode(putp(flash_screen)); + res = putp(flash_screen); + _nc_flush(); } else if (bell) { TPUTS_TRACE("bell"); - returnCode(putp(bell)); + res = putp(bell); + _nc_flush(); } - else - returnCode(ERR); + + returnCode(res); } diff --git a/ncurses/lib_freeall.c b/ncurses/base/lib_freeall.c similarity index 91% rename from ncurses/lib_freeall.c rename to ncurses/base/lib_freeall.c index fe756bb4..324e7a28 100644 --- a/ncurses/lib_freeall.c +++ b/ncurses/base/lib_freeall.c @@ -30,16 +30,16 @@ * Author: Thomas E. Dickey 1996,1997 * ****************************************************************************/ -#define HAVE_NC_FREEALL 1 - #include -#include +#include + +#if HAVE_NC_FREEALL #if HAVE_LIBDBMALLOC extern int malloc_errfd; /* FIXME */ #endif -MODULE_ID("$Id: lib_freeall.c,v 1.11 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: lib_freeall.c,v 1.15 1999/10/22 21:40:10 tom Exp $") static void free_slk(SLK *p) { @@ -50,16 +50,6 @@ static void free_slk(SLK *p) } } -void _nc_free_termtype(struct termtype *p, int base) -{ - if (p != 0) { - FreeIfNeeded(p->term_names); - FreeIfNeeded(p->str_table); - if (base) - free(p); - } -} - static void free_tries(struct tries *p) { struct tries *q; @@ -111,14 +101,14 @@ void _nc_freeall(void) free_slk(SP->_slk); FreeIfNeeded(SP->_color_pairs); FreeIfNeeded(SP->_color_table); - _nc_set_buffer(SP->_ofp, FALSE); #if !BROKEN_LINKER FreeAndNull(SP); #endif } if (cur_term != 0) { - _nc_free_termtype(&(cur_term->type), TRUE); + _nc_free_termtype(&(cur_term->type)); + free(cur_term); } #ifdef TRACE @@ -137,3 +127,6 @@ void _nc_free_and_exit(int code) _nc_freeall(); exit(code); } +#else +void _nc_freeall(void) { } +#endif diff --git a/ncurses/lib_getch.c b/ncurses/base/lib_getch.c similarity index 90% rename from ncurses/lib_getch.c rename to ncurses/base/lib_getch.c index 337cc2ca..b740885b 100644 --- a/ncurses/lib_getch.c +++ b/ncurses/base/lib_getch.c @@ -40,17 +40,48 @@ #include -MODULE_ID("$Id: lib_getch.c,v 1.40 1998/02/11 12:13:58 tom Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.43 1999/03/08 02:35:10 tom Exp $") #include int ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */ +#ifdef USE_EMX_MOUSE +# include +static int +kbd_mouse_read(unsigned char *p) +{ +fd_set fdset; +int nums = SP->_ifd+1; + + for (;;) { + FD_ZERO(&fdset); + FD_SET(SP->_checkfd, &fdset); + if (SP->_mouse_fd >= 0) { + FD_SET(SP->_mouse_fd, &fdset); + if (SP->_mouse_fd > SP->_checkfd) + nums = SP->_mouse_fd+1; + } + if (select(nums, &fdset, NULL, NULL, NULL) >= 0) { + int n; + + if (FD_ISSET(SP->_mouse_fd, &fdset)) /* Prefer mouse */ + n = read(SP->_mouse_fd, p, 1); + else + n = read(SP->_ifd, p, 1); + return n; + } + if (errno != EINTR) + return -1; + } +} +#endif /* USE_EMX_MOUSE */ + static inline int fifo_peek(void) { int ch = SP->_fifo[peek]; T(("peeking at %d", peek)); - + p_inc(); return ch; } @@ -69,7 +100,7 @@ int ch; } else h_inc(); - + #ifdef TRACE if (_nc_tracing & TRACE_IEVENT) _nc_fifo_dump(); #endif @@ -88,8 +119,8 @@ again: errno = 0; #endif -#if USE_GPM_SUPPORT - if ((SP->_mouse_fd >= 0) +#if USE_GPM_SUPPORT + if ((SP->_mouse_fd >= 0) && (_nc_timed_wait(3, -1, (int *)0) & 2)) { SP->_mouse_event(SP); @@ -99,17 +130,21 @@ again: #endif { unsigned char c2=0; +#ifdef USE_EMX_MOUSE + n = kbd_mouse_read(&c2); +#else n = read(SP->_ifd, &c2, 1); - ch = c2; +#endif + ch = c2 & 0xff; } #ifdef HIDE_EINTR /* * Under System V curses with non-restarting signals, getch() returns - * with value ERR when a handled signal keeps it from completing. + * with value ERR when a handled signal keeps it from completing. * If signals restart system calls, OTOH, the signal is invisible * except to its handler. - * + * * We don't want this difference to show. This piece of code * tries to make it look like we always have restarting signals. */ @@ -194,8 +229,9 @@ int ch; if (wgetch_should_refresh(win)) wrefresh(win); - if (!win->_notimeout && (win->_delay >= 0 || SP->_cbreak > 1)) { - int delay; + if (!win->_notimeout && (win->_delay >= 0 || SP->_cbreak > 1)) + { + int delay; T(("timed delay in wgetch()")); if (SP->_cbreak > 1) @@ -211,7 +247,8 @@ int ch; /* else go on to read data available */ } - if (win->_use_keypad) { + if (win->_use_keypad) + { /* * This is tricky. We only want to get special-key * events one at a time. But we want to accumulate diff --git a/ncurses/lib_getstr.c b/ncurses/base/lib_getstr.c similarity index 97% rename from ncurses/lib_getstr.c rename to ncurses/base/lib_getstr.c index 33a637ed..485c6e35 100644 --- a/ncurses/lib_getstr.c +++ b/ncurses/base/lib_getstr.c @@ -42,7 +42,7 @@ #include #include -MODULE_ID("$Id: lib_getstr.c,v 1.19 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: lib_getstr.c,v 1.20 1998/12/20 00:16:01 tom Exp $") /* * This wipes out the last character, no matter whether it was a tab, control @@ -84,7 +84,7 @@ int y, x; if (!win) returnCode(ERR); - _nc_get_curterm(&buf); + _nc_get_tty_mode(&buf); oldnl = SP->_nl; oldecho = SP->_echo; @@ -180,7 +180,7 @@ int y, x; SP->_raw = oldraw; SP->_cbreak = oldcbreak; - _nc_set_curterm(&buf); + _nc_set_tty_mode(&buf); *str = '\0'; if (ch == ERR) diff --git a/ncurses/lib_hline.c b/ncurses/base/lib_hline.c similarity index 88% rename from ncurses/lib_hline.c rename to ncurses/base/lib_hline.c index d3b3f2dc..3b0a602e 100644 --- a/ncurses/lib_hline.c +++ b/ncurses/base/lib_hline.c @@ -42,37 +42,32 @@ #include -MODULE_ID("$Id: lib_hline.c,v 1.2 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_hline.c,v 1.4 1998/06/28 00:11:01 tom Exp $") int whline(WINDOW *win, chtype ch, int n) { int code = ERR; -short line; short start; short end; T((T_CALLED("whline(%p,%s,%d)"), win, _tracechtype(ch), n)); if (win) { - line = win->_cury; + struct ldat *line = &(win->_line[win->_cury]); + start = win->_curx; end = start + n - 1; if (end > win->_maxx) end = win->_maxx; - if (win->_line[line].firstchar == _NOCHANGE - || win->_line[line].firstchar > start) - win->_line[line].firstchar = start; - if (win->_line[line].lastchar == _NOCHANGE - || win->_line[line].lastchar < start) - win->_line[line].lastchar = end; + CHANGED_RANGE(line, start, end); if (ch == 0) ch = ACS_HLINE; ch = _nc_render(win, ch); while ( end >= start) { - win->_line[line].text[end] = ch; + line->text[end] = ch; end--; } code = OK; diff --git a/ncurses/lib_immedok.c b/ncurses/base/lib_immedok.c similarity index 100% rename from ncurses/lib_immedok.c rename to ncurses/base/lib_immedok.c diff --git a/ncurses/lib_inchstr.c b/ncurses/base/lib_inchstr.c similarity index 100% rename from ncurses/lib_inchstr.c rename to ncurses/base/lib_inchstr.c diff --git a/ncurses/lib_initscr.c b/ncurses/base/lib_initscr.c similarity index 89% rename from ncurses/lib_initscr.c rename to ncurses/base/lib_initscr.c index e33f0b34..9a89a077 100644 --- a/ncurses/lib_initscr.c +++ b/ncurses/base/lib_initscr.c @@ -45,12 +45,13 @@ #include /* needed for ISC */ #endif -MODULE_ID("$Id: lib_initscr.c,v 1.21 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: lib_initscr.c,v 1.26 1998/12/19 23:10:09 tom Exp $") WINDOW *initscr(void) { static bool initialized = FALSE; -const char *name; +NCURSES_CONST char *name; +int value; T((T_CALLED("initscr()"))); /* Portable applications must not call initscr() more than once */ @@ -66,25 +67,12 @@ const char *name; } /* allow user to set maximum escape delay from the environment */ - if ((name = getenv("ESCDELAY")) != 0) - ESCDELAY = atoi(getenv("ESCDELAY")); + if ((value = _nc_getenv_num("ESCDELAY")) >= 0) { + ESCDELAY = value; + } /* def_shell_mode - done in newterm/_nc_setupscreen */ def_prog_mode(); } returnWin(stdscr); } - -char *termname(void) -{ -char *term = getenv("TERM"); -static char ret[MAX_ALIAS]; - - T(("termname() called")); - - if (term != 0) { - (void) strncpy(ret, term, sizeof(ret) - 1); - term = ret; - } - return term; -} diff --git a/ncurses/lib_insch.c b/ncurses/base/lib_insch.c similarity index 83% rename from ncurses/lib_insch.c rename to ncurses/base/lib_insch.c index ebee1788..ccc5ff5d 100644 --- a/ncurses/lib_insch.c +++ b/ncurses/base/lib_insch.c @@ -42,31 +42,26 @@ #include -MODULE_ID("$Id: lib_insch.c,v 1.9 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_insch.c,v 1.10 1998/06/28 00:26:52 tom Exp $") int winsch(WINDOW *win, chtype c) { int code = ERR; -chtype *temp1, *temp2; -chtype *end; T((T_CALLED("winsch(%p, %s)"), win, _tracechtype(c))); if (win) { - end = &win->_line[win->_cury].text[win->_curx]; - temp1 = &win->_line[win->_cury].text[win->_maxx]; - temp2 = temp1 - 1; + struct ldat *line = &(win->_line[win->_cury]); + chtype *end = &(line->text[win->_curx]); + chtype *temp1 = &(line->text[win->_maxx]); + chtype *temp2 = temp1 - 1; - while (temp1 > end) - *temp1-- = *temp2--; - - *temp1 = _nc_render(win, c); - - win->_line[win->_cury].lastchar = win->_maxx; - if (win->_line[win->_cury].firstchar == _NOCHANGE - || win->_line[win->_cury].firstchar > win->_curx) - win->_line[win->_cury].firstchar = win->_curx; - code = OK; + CHANGED_TO_EOL(line, win->_curx, win->_maxx); + while (temp1 > end) + *temp1-- = *temp2--; + + *temp1 = _nc_render(win, c); + code = OK; } returnCode(code); } diff --git a/ncurses/lib_insdel.c b/ncurses/base/lib_insdel.c similarity index 100% rename from ncurses/lib_insdel.c rename to ncurses/base/lib_insdel.c diff --git a/ncurses/lib_insstr.c b/ncurses/base/lib_insstr.c similarity index 96% rename from ncurses/lib_insstr.c rename to ncurses/base/lib_insstr.c index 0da8c220..cba14731 100644 --- a/ncurses/lib_insstr.c +++ b/ncurses/base/lib_insstr.c @@ -43,7 +43,7 @@ #include #include -MODULE_ID("$Id: lib_insstr.c,v 1.12 1998/02/23 12:12:16 tom Exp $") +MODULE_ID("$Id: lib_insstr.c,v 1.13 1999/03/14 00:27:21 tom Exp $") int winsnstr(WINDOW *win, const char *s, int n) { @@ -53,7 +53,7 @@ short ox ; const unsigned char *str = (const unsigned char *)s; const unsigned char *cp; - T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbuf(str), n)); + T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbuf(s), n)); if (win && str) { oy = win->_cury; ox = win->_curx; diff --git a/ncurses/lib_instr.c b/ncurses/base/lib_instr.c similarity index 100% rename from ncurses/lib_instr.c rename to ncurses/base/lib_instr.c diff --git a/ncurses/lib_isendwin.c b/ncurses/base/lib_isendwin.c similarity index 96% rename from ncurses/lib_isendwin.c rename to ncurses/base/lib_isendwin.c index 0ed2494d..60015fca 100644 --- a/ncurses/lib_isendwin.c +++ b/ncurses/base/lib_isendwin.c @@ -41,9 +41,9 @@ #include -MODULE_ID("$Id: lib_isendwin.c,v 1.3 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: lib_isendwin.c,v 1.4 1998/04/11 22:52:32 tom Exp $") -int isendwin(void) +bool isendwin(void) { if (SP == NULL) return FALSE; diff --git a/ncurses/lib_leaveok.c b/ncurses/base/lib_leaveok.c similarity index 95% rename from ncurses/lib_leaveok.c rename to ncurses/base/lib_leaveok.c index 063ab447..e83285d7 100644 --- a/ncurses/lib_leaveok.c +++ b/ncurses/base/lib_leaveok.c @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: lib_leaveok.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: lib_leaveok.c,v 1.3 1998/03/21 22:54:20 jtc Exp $") int leaveok(WINDOW *win, bool flag) { @@ -49,10 +49,6 @@ int leaveok(WINDOW *win, bool flag) if (win) { win->_leaveok = flag; - if (flag == TRUE) - curs_set(0); - else - curs_set(1); returnCode(OK); } else diff --git a/ncurses/lib_mouse.c b/ncurses/base/lib_mouse.c similarity index 78% rename from ncurses/lib_mouse.c rename to ncurses/base/lib_mouse.c index c4f510db..d34d4834 100644 --- a/ncurses/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,7 +36,7 @@ * devices. * * The first method used is xterm's internal mouse-tracking facility. - * The second (not yet implemented) will be Alessandro Rubini's GPM server. + * The second is Alessandro Rubini's GPM server. * * Notes for implementors of new mouse-interface methods: * @@ -63,17 +63,29 @@ * used yet, and a couple of bits open at the high end. */ +#ifdef __EMX__ +# include "io.h" +# include "fcntl.h" +# define INCL_DOS +# define INCL_VIO +# define INCL_KBD +# define INCL_MOU +# define INCL_DOSPROCESS +# include /* Need to include before the others */ +#endif + #include #include #if USE_GPM_SUPPORT -#ifndef LINT /* don't need this for llib-lncurses */ -#undef buttons /* term.h defines this, and gpm uses it! */ +#ifndef LINT /* don't need this for llib-lncurses */ +#undef buttons /* term.h defines this, and gpm uses it! */ #include +#include /* defines KG_* macros */ #endif #endif -MODULE_ID("$Id: lib_mouse.c,v 1.35 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.45 1999/10/22 21:39:02 tom Exp $") #define MY_TRACE TRACE_ICALLS|TRACE_IEVENT @@ -117,24 +129,104 @@ static void _trace_slot(const char *tag) _tracef(tag); for (ep = events; ep < events + EV_MAX; ep++) - _tracef("mouse event queue slot %d = %s", ep-events, _tracemouse(ep)); + _tracef("mouse event queue slot %ld = %s", + (long) (ep - events), + _tracemouse(ep)); } #endif -/* FIXME: The list of names should be configurable */ -static int is_xterm(const char *name) +#ifdef USE_EMX_MOUSE + +# define TOP_ROW 0 +# define LEFT_COL 0 + +static int mouse_wfd; +static int mouse_thread; +static int mouse_activated; +static char mouse_buttons[] = { 0, 1, 3, 2}; + + +# define M_FD(sp) sp->_mouse_fd + +static void +write_event(int down, int button, int x, int y) { - return (!strncmp(name, "xterm", 5) - || !strncmp(name, "rxvt", 4) - || !strncmp(name, "kterm", 5) - || !strncmp(name, "color_xterm", 11)); + char buf[6]; + unsigned long ignore; + + strcpy(buf, key_mouse); + buf[3] = ' ' + (button - 1) + (down ? 0 : 0x40); + buf[4] = ' ' + x - LEFT_COL + 1; + buf[5] = ' ' + y - TOP_ROW + 1; + DosWrite(mouse_wfd, buf, 6, &ignore); } +static void +mouse_server(unsigned long ignored GCC_UNUSED) +{ + unsigned short fWait = MOU_WAIT; + /* NOPTRRECT mourt = { 0,0,24,79 }; */ + MOUEVENTINFO mouev; + HMOU hmou; + unsigned short mask = MOUSE_BN1_DOWN | MOUSE_BN2_DOWN | MOUSE_BN3_DOWN; + int oldstate = 0; + char errmess[] = "Unexpected termination of mouse thread\r\n"; + unsigned long ignore; + + /* open the handle for the mouse */ + if (MouOpen(NULL,&hmou) == 0) { + + if (MouSetEventMask(&mask,hmou) == 0 + && MouDrawPtr(hmou) == 0) { + + for (;;) { + /* sit and wait on the event queue */ + if (MouReadEventQue(&mouev,&fWait,hmou)) + break; + if (!mouse_activated) + goto finish; + + /* + * OS/2 numbers a 3-button mouse inconsistently from other + * platforms: + * 1 = left + * 2 = right + * 3 = middle. + */ + if ((mouev.fs ^ oldstate) & MOUSE_BN1_DOWN) + write_event(mouev.fs & MOUSE_BN1_DOWN, + mouse_buttons[1], mouev.col, mouev.row); + if ((mouev.fs ^ oldstate) & MOUSE_BN2_DOWN) + write_event(mouev.fs & MOUSE_BN2_DOWN, + mouse_buttons[3], mouev.col, mouev.row); + if ((mouev.fs ^ oldstate) & MOUSE_BN3_DOWN) + write_event(mouev.fs & MOUSE_BN3_DOWN, + mouse_buttons[2], mouev.col, mouev.row); + + finish: + oldstate = mouev.fs; + } + } + + DosWrite(2, errmess, strlen(errmess), &ignore); + MouClose(hmou); + } + DosExit(EXIT_THREAD, 0L ); +} +static void +server_state(const int state) +{ /* It would be nice to implement pointer-off and stop looping... */ + mouse_activated = state; +} + +#endif + +static int initialized; + static void _nc_mouse_init(void) /* initialize the mouse */ { int i; - static int initialized; if (initialized) { return; @@ -148,7 +240,7 @@ static void _nc_mouse_init(void) /* we know how to recognize mouse events under xterm */ if (key_mouse != 0 - && is_xterm(cur_term->type.term_names)) + && getenv("DISPLAY") != 0) mousetype = M_XTERM; #if USE_GPM_SUPPORT @@ -156,9 +248,9 @@ static void _nc_mouse_init(void) { /* GPM: initialize connection to gpm server */ gpm_connect.eventMask = GPM_DOWN|GPM_UP; - gpm_connect.defaultMask = ~gpm_connect.eventMask; + gpm_connect.defaultMask = ~(gpm_connect.eventMask|GPM_HARD); gpm_connect.minMod = 0; - gpm_connect.maxMod = ~0; + gpm_connect.maxMod = ~((1<= 0) { /* returns the file-descriptor */ mousetype = M_GPM; SP->_mouse_fd = gpm_fd; @@ -166,6 +258,40 @@ static void _nc_mouse_init(void) } #endif + /* OS/2 VIO */ +#ifdef USE_EMX_MOUSE + if (!mouse_thread && mousetype != M_XTERM && key_mouse) { + int handles[2]; + if (pipe(handles) < 0) { + perror("mouse pipe error"); + } else { + int rc; + + if (!mouse_buttons[0]) { + char *s = getenv("MOUSE_BUTTONS_123"); + + mouse_buttons[0] = 1; + if (s && strlen(s) >= 3) { + mouse_buttons[1] = s[0] - '0'; + mouse_buttons[2] = s[1] - '0'; + mouse_buttons[3] = s[2] - '0'; + } + } + mouse_wfd = handles[1]; + M_FD(SP) = handles[0]; + /* Needed? */ + setmode(handles[0], O_BINARY); + setmode(handles[1], O_BINARY); + /* Do not use CRT functions, we may single-threaded. */ + rc = DosCreateThread((unsigned long*)&mouse_thread, mouse_server, 0, 0, 8192); + if (rc) + printf("mouse thread error %d=%#x", rc, rc); + else + mousetype = M_XTERM; + } + } +#endif + T(("_nc_mouse_init() set mousetype to %d", mousetype)); } @@ -257,7 +383,13 @@ static bool _nc_mouse_inline(SCREEN *sp) */ for (grabbed = 0; grabbed < 3; grabbed += res) { + + /* For VIO mouse we add extra bit 64 to disambiguate button-up. */ +#ifdef USE_EMX_MOUSE + res = read( M_FD(sp) >= 0 ? M_FD(sp) : sp->_ifd, &kbuf, 3); +#else res = read(sp->_ifd, kbuf + grabbed, 3-grabbed); +#endif if (res == -1) break; } @@ -273,14 +405,26 @@ static bool _nc_mouse_inline(SCREEN *sp) { case 0x0: eventp->bstate = BUTTON1_PRESSED; +#ifdef USE_EMX_MOUSE + if (kbuf[0] & 0x40) + eventp->bstate = BUTTON1_RELEASED; +#endif break; case 0x1: eventp->bstate = BUTTON2_PRESSED; +#ifdef USE_EMX_MOUSE + if (kbuf[0] & 0x40) + eventp->bstate = BUTTON2_RELEASED; +#endif break; case 0x2: eventp->bstate = BUTTON3_PRESSED; +#ifdef USE_EMX_MOUSE + if (kbuf[0] & 0x40) + eventp->bstate = BUTTON3_RELEASED; +#endif break; case 0x3: @@ -320,7 +464,9 @@ static bool _nc_mouse_inline(SCREEN *sp) eventp->x = (kbuf[1] - ' ') - 1; eventp->y = (kbuf[2] - ' ') - 1; - TR(MY_TRACE, ("_nc_mouse_inline: primitive mouse-event %s has slot %d", _tracemouse(eventp), eventp - events)); + TR(MY_TRACE, ("_nc_mouse_inline: primitive mouse-event %s has slot %ld", + _tracemouse(eventp), + (long) (eventp - events))); /* bump the next-free pointer into the circular list */ eventp = NEXT(eventp); @@ -334,6 +480,9 @@ static bool _nc_mouse_inline(SCREEN *sp) static void mouse_activate(bool on) { + if (!on && !initialized) + return; + _nc_mouse_init(); if (on) { @@ -344,7 +493,11 @@ static void mouse_activate(bool on) keyok(KEY_MOUSE, on); #endif TPUTS_TRACE("xterm mouse initialization"); +#ifdef USE_EMX_MOUSE + server_state(1); +#else putp("\033[?1000h"); +#endif break; #if USE_GPM_SUPPORT case M_GPM: @@ -366,7 +519,11 @@ static void mouse_activate(bool on) switch (mousetype) { case M_XTERM: TPUTS_TRACE("xterm mouse deinitialization"); +#ifdef USE_EMX_MOUSE + server_state(0); +#else putp("\033[?1000l"); +#endif break; #if USE_GPM_SUPPORT case M_GPM: @@ -374,7 +531,7 @@ static void mouse_activate(bool on) #endif } } - (void) fflush(SP->_ofp); + _nc_flush(); } /************************************************************************** @@ -415,8 +572,9 @@ static bool _nc_mouse_parse(int runcount) */ if (runcount == 1) { - TR(MY_TRACE, ("_nc_mouse_parse: returning simple mouse event %s at slot %d", - _tracemouse(prev), prev-events)); + TR(MY_TRACE, ("_nc_mouse_parse: returning simple mouse event %s at slot %ld", + _tracemouse(prev), + (long) (prev - events))); return (prev->id >= 0) ? ((prev->bstate & eventmask) ? TRUE : FALSE) : FALSE; @@ -432,8 +590,10 @@ static bool _nc_mouse_parse(int runcount) if (_nc_tracing & TRACE_IEVENT) { _trace_slot("before mouse press/release merge:"); - _tracef("_nc_mouse_parse: run starts at %d, ends at %d, count %d", - runp-events, ((eventp - events) + (EV_MAX-1)) % EV_MAX, runcount); + _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d", + (long) (runp - events), + (long) ((eventp - events) + (EV_MAX-1)) % EV_MAX, + runcount); } #endif /* TRACE */ @@ -484,8 +644,10 @@ static bool _nc_mouse_parse(int runcount) if (_nc_tracing & TRACE_IEVENT) { _trace_slot("before mouse click merge:"); - _tracef("_nc_mouse_parse: run starts at %d, ends at %d, count %d", - runp-events, ((eventp - events) + (EV_MAX-1)) % EV_MAX, runcount); + _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d", + (long) (runp - events), + (long) ((eventp - events) + (EV_MAX-1)) % EV_MAX, + runcount); } #endif /* TRACE */ @@ -589,8 +751,10 @@ static bool _nc_mouse_parse(int runcount) if (_nc_tracing & TRACE_IEVENT) { _trace_slot("before mouse event queue compaction:"); - _tracef("_nc_mouse_parse: run starts at %d, ends at %d, count %d", - runp-events, ((eventp - events) + (EV_MAX-1)) % EV_MAX, runcount); + _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d", + (long) (runp - events), + (long) ((eventp - events) + (EV_MAX-1)) % EV_MAX, + runcount); } #endif /* TRACE */ @@ -607,13 +771,16 @@ static bool _nc_mouse_parse(int runcount) if (_nc_tracing & TRACE_IEVENT) { _trace_slot("after mouse event queue compaction:"); - _tracef("_nc_mouse_parse: run starts at %d, ends at %d, count %d", - runp-events, ((eventp - events) + (EV_MAX-1)) % EV_MAX, runcount); + _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d", + (long) (runp - events), + (long) ((eventp - events) + (EV_MAX-1)) % EV_MAX, + runcount); } for (ep = runp; ep != eventp; ep = NEXT(ep)) if (ep->id != INVALID_EVENT) - TR(MY_TRACE, ("_nc_mouse_parse: returning composite mouse event %s at slot %d", - _tracemouse(ep), ep-events)); + TR(MY_TRACE, ("_nc_mouse_parse: returning composite mouse event %s at slot %ld", + _tracemouse(ep), + (long) (ep - events))); #endif /* TRACE */ /* after all this, do we have a valid event? */ @@ -627,9 +794,9 @@ static void _nc_mouse_wrap(SCREEN *sp GCC_UNUSED) switch (mousetype) { case M_XTERM: - if (eventmask) - mouse_activate(FALSE); - break; + if (eventmask) + mouse_activate(FALSE); + break; #if USE_GPM_SUPPORT /* GPM: pass all mouse events to next client */ case M_GPM: @@ -669,8 +836,9 @@ int getmouse(MEVENT *aevent) /* copy the event we find there */ *aevent = *prev; - TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %d", - _tracemouse(prev), prev-events)); + TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld", + _tracemouse(prev), + (long) (prev - events))); prev->id = INVALID_EVENT; /* so the queue slot becomes free */ returnCode(OK); @@ -701,6 +869,9 @@ mmask_t mousemask(mmask_t newmask, mmask_t *oldmask) if (oldmask) *oldmask = eventmask; + if (!newmask && !initialized) + returnCode(0); + _nc_mouse_init(); if ( mousetype != M_NONE ) { @@ -757,4 +928,37 @@ int _nc_has_mouse(void) { return (mousetype==M_NONE ? 0:1); } +bool wmouse_trafo(const WINDOW* win, int* pY, int* pX, bool to_screen) +{ + bool result = FALSE; + + if (win && pY && pX) + { + int y = *pY; int x = *pX; + + if (to_screen) + { + y += win->_begy + win->_yoffset; + x += win->_begx; + if (wenclose(win,y,x)) + result = TRUE; + } + else + { + if (wenclose(win,y,x)) + { + y -= (win->_begy + win->_yoffset); + x -= win->_begx; + result = TRUE; + } + } + if (result) + { + *pX = x; + *pY = y; + } + } + return(result); +} + /* lib_mouse.c ends here */ diff --git a/ncurses/lib_move.c b/ncurses/base/lib_move.c similarity index 100% rename from ncurses/lib_move.c rename to ncurses/base/lib_move.c diff --git a/ncurses/lib_mvwin.c b/ncurses/base/lib_mvwin.c similarity index 100% rename from ncurses/lib_mvwin.c rename to ncurses/base/lib_mvwin.c diff --git a/ncurses/lib_newterm.c b/ncurses/base/lib_newterm.c similarity index 87% rename from ncurses/lib_newterm.c rename to ncurses/base/lib_newterm.c index ea5333d8..9a4919bf 100644 --- a/ncurses/lib_newterm.c +++ b/ncurses/base/lib_newterm.c @@ -48,7 +48,7 @@ #include /* clear_screen, cup & friends, cur_term */ -MODULE_ID("$Id: lib_newterm.c,v 1.33 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: lib_newterm.c,v 1.41 1999/07/24 20:07:48 tom Exp $") #ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */ #define ONLCR 0 @@ -75,7 +75,7 @@ static inline int _nc_initscr(void) #else cur_term->Nttyb.sg_flags &= ~(ECHO|CRMOD); #endif - return _nc_set_curterm(&cur_term->Nttyb); + return _nc_set_tty_mode(&cur_term->Nttyb); } /* @@ -91,53 +91,35 @@ void filter(void) filter_mode = TRUE; } -SCREEN * newterm(const char *term, FILE *ofp, FILE *ifp) +SCREEN * newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp) { int errret; +int slk_format = _nc_slk_format; SCREEN* current; #ifdef TRACE -char *t = getenv("NCURSES_TRACE"); +int t = _nc_getenv_num("NCURSES_TRACE"); - if (t) - trace((unsigned) strtol(t, 0, 0)); + if (t >= 0) + trace(t); #endif - T((T_CALLED("newterm(\"%s\",%p,%p)"), term, ofp, ifp)); + T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp)); /* this loads the capability entry, then sets LINES and COLS */ - if (setupterm(term, fileno(ofp), &errret) == ERR) + if (setupterm(name, fileno(ofp), &errret) == ERR) return 0; - /* - * Check for mismatched graphic-rendition capabilities. Most SVr4 - * terminfo trees contain entries that have rmul or rmso equated to - * sgr0 (Solaris curses copes with those entries). We do this only for - * curses, since many termcap applications assume that smso/rmso and - * smul/rmul are paired, and will not function properly if we remove - * rmso or rmul. Curses applications shouldn't be looking at this - * detail. - */ - if (exit_attribute_mode) { -#define SGR0_FIX(mode) if (mode != 0 && !strcmp(mode, exit_attribute_mode)) \ - mode = 0 - SGR0_FIX(exit_underline_mode); - SGR0_FIX(exit_standout_mode); - } - /* implement filter mode */ if (filter_mode) { LINES = 1; -#ifdef init_tabs if (init_tabs != -1) TABSIZE = init_tabs; else -#endif /* init_tabs */ TABSIZE = 8; T(("TABSIZE = %d", TABSIZE)); -#ifdef clear_screen clear_screen = 0; cursor_down = parm_down_cursor = 0; cursor_address = 0; @@ -145,19 +127,17 @@ char *t = getenv("NCURSES_TRACE"); row_address = 0; cursor_home = carriage_return; -#endif /* clear_screen */ } /* If we must simulate soft labels, grab off the line to be used. We assume that we must simulate, if it is none of the standard formats (4-4 or 3-2-3) for which there may be some hardware support. */ -#ifdef num_labels - if (num_labels <= 0 || !SLK_STDFMT) -#endif /* num_labels */ - if (_nc_slk_format) + if (num_labels <= 0 || !SLK_STDFMT(slk_format)) + if (slk_format) { - if (ERR==_nc_ripoffline(-SLK_LINES, _nc_slk_initialize)) + if (ERR==_nc_ripoffline(-SLK_LINES(slk_format), + _nc_slk_initialize)) return 0; } /* this actually allocates the screen structure, and saves the @@ -170,11 +150,9 @@ char *t = getenv("NCURSES_TRACE"); return 0; } -#ifdef num_labels /* if the terminal type has real soft labels, set those up */ - if (_nc_slk_format && num_labels > 0 && SLK_STDFMT) + if (slk_format && num_labels > 0 && SLK_STDFMT(slk_format)) _nc_slk_initialize(stdscr, COLS); -#endif /* num_labels */ SP->_ifd = fileno(ifp); SP->_checkfd = fileno(ifp); @@ -199,17 +177,30 @@ char *t = getenv("NCURSES_TRACE"); SP->_keytry = 0; + /* + * Check for mismatched graphic-rendition capabilities. Most SVr4 + * terminfo trees contain entries that have rmul or rmso equated to + * sgr0 (Solaris curses copes with those entries). We do this only for + * curses, since many termcap applications assume that smso/rmso and + * smul/rmul are paired, and will not function properly if we remove + * rmso or rmul. Curses applications shouldn't be looking at this + * detail. + */ +#define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode)) + SP->_use_rmso = SGR0_TEST(exit_standout_mode); + SP->_use_rmul = SGR0_TEST(exit_underline_mode); + /* compute movement costs so we can do better move optimization */ _nc_mvcur_init(); - _nc_signal_handler(TRUE); - /* initialize terminal to a sane state */ _nc_screen_init(); /* Initialize the terminal line settings. */ _nc_initscr(); + _nc_signal_handler(TRUE); + T((T_RETURN("%p"), SP)); return(SP); } diff --git a/ncurses/lib_newwin.c b/ncurses/base/lib_newwin.c similarity index 97% rename from ncurses/lib_newwin.c rename to ncurses/base/lib_newwin.c index d96bf0a4..d7fc02b3 100644 --- a/ncurses/lib_newwin.c +++ b/ncurses/base/lib_newwin.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_newwin.c,v 1.19 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_newwin.c,v 1.21 1999/10/03 00:42:03 tom Exp $") void _nc_freewin(WINDOW *win) { @@ -60,7 +60,7 @@ int i; if (! (win->_flags & _SUBWIN)) { for (i = 0; i <= win->_maxy && win->_line[i].text; i++) - free(win->_line[i].text); + FreeIfNeeded(win->_line[i].text); } free(win->_line); free(win); @@ -130,10 +130,10 @@ int flags = _SUBWIN; returnWin(0); if (num_lines == 0) - num_lines = orig->_maxy - begy; + num_lines = orig->_maxy + 1 - begy; if (num_columns == 0) - num_columns = orig->_maxx - begx; + num_columns = orig->_maxx + 1 - begx; if (orig->_flags & _ISPAD) flags |= _ISPAD; diff --git a/ncurses/lib_nl.c b/ncurses/base/lib_nl.c similarity index 93% rename from ncurses/lib_nl.c rename to ncurses/base/lib_nl.c index bb165dbc..75d4a638 100644 --- a/ncurses/lib_nl.c +++ b/ncurses/base/lib_nl.c @@ -42,9 +42,8 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_nl.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: lib_nl.c,v 1.4 1999/10/22 22:31:51 tom Exp $") #ifdef __EMX__ #include @@ -58,8 +57,8 @@ int nl(void) SP->_nl = TRUE; #ifdef __EMX__ - fflush(SP->_ofp); - _fsetmode(SP->_ofp, "t"); + _nc_flush(); + _fsetmode(NC_OUTPUT, "t"); #endif returnCode(OK); @@ -72,8 +71,8 @@ int nonl(void) SP->_nl = FALSE; #ifdef __EMX__ - fflush(SP->_ofp); - _fsetmode(SP->_ofp, "b"); + _nc_flush(); + _fsetmode(NC_OUTPUT, "b"); #endif returnCode(OK); diff --git a/ncurses/lib_overlay.c b/ncurses/base/lib_overlay.c similarity index 100% rename from ncurses/lib_overlay.c rename to ncurses/base/lib_overlay.c diff --git a/ncurses/lib_pad.c b/ncurses/base/lib_pad.c similarity index 97% rename from ncurses/lib_pad.c rename to ncurses/base/lib_pad.c index 6e797aef..d4e341c0 100644 --- a/ncurses/lib_pad.c +++ b/ncurses/base/lib_pad.c @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: lib_pad.c,v 1.25 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_pad.c,v 1.27 1998/06/28 00:10:16 tom Exp $") WINDOW *newpad(int l, int c) { @@ -178,13 +178,7 @@ bool wide; for (j = pmincol, n = smincol; j <= pmaxcol; j++, n++) { if (oline->text[j] != nline->text[n]) { nline->text[n] = oline->text[j]; - - if (nline->firstchar == _NOCHANGE) - nline->firstchar = nline->lastchar = n; - else if (n < nline->firstchar) - nline->firstchar = n; - else if (n > nline->lastchar) - nline->lastchar = n; + CHANGED_CELL(nline,n); } } diff --git a/ncurses/lib_printw.c b/ncurses/base/lib_printw.c similarity index 90% rename from ncurses/lib_printw.c rename to ncurses/base/lib_printw.c index a8b49aa5..8d28f288 100644 --- a/ncurses/lib_printw.c +++ b/ncurses/base/lib_printw.c @@ -39,9 +39,9 @@ #include -MODULE_ID("$Id: lib_printw.c,v 1.6 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_printw.c,v 1.7 1998/04/11 22:53:44 tom Exp $") -int printw(const char *fmt, ...) +int printw(NCURSES_CONST char *fmt, ...) { va_list argp; int code; @@ -55,7 +55,7 @@ int printw(const char *fmt, ...) return code; } -int wprintw(WINDOW *win, const char *fmt, ...) +int wprintw(WINDOW *win, NCURSES_CONST char *fmt, ...) { va_list argp; int code; @@ -69,7 +69,7 @@ int wprintw(WINDOW *win, const char *fmt, ...) return code; } -int mvprintw(int y, int x, const char *fmt, ...) +int mvprintw(int y, int x, NCURSES_CONST char *fmt, ...) { va_list argp; int code = move(y, x); @@ -82,7 +82,7 @@ int mvprintw(int y, int x, const char *fmt, ...) return code; } -int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...) +int mvwprintw(WINDOW *win, int y, int x, NCURSES_CONST char *fmt, ...) { va_list argp; int code = wmove(win, y, x); @@ -95,7 +95,7 @@ int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...) return code; } -int vwprintw(WINDOW *win, const char *fmt, va_list argp) +int vwprintw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) { char *buf = _nc_printf_string(fmt, argp); int code = ERR; diff --git a/ncurses/lib_redrawln.c b/ncurses/base/lib_redrawln.c similarity index 80% rename from ncurses/lib_redrawln.c rename to ncurses/base/lib_redrawln.c index adcdf736..10fda917 100644 --- a/ncurses/lib_redrawln.c +++ b/ncurses/base/lib_redrawln.c @@ -39,29 +39,31 @@ #include -MODULE_ID("$Id: lib_redrawln.c,v 1.2 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: lib_redrawln.c,v 1.7 1998/09/19 20:09:50 Alexander.V.Lukyanov Exp $") int wredrawln(WINDOW *win, int beg, int num) { -int i; + int i; + int end; + size_t len = (win->_maxx + 1) * sizeof(chtype); T((T_CALLED("wredrawln(%p,%d,%d)"), win, beg, num)); - if (touchline(win, beg, num) == OK) { - size_t len = win->_maxx * sizeof(chtype); + if (beg < 0) + beg = 0; - /* - * XSI says that wredrawln() tells the library not to base - * optimization on the contents of the lines that are marked. - * We do that by changing the contents to nulls after touching - * the corresponding lines to get the optimizer's attention. - * - * FIXME: this won't work if the application makes further - * updates before the next refresh. - */ - for (i = beg; (i < beg + num) && (i < win->_maxy); i++) { - memset(win->_line[i].text, 0, len); - } + if (touchline (win, beg, num) == ERR) + returnCode(ERR); + + end = beg + num; + if (end > win->_maxy + 1) + end = win->_maxy + 1; + + for (i = beg; i < end; i++) + { + memset (curscr->_line[i+win->_begy].text+win->_begx, 0, len); + _nc_make_oldhash(i+win->_begy); } + returnCode(OK); } diff --git a/ncurses/lib_refresh.c b/ncurses/base/lib_refresh.c similarity index 89% rename from ncurses/lib_refresh.c rename to ncurses/base/lib_refresh.c index 417e6702..88e3b75a 100644 --- a/ncurses/lib_refresh.c +++ b/ncurses/base/lib_refresh.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_refresh.c,v 1.19 1998/02/11 12:13:59 tom Exp $") +MODULE_ID("$Id: lib_refresh.c,v 1.24 1999/07/31 11:36:37 juergen Exp $") int wrefresh(WINDOW *win) { @@ -70,6 +70,7 @@ int code; int wnoutrefresh(WINDOW *win) { +short limit_x; short i, j; short begx; short begy; @@ -93,14 +94,7 @@ bool wide; begx = win->_begx; begy = win->_begy; - /* - * If 'newscr' has a different background than the window that we're - * trying to refresh, we'll have to copy the whole thing. - */ - if (win->_bkgd != newscr->_bkgd) { - touchwin(win); - newscr->_bkgd = win->_bkgd; - } + newscr->_bkgd = win->_bkgd; newscr->_attrs = win->_attrs; /* merge in change information from all subwindows of this window */ @@ -130,6 +124,13 @@ bool wide; * common-subexpression chunking to make it really tense, * so we'll force the issue. */ + + /* limit(n) */ + limit_x = win->_maxx; + /* limit(j) */ + if (limit_x > win->_maxx) + limit_x = win->_maxx; + for (i = 0, m = begy + win->_yoffset; i <= win->_maxy && m <= newscr->_maxy; i++, m++) { @@ -139,23 +140,13 @@ bool wide; if (oline->firstchar != _NOCHANGE) { int last = oline->lastchar; - /* limit(j) */ - if (last > win->_maxx) - last = win->_maxx; - /* limit(n) */ - if (last > newscr->_maxx - begx) - last = newscr->_maxx - begx; + if (last > limit_x) + last = limit_x; for (j = oline->firstchar, n = j + begx; j <= last; j++, n++) { if (oline->text[j] != nline->text[n]) { nline->text[n] = oline->text[j]; - - if (nline->firstchar == _NOCHANGE) - nline->firstchar = nline->lastchar = n; - else if (n < nline->firstchar) - nline->firstchar = n; - else if (n > nline->lastchar) - nline->lastchar = n; + CHANGED_CELL(nline, n); } } @@ -182,6 +173,8 @@ bool wide; newscr->_cury = win->_cury + win->_begy + win->_yoffset; newscr->_curx = win->_curx + win->_begx; } + newscr->_leaveok = win->_leaveok; + #ifdef TRACE if (_nc_tracing & TRACE_UPDATE) _tracedump("newscr", newscr); diff --git a/ncurses/lib_restart.c b/ncurses/base/lib_restart.c similarity index 74% rename from ncurses/lib_restart.c rename to ncurses/base/lib_restart.c index 6dc18314..de0182f4 100644 --- a/ncurses/lib_restart.c +++ b/ncurses/base/lib_restart.c @@ -47,69 +47,18 @@ #include /* lines, columns, cur_term */ -MODULE_ID("$Id: lib_restart.c,v 1.16 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: lib_restart.c,v 1.2 1999/07/24 20:10:04 tom Exp $") -#undef tabs - -#ifdef TAB3 -# define tabs TAB3 -#else -# ifdef XTABS -# define tabs XTABS -# else -# ifdef OXTABS -# define tabs OXTABS -# else -# define tabs 0 -# endif -# endif -#endif - -int def_shell_mode(void) -{ - T((T_CALLED("def_shell_mode()"))); - - /* - * Turn off the XTABS bit in the tty structure if it was on. If XTABS - * was on, remove the tab and backtab capabilities. - */ - - if (_nc_get_curterm(&cur_term->Ottyb) != OK) - returnCode(ERR); -#ifdef TERMIOS - if (cur_term->Ottyb.c_oflag & tabs) - tab = back_tab = NULL; -#else - if (cur_term->Ottyb.sg_flags & XTABS) - tab = back_tab = NULL; -#endif - returnCode(OK); -} - -int def_prog_mode(void) -{ - T((T_CALLED("def_prog_mode()"))); - - if (_nc_get_curterm(&cur_term->Nttyb) != OK) - returnCode(ERR); -#ifdef TERMIOS - cur_term->Nttyb.c_oflag &= ~tabs; -#else - cur_term->Nttyb.sg_flags &= ~XTABS; -#endif - returnCode(OK); -} - -int restartterm(const char *term, int filenum, int *errret) +int restartterm(NCURSES_CONST char *termp, int filenum, int *errret) { int saveecho = SP->_echo; int savecbreak = SP->_cbreak; int saveraw = SP->_raw; int savenl = SP->_nl; - T((T_CALLED("restartterm(%s,%d,%p)"), term, filenum, errret)); + T((T_CALLED("restartterm(%s,%d,%p)"), termp, filenum, errret)); - setupterm(term, filenum, errret); + setupterm(termp, filenum, errret); if (saveecho) echo(); diff --git a/ncurses/lib_scanw.c b/ncurses/base/lib_scanw.c similarity index 90% rename from ncurses/lib_scanw.c rename to ncurses/base/lib_scanw.c index 9148ab33..cc66613f 100644 --- a/ncurses/lib_scanw.c +++ b/ncurses/base/lib_scanw.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_scanw.c,v 1.7 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_scanw.c,v 1.8 1998/04/11 22:54:18 tom Exp $") #if !HAVE_VSSCANF #if defined(__QNX__) @@ -52,7 +52,7 @@ extern int vsscanf(const char *str, const char *format, ...); #endif #endif -int vwscanw(WINDOW *win, const char *fmt, va_list argp) +int vwscanw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) { char buf[BUFSIZ]; @@ -62,7 +62,7 @@ char buf[BUFSIZ]; return(vsscanf(buf, fmt, argp)); } -int scanw(const char *fmt, ...) +int scanw(NCURSES_CONST char *fmt, ...) { int code; va_list ap; @@ -75,7 +75,7 @@ va_list ap; return (code); } -int wscanw(WINDOW *win, const char *fmt, ...) +int wscanw(WINDOW *win, NCURSES_CONST char *fmt, ...) { int code; va_list ap; @@ -88,7 +88,7 @@ va_list ap; return (code); } -int mvscanw(int y, int x, const char *fmt, ...) +int mvscanw(int y, int x, NCURSES_CONST char *fmt, ...) { int code; va_list ap; @@ -99,7 +99,7 @@ va_list ap; return (code); } -int mvwscanw(WINDOW *win, int y, int x, const char *fmt, ...) +int mvwscanw(WINDOW *win, int y, int x, NCURSES_CONST char *fmt, ...) { int code; va_list ap; diff --git a/ncurses/lib_screen.c b/ncurses/base/lib_screen.c similarity index 94% rename from ncurses/lib_screen.c rename to ncurses/base/lib_screen.c index f12b2dec..3038393c 100644 --- a/ncurses/lib_screen.c +++ b/ncurses/base/lib_screen.c @@ -38,7 +38,7 @@ #include #include /* exit_ca_mode, non_rev_rmcup */ -MODULE_ID("$Id: lib_screen.c,v 1.11 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_screen.c,v 1.15 1999/07/24 20:05:29 tom Exp $") static time_t dumptime; @@ -125,11 +125,12 @@ int putwin(WINDOW *win, FILE *filep) int scr_restore(const char *file) { - FILE *fp; + FILE *fp = 0; T((T_CALLED("scr_restore(%s)"), _nc_visbuf(file))); - if ((fp = fopen(file, "rb")) == 0) + if (_nc_access(file, R_OK) < 0 + || (fp = fopen(file, "rb")) == 0) returnCode(ERR); else { @@ -142,11 +143,12 @@ int scr_restore(const char *file) int scr_dump(const char *file) { - FILE *fp; + FILE *fp = 0; T((T_CALLED("scr_dump(%s)"), _nc_visbuf(file))); - if ((fp = fopen(file, "wb")) == 0) + if (_nc_access(file, W_OK) < 0 + || (fp = fopen(file, "wb")) == 0) returnCode(ERR); else { @@ -159,17 +161,16 @@ int scr_dump(const char *file) int scr_init(const char *file) { - FILE *fp; + FILE *fp = 0; struct stat stb; T((T_CALLED("scr_init(%s)"), _nc_visbuf(file))); -#ifdef exit_ca_mode if (exit_ca_mode && non_rev_rmcup) returnCode(ERR); -#endif /* exit_ca_mode */ - if ((fp = fopen(file, "rb")) == 0) + if (_nc_access(file, R_OK) < 0 + || (fp = fopen(file, "rb")) == 0) returnCode(ERR); else if (fstat(STDOUT_FILENO, &stb) || stb.st_mtime > dumptime) returnCode(ERR); diff --git a/ncurses/lib_scroll.c b/ncurses/base/lib_scroll.c similarity index 100% rename from ncurses/lib_scroll.c rename to ncurses/base/lib_scroll.c diff --git a/ncurses/lib_scrollok.c b/ncurses/base/lib_scrollok.c similarity index 100% rename from ncurses/lib_scrollok.c rename to ncurses/base/lib_scrollok.c diff --git a/ncurses/lib_scrreg.c b/ncurses/base/lib_scrreg.c similarity index 100% rename from ncurses/lib_scrreg.c rename to ncurses/base/lib_scrreg.c diff --git a/ncurses/lib_set_term.c b/ncurses/base/lib_set_term.c similarity index 76% rename from ncurses/lib_set_term.c rename to ncurses/base/lib_set_term.c index 12ac5fd6..443236cf 100644 --- a/ncurses/lib_set_term.c +++ b/ncurses/base/lib_set_term.c @@ -31,8 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - - /* ** lib_set_term.c ** @@ -44,78 +42,16 @@ #include /* cur_term */ -MODULE_ID("$Id: lib_set_term.c,v 1.37 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: lib_set_term.c,v 1.46 1999/07/24 20:05:49 tom Exp $") -/* - * If the output file descriptor is connected to a tty (the typical case) it - * will probably be line-buffered. Keith Bostic pointed out that we don't want - * this; it hoses people running over networks by forcing out a bunch of small - * packets instead of one big one, so screen updates on ptys look jerky. - * Restore block buffering to prevent this minor lossage. - * - * The buffer size is a compromise. Ideally we'd like a buffer that can hold - * the maximum possible update size (the whole screen plus cup commands to - * change lines as it's painted). On a 66-line xterm this can become - * excessive. So we min it with the amount of data we think we can get through - * two Ethernet packets (maximum packet size - 100 for TCP/IP overhead). - * - * Why two ethernet packets? It used to be one, on the theory that said - * packets define the maximum size of atomic update. But that's less than the - * 2000 chars on a 25 x 80 screen, and we don't want local updates to flicker - * either. Two packet lengths will handle up to a 35 x 80 screen. - * - * The magic '6' is the estimated length of the end-of-line cup sequence to go - * to the next line. It's generous. We used to mess with the buffering in - * init_mvcur() after cost computation, but that lost the sequences emitted by - * init_acs() in setupscreen(). - * - * "The setvbuf function may be used only after the stream pointed to by stream - * has been associated with an open file and before any other operation is - * performed on the stream." (ISO 7.9.5.6.) - * - * Grrrr... - */ -void _nc_set_buffer(FILE *ofp, bool buffered) -{ - /* optional optimization hack -- do before any output to ofp */ -#if HAVE_SETVBUF || HAVE_SETBUFFER - unsigned buf_len; - char *buf_ptr; - - if (buffered) { - buf_len = min(LINES * (COLS + 6), 2800); - buf_ptr = malloc(buf_len); - } else { - buf_len = 0; - buf_ptr = 0; - } - -#if HAVE_SETVBUF -#ifdef SETVBUF_REVERSED /* pre-svr3? */ - (void) setvbuf(ofp, buf_ptr, buf_len, buf_len ? _IOFBF : _IONBF); -#else - (void) setvbuf(ofp, buf_ptr, buf_len ? _IOFBF : _IONBF, buf_len); -#endif -#elif HAVE_SETBUFFER - (void) setbuffer(ofp, buf_ptr, (int)buf_len); -#endif - - if (!buffered) { - FreeIfNeeded(SP->_setbuf); - } - SP->_setbuf = buf_ptr; - -#endif /* HAVE_SETVBUF || HAVE_SETBUFFER */ -} - -SCREEN * set_term(SCREEN *screen) +SCREEN * set_term(SCREEN *screenp) { SCREEN *oldSP; - T((T_CALLED("set_term(%p)"), screen)); + T((T_CALLED("set_term(%p)"), screenp)); oldSP = SP; - _nc_set_screen(screen); + _nc_set_screen(screenp); set_curterm(SP->_term); curscr = SP->_curscr; @@ -166,6 +102,11 @@ void delscreen(SCREEN *sp) FreeIfNeeded(sp->_color_table); FreeIfNeeded(sp->_color_pairs); + FreeIfNeeded(sp->oldhash); + FreeIfNeeded(sp->newhash); + + del_curterm(sp->_term); + free(sp); /* @@ -200,13 +141,13 @@ int _nc_setupscreen(short slines, short const scolumns, FILE *output) int bottom_stolen = 0; size_t i; - assert(SP==0); /* has been reset in newterm() ! */ + assert(SP==0); /* has been reset in newterm() ! */ if (!_nc_alloc_screen()) return ERR; SP->_next_screen = _nc_screen_chain; _nc_screen_chain = SP; - + _nc_set_buffer(output, TRUE); SP->_term = cur_term; SP->_lines = slines; @@ -216,12 +157,15 @@ size_t i; SP->_curscol = -1; SP->_nl = TRUE; SP->_raw = FALSE; - SP->_cbreak = FALSE; + SP->_cbreak = 0; SP->_echo = TRUE; SP->_fifohead = -1; SP->_endwin = TRUE; SP->_ofp = output; SP->_cursor = -1; /* cannot know real cursor shape */ +#ifdef NCURSES_NO_PADDING + SP->_no_padding = getenv("NCURSES_NO_PADDING") != 0; +#endif SP->_maxclick = DEFAULT_MAXCLICK; SP->_mouse_event = no_mouse_event; @@ -268,14 +212,17 @@ size_t i; acs_chars = 0; #endif } - init_acs(); + _nc_init_acs(); memcpy(SP->_acs_map, acs_map, sizeof(chtype)*ACS_LEN); _nc_idcok = TRUE; _nc_idlok = FALSE; - + _nc_windows = 0; /* no windows yet */ + SP->oldhash = 0; + SP->newhash = 0; + T(("creating newscr")); if ((newscr = newwin(slines, scolumns, 0, 0)) == 0) return ERR; diff --git a/ncurses/lib_slk.c b/ncurses/base/lib_slk.c similarity index 88% rename from ncurses/lib_slk.c rename to ncurses/base/lib_slk.c index 64a943a2..9b9b09a4 100644 --- a/ncurses/lib_slk.c +++ b/ncurses/base/lib_slk.c @@ -41,7 +41,7 @@ #include #include /* num_labels, label_*, plab_norm */ -MODULE_ID("$Id: lib_slk.c,v 1.14 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slk.c,v 1.16 1999/03/03 23:44:22 juergen Exp $") /* * We'd like to move these into the screen context structure, but cannot, @@ -56,7 +56,7 @@ int _nc_slk_format; /* one more than format specified in slk_init() */ static void slk_paint_info(WINDOW *win) { - if (win && _nc_slk_format==4) + if (win && SP->slk_format==4) { int i; @@ -64,7 +64,7 @@ slk_paint_info(WINDOW *win) wmove (win,0,0); for (i = 0; i < SP->_slk->maxlab; i++) { - if (win && _nc_slk_format==4) + if (win && SP->slk_format==4) { mvwaddch(win,0,SP->_slk->ent[i].x,'F'); if (i<9) @@ -87,6 +87,7 @@ int _nc_slk_initialize(WINDOW *stwin, int cols) { int i, x; +int res = OK; char *p; T(("slk_initialize()")); @@ -103,14 +104,12 @@ char *p; SP->_slk->buffer = NULL; SP->_slk->attr = A_STANDOUT; -#ifdef num_labels - SP->_slk->maxlab = (num_labels > 0) ? num_labels : MAX_SKEY; - SP->_slk->maxlen = (num_labels > 0) ? label_width * label_height : MAX_SKEY_LEN; - SP->_slk->labcnt = (SP->_slk->maxlab < MAX_SKEY) ? MAX_SKEY : SP->_slk->maxlab; -#else - SP->_slk->labcnt = SP->_slk->maxlab = MAX_SKEY; - SP->_slk->maxlen = MAX_SKEY_LEN; -#endif /* num_labels */ + SP->_slk->maxlab = (num_labels > 0) ? + num_labels : MAX_SKEY(_nc_slk_format); + SP->_slk->maxlen = (num_labels > 0) ? + label_width * label_height : MAX_SKEY_LEN(_nc_slk_format); + SP->_slk->labcnt = (SP->_slk->maxlab < MAX_SKEY(_nc_slk_format)) ? + MAX_SKEY(_nc_slk_format) : SP->_slk->maxlab; SP->_slk->ent = typeCalloc(slk_ent, SP->_slk->labcnt); if (SP->_slk->ent == NULL) @@ -182,11 +181,17 @@ char *p; FreeIfNeeded(SP->_slk->ent); free(SP->_slk); SP->_slk = (SLK*)0; - return(ERR); + res = (ERR); } } - return(OK); + /* We now reset the format so that the next newterm has again + * per default no SLK keys and may call slk_init again to + * define a new layout. (juergen 03-Mar-1999) + */ + SP->slk_format = _nc_slk_format; + _nc_slk_format = 0; + return(res); } diff --git a/menu/m_adabind.c b/ncurses/base/lib_slkatr_set.c similarity index 66% rename from menu/m_adabind.c rename to ncurses/base/lib_slkatr_set.c index a6167c2c..0695d186 100644 --- a/menu/m_adabind.c +++ b/ncurses/base/lib_slkatr_set.c @@ -27,39 +27,30 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer 1998 * ****************************************************************************/ -/*************************************************************************** -* Module m_adabind.c * -* Helper routines to ease the implementation of an Ada95 binding to * -* ncurses. For details and copyright of the binding see the ../Ada95 * -* subdirectory. * -***************************************************************************/ -#include "menu.priv.h" +/* + * lib_slkatr_set.c + * Soft key routines. + * Set the labels attributes + */ +#include -MODULE_ID("$Id: m_adabind.c,v 1.6 1998/02/11 12:13:50 tom Exp $") +MODULE_ID("$Id: lib_slkatr_set.c,v 1.3 1999/05/16 17:13:59 juergen Exp $") -/* Prototypes for the functions in this module */ -void _nc_ada_normalize_menu_opts (int *opt); -void _nc_ada_normalize_item_opts (int *opt); -ITEM* _nc_get_item(const MENU*, int); - -void _nc_ada_normalize_menu_opts (int *opt) +int +slk_attr_set(const attr_t attr, short color_pair_number, void* opts) { - *opt = ALL_MENU_OPTS & (*opt); -} - -void _nc_ada_normalize_item_opts (int *opt) -{ - *opt = ALL_ITEM_OPTS & (*opt); -} + T((T_CALLED("slk_attr_set(%s,%d)"), _traceattr(attr), color_pair_number)); -ITEM* _nc_get_item(const MENU* menu, int idx) { - if (menu && menu->items && idx>=0 && (idxnitems)) + if (SP!=0 && SP->_slk!=0 && !opts && + color_pair_number>=0 && color_pair_numberitems[idx]; + SP->_slk->attr = attr; + toggle_attr_on(SP->_slk->attr,COLOR_PAIR(color_pair_number)); + returnCode(OK); } else - return (ITEM*)0; + returnCode(ERR); } diff --git a/ncurses/lib_slkatrof.c b/ncurses/base/lib_slkatrof.c similarity index 96% rename from ncurses/lib_slkatrof.c rename to ncurses/base/lib_slkatrof.c index 2e1b3723..5e4f5f55 100644 --- a/ncurses/lib_slkatrof.c +++ b/ncurses/base/lib_slkatrof.c @@ -38,10 +38,10 @@ */ #include -MODULE_ID("$Id: lib_slkatrof.c,v 1.3 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slkatrof.c,v 1.4 1998/03/11 19:26:07 juergen Exp $") int -slk_attroff(const attr_t attr) +slk_attroff(const chtype attr) { T((T_CALLED("slk_attroff(%s)"), _traceattr(attr))); diff --git a/ncurses/lib_slkatron.c b/ncurses/base/lib_slkatron.c similarity index 96% rename from ncurses/lib_slkatron.c rename to ncurses/base/lib_slkatron.c index 55527762..a2488652 100644 --- a/ncurses/lib_slkatron.c +++ b/ncurses/base/lib_slkatron.c @@ -38,10 +38,10 @@ */ #include -MODULE_ID("$Id: lib_slkatron.c,v 1.3 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slkatron.c,v 1.4 1998/03/11 19:26:07 juergen Exp $") int -slk_attron(const attr_t attr) +slk_attron(const chtype attr) { T((T_CALLED("slk_attron(%s)"), _traceattr(attr))); diff --git a/ncurses/lib_slkatrset.c b/ncurses/base/lib_slkatrset.c similarity index 96% rename from ncurses/lib_slkatrset.c rename to ncurses/base/lib_slkatrset.c index a540491b..391c7ffe 100644 --- a/ncurses/lib_slkatrset.c +++ b/ncurses/base/lib_slkatrset.c @@ -38,10 +38,10 @@ */ #include -MODULE_ID("$Id: lib_slkatrset.c,v 1.3 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slkatrset.c,v 1.4 1998/03/11 19:26:01 juergen Exp $") int -slk_attrset(const attr_t attr) +slk_attrset(const chtype attr) { T((T_CALLED("slk_attrset(%s)"), _traceattr(attr))); diff --git a/ncurses/lib_slkattr.c b/ncurses/base/lib_slkattr.c similarity index 100% rename from ncurses/lib_slkattr.c rename to ncurses/base/lib_slkattr.c diff --git a/ncurses/lib_slkclear.c b/ncurses/base/lib_slkclear.c similarity index 92% rename from ncurses/lib_slkclear.c rename to ncurses/base/lib_slkclear.c index 42e76a7b..ac6e414b 100644 --- a/ncurses/lib_slkclear.c +++ b/ncurses/base/lib_slkclear.c @@ -38,7 +38,7 @@ */ #include -MODULE_ID("$Id: lib_slkclear.c,v 1.3 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slkclear.c,v 1.4 1999/03/03 23:44:22 juergen Exp $") int slk_clear(void) @@ -52,7 +52,11 @@ slk_clear(void) inherit those attributes from the standard screen */ SP->_slk->win->_bkgd = stdscr->_bkgd; SP->_slk->win->_attrs = stdscr->_attrs; - werase(SP->_slk->win); - - returnCode(wrefresh(SP->_slk->win)); + if (SP->_slk->win == stdscr) { + returnCode(OK); + } + else { + werase(SP->_slk->win); + returnCode(wrefresh(SP->_slk->win)); + } } diff --git a/ncurses/base/lib_slkcolor.c b/ncurses/base/lib_slkcolor.c new file mode 100644 index 00000000..3728808f --- /dev/null +++ b/ncurses/base/lib_slkcolor.c @@ -0,0 +1,54 @@ +/**************************************************************************** + * 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 1998 * + ****************************************************************************/ + +/* + * lib_slkcolor.c + */ +#include + +MODULE_ID("$Id: lib_slkcolor.c,v 1.5 1999/05/16 17:14:13 juergen Exp $") + +int +slk_color(short color_pair_number) +{ + T((T_CALLED("slk_color(%d)"), color_pair_number)); + + if (SP!=0 && SP->_slk!=0 && + color_pair_number>=0 && color_pair_number_slk->attr))); + toggle_attr_on(SP->_slk->attr,COLOR_PAIR(color_pair_number)); + returnCode(OK); + } + else + returnCode(ERR); +} diff --git a/ncurses/lib_slkinit.c b/ncurses/base/lib_slkinit.c similarity index 100% rename from ncurses/lib_slkinit.c rename to ncurses/base/lib_slkinit.c diff --git a/ncurses/lib_slklab.c b/ncurses/base/lib_slklab.c similarity index 100% rename from ncurses/lib_slklab.c rename to ncurses/base/lib_slklab.c diff --git a/ncurses/lib_slkrefr.c b/ncurses/base/lib_slkrefr.c similarity index 90% rename from ncurses/lib_slkrefr.c rename to ncurses/base/lib_slkrefr.c index dcdef99a..ee3c91db 100644 --- a/ncurses/lib_slkrefr.c +++ b/ncurses/base/lib_slkrefr.c @@ -38,7 +38,7 @@ #include #include /* num_labels, label_*, plab_norm */ -MODULE_ID("$Id: lib_slkrefr.c,v 1.4 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slkrefr.c,v 1.8 1999/03/14 00:10:27 Alexander.V.Lukyanov Exp $") /* * Write the soft labels to the soft-key window. @@ -47,24 +47,25 @@ static void slk_intern_refresh(SLK *slk) { int i; +int fmt = SP->slk_format; + for (i = 0; i < slk->labcnt; i++) { if (slk->dirty || slk->ent[i].dirty) { if (slk->ent[i].visible) { -#ifdef num_labels - if (num_labels > 0 && SLK_STDFMT) + if (num_labels > 0 && SLK_STDFMT(fmt)) { if (i < num_labels) { TPUTS_TRACE("plab_norm"); - putp(tparm(plab_norm, i, slk->win,slk->ent[i].form_text)); + putp(tparm(plab_norm, i+1, slk->ent[i].form_text)); } } else -#endif /* num_labels */ { - wmove(slk->win,SLK_LINES-1,slk->ent[i].x); + wmove(slk->win,SLK_LINES(fmt)-1,slk->ent[i].x); if (SP && SP->_slk) wattrset(slk->win,SP->_slk->attr); - waddnstr(slk->win,slk->ent[i].form_text, MAX_SKEY_LEN); + waddnstr(slk->win,slk->ent[i].form_text, + MAX_SKEY_LEN(fmt)); /* if we simulate SLK's, it's looking much more natural to use the current ATTRIBUTE also for the label window */ @@ -76,8 +77,7 @@ int i; } slk->dirty = FALSE; -#ifdef num_labels - if (num_labels > 0) + if (num_labels > 0) { if (slk->hidden) { TPUTS_TRACE("label_off"); @@ -88,7 +88,7 @@ int i; TPUTS_TRACE("label_on"); putp(label_on); } -#endif /* num_labels */ + } } /* diff --git a/ncurses/lib_slkset.c b/ncurses/base/lib_slkset.c similarity index 100% rename from ncurses/lib_slkset.c rename to ncurses/base/lib_slkset.c diff --git a/ncurses/lib_slktouch.c b/ncurses/base/lib_slktouch.c similarity index 100% rename from ncurses/lib_slktouch.c rename to ncurses/base/lib_slktouch.c diff --git a/ncurses/lib_touch.c b/ncurses/base/lib_touch.c similarity index 96% rename from ncurses/lib_touch.c rename to ncurses/base/lib_touch.c index f39338d0..7ce863d0 100644 --- a/ncurses/lib_touch.c +++ b/ncurses/base/lib_touch.c @@ -43,9 +43,9 @@ #include -MODULE_ID("$Id: lib_touch.c,v 1.5 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_touch.c,v 1.6 1998/04/11 22:55:02 tom Exp $") -int is_linetouched(WINDOW *win, int line) +bool is_linetouched(WINDOW *win, int line) { T((T_CALLED("is_linetouched(%p,%d)"), win, line)); @@ -56,7 +56,7 @@ int is_linetouched(WINDOW *win, int line) returnCode(win->_line[line].firstchar != _NOCHANGE ? TRUE : FALSE); } -int is_wintouched(WINDOW *win) +bool is_wintouched(WINDOW *win) { int i; diff --git a/ncurses/lib_ungetch.c b/ncurses/base/lib_ungetch.c similarity index 100% rename from ncurses/lib_ungetch.c rename to ncurses/base/lib_ungetch.c diff --git a/ncurses/lib_vline.c b/ncurses/base/lib_vline.c similarity index 89% rename from ncurses/lib_vline.c rename to ncurses/base/lib_vline.c index 93936c09..007ef55c 100644 --- a/ncurses/lib_vline.c +++ b/ncurses/base/lib_vline.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_vline.c,v 1.2 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_vline.c,v 1.4 1998/06/28 00:10:12 tom Exp $") int wvline(WINDOW *win, chtype ch, int n) { @@ -64,13 +64,9 @@ short end; ch = _nc_render(win, ch); while(end >= row) { - win->_line[end].text[col] = ch; - if (win->_line[end].firstchar == _NOCHANGE - || win->_line[end].firstchar > col) - win->_line[end].firstchar = col; - if (win->_line[end].lastchar == _NOCHANGE - || win->_line[end].lastchar < col) - win->_line[end].lastchar = col; + struct ldat *line = &(win->_line[end]); + line->text[col] = ch; + CHANGED_CELL(line, col); end--; } diff --git a/ncurses/lib_wattroff.c b/ncurses/base/lib_wattroff.c similarity index 95% rename from ncurses/lib_wattroff.c rename to ncurses/base/lib_wattroff.c index 6f14be63..a6c9f0f1 100644 --- a/ncurses/lib_wattroff.c +++ b/ncurses/base/lib_wattroff.c @@ -41,9 +41,9 @@ #include #include -MODULE_ID("$Id: lib_wattroff.c,v 1.2 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_wattroff.c,v 1.4 1998/05/10 12:02:11 tom Exp $") -int wattr_off(WINDOW *win, const attr_t at) +int wattr_off(WINDOW *win, NCURSES_CONST attr_t at, void *opts GCC_UNUSED) { T((T_CALLED("wattr_off(%p,%s)"), win, _traceattr(at))); if (win) { diff --git a/ncurses/lib_wattron.c b/ncurses/base/lib_wattron.c similarity index 95% rename from ncurses/lib_wattron.c rename to ncurses/base/lib_wattron.c index fed0fe4d..a951c576 100644 --- a/ncurses/lib_wattron.c +++ b/ncurses/base/lib_wattron.c @@ -41,9 +41,9 @@ #include #include -MODULE_ID("$Id: lib_wattron.c,v 1.2 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_wattron.c,v 1.4 1998/05/10 12:02:28 tom Exp $") -int wattr_on(WINDOW *win, const attr_t at) +int wattr_on(WINDOW *win, NCURSES_CONST attr_t at, void *opts GCC_UNUSED) { T((T_CALLED("wattr_on(%p,%s)"), win, _traceattr(at))); if (win) { diff --git a/ncurses/base/lib_winch.c b/ncurses/base/lib_winch.c new file mode 100644 index 00000000..119c731e --- /dev/null +++ b/ncurses/base/lib_winch.c @@ -0,0 +1,52 @@ +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1998 * + ****************************************************************************/ + +/* +** lib_winch.c +** +** The routine winch(). +** +*/ + +#include + +MODULE_ID("$Id: lib_winch.c,v 1.1 1998/11/14 22:06:09 tom Exp $") + +chtype winch(WINDOW *win) +{ + T((T_CALLED("winch(%p)"), win)); + if (win != 0) { + returnCode(win->_line[win->_cury].text[win->_curx]); + } else { + returnCode(0); + } +} diff --git a/ncurses/lib_window.c b/ncurses/base/lib_window.c similarity index 90% rename from ncurses/lib_window.c rename to ncurses/base/lib_window.c index 741ff3f9..5eae9b1a 100644 --- a/ncurses/lib_window.c +++ b/ncurses/base/lib_window.c @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_window.c,v 1.11 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: lib_window.c,v 1.13 1998/06/28 00:10:59 tom Exp $") void _nc_synchook(WINDOW *win) /* hook to be called after each window change */ @@ -108,22 +108,12 @@ void wsyncup(WINDOW *win) int left = wp->_line[y].firstchar; if (left >= 0) /* line is touched */ { + struct ldat *line = &(pp->_line[wp->_pary + y]); /* left & right character in parent window coordinates */ int right = wp->_line[y].lastchar + wp->_parx; left += wp->_parx; - if (pp->_line[wp->_pary + y].firstchar == _NOCHANGE) - { - pp->_line[wp->_pary + y].firstchar = left; - pp->_line[wp->_pary + y].lastchar = right; - } - else - { - if (left < pp->_line[wp->_pary + y].firstchar) - pp->_line[wp->_pary + y].firstchar = left; - if (pp->_line[wp->_pary + y].lastchar < right) - pp->_line[wp->_pary + y].lastchar = right; - } + CHANGED_RANGE(line, left, right); } } } @@ -151,6 +141,7 @@ void wsyncdown(WINDOW *win) { if (pp->_line[win->_pary + y].firstchar >= 0) /* parent changed */ { + struct ldat *line = &(win->_line[y]); /* left and right character in child coordinates */ int left = pp->_line[win->_pary + y].firstchar - win->_parx; int right = pp->_line[win->_pary + y].lastchar - win->_parx; @@ -159,18 +150,7 @@ void wsyncdown(WINDOW *win) left = 0; if (right > win->_maxx) right = win->_maxx; - if (win->_line[y].firstchar == _NOCHANGE) - { - win->_line[y].firstchar = left; - win->_line[y].lastchar = right; - } - else - { - if (left < win->_line[y].firstchar) - win->_line[y].firstchar = left; - if (win->_line[y].lastchar < right) - win->_line[y].lastchar = right; - } + CHANGED_RANGE(line, left, right); } } } diff --git a/ncurses/base/memmove.c b/ncurses/base/memmove.c new file mode 100644 index 00000000..55a41063 --- /dev/null +++ b/ncurses/base/memmove.c @@ -0,0 +1,63 @@ +/**************************************************************************** + * 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. * + ****************************************************************************/ + +#include + +MODULE_ID("$Id: memmove.c,v 1.2 1999/02/27 19:55:57 tom Exp $") + +/**************************************************************************** + * Author: Thomas E. Dickey 1998 * + ****************************************************************************/ + +#if USE_MY_MEMMOVE +#define DST ((char *)s1) +#define SRC ((const char *)s2) +void * _nc_memmove(void * s1, const void * s2, size_t n) +{ + if (n != 0) { + if ((DST+n > SRC) && (SRC+n > DST)) { + static char *bfr; + static size_t length; + register size_t j; + if (length < n) { + length = (n * 3) / 2; + bfr = typeRealloc(char,length,bfr); + } + for (j = 0; j < n; j++) + bfr[j] = SRC[j]; + SRC = bfr; + } + while (n-- != 0) + DST[n] = SRC[n]; + } + return s1; +} +#else +extern void _nc_memmove(void); /* quiet's gcc warning */ +void _nc_memmove(void) { } /* nonempty for strict ANSI compilers */ +#endif /* USE_MY_MEMMOVE */ diff --git a/ncurses/nc_panel.c b/ncurses/base/nc_panel.c similarity index 100% rename from ncurses/nc_panel.c rename to ncurses/base/nc_panel.c diff --git a/ncurses/resizeterm.c b/ncurses/base/resizeterm.c similarity index 94% rename from ncurses/resizeterm.c rename to ncurses/base/resizeterm.c index aaf823fb..86035502 100644 --- a/ncurses/resizeterm.c +++ b/ncurses/base/resizeterm.c @@ -41,7 +41,7 @@ #include #include -MODULE_ID("$Id: resizeterm.c,v 1.6 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: resizeterm.c,v 1.7 1998/09/19 19:27:43 Alexander.V.Lukyanov Exp $") /* * This function reallocates NCURSES window structures. It is invoked in @@ -69,7 +69,7 @@ resizeterm(int ToLines, int ToCols) #if USE_SIGWINCH ungetch(KEY_RESIZE); /* so application can know this */ - clearok(curscr, TRUE); /* screen contents is unknown */ + clearok(curscr, TRUE); /* screen contents are unknown */ #endif for (wp = _nc_windows; wp != 0; wp = wp->next) { @@ -105,6 +105,9 @@ resizeterm(int ToLines, int ToCols) screen_columns = columns = ToCols; SP->_lines_avail = lines - stolen; + + if (SP->oldhash) { FreeAndNull(SP->oldhash); } + if (SP->newhash) { FreeAndNull(SP->newhash); } } /* diff --git a/ncurses/safe_sprintf.c b/ncurses/base/safe_sprintf.c similarity index 92% rename from ncurses/safe_sprintf.c rename to ncurses/base/safe_sprintf.c index 6dbc8d98..e4d52527 100644 --- a/ncurses/safe_sprintf.c +++ b/ncurses/base/safe_sprintf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,7 @@ #include #include -MODULE_ID("$Id: safe_sprintf.c,v 1.5 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: safe_sprintf.c,v 1.11 1999/09/11 18:03:27 tom Exp $") #if USE_SAFE_SPRINTF @@ -57,17 +57,18 @@ _nc_printf_length(const char *fmt, va_list ap) if (fmt == 0 || *fmt == '\0') return -1; - if ((format = malloc(strlen(fmt)+1)) == 0) + if ((format = typeMalloc(char, strlen(fmt)+1)) == 0) return -1; - if ((buffer = malloc(length)) == 0) { + if ((buffer = typeMalloc(char, length)) == 0) { free(format); return -1; } while (*fmt != '\0') { if (*fmt == '%') { + static char dummy[] = ""; PRINTF state = Flags; - char *pval = ""; + char *pval = dummy; /* avoid const-cast */ double fval = 0.0; int done = FALSE; int ival = 0; @@ -111,7 +112,6 @@ _nc_printf_length(const char *fmt, va_list ap) case 'Z': /* FALLTHRU */ case 'h': /* FALLTHRU */ case 'l': /* FALLTHRU */ - case 'L': /* FALLTHRU */ done = FALSE; type = *fmt; break; @@ -133,10 +133,7 @@ _nc_printf_length(const char *fmt, va_list ap) case 'E': /* FALLTHRU */ case 'g': /* FALLTHRU */ case 'G': /* FALLTHRU */ - if (type == 'L') - VA_FLOAT(long double); - else - VA_FLOAT(double); + VA_FLOAT(double); used = 'f'; break; case 'c': @@ -149,7 +146,7 @@ _nc_printf_length(const char *fmt, va_list ap) prec = strlen(pval); if (prec > (int)length) { length = length + prec; - buffer = realloc(buffer, length); + buffer = typeRealloc(char, length, buffer); if (buffer == 0) { free(format); return -1; @@ -211,7 +208,8 @@ _nc_printf_string(const char *fmt, va_list ap) int len = _nc_printf_length(fmt, ap); if (len > 0) { - buf = malloc(len+1); + if ((buf = typeMalloc(char, len+1)) == 0) + return(0); vsprintf(buf, fmt, ap); } #else @@ -223,10 +221,10 @@ _nc_printf_string(const char *fmt, va_list ap) if (screen_lines > rows) rows = screen_lines; if (screen_columns > cols) cols = screen_columns; len = (rows * (cols + 1)) + 1; - if (buf == 0) - buf = malloc(len); - else - buf = realloc(buf, len); + buf = typeRealloc(char, len, buf); + if (buf == 0) { + return(0); + } } if (buf != 0) { @@ -235,7 +233,7 @@ _nc_printf_string(const char *fmt, va_list ap) # else vsprintf(buf, fmt, ap); /* ANSI */ # endif -#endif } +#endif return buf; } diff --git a/ncurses/sigaction.c b/ncurses/base/sigaction.c similarity index 94% rename from ncurses/sigaction.c rename to ncurses/base/sigaction.c index 405f5913..ab1e569f 100644 --- a/ncurses/sigaction.c +++ b/ncurses/base/sigaction.c @@ -33,14 +33,15 @@ #include +#include +#include + /* This file provides sigaction() emulation using sigvec() */ /* Use only if this is non POSIX system */ -#if !HAVE_SIGACTION -#include -#include +#if !HAVE_SIGACTION && HAVE_SIGVEC -MODULE_ID("$Id: sigaction.c,v 1.7 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: sigaction.c,v 1.9 1999/06/19 23:05:16 tom Exp $") int sigaction (int sig, sigaction_t * sigact, sigaction_t * osigact) @@ -57,7 +58,7 @@ sigemptyset (sigset_t * mask) int sigprocmask (int mode, sigset_t * mask, sigset_t * omask) - { +{ sigset_t current = sigsetmask(0); if (omask) *omask = current; @@ -71,7 +72,7 @@ sigprocmask (int mode, sigset_t * mask, sigset_t * omask) sigsetmask(current); return 0; - } +} int sigsuspend (sigset_t * mask) @@ -92,6 +93,13 @@ sigaddset (sigset_t * mask, int sig) *mask |= sigmask (sig); return 0; } + +int +sigismember (sigset_t * mask, int sig) +{ + return (*mask & sigmask (sig)) != 0; +} + #else extern void _nc_sigaction(void); /* quiet's gcc warning */ void _nc_sigaction(void) { } /* nonempty for strict ANSI compilers */ diff --git a/ncurses/base/tries.c b/ncurses/base/tries.c new file mode 100644 index 00000000..3c396529 --- /dev/null +++ b/ncurses/base/tries.c @@ -0,0 +1,138 @@ +/**************************************************************************** + * 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 * + ****************************************************************************/ + +/* +** tries.c +** +** Functions to manage the tree of partial-completions for keycodes. +** +*/ + +#include + +MODULE_ID("$Id: tries.c,v 1.12 1999/03/01 23:23:59 tom Exp $") + +/* + * Expand a keycode into the string that it corresponds to, returning null if + * no match was found, otherwise allocating a string of the result. + */ +char *_nc_expand_try(struct tries *tree, unsigned short code, int *count, size_t len) +{ + struct tries *ptr = tree; + char *result = 0; + + if (code != 0) { + while (ptr != 0) { + if ((result = _nc_expand_try(ptr->child, code, count, len + 1)) != 0) { + break; + } + if (ptr->value == code) { + *count -= 1; + if (*count == -1) { + result = typeCalloc(char, len+2); + break; + } + } + ptr = ptr->sibling; + } + } + if (result != 0) { + if ((result[len] = ptr->ch) == 0) + *((unsigned char *)(result+len)) = 128; +#ifdef TRACE + if (len == 0) + _tracef("expand_key %s %s", _trace_key(code), _nc_visbuf(result)); +#endif + } + return result; +} + +/* + * Remove a code from the specified tree, freeing the unused nodes. Returns + * true if the code was found/removed. + */ +int _nc_remove_key(struct tries **tree, unsigned short code) +{ + T((T_CALLED("_nc_remove_key(%p,%d)"), tree, code)); + + if (code == 0) + returnCode(FALSE); + + while (*tree != 0) { + if (_nc_remove_key(&(*tree)->child, code)) { + returnCode(TRUE); + } + if ((*tree)->value == code) { + if((*tree)->child) { + /* don't cut the whole sub-tree */ + (*tree)->value = 0; + } else { + struct tries *to_free = *tree; + *tree = (*tree)->sibling; + free(to_free); + } + returnCode(TRUE); + } + tree = &(*tree)->sibling; + } + returnCode(FALSE); +} + +/* + * Remove a string from the specified tree, freeing the unused nodes. Returns + * true if the string was found/removed. + */ +int _nc_remove_string(struct tries **tree, char *string) +{ + T((T_CALLED("_nc_remove_string(%p,%s)"), tree, _nc_visbuf(string))); + + if (string == 0 || *string == 0) + returnCode(FALSE); + + while (*tree != 0) { + if ((unsigned char)(*tree)->ch == (unsigned char)*string) { + if (string[1] != 0) + returnCode(_nc_remove_string(&(*tree)->child, string+1)); + if((*tree)->child) { + /* don't cut the whole sub-tree */ + (*tree)->value = 0; + } else { + struct tries *to_free = *tree; + *tree = (*tree)->sibling; + free(to_free); + } + returnCode(TRUE); + } + tree = &(*tree)->sibling; + } + returnCode(FALSE); +} diff --git a/ncurses/base/version.c b/ncurses/base/version.c new file mode 100644 index 00000000..74d46ae9 --- /dev/null +++ b/ncurses/base/version.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * Copyright (c) 1999 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1999 * + ****************************************************************************/ + +#include + +MODULE_ID("$Id: version.c,v 1.1 1999/10/23 13:28:49 tom Exp $") + +const char * +curses_version(void) +{ + static char my_version[80]; + + T((T_CALLED("curses_version()"))); + sprintf(my_version, "ncurses %d.%d.%d", + NCURSES_VERSION_MAJOR, + NCURSES_VERSION_MINOR, + NCURSES_VERSION_PATCH); + returnPtr(my_version); +} diff --git a/ncurses/vsscanf.c b/ncurses/base/vsscanf.c similarity index 100% rename from ncurses/vsscanf.c rename to ncurses/base/vsscanf.c diff --git a/ncurses/wresize.c b/ncurses/base/wresize.c similarity index 95% rename from ncurses/wresize.c rename to ncurses/base/wresize.c index c5b2dd9a..1b91476c 100644 --- a/ncurses/wresize.c +++ b/ncurses/base/wresize.c @@ -31,9 +31,8 @@ ****************************************************************************/ #include -#include -MODULE_ID("$Id: wresize.c,v 1.9 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: wresize.c,v 1.12 1999/02/27 18:57:31 tom Exp $") /* * Reallocate a curses WINDOW struct to either shrink or grow to the specified @@ -41,16 +40,7 @@ MODULE_ID("$Id: wresize.c,v 1.9 1998/02/11 12:13:54 tom Exp $") * blanks. The application is responsible for repainting the blank area. */ -static void *doalloc(void *p, size_t n) -{ - if (p == 0) - p = malloc(n); - else - p = realloc(p, n); - return p; -} - -#define DOALLOC(p,t,n) (t *)doalloc(p, sizeof(t)*(n)) +#define DOALLOC(p,t,n) typeRealloc(t, n, p) #define ld_ALLOC(p,n) DOALLOC(p,struct ldat,n) #define c_ALLOC(p,n) DOALLOC(p,chtype,n) diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 30ce3fbf..76a92305 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -33,7 +33,7 @@ /* - * $Id: curses.priv.h,v 1.101 1998/02/11 12:13:57 tom Exp $ + * $Id: curses.priv.h,v 1.144 1999/10/22 23:15:37 tom Exp $ * * curses.priv.h * @@ -117,6 +117,11 @@ extern int errno; #define USE_QNX_MOUSE 0 #endif +/* EMX mouse support */ +#ifdef __EMX__ +#define USE_EMX_MOUSE +#endif + #define DEFAULT_MAXCLICK 166 #define EV_MAX 8 /* size of mouse circular event queue */ @@ -135,10 +140,21 @@ extern int errno; #endif /* - * As currently coded, hashmap relies on the scroll-hints logic. + * Not all platforms have memmove; some have an equivalent bcopy. (Some may + * have neither). + */ +#if USE_OK_BCOPY +#define memmove(d,s,n) bcopy(s,d,n) +#elif USE_MY_MEMMOVE +#define memmove(d,s,n) _nc_memmove(d,s,n) +extern void * _nc_memmove(void *, const void *, size_t); +#endif + +/* + * Scroll hints are useless when hashmap is used */ #if !USE_SCROLL_HINTS -#if USE_HASHMAP +#if !USE_HASHMAP #define USE_SCROLL_HINTS 1 #else #define USE_SCROLL_HINTS 0 @@ -174,6 +190,13 @@ struct tries { #define PAIR_OF(fg, bg) ((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK)) +/* + * Common/troublesome character definitions + */ +#define L_BRACE '{' +#define R_BRACE '}' +#define S_QUOTE '\'' + /* * Structure for palette tables */ @@ -223,6 +246,7 @@ struct screen { int _ifd; /* input file ptr for screen */ FILE *_ofp; /* output file ptr for screen */ char *_setbuf; /* buffered I/O for output */ + int _buffered; /* setvbuf uses _setbuf data */ int _checkfd; /* filedesc for typeahead check */ struct term *_term; /* terminal type information */ short _lines; /* screen lines */ @@ -257,8 +281,11 @@ struct screen { int _echo; /* True if echo on */ int _use_meta; /* use the meta key? */ SLK *_slk; /* ptr to soft key struct / NULL */ - + int slk_format; /* selected format for this screen */ /* cursor movement costs; units are 10ths of milliseconds */ +#ifdef NCURSES_NO_PADDING + int _no_padding; /* flag to set if padding disabled */ +#endif int _char_padding; /* cost of character put */ int _cr_cost; /* cost of (carriage_return) */ int _cup_cost; /* cost of (cursor_address) */ @@ -290,6 +317,9 @@ struct screen { int _rep_cost; /* cost of (repeat_char) */ int _hpa_ch_cost; /* cost of (column_address) */ int _cup_ch_cost; /* cost of (cursor_address) */ + int _smir_cost; /* cost of (enter_insert_mode) */ + int _rmir_cost; /* cost of (exit_insert_mode) */ + int _ip_cost; /* cost of (insert_padding) */ /* used in lib_mvcur.c */ char * _address_cursor; int _carriage_return_length; @@ -307,6 +337,10 @@ struct screen { chtype _xmc_triggers; /* attributes to process if xmc */ chtype _acs_map[ACS_LEN]; + /* used in lib_vidattr.c */ + bool _use_rmso; /* true if we may use 'rmso' */ + bool _use_rmul; /* true if we may use 'rmul' */ + /* * These data correspond to the state of the idcok() and idlok() * functions. A caveat is in order here: the XSI and SVr4 @@ -351,6 +385,11 @@ struct screen { bool _sig_winch; SCREEN *_next_screen; + + /* hashes for old and new lines */ + unsigned long *oldhash, *newhash; + + bool _cleanup; /* cleanup after int/quit signal */ }; extern SCREEN *_nc_screen_chain; @@ -382,6 +421,10 @@ typedef struct { #endif /* usually in */ +#ifndef STDIN_FILENO +#define STDIN_FILENO 0 +#endif + #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif @@ -418,8 +461,32 @@ typedef struct { #define CHANGED -1 +#define CHANGED_CELL(line,col) \ + if (line->firstchar == _NOCHANGE) \ + line->firstchar = line->lastchar = col; \ + else if ((col) < line->firstchar) \ + line->firstchar = col; \ + else if ((col) > line->lastchar) \ + line->lastchar = col + +#define CHANGED_RANGE(line,start,end) \ + if (line->firstchar == _NOCHANGE \ + || line->firstchar > (start)) \ + line->firstchar = start; \ + if (line->lastchar == _NOCHANGE \ + || line->lastchar < (end)) \ + line->lastchar = end + +#define CHANGED_TO_EOL(line,start,end) \ + if (line->firstchar == _NOCHANGE \ + || line->firstchar > (start)) \ + line->firstchar = start; \ + line->lastchar = end + #define SIZEOF(v) (sizeof(v)/sizeof(v[0])) -#define typeCalloc(type,elts) (type *)calloc(elts,sizeof(type)) +#define typeMalloc(type,elts) (type *)malloc((elts)*sizeof(type)) +#define typeCalloc(type,elts) (type *)calloc((elts),sizeof(type)) +#define typeRealloc(type,elts,ptr) (type *)_nc_doalloc(ptr, (elts)*sizeof(type)) #define FreeIfNeeded(p) if(p != 0) free(p) #define FreeAndNull(p) free(p); p = 0 @@ -444,13 +511,10 @@ typedef struct { #define returnPtr(code) TRACE_RETURN(code,ptr) #define returnVoid T((T_RETURN(""))); return #define returnWin(code) TRACE_RETURN(code,win) -extern unsigned _nc_tracing; extern WINDOW * _nc_retrace_win(WINDOW *); extern attr_t _nc_retrace_attr_t(attr_t); extern char *_nc_retrace_ptr(char *); extern const char *_nc_tputs_trace; -extern const char *_nc_visbuf(const char *); -extern const char *_nc_visbuf2(int, const char *); extern int _nc_retrace_int(int); extern long _nc_outchars; extern void _nc_fifo_dump(void); @@ -465,6 +529,9 @@ extern void _nc_fifo_dump(void); #define returnWin(code) return code #endif +extern unsigned _nc_tracing; +extern const char *_nc_visbuf2(int, const char *); + #define _trace_key(ch) ((ch > KEY_MIN) ? keyname(ch) : _tracechar((unsigned char)ch)) #define ALL_BUT_COLOR ((chtype)~(A_COLOR)) @@ -505,9 +572,11 @@ extern void _nc_fifo_dump(void); #define InsCharCost(count) \ ((parm_ich != 0) \ ? SP->_ich_cost \ - : ((insert_character != 0) \ - ? (SP->_ich1_cost * count) \ - : INFINITY)) + : ((enter_insert_mode && exit_insert_mode) \ + ? SP->_smir_cost + SP->_rmir_cost + (SP->_ip_cost * count) \ + : ((insert_character != 0) \ + ? (SP->_ich1_cost * count) \ + : INFINITY))) #if USE_XMC_SUPPORT #define UpdateAttrs(c) if (SP->_current_attr != AttrOf(c)) { \ @@ -568,23 +637,29 @@ extern void _nc_expanded(void); #endif +#if !HAVE_GETCWD +#define getcwd(buf,len) getwd(buf) +#endif + +/* doalloc.c */ +extern void *_nc_doalloc(void *, size_t); +#if !HAVE_STRDUP +#define strdup _nc_strdup +extern char *_nc_strdup(const char *); +#endif + /* doupdate.c */ #if USE_XMC_SUPPORT extern void _nc_do_xmc_glitch(attr_t); #endif /* hardscroll.c */ -#if defined(TRACE) || defined(SCROLLDEBUG) -extern void _nc_linedump(void); -#endif - -/* hardscroll.c */ -#if defined(TRACE) || defined(SCROLLDEBUG) +#if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) extern void _nc_linedump(void); #endif /* lib_acs.c */ -extern void init_acs(void); /* no prefix, this name is traditional */ +extern void _nc_init_acs(void); /* corresponds to traditional 'init_acs()' */ extern int _nc_msec_cost(const char *const, int); /* used by 'tack' program */ /* lib_mvcur.c */ @@ -600,47 +675,70 @@ extern void _nc_screen_init(void); extern void _nc_screen_resume(void); extern void _nc_screen_wrap(void); +#if !HAVE_STRSTR +#define strstr _nc_strstr +extern char *_nc_strstr(const char *, const char *); +#endif + /* lib_mouse.c */ extern int _nc_has_mouse(void); /* safe_sprintf.c */ extern char * _nc_printf_string(const char *fmt, va_list ap); -/* softscroll.c */ -extern void _nc_setup_scroll(void); -extern void _nc_perform_scroll(void); - /* tries.c */ extern void _nc_add_to_try(struct tries **tree, char *str, unsigned short code); -extern char *_nc_expand_try(struct tries *tree, unsigned short code, size_t len); +extern char *_nc_expand_try(struct tries *tree, unsigned short code, int *count, size_t len); extern int _nc_remove_key(struct tries **tree, unsigned short code); +extern int _nc_remove_string(struct tries **tree, char *string); /* elsewhere ... */ extern WINDOW *_nc_makenew(int, int, int, int, int); +extern char *_nc_home_terminfo(void); extern char *_nc_trace_buf(int, size_t); extern chtype _nc_background(WINDOW *); extern chtype _nc_render(WINDOW *, chtype); +extern int _nc_access(const char *, int); +extern int _nc_baudrate(int); +extern int _nc_getenv_num(const char *); extern int _nc_keypad(bool); +extern int _nc_ospeed(int); extern int _nc_outch(int); extern int _nc_setupscreen(short, short const, FILE *); extern int _nc_timed_wait(int, int, int *); extern int _nc_waddch_nosync(WINDOW *, const chtype); extern void _nc_do_color(int, bool, int (*)(int)); -extern void _nc_free_and_exit(int); extern void _nc_freeall(void); extern void _nc_freewin(WINDOW *win); extern void _nc_hash_map(void); +extern void _nc_init_keytry(void); +extern void _nc_keep_tic_dir(const char *); +extern void _nc_make_oldhash(int i); extern void _nc_outstr(const char *str); +extern void _nc_scroll_oldhash(int n, int top, int bot); extern void _nc_scroll_optimize(void); extern void _nc_scroll_window(WINDOW *, int const, short const, short const, chtype); extern void _nc_set_buffer(FILE *ofp, bool buffered); extern void _nc_signal_handler(bool); extern void _nc_synchook(WINDOW *win); +extern void _nc_trace_tries(struct tries *tree); #if USE_SIZECHANGE extern void _nc_update_screensize(void); #endif +/* scroll indices */ +extern int *_nc_oldnums; + +#define USE_SETBUF_0 0 + +#define NC_BUFFERED(flag) \ + if ((SP->_buffered != 0) != flag) \ + _nc_set_buffer(SP->_ofp, flag) + +#define NC_OUTPUT ((SP != 0) ? SP->_ofp : stdout) +#define _nc_flush() (void)fflush(NC_OUTPUT) + /* * On systems with a broken linker, define 'SP' as a function to force the * linker to pull in the data-only module with 'SP'. @@ -673,21 +771,21 @@ extern SCREEN *SP; extern int _nc_slk_format; /* != 0 if slk_init() called */ extern int _nc_slk_initialize(WINDOW *, int); -/* - * Some constants related to SLK's +/* + * Some constants related to SLK's */ #define MAX_SKEY_OLD 8 /* count of soft keys */ #define MAX_SKEY_LEN_OLD 8 /* max length of soft key text */ #define MAX_SKEY_PC 12 /* This is what most PC's have */ #define MAX_SKEY_LEN_PC 5 -#define MAX_SKEY (SLK_STDFMT ? MAX_SKEY_OLD : MAX_SKEY_PC) -#define MAX_SKEY_LEN (SLK_STDFMT ? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC) - /* Macro to check whether or not we use a standard format */ -#define SLK_STDFMT (_nc_slk_format < 3) +#define SLK_STDFMT(fmt) (fmt < 3) /* Macro to determine height of label window */ -#define SLK_LINES (SLK_STDFMT ? 1 : (_nc_slk_format - 2)) +#define SLK_LINES(fmt) (SLK_STDFMT(fmt) ? 1 : ((fmt) - 2)) + +#define MAX_SKEY(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_OLD : MAX_SKEY_PC) +#define MAX_SKEY_LEN(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC) extern int _nc_ripoffline(int line, int (*init)(WINDOW *,int)); diff --git a/ncurses/lib_adabind.c b/ncurses/lib_adabind.c deleted file mode 100644 index e049b2b0..00000000 --- a/ncurses/lib_adabind.c +++ /dev/null @@ -1,246 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer 1996,1997 * - ****************************************************************************/ - -/* -// lib_adabind.c -// -// Some small wrappers to ease the implementation of an Ada95 -// binding. Especially functionalities only available as macros -// in (n)curses are wrapped here by functions. -// See the documentation and copyright notices in the ../Ada95 -// subdirectory. -*/ -#include "curses.priv.h" - -MODULE_ID("$Id: lib_adabind.c,v 1.7 1998/02/11 12:13:59 tom Exp $") - -/* In (n)curses are a few functionalities that can't be expressed as -// functions, because for historic reasons they use as macro argument -// variable names that are "out" parameters. For those macros we provide -// small wrappers. -*/ - -/* Prototypes for the functions in this module */ -int _nc_ada_getmaxyx (const WINDOW *win, int *y, int *x); -int _nc_ada_getbegyx (const WINDOW *win, int *y, int *x); -int _nc_ada_getyx (const WINDOW *win, int *y, int *x); -int _nc_ada_getparyx (const WINDOW *win, int *y, int *x); -int _nc_ada_isscroll (const WINDOW *win); -int _nc_ada_coord_transform (const WINDOW *win, int *Y, int *X, int dir); -void _nc_ada_mouse_event (mmask_t m, int *b, int *s); -int _nc_ada_mouse_mask (int button, int state, mmask_t *mask); -void _nc_ada_unregister_mouse (void); -int _nc_ada_vcheck (int major, int minor); - -int _nc_ada_getmaxyx (const WINDOW *win, int *y, int *x) -{ - if (win && y && x) - { - getmaxyx(win,*y,*x); - return OK; - } - else - return ERR; -} - -int _nc_ada_getbegyx (const WINDOW *win, int *y, int *x) -{ - if (win && y && x) - { - getbegyx(win,*y,*x); - return OK; - } - else - return ERR; -} - -int _nc_ada_getyx (const WINDOW *win, int *y, int *x) -{ - if (win && y && x) - { - getyx(win,*y,*x); - return OK; - } - else - return ERR; -} - -int _nc_ada_getparyx (const WINDOW *win, int *y, int *x) -{ - if (win && y && x) - { - getparyx(win,*y,*x); - return OK; - } - else - return ERR; -} - -int _nc_ada_isscroll (const WINDOW *win) -{ - return win ? (win->_scroll ? TRUE : FALSE) : ERR; -} - -int _nc_ada_coord_transform (const WINDOW *win, int *Y, int *X, int dir) -{ - if (win && Y && X) - { - int y = *Y; int x = *X; - if (dir) - { /* to screen coordinates */ - y += win->_yoffset; - y += win->_begy; - x += win->_begx; - if (!wenclose(win,y,x)) - return FALSE; - } - else - { /* from screen coordinates */ - if (!wenclose(win,y,x)) - return FALSE; - y -= win->_yoffset; - y -= win->_begy; - x -= win->_begx; - } - *X = x; - *Y = y; - return TRUE; - } - return FALSE; -} - -#define BUTTON1_EVENTS (BUTTON1_RELEASED |\ - BUTTON1_PRESSED |\ - BUTTON1_CLICKED |\ - BUTTON1_DOUBLE_CLICKED |\ - BUTTON1_TRIPLE_CLICKED |\ - BUTTON1_RESERVED_EVENT ) - -#define BUTTON2_EVENTS (BUTTON2_RELEASED |\ - BUTTON2_PRESSED |\ - BUTTON2_CLICKED |\ - BUTTON2_DOUBLE_CLICKED |\ - BUTTON2_TRIPLE_CLICKED |\ - BUTTON2_RESERVED_EVENT ) - -#define BUTTON3_EVENTS (BUTTON3_RELEASED |\ - BUTTON3_PRESSED |\ - BUTTON3_CLICKED |\ - BUTTON3_DOUBLE_CLICKED |\ - BUTTON3_TRIPLE_CLICKED |\ - BUTTON3_RESERVED_EVENT ) - -#define BUTTON4_EVENTS (BUTTON4_RELEASED |\ - BUTTON4_PRESSED |\ - BUTTON4_CLICKED |\ - BUTTON4_DOUBLE_CLICKED |\ - BUTTON4_TRIPLE_CLICKED |\ - BUTTON4_RESERVED_EVENT ) - -void _nc_ada_mouse_event( mmask_t m, int *b, int *s ) -{ - int k = 0; - - if ( m & BUTTON1_EVENTS) - { - k = 1; - } - else if ( m & BUTTON2_EVENTS) - { - k = 2; - } - else if ( m & BUTTON3_EVENTS) - { - k = 3; - } - else if ( m & BUTTON4_EVENTS) - { - k = 4; - } - - if (k) - { - *b = k-1; - if (BUTTON_RELEASE(m,k)) *s = 0; - else if (BUTTON_PRESS(m,k)) *s = 1; - else if (BUTTON_CLICK(m,k)) *s = 2; - else if (BUTTON_DOUBLE_CLICK(m,k)) *s = 3; - else if (BUTTON_TRIPLE_CLICK(m,k)) *s = 4; - else if (BUTTON_RESERVED_EVENT(m,k)) *s = 5; - else - { - *s = -1; - } - } - else - { - *s = 1; - if (m & BUTTON_CTRL) *b = 4; - else if (m & BUTTON_SHIFT) *b = 5; - else if (m & BUTTON_ALT) *b = 6; - else - { - *b = -1; - } - } -} - -int _nc_ada_mouse_mask ( int button, int state, mmask_t *mask ) -{ - mmask_t b = (button<4) ? ((1<=4 && state!=1) - return ERR; - - *mask |= b; - return OK; -} - -/* - * Allow Ada to check whether or not we are the correct library version - * for the binding. It calls this routine with the version it requests - * and this routine returns a 1 if it is a correct version, a 2 if the - * major version is correct but the minor version of the library differs - * and a 0 if the versions don't match. - */ -int _nc_ada_vcheck (int major, int minor) -{ - if (major==NCURSES_VERSION_MAJOR) { - if (minor==NCURSES_VERSION_MINOR) - return 1; - else - return 2; - } - else - return 0; -} diff --git a/ncurses/llib-lncurses b/ncurses/llib-lncurses index 9a58ee0e..83a1e0e7 100644 --- a/ncurses/llib-lncurses +++ b/ncurses/llib-lncurses @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,19 +27,24 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1996,1997,1998 * + * Author: Thomas E. Dickey 1996,1997,1998,1999 * ****************************************************************************/ /* LINTLIBRARY */ -/* ./hardscroll.c */ +/* ./tty/hardscroll.c */ #include +#undef _nc_oldnums +int *_nc_oldnums; + #undef _nc_scroll_optimize void _nc_scroll_optimize(void) { /* void */ } -/* ./hashmap.c */ +/* ./tty/hashmap.c */ + +#include typedef struct { @@ -53,30 +58,22 @@ typedef struct void _nc_hash_map(void) { /* void */ } -/* ./lib_acs.c */ - -#include - -#undef acs_map -chtype acs_map[128 ]; +#undef _nc_make_oldhash +void _nc_make_oldhash( + int i) + { /* void */ } -#undef init_acs -void init_acs(void) +#undef _nc_scroll_oldhash +void _nc_scroll_oldhash( + int n, + int top, + int bot) { /* void */ } -/* ./lib_addch.c */ +/* ./base/lib_addch.c */ #include -#undef wchgat -int wchgat( - WINDOW *win, - int n, - attr_t attr, - short color, - const void *opts) - { return(*(int *)0); } - #undef _nc_background chtype _nc_background( WINDOW *win) @@ -106,7 +103,7 @@ int wechochar( const chtype ch) { return(*(int *)0); } -/* ./lib_addstr.c */ +/* ./base/lib_addstr.c */ #undef waddnstr int waddnstr( @@ -122,24 +119,13 @@ int waddchnstr( int n) { return(*(int *)0); } -/* ./lib_baudrate.c */ - -struct speed { - speed_t s; - int sp; -}; - -#undef baudrate -int baudrate(void) - { return(*(int *)0); } - -/* ./lib_beep.c */ +/* ./base/lib_beep.c */ #undef beep int beep(void) { return(*(int *)0); } -/* ./lib_bkgd.c */ +/* ./base/lib_bkgd.c */ #undef wbkgdset void wbkgdset( @@ -153,7 +139,7 @@ int wbkgd( const chtype ch) { return(*(int *)0); } -/* ./lib_box.c */ +/* ./base/lib_box.c */ #undef wborder int wborder( @@ -168,28 +154,47 @@ int wborder( chtype br) { return(*(int *)0); } -/* ./lib_clear.c */ +/* ./base/lib_chgat.c */ + +#undef wchgat +int wchgat( + WINDOW *win, + int n, + attr_t attr, + short color, + const void *opts) + { return(*(int *)0); } + +/* ./base/lib_clear.c */ #undef wclear int wclear( WINDOW *win) { return(*(int *)0); } -/* ./lib_clrbot.c */ +/* ./base/lib_clearok.c */ + +#undef clearok +int clearok( + WINDOW *win, + bool flag) + { return(*(int *)0); } + +/* ./base/lib_clrbot.c */ #undef wclrtobot int wclrtobot( WINDOW *win) { return(*(int *)0); } -/* ./lib_clreol.c */ +/* ./base/lib_clreol.c */ #undef wclrtoeol int wclrtoeol( WINDOW *win) { return(*(int *)0); } -/* ./lib_color.c */ +/* ./base/lib_color.c */ #undef COLOR_PAIRS int COLOR_PAIRS; @@ -241,89 +246,58 @@ int pair_content( #undef _nc_do_color void _nc_do_color( int pair, + bool reverse, int (*outc)( int p1)) { /* void */ } -/* ./lib_data.c */ +/* ./base/lib_colorset.c */ -#undef stdscr -WINDOW *stdscr; -#undef curscr -WINDOW *curscr; -#undef newscr -WINDOW *newscr; -#undef _nc_screen_chain -SCREEN *_nc_screen_chain; -#undef SP -SCREEN *SP; +#undef wcolor_set +int wcolor_set( + WINDOW *win, + short color_pair_number, + void *opts) + { return(*(int *)0); } -/* ./lib_delch.c */ +/* ./base/lib_delch.c */ #undef wdelch int wdelch( WINDOW *win) { return(*(int *)0); } -/* ./lib_delwin.c */ +/* ./base/lib_delwin.c */ #undef delwin int delwin( WINDOW *win) { return(*(int *)0); } -/* ./lib_doupdate.c */ - -#include +/* ./base/lib_echo.c */ -#undef doupdate -int doupdate(void) +#undef echo +int echo(void) { return(*(int *)0); } -#undef _nc_outstr -void _nc_outstr( - const char *str) - { /* void */ } - -#undef _nc_scrolln -int _nc_scrolln( - int n, - int top, - int bot, - int maxy) +#undef noecho +int noecho(void) { return(*(int *)0); } -#undef _nc_screen_resume -void _nc_screen_resume(void) - { /* void */ } - -#undef _nc_screen_init -void _nc_screen_init(void) - { /* void */ } - -#undef _nc_screen_wrap -void _nc_screen_wrap(void) - { /* void */ } - -#undef _nc_do_xmc_glitch -void _nc_do_xmc_glitch( - attr_t previous) - { /* void */ } - -/* ./lib_endwin.c */ +/* ./base/lib_endwin.c */ #undef endwin int endwin(void) { return(*(int *)0); } -/* ./lib_erase.c */ +/* ./base/lib_erase.c */ #undef werase int werase( WINDOW *win) { return(*(int *)0); } -/* ./lib_flash.c */ +/* ./base/lib_flash.c */ #undef flash int flash(void) @@ -374,22 +348,29 @@ int attrset( { return(*(int *)0); } #undef attr_get -int attr_get(void) +int attr_get( + attr_t *a1, + short *a2, + void *z) { return(*(int *)0); } #undef attr_off int attr_off( - NCURSES_ATTR_T z) + attr_t a1, + void *z) { return(*(int *)0); } #undef attr_on int attr_on( - NCURSES_ATTR_T z) + attr_t a1, + void *z) { return(*(int *)0); } #undef attr_set int attr_set( - NCURSES_ATTR_T z) + attr_t a1, + short a2, + void *z) { return(*(int *)0); } #undef bkgd @@ -441,6 +422,12 @@ int clrtobot(void) int clrtoeol(void) { return(*(int *)0); } +#undef color_set +int color_set( + short a1, + void *z) + { return(*(int *)0); } + #undef COLOR_PAIR int COLOR_PAIR( int z) @@ -897,9 +884,9 @@ int standend(void) { return(*(int *)0); } #undef timeout -int timeout( +void timeout( int z) - { return(*(int *)0); } + { /* void */ } #undef untouchwin int untouchwin( @@ -915,14 +902,14 @@ int vline( #undef vw_printw int vw_printw( WINDOW *a1, - const char *a2, + char *a2, va_list z) { return(*(int *)0); } #undef vw_scanw int vw_scanw( WINDOW *a1, - const char *a2, + char *a2, va_list z) { return(*(int *)0); } @@ -957,14 +944,19 @@ int wattrset( { return(*(int *)0); } #undef wattr_get -attr_t wattr_get( - WINDOW *z) - { return(*(attr_t *)0); } +int wattr_get( + WINDOW *a1, + attr_t *a2, + short *a3, + void *z) + { return(*(int *)0); } #undef wattr_set int wattr_set( WINDOW *a1, - attr_t z) + attr_t a2, + short a3, + void *z) { return(*(int *)0); } #undef wdeleteln @@ -978,11 +970,6 @@ int wgetstr( char *z) { return(*(int *)0); } -#undef winch -chtype winch( - WINDOW *z) - { return(*(chtype *)0); } - #undef winchstr int winchstr( WINDOW *a1, @@ -1016,7 +1003,14 @@ int wstandend( WINDOW *z) { return(*(int *)0); } -/* ./lib_getch.c */ +#undef mouse_trafo +bool mouse_trafo( + int *a1, + int *a2, + bool z) + { return(*(bool *)0); } + +/* ./base/lib_getch.c */ #include @@ -1028,7 +1022,7 @@ int wgetch( WINDOW *win) { return(*(int *)0); } -/* ./lib_getstr.c */ +/* ./base/lib_getstr.c */ #undef wgetnstr int wgetnstr( @@ -1037,7 +1031,7 @@ int wgetnstr( int maxlen) { return(*(int *)0); } -/* ./lib_hline.c */ +/* ./base/lib_hline.c */ #undef whline int whline( @@ -1046,7 +1040,15 @@ int whline( int n) { return(*(int *)0); } -/* ./lib_inchstr.c */ +/* ./base/lib_immedok.c */ + +#undef immedok +void immedok( + WINDOW *win, + bool flag) + { /* void */ } + +/* ./base/lib_inchstr.c */ #undef winchnstr int winchnstr( @@ -1055,17 +1057,15 @@ int winchnstr( int n) { return(*(int *)0); } -/* ./lib_initscr.c */ +/* ./base/lib_initscr.c */ + +#include #undef initscr WINDOW *initscr(void) { return(*(WINDOW **)0); } -#undef termname -char *termname(void) - { return(*(char **)0); } - -/* ./lib_insch.c */ +/* ./base/lib_insch.c */ #undef winsch int winsch( @@ -1073,7 +1073,7 @@ int winsch( chtype c) { return(*(int *)0); } -/* ./lib_insdel.c */ +/* ./base/lib_insdel.c */ #undef winsdelln int winsdelln( @@ -1081,16 +1081,16 @@ int winsdelln( int n) { return(*(int *)0); } -/* ./lib_insstr.c */ +/* ./base/lib_insstr.c */ #undef winsnstr int winsnstr( WINDOW *win, - const char *str, + const char *s, int n) { return(*(int *)0); } -/* ./lib_instr.c */ +/* ./base/lib_instr.c */ #undef winnstr int winnstr( @@ -1099,19 +1099,21 @@ int winnstr( int n) { return(*(int *)0); } -/* ./lib_isendwin.c */ +/* ./base/lib_isendwin.c */ #undef isendwin -int isendwin(void) - { return(*(int *)0); } +bool isendwin(void) + { return(*(bool *)0); } -/* ./lib_longname.c */ +/* ./base/lib_leaveok.c */ -#undef longname -char *longname(void) - { return(*(char **)0); } +#undef leaveok +int leaveok( + WINDOW *win, + bool flag) + { return(*(int *)0); } -/* ./lib_mouse.c */ +/* ./base/lib_mouse.c */ #undef getmouse int getmouse( @@ -1145,7 +1147,15 @@ int mouseinterval( int _nc_has_mouse(void) { return(*(int *)0); } -/* ./lib_move.c */ +#undef wmouse_trafo +bool wmouse_trafo( + const WINDOW *win, + int *pY, + int *pX, + bool to_screen) + { return(*(bool *)0); } + +/* ./base/lib_move.c */ #undef wmove int wmove( @@ -1154,7 +1164,7 @@ int wmove( int x) { return(*(int *)0); } -/* ./lib_mvcur.c */ +/* ./tty/lib_mvcur.c */ #undef _nc_msec_cost int _nc_msec_cost( @@ -1182,7 +1192,7 @@ int mvcur( int xnew) { return(*(int *)0); } -/* ./lib_mvwin.c */ +/* ./base/lib_mvwin.c */ #undef mvwin int mvwin( @@ -1191,7 +1201,7 @@ int mvwin( int bx) { return(*(int *)0); } -/* ./lib_newterm.c */ +/* ./base/lib_newterm.c */ #undef filter void filter(void) @@ -1199,12 +1209,12 @@ void filter(void) #undef newterm SCREEN *newterm( - const char *term, + char *name, FILE *ofp, FILE *ifp) { return(*(SCREEN **)0); } -/* ./lib_newwin.c */ +/* ./base/lib_newwin.c */ #undef _nc_freewin void _nc_freewin( @@ -1246,7 +1256,17 @@ WINDOW *_nc_makenew( int flags) { return(*(WINDOW **)0); } -/* ./lib_overlay.c */ +/* ./base/lib_nl.c */ + +#undef nl +int nl(void) + { return(*(int *)0); } + +#undef nonl +int nonl(void) + { return(*(int *)0); } + +/* ./base/lib_overlay.c */ #undef overlay int overlay( @@ -1273,7 +1293,7 @@ int copywin( int over) { return(*(int *)0); } -/* ./lib_pad.c */ +/* ./base/lib_pad.c */ #undef newpad WINDOW *newpad( @@ -1318,26 +1338,18 @@ int pechochar( const chtype ch) { return(*(int *)0); } -/* ./lib_print.c */ - -#undef mcprint -int mcprint( - char *data, - int len) - { return(*(int *)0); } - -/* ./lib_printw.c */ +/* ./base/lib_printw.c */ #undef printw int printw( - const char *fmt, + char *fmt, ...) { return(*(int *)0); } #undef wprintw int wprintw( WINDOW *win, - const char *fmt, + char *fmt, ...) { return(*(int *)0); } @@ -1345,7 +1357,7 @@ int wprintw( int mvprintw( int y, int x, - const char *fmt, + char *fmt, ...) { return(*(int *)0); } @@ -1354,18 +1366,18 @@ int mvwprintw( WINDOW *win, int y, int x, - const char *fmt, + char *fmt, ...) { return(*(int *)0); } #undef vwprintw int vwprintw( WINDOW *win, - const char *fmt, + char *fmt, va_list argp) { return(*(int *)0); } -/* ./lib_redrawln.c */ +/* ./base/lib_redrawln.c */ #undef wredrawln int wredrawln( @@ -1374,7 +1386,7 @@ int wredrawln( int num) { return(*(int *)0); } -/* ./lib_refresh.c */ +/* ./base/lib_refresh.c */ #undef wrefresh int wrefresh( @@ -1386,42 +1398,34 @@ int wnoutrefresh( WINDOW *win) { return(*(int *)0); } -/* ./lib_restart.c */ - -#undef def_shell_mode -int def_shell_mode(void) - { return(*(int *)0); } - -#undef def_prog_mode -int def_prog_mode(void) - { return(*(int *)0); } +/* ./base/lib_restart.c */ #undef restartterm int restartterm( - const char *term, + char *termp, int filenum, int *errret) { return(*(int *)0); } -/* ./lib_scanw.c */ +/* ./base/lib_scanw.c */ #undef vwscanw int vwscanw( WINDOW *win, - const char *fmt, + char *fmt, va_list argp) { return(*(int *)0); } #undef scanw int scanw( - const char *fmt, + char *fmt, ...) { return(*(int *)0); } #undef wscanw int wscanw( WINDOW *win, - const char *fmt, + char *fmt, ...) { return(*(int *)0); } @@ -1429,7 +1433,7 @@ int wscanw( int mvscanw( int y, int x, - const char *fmt, + char *fmt, ...) { return(*(int *)0); } @@ -1438,11 +1442,11 @@ int mvwscanw( WINDOW *win, int y, int x, - const char *fmt, + char *fmt, ...) { return(*(int *)0); } -/* ./lib_screen.c */ +/* ./base/lib_screen.c */ #include #include @@ -1478,7 +1482,7 @@ int scr_set( const char *file) { return(*(int *)0); } -/* ./lib_scroll.c */ +/* ./base/lib_scroll.c */ #undef _nc_scroll_window void _nc_scroll_window( @@ -1495,7 +1499,15 @@ int wscrl( int n) { return(*(int *)0); } -/* ./lib_scrreg.c */ +/* ./base/lib_scrollok.c */ + +#undef scrollok +int scrollok( + WINDOW *win, + bool flag) + { return(*(int *)0); } + +/* ./base/lib_scrreg.c */ #undef wsetscrreg int wsetscrreg( @@ -1504,17 +1516,11 @@ int wsetscrreg( int bottom) { return(*(int *)0); } -/* ./lib_set_term.c */ - -#undef _nc_set_buffer -void _nc_set_buffer( - FILE *ofp, - bool buffered) - { /* void */ } +/* ./base/lib_set_term.c */ #undef set_term SCREEN *set_term( - SCREEN *screen) + SCREEN *screenp) { return(*(SCREEN **)0); } #undef delscreen @@ -1545,7 +1551,7 @@ int ripoffline( int p2)) { return(*(int *)0); } -/* ./lib_slk.c */ +/* ./base/lib_slk.c */ #undef _nc_slk_format int _nc_slk_format; @@ -1560,54 +1566,70 @@ int _nc_slk_initialize( int slk_restore(void) { return(*(int *)0); } -/* ./lib_slkatrof.c */ +/* ./base/lib_slkatr_set.c */ + +#undef slk_attr_set +int slk_attr_set( + const attr_t attr, + short color_pair_number, + void *opts) + { return(*(int *)0); } + +/* ./base/lib_slkatrof.c */ #undef slk_attroff int slk_attroff( - const attr_t attr) + const chtype attr) { return(*(int *)0); } -/* ./lib_slkatron.c */ +/* ./base/lib_slkatron.c */ #undef slk_attron int slk_attron( - const attr_t attr) + const chtype attr) { return(*(int *)0); } -/* ./lib_slkatrset.c */ +/* ./base/lib_slkatrset.c */ #undef slk_attrset int slk_attrset( - const attr_t attr) + const chtype attr) { return(*(int *)0); } -/* ./lib_slkattr.c */ +/* ./base/lib_slkattr.c */ #undef slk_attr attr_t slk_attr(void) { return(*(attr_t *)0); } -/* ./lib_slkclear.c */ +/* ./base/lib_slkclear.c */ #undef slk_clear int slk_clear(void) { return(*(int *)0); } -/* ./lib_slkinit.c */ +/* ./base/lib_slkcolor.c */ + +#undef slk_color +int slk_color( + short color_pair_number) + { return(*(int *)0); } + +/* ./base/lib_slkinit.c */ #undef slk_init int slk_init( int format) { return(*(int *)0); } -/* ./lib_slklab.c */ +/* ./base/lib_slklab.c */ #undef slk_label char *slk_label( int n) { return(*(char **)0); } -/* ./lib_slkrefr.c */ +/* ./base/lib_slkrefr.c */ #undef slk_noutrefresh int slk_noutrefresh(void) @@ -1617,7 +1639,7 @@ int slk_noutrefresh(void) int slk_refresh(void) { return(*(int *)0); } -/* ./lib_slkset.c */ +/* ./base/lib_slkset.c */ #undef slk_set int slk_set( @@ -1626,24 +1648,24 @@ int slk_set( int format) { return(*(int *)0); } -/* ./lib_slktouch.c */ +/* ./base/lib_slktouch.c */ #undef slk_touch int slk_touch(void) { return(*(int *)0); } -/* ./lib_touch.c */ +/* ./base/lib_touch.c */ #undef is_linetouched -int is_linetouched( +bool is_linetouched( WINDOW *win, int line) - { return(*(int *)0); } + { return(*(bool *)0); } #undef is_wintouched -int is_wintouched( +bool is_wintouched( WINDOW *win) - { return(*(int *)0); } + { return(*(bool *)0); } #undef wtouchln int wtouchln( @@ -1653,51 +1675,25 @@ int wtouchln( int changed) { return(*(int *)0); } -/* ./lib_traceatr.c */ - -#undef _traceattr2 -char *_traceattr2( - int bufnum, - attr_t newmode) - { return(*(char **)0); } - -#undef _traceattr -char *_traceattr( - attr_t newmode) - { return(*(char **)0); } - -#undef _nc_retrace_attr_t -attr_t _nc_retrace_attr_t( - attr_t code) - { return(*(attr_t *)0); } - -#undef _tracechtype2 -char *_tracechtype2( - int bufnum, - chtype ch) - { return(*(char **)0); } +/* ./trace/lib_traceatr.c */ -#undef _tracechtype -char *_tracechtype( - chtype ch) - { return(*(char **)0); } +#undef _nc_lib_traceatr +void _nc_lib_traceatr(void) + { /* void */ } -/* ./lib_tracedmp.c */ +/* ./trace/lib_tracedmp.c */ -#undef _tracedump -void _tracedump( - const char *name, - WINDOW *win) +#undef _nc_lib_tracedmp +void _nc_lib_tracedmp(void) { /* void */ } -/* ./lib_tracemse.c */ +/* ./trace/lib_tracemse.c */ -#undef _tracemouse -char *_tracemouse( - MEVENT const *ep) - { return(*(char **)0); } +#undef _nc_lib_tracemouse +void _nc_lib_tracemouse(void) + { /* void */ } -/* ./lib_tstp.c */ +/* ./tty/lib_tstp.c */ #include #include @@ -1707,14 +1703,14 @@ void _nc_signal_handler( bool enable) { /* void */ } -/* ./lib_ungetch.c */ +/* ./base/lib_ungetch.c */ #undef ungetch int ungetch( int ch) { return(*(int *)0); } -/* ./lib_vidattr.c */ +/* ./tty/lib_vidattr.c */ #undef vidputs int vidputs( @@ -1732,7 +1728,7 @@ int vidattr( chtype termattrs(void) { return(*(chtype *)0); } -/* ./lib_vline.c */ +/* ./base/lib_vline.c */ #undef wvline int wvline( @@ -1741,23 +1737,32 @@ int wvline( int n) { return(*(int *)0); } -/* ./lib_wattroff.c */ +/* ./base/lib_wattroff.c */ #undef wattr_off int wattr_off( WINDOW *win, - const attr_t at) + attr_t at, + void *opts) { return(*(int *)0); } -/* ./lib_wattron.c */ +/* ./base/lib_wattron.c */ #undef wattr_on int wattr_on( WINDOW *win, - const attr_t at) + attr_t at, + void *opts) { return(*(int *)0); } -/* ./lib_window.c */ +/* ./base/lib_winch.c */ + +#undef winch +chtype winch( + WINDOW *win) + { return(*(chtype *)0); } + +/* ./base/lib_window.c */ #undef _nc_synchook void _nc_synchook( @@ -1797,13 +1802,13 @@ WINDOW *dupwin( WINDOW *win) { return(*(WINDOW **)0); } -/* ./nc_panel.c */ +/* ./base/nc_panel.c */ #undef _nc_panelhook struct panelhook *_nc_panelhook(void) { return(*(struct panelhook **)0); } -/* ./safe_sprintf.c */ +/* ./base/safe_sprintf.c */ #undef _nc_printf_string char *_nc_printf_string( @@ -1811,38 +1816,63 @@ char *_nc_printf_string( va_list ap) { return(*(char **)0); } -/* ./write_entry.c */ +/* ./tty/tty_update.c */ -#include -#include +#include -#undef _nc_set_writedir -void _nc_set_writedir( - char *dir) - { /* void */ } +#undef doupdate +int doupdate(void) + { return(*(int *)0); } -#undef _nc_write_entry -void _nc_write_entry( - TERMTYPE *const tp) +#undef _nc_outstr +void _nc_outstr( + const char *str) { /* void */ } -#undef _nc_tic_written -int _nc_tic_written(void) +#undef _nc_scrolln +int _nc_scrolln( + int n, + int top, + int bot, + int maxy) { return(*(int *)0); } -/* ./sigaction.c */ - -#undef _nc_sigaction -void _nc_sigaction(void) +#undef _nc_screen_resume +void _nc_screen_resume(void) { /* void */ } -/* ./vsscanf.c */ +#undef _nc_screen_init +void _nc_screen_init(void) + { /* void */ } + +#undef _nc_screen_wrap +void _nc_screen_wrap(void) + { /* void */ } + +#undef _nc_do_xmc_glitch +void _nc_do_xmc_glitch( + attr_t previous) + { /* void */ } + +/* ./base/memmove.c */ + +#undef _nc_memmove +void _nc_memmove(void) + { /* void */ } + +/* ./base/sigaction.c */ + +#undef _nc_sigaction +void _nc_sigaction(void) + { /* void */ } + +/* ./base/vsscanf.c */ #undef _nc_vsscanf void _nc_vsscanf(void) { /* void */ } -/* ./define_key.c */ +/* ./base/define_key.c */ #undef define_key int define_key( @@ -1884,7 +1914,15 @@ void _nc_UpdateAttrs( chtype c) { /* void */ } -/* ./keyok.c */ +/* ./base/keybound.c */ + +#undef keybound +char *keybound( + int code, + int count) + { return(*(char **)0); } + +/* ./base/keyok.c */ #undef keyok int keyok( @@ -1892,93 +1930,29 @@ int keyok( bool flag) { return(*(int *)0); } -/* ./lib_adabind.c */ - -#undef _nc_ada_getmaxyx -int _nc_ada_getmaxyx( - const WINDOW *win, - int *y, - int *x) - { return(*(int *)0); } - -#undef _nc_ada_getbegyx -int _nc_ada_getbegyx( - const WINDOW *win, - int *y, - int *x) - { return(*(int *)0); } - -#undef _nc_ada_getyx -int _nc_ada_getyx( - const WINDOW *win, - int *y, - int *x) - { return(*(int *)0); } - -#undef _nc_ada_getparyx -int _nc_ada_getparyx( - const WINDOW *win, - int *y, - int *x) - { return(*(int *)0); } - -#undef _nc_ada_isscroll -int _nc_ada_isscroll( - const WINDOW *win) - { return(*(int *)0); } - -#undef _nc_ada_coord_transform -int _nc_ada_coord_transform( - const WINDOW *win, - int *Y, - int *X, - int dir) - { return(*(int *)0); } - -#undef _nc_ada_mouse_event -void _nc_ada_mouse_event( - mmask_t m, - int *b, - int *s) - { /* void */ } - -#undef _nc_ada_mouse_mask -int _nc_ada_mouse_mask( - int button, - int state, - mmask_t *mask) - { return(*(int *)0); } - -#undef _nc_ada_vcheck -int _nc_ada_vcheck( - int major, - int minor) - { return(*(int *)0); } - -/* ./lib_dft_fgbg.c */ +/* ./base/lib_dft_fgbg.c */ #undef use_default_colors int use_default_colors(void) { return(*(int *)0); } -/* ./lib_freeall.c */ +/* ./base/lib_freeall.c */ -#undef _nc_free_termtype -void _nc_free_termtype( - struct termtype *p, - int base) - { /* void */ } +#include #undef _nc_freeall void _nc_freeall(void) { /* void */ } -#undef _nc_free_and_exit -void _nc_free_and_exit( - int code) - { /* void */ } +/* ./tinfo/lib_print.c */ + +#undef mcprint +int mcprint( + char *data, + int len) + { return(*(int *)0); } -/* ./resizeterm.c */ +/* ./base/resizeterm.c */ #undef resizeterm int resizeterm( @@ -1986,17 +1960,42 @@ int resizeterm( int ToCols) { return(*(int *)0); } -/* ./softscroll.c */ +/* ./trace/trace_xnames.c */ -#undef _nc_setup_scroll -void _nc_setup_scroll(void) +#undef _nc_trace_xnames +void _nc_trace_xnames( + TERMTYPE *tp) { /* void */ } -#undef _nc_perform_scroll -void _nc_perform_scroll(void) - { /* void */ } +/* ./base/tries.c */ -/* ./wresize.c */ +#undef _nc_expand_try +char *_nc_expand_try( + struct tries *tree, + unsigned short code, + int *count, + size_t len) + { return(*(char **)0); } + +#undef _nc_remove_key +int _nc_remove_key( + struct tries **tree, + unsigned short code) + { return(*(int *)0); } + +#undef _nc_remove_string +int _nc_remove_string( + struct tries **tree, + char *string) + { return(*(int *)0); } + +/* ./base/version.c */ + +#undef curses_version +const char *curses_version(void) + { return(*(const char **)0); } + +/* ./base/wresize.c */ #undef wresize int wresize( @@ -2005,13 +2004,35 @@ int wresize( int ToCols) { return(*(int *)0); } -/* ./alloc_entry.c */ +/* ./tinfo/access.c */ + +#undef _nc_access +int _nc_access( + const char *path, + int mode) + { return(*(int *)0); } + +/* ./tinfo/add_tries.c */ + +#undef _nc_add_to_try +void _nc_add_to_try( + struct tries **tree, + char *str, + unsigned short code) + { /* void */ } + +/* ./tinfo/alloc_entry.c */ #undef _nc_init_entry void _nc_init_entry( TERMTYPE *const tp) { /* void */ } +#undef _nc_copy_entry +ENTRY *_nc_copy_entry( + ENTRY *oldp) + { return(*(ENTRY **)0); } + #undef _nc_save_str char *_nc_save_str( const char *const string) @@ -2028,7 +2049,21 @@ void _nc_merge_entry( TERMTYPE *const from) { /* void */ } -/* ./captoinfo.c */ +/* ./tinfo/alloc_ttype.c */ + +#undef _nc_align_termtype +void _nc_align_termtype( + TERMTYPE *to, + TERMTYPE *from) + { /* void */ } + +#undef _nc_copy_termtype +void _nc_copy_termtype( + TERMTYPE *dst, + TERMTYPE *src) + { /* void */ } + +/* ./tinfo/captoinfo.c */ #undef _nc_captoinfo char *_nc_captoinfo( @@ -2058,9 +2093,9 @@ char *const strcodes[] = {0}; #include #undef _nc_info_hash_table -const struct name_table_entry *const _nc_info_hash_table[991] = {0}; +const struct name_table_entry *const _nc_info_hash_table[995] = {0}; #undef _nc_cap_hash_table -const struct name_table_entry *const _nc_cap_hash_table[991] = {0}; +const struct name_table_entry *const _nc_cap_hash_table[995] = {0}; #undef _nc_capalias_table const struct alias _nc_capalias_table[] = {0}; #undef _nc_infoalias_table @@ -2071,7 +2106,12 @@ const struct name_table_entry *_nc_get_table( bool termcap) { return(*(const struct name_table_entry **)0); } -/* ./comp_error.c */ +#undef _nc_get_hash_table +const struct name_table_entry *const *_nc_get_hash_table( + bool termcap) + { return(*(const struct name_table_entry **)0); } + +/* ./tinfo/comp_error.c */ #undef _nc_suppress_warnings bool _nc_suppress_warnings; @@ -2113,15 +2153,16 @@ void _nc_syserr_abort( ...) { /* void */ } -/* ./comp_expand.c */ +/* ./tinfo/comp_expand.c */ #undef _nc_tic_expand char *_nc_tic_expand( const char *srcp, - bool tic_format) + bool tic_format, + int numbers) { return(*(char **)0); } -/* ./comp_hash.c */ +/* ./tinfo/comp_hash.c */ #include @@ -2138,8 +2179,11 @@ struct name_table_entry const *_nc_find_type_entry( const struct name_table_entry *table) { return(*(struct name_table_entry const **)0); } -/* ./comp_parse.c */ +/* ./tinfo/comp_parse.c */ +#undef _nc_check_termtype +void (*_nc_check_termtype)( + TERMTYPE *p1); #undef _nc_head ENTRY *_nc_head; #undef _nc_tail @@ -2170,7 +2214,7 @@ void _nc_read_entry_source( int _nc_resolve_uses(void) { return(*(int *)0); } -/* ./comp_scan.c */ +/* ./tinfo/comp_scan.c */ #undef _nc_syntax int _nc_syntax; @@ -2208,6 +2252,14 @@ void _nc_reset_input( char *buf) { /* void */ } +/* ./tinfo/doalloc.c */ + +#undef _nc_doalloc +void *_nc_doalloc( + void *oldp, + size_t amount) + { return(*(void **)0); } + /* ./fallback.c */ #undef _nc_fallback @@ -2215,45 +2267,121 @@ const TERMTYPE *_nc_fallback( const char *name) { return(*(const TERMTYPE **)0); } -/* ./lib_cur_term.c */ +/* ./tinfo/free_ttype.c */ -#undef cur_term -TERMINAL *cur_term; +#undef _nc_free_termtype +void _nc_free_termtype( + TERMTYPE *ptr) + { /* void */ } -#undef _nc_get_curterm -int _nc_get_curterm( - struct termios *buf) +#undef _nc_user_definable +bool _nc_user_definable; + +#undef use_extended_names +int use_extended_names( + bool flag) { return(*(int *)0); } -#undef _nc_set_curterm -int _nc_set_curterm( - struct termios *buf) +/* ./tinfo/getenv_num.c */ + +#undef _nc_getenv_num +int _nc_getenv_num( + const char *name) + { return(*(int *)0); } + +/* ./tinfo/home_terminfo.c */ + +#undef _nc_home_terminfo +char *_nc_home_terminfo(void) + { return(*(char **)0); } + +/* ./tinfo/init_keytry.c */ + +#if 0 + +#include + +#endif + +#undef _nc_tinfo_fkeysf +struct tinfo_fkeys *_nc_tinfo_fkeysf(void) + { return(*(struct tinfo_fkeys **)0); } + +#undef _nc_init_keytry +void _nc_init_keytry(void) + { /* void */ } + +/* ./tinfo/lib_acs.c */ + +#undef acs_map +chtype acs_map[128 ]; + +#undef _nc_init_acs +void _nc_init_acs(void) + { /* void */ } + +/* ./tinfo/lib_baudrate.c */ + +#include + +struct speed { + speed_t s; + int sp; +}; + +#undef _nc_baudrate +int _nc_baudrate( + int OSpeed) + { return(*(int *)0); } + +#undef _nc_ospeed +int _nc_ospeed( + int BaudRate) + { return(*(int *)0); } + +#undef baudrate +int baudrate(void) { return(*(int *)0); } +/* ./tinfo/lib_cur_term.c */ + +#undef cur_term +TERMINAL *cur_term; + #undef set_curterm TERMINAL *set_curterm( - TERMINAL *term) + TERMINAL *termp) { return(*(TERMINAL **)0); } #undef del_curterm int del_curterm( - TERMINAL *term) + TERMINAL *termp) { return(*(int *)0); } -/* ./lib_kernel.c */ +/* ./tinfo/lib_data.c */ -#undef napms -int napms( - int ms) - { return(*(int *)0); } +#undef stdscr +WINDOW *stdscr; +#undef curscr +WINDOW *curscr; +#undef newscr +WINDOW *newscr; +#undef _nc_screen_chain +SCREEN *_nc_screen_chain; +#undef SP +SCREEN *SP; -#undef reset_prog_mode -int reset_prog_mode(void) - { return(*(int *)0); } +/* ./tinfo/lib_has_cap.c */ -#undef reset_shell_mode -int reset_shell_mode(void) - { return(*(int *)0); } +#undef has_ic +bool has_ic(void) + { return(*(bool *)0); } + +#undef has_il +bool has_il(void) + { return(*(bool *)0); } + +/* ./tinfo/lib_kernel.c */ #undef erasechar char erasechar(void) @@ -2267,43 +2395,35 @@ char killchar(void) int flushinp(void) { return(*(int *)0); } -#undef savetty -int savetty(void) - { return(*(int *)0); } - -#undef resetty -int resetty(void) - { return(*(int *)0); } - /* ./lib_keyname.c */ #include #include #include -struct kn { - const char *name; - int code; -}; - -#undef key_names -const struct kn key_names[] = {0}; +#undef _nc_key_names +const struct kn _nc_key_names[] = {0}; #undef keyname -const char *keyname( +char *keyname( int c) - { return(*(const char **)0); } + { return(*(char **)0); } -/* ./lib_options.c */ +/* ./tinfo/lib_longname.c */ -#undef has_ic -int has_ic(void) - { return(*(int *)0); } +#undef longname +char *longname(void) + { return(*(char **)0); } -#undef has_il -int has_il(void) +/* ./tinfo/lib_napms.c */ + +#undef napms +int napms( + int ms) { return(*(int *)0); } +/* ./tinfo/lib_options.c */ + #undef idlok int idlok( WINDOW *win, @@ -2316,30 +2436,6 @@ void idcok( bool flag) { /* void */ } -#undef clearok -int clearok( - WINDOW *win, - bool flag) - { return(*(int *)0); } - -#undef immedok -void immedok( - WINDOW *win, - bool flag) - { /* void */ } - -#undef leaveok -int leaveok( - WINDOW *win, - bool flag) - { return(*(int *)0); } - -#undef scrollok -int scrollok( - WINDOW *win, - bool flag) - { return(*(int *)0); } - #undef halfdelay int halfdelay( int t) @@ -2358,10 +2454,10 @@ int notimeout( { return(*(int *)0); } #undef wtimeout -int wtimeout( +void wtimeout( WINDOW *win, int delay) - { return(*(int *)0); } + { /* void */ } #undef keypad int keypad( @@ -2390,18 +2486,12 @@ int has_key( int keycode) { return(*(int *)0); } -#if 0 - -#include - -#endif - #undef _nc_keypad int _nc_keypad( bool flag) { return(*(int *)0); } -/* ./lib_raw.c */ +/* ./tinfo/lib_raw.c */ #undef raw int raw(void) @@ -2411,17 +2501,9 @@ int raw(void) int cbreak(void) { return(*(int *)0); } -#undef echo -int echo(void) - { return(*(int *)0); } - -#undef nl -int nl(void) - { return(*(int *)0); } - #undef qiflush -int qiflush(void) - { return(*(int *)0); } +void qiflush(void) + { /* void */ } #undef noraw int noraw(void) @@ -2431,17 +2513,9 @@ int noraw(void) int nocbreak(void) { return(*(int *)0); } -#undef noecho -int noecho(void) - { return(*(int *)0); } - -#undef nonl -int nonl(void) - { return(*(int *)0); } - #undef noqiflush -int noqiflush(void) - { return(*(int *)0); } +void noqiflush(void) + { /* void */ } #undef intrflush int intrflush( @@ -2449,18 +2523,42 @@ int intrflush( bool flag) { return(*(int *)0); } -/* ./lib_termcap.c */ +/* ./tinfo/lib_setup.c */ -#include +#include + +#undef use_env +void use_env( + bool f) + { /* void */ } + +#undef LINES +int LINES; +#undef COLS +int COLS; +#undef TABSIZE +int TABSIZE; + +#undef _nc_update_screensize +void _nc_update_screensize(void) + { /* void */ } + +#undef ttytype +char ttytype[256 ]; + +#undef setupterm +int setupterm( + char *tname, + int Filedes, + int *errret) + { return(*(int *)0); } + +/* ./tinfo/lib_termcap.c */ -#undef PC -char PC; #undef UP char *UP; #undef BC char *BC; -#undef ospeed -short ospeed; #undef tgetent int tgetent( @@ -2476,17 +2574,17 @@ int tgetent( #undef tgetflag int tgetflag( - const char *id) + char *id) { return(*(int *)0); } #undef tgetnum int tgetnum( - const char *id) + char *id) { return(*(int *)0); } #undef tgetstr char *tgetstr( - const char *id, + char *id, char **area) { return(*(char **)0); } @@ -2497,24 +2595,30 @@ char *tgoto( int y) { return(*(char **)0); } -/* ./lib_ti.c */ +/* ./tinfo/lib_termname.c */ + +#undef termname +char *termname(void) + { return(*(char **)0); } + +/* ./tinfo/lib_ti.c */ #undef tigetflag int tigetflag( - const char *str) + char *str) { return(*(int *)0); } #undef tigetnum int tigetnum( - const char *str) + char *str) { return(*(int *)0); } #undef tigetstr char *tigetstr( - const char *str) + char *str) { return(*(char **)0); } -/* ./lib_tparm.c */ +/* ./tinfo/lib_tparm.c */ typedef union { unsigned int num; @@ -2523,12 +2627,16 @@ typedef union { #undef tparm char *tparm( - const char *string, + char *string, ...) { return(*(char **)0); } -/* ./lib_tputs.c */ +/* ./tinfo/lib_tputs.c */ +#undef PC +char PC; +#undef ospeed +speed_t ospeed; #undef _nc_nulls_sent int _nc_nulls_sent; @@ -2555,18 +2663,12 @@ int tputs( int p1)) { return(*(int *)0); } -/* ./lib_trace.c */ +/* ./trace/lib_trace.c */ #include #undef _nc_tracing unsigned _nc_tracing; -#undef _nc_tputs_trace -const char *_nc_tputs_trace = {0}; -#undef _nc_outchars -long _nc_outchars; -#undef _nc_optimize_enable -int _nc_optimize_enable; #undef trace void trace( @@ -2584,35 +2686,56 @@ const char *_nc_visbuf( const char *buf) { return(*(const char **)0); } -#undef _tracef -void _tracef( - const char *fmt, - ...) - { /* void */ } - -#undef _nc_retrace_int -int _nc_retrace_int( - int code) - { return(*(int *)0); } +/* ./trace/lib_tracebits.c */ -#undef _nc_retrace_ptr -char *_nc_retrace_ptr( - char *code) +#undef _nc_tracebits +char *_nc_tracebits(void) { return(*(char **)0); } -#undef _nc_retrace_win -WINDOW *_nc_retrace_win( - WINDOW *code) - { return(*(WINDOW **)0); } - -/* ./lib_tracechr.c */ +/* ./trace/lib_tracechr.c */ #undef _tracechar char *_tracechar( const unsigned char ch) { return(*(char **)0); } -/* ./lib_twait.c */ +/* ./tinfo/lib_ttyflags.c */ + +#undef _nc_get_tty_mode +int _nc_get_tty_mode( + struct termios *buf) + { return(*(int *)0); } + +#undef _nc_set_tty_mode +int _nc_set_tty_mode( + struct termios *buf) + { return(*(int *)0); } + +#undef def_shell_mode +int def_shell_mode(void) + { return(*(int *)0); } + +#undef def_prog_mode +int def_prog_mode(void) + { return(*(int *)0); } + +#undef reset_prog_mode +int reset_prog_mode(void) + { return(*(int *)0); } + +#undef reset_shell_mode +int reset_shell_mode(void) + { return(*(int *)0); } + +#undef savetty +int savetty(void) + { return(*(int *)0); } + +#undef resetty +int resetty(void) + { return(*(int *)0); } + +/* ./tty/lib_twait.c */ #undef _nc_timed_wait int _nc_timed_wait( @@ -2621,7 +2744,7 @@ int _nc_timed_wait( int *timeleft) { return(*(int *)0); } -/* ./name_match.c */ +/* ./tinfo/name_match.c */ #undef _nc_first_name char *_nc_first_name( @@ -2650,7 +2773,7 @@ char *const strnames[] = {0}; #undef strfnames char *const strfnames[] = {0}; -/* ./parse_entry.c */ +/* ./tinfo/parse_entry.c */ #undef _nc_curr_token struct token _nc_curr_token; @@ -2669,13 +2792,18 @@ int _nc_capcmp( typedef struct {const char *from; const char *to;} assoc; -/* ./read_entry.c */ +/* ./tinfo/read_entry.c */ #undef _nc_tic_dir const char *_nc_tic_dir( const char *path) { return(*(const char **)0); } +#undef _nc_keep_tic_dir +void _nc_keep_tic_dir( + const char *path) + { /* void */ } + #undef _nc_read_file_entry int _nc_read_file_entry( const char *const filename, @@ -2689,45 +2817,26 @@ int _nc_read_entry( TERMTYPE *const tp) { return(*(int *)0); } -/* ./read_termcap.c */ +/* ./tinfo/read_termcap.c */ -#undef _nc_read_termcap_entry -int _nc_read_termcap_entry( - const char *const tn, - TERMTYPE *const tp) - { return(*(int *)0); } - -/* ./lib_setup.c */ - -#include - -#undef use_env -void use_env( - bool f) +#undef _nc_read_termcap +void _nc_read_termcap(void) { /* void */ } -#undef LINES -int LINES; -#undef COLS -int COLS; -#undef TABSIZE -int TABSIZE; +/* ./tinfo/setbuf.c */ -#undef _nc_update_screensize -void _nc_update_screensize(void) +#undef _nc_set_buffer +void _nc_set_buffer( + FILE *ofp, + bool buffered) { /* void */ } -#undef ttytype -char ttytype[256 ]; +/* ./trace/trace_buf.c */ -#undef setupterm -int setupterm( - const char *tname, - int Filedes, - int *errret) - { return(*(int *)0); } - -/* ./trace_buf.c */ +typedef struct { + char *text; + size_t size; +} LIST; #undef _nc_trace_buf char *_nc_trace_buf( @@ -2735,31 +2844,32 @@ char *_nc_trace_buf( size_t want) { return(*(char **)0); } -/* ./tries.c */ +/* ./trace/trace_tries.c */ -#undef _nc_add_to_try -void _nc_add_to_try( - struct tries **tree, - char *str, - unsigned short code) +#undef _nc_trace_tries +void _nc_trace_tries( + struct tries *tree) { /* void */ } -#undef _nc_expand_try -char *_nc_expand_try( - struct tries *tree, - unsigned short code, - size_t len) - { return(*(char **)0); } - -#undef _nc_remove_key -int _nc_remove_key( - struct tries **tree, - unsigned short code) - { return(*(int *)0); } - /* ./unctrl.c */ #undef unctrl char *unctrl( chtype ch) { return(*(char **)0); } + +/* ./tinfo/write_entry.c */ + +#undef _nc_set_writedir +void _nc_set_writedir( + char *dir) + { /* void */ } + +#undef _nc_write_entry +void _nc_write_entry( + TERMTYPE *const tp) + { /* void */ } + +#undef _nc_tic_written +int _nc_tic_written(void) + { return(*(int *)0); } diff --git a/ncurses/modules b/ncurses/modules index 321170cb..4b9c5dfe 100644 --- a/ncurses/modules +++ b/ncurses/modules @@ -1,6 +1,6 @@ -# $Id: modules,v 1.42 1998/02/11 12:13:57 tom Exp $ +# $Id: modules,v 1.70 1999/10/23 12:39:12 tom Exp $ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -27,141 +27,161 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1996,1997 +# Author: Thomas E. Dickey 1996,1997,1998 # @ base # Library objects -hardscroll lib $(srcdir) -hashmap lib $(srcdir) -lib_acs lib $(srcdir) ../include/term.h -lib_addch lib $(srcdir) -lib_addstr lib $(srcdir) -lib_baudrate lib $(srcdir) ../include/term.h -lib_beep lib $(srcdir) ../include/term.h -lib_bkgd lib $(srcdir) -lib_box lib $(srcdir) -lib_chgat lib $(srcdir) -lib_clear lib $(srcdir) -lib_clearok lib $(srcdir) -lib_clrbot lib $(srcdir) -lib_clreol lib $(srcdir) -lib_color lib $(srcdir) ../include/term.h -lib_data lib $(srcdir) -lib_delch lib $(srcdir) -lib_delwin lib $(srcdir) -lib_doupdate lib $(srcdir) ../include/term.h -lib_echo lib $(srcdir) -lib_endwin lib $(srcdir) -lib_erase lib $(srcdir) -lib_flash lib $(srcdir) ../include/term.h +hardscroll lib $(serial) +hashmap lib $(serial) ../include/term.h +lib_addch lib $(base) +lib_addstr lib $(base) +lib_beep lib $(base) ../include/term.h +lib_bkgd lib $(base) +lib_box lib $(base) +lib_chgat lib $(base) +lib_clear lib $(base) +lib_clearok lib $(base) +lib_clrbot lib $(base) +lib_clreol lib $(base) +lib_color lib $(base) ../include/term.h +lib_colorset lib $(base) +lib_delch lib $(base) +lib_delwin lib $(base) +lib_echo lib $(base) +lib_endwin lib $(base) ../include/term.h +lib_erase lib $(base) +lib_flash lib $(base) ../include/term.h lib_gen lib . ../include/curses.h -lib_getch lib $(srcdir) -lib_getstr lib $(srcdir) ../include/term.h -lib_hline lib $(srcdir) -lib_immedok lib $(srcdir) -lib_inchstr lib $(srcdir) -lib_initscr lib $(srcdir) -lib_insch lib $(srcdir) -lib_insdel lib $(srcdir) -lib_insstr lib $(srcdir) -lib_instr lib $(srcdir) -lib_isendwin lib $(srcdir) -lib_leaveok lib $(srcdir) -lib_longname lib $(srcdir) -lib_mouse lib $(srcdir) ../include/term.h -lib_move lib $(srcdir) -lib_mvcur lib $(srcdir) ../include/term.h -lib_mvwin lib $(srcdir) -lib_napms lib $(srcdir) -lib_newterm lib $(srcdir) ../include/term.h -lib_newwin lib $(srcdir) -lib_nl lib $(srcdir) -lib_overlay lib $(srcdir) -lib_pad lib $(srcdir) -lib_print lib $(srcdir) ../include/term.h -lib_printw lib $(srcdir) -lib_redrawln lib $(srcdir) -lib_refresh lib $(srcdir) -lib_restart lib $(srcdir) -lib_scanw lib $(srcdir) -lib_screen lib $(srcdir) ../include/term.h -lib_scroll lib $(srcdir) -lib_scrollok lib $(srcdir) -lib_scrreg lib $(srcdir) -lib_set_term lib $(srcdir) ../include/term.h -lib_slk lib $(srcdir) ../include/term.h -lib_slkatrof lib $(srcdir) -lib_slkatron lib $(srcdir) -lib_slkatrset lib $(srcdir) -lib_slkattr lib $(srcdir) -lib_slkclear lib $(srcdir) -lib_slkinit lib $(srcdir) -lib_slklab lib $(srcdir) -lib_slkrefr lib $(srcdir) ../include/term.h -lib_slkset lib $(srcdir) -lib_slktouch lib $(srcdir) -lib_touch lib $(srcdir) -lib_traceatr lib $(srcdir) -lib_tracedmp lib $(srcdir) -lib_tracemse lib $(srcdir) -lib_tstp lib $(srcdir) -lib_ungetch lib $(srcdir) -lib_vidattr lib $(srcdir) ../include/term.h -lib_vline lib $(srcdir) -lib_wattroff lib $(srcdir) -lib_wattron lib $(srcdir) -lib_window lib $(srcdir) -nc_panel lib $(srcdir) -safe_sprintf lib $(srcdir) -write_entry lib $(srcdir) ../include/term.h $(INCDIR)/tic.h +lib_getch lib $(base) +lib_getstr lib $(base) ../include/term.h +lib_hline lib $(base) +lib_immedok lib $(base) +lib_inchstr lib $(base) +lib_initscr lib $(base) $(INCDIR)/tic.h +lib_insch lib $(base) +lib_insdel lib $(base) +lib_insstr lib $(base) +lib_instr lib $(base) +lib_isendwin lib $(base) +lib_leaveok lib $(base) +lib_mouse lib $(base) ../include/term.h +lib_move lib $(base) +lib_mvcur lib $(serial) ../include/term.h $(INCDIR)/tic.h +lib_mvwin lib $(base) +lib_newterm lib $(base) ../include/term.h +lib_newwin lib $(base) +lib_nl lib $(base) +lib_overlay lib $(base) +lib_pad lib $(base) +lib_printw lib $(base) +lib_redrawln lib $(base) +lib_refresh lib $(base) +lib_restart lib $(base) ../include/term.h +lib_scanw lib $(base) +lib_screen lib $(base) ../include/term.h +lib_scroll lib $(base) +lib_scrollok lib $(base) +lib_scrreg lib $(base) +lib_set_term lib $(base) ../include/term.h +lib_slk lib $(base) ../include/term.h +lib_slkatr_set lib $(base) +lib_slkatrof lib $(base) +lib_slkatron lib $(base) +lib_slkatrset lib $(base) +lib_slkattr lib $(base) +lib_slkclear lib $(base) +lib_slkcolor lib $(base) +lib_slkinit lib $(base) +lib_slklab lib $(base) +lib_slkrefr lib $(base) ../include/term.h +lib_slkset lib $(base) +lib_slktouch lib $(base) +lib_touch lib $(base) +lib_traceatr lib $(trace) ../include/term.h +lib_tracedmp lib $(trace) +lib_tracemse lib $(trace) +lib_tstp lib $(serial) +lib_ungetch lib $(base) +lib_vidattr lib $(serial) ../include/term.h +lib_vline lib $(base) +lib_wattroff lib $(base) +lib_wattron lib $(base) +lib_winch lib $(base) +lib_window lib $(base) +nc_panel lib $(base) +safe_sprintf lib $(base) +tty_update lib $(serial) ../include/term.h # Modules for porting -sigaction lib $(srcdir) -vsscanf lib $(srcdir) +memmove lib $(base) +sigaction lib $(base) +vsscanf lib $(base) # Extensions to the base library @ ext_funcs -define_key lib $(srcdir) +define_key lib $(base) expanded lib . -keyok lib $(srcdir) -lib_adabind lib $(srcdir) -lib_dft_fgbg lib $(srcdir) -lib_freeall lib $(srcdir) -resizeterm lib $(srcdir) ../include/term.h -softscroll lib $(srcdir) -wresize lib $(srcdir) ../include/term.h +keybound lib $(base) +keyok lib $(base) +lib_dft_fgbg lib $(base) ../include/term.h +lib_freeall lib $(base) +lib_print lib $(tinfo) ../include/term.h +resizeterm lib $(base) ../include/term.h +trace_xnames lib $(trace) ../include/term.h $(INCDIR)/term_entry.h +tries lib $(base) +version lib $(base) +wresize lib $(base) ../include/term.h # Support for termcap (and tic, etc.), which can be a separate library @ termlib -alloc_entry lib $(srcdir) ../include/term.h -captoinfo lib $(srcdir) +access lib $(tinfo) +add_tries lib $(tinfo) +alloc_entry lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h +alloc_ttype lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h +captoinfo lib $(tinfo) $(INCDIR)/tic.h codes lib . -comp_captab lib . ../include/term.h ../include/hashsize.h -comp_error lib $(srcdir) -comp_expand lib $(srcdir) $(INCDIR)/tic.h -comp_hash lib $(srcdir) ../include/term.h ../include/hashsize.h -comp_parse lib $(srcdir) ../include/term.h $(INCDIR)/tic.h -comp_scan lib $(srcdir) +comp_captab lib . $(INCDIR)/tic.h ../include/term.h ../include/hashsize.h +comp_error lib $(tinfo) $(INCDIR)/tic.h +comp_expand lib $(tinfo) $(INCDIR)/tic.h +comp_hash lib $(tinfo) ../include/term.h $(INCDIR)/tic.h ../include/hashsize.h +comp_parse lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h +comp_scan lib $(tinfo) $(INCDIR)/tic.h +doalloc lib $(tinfo) fallback lib . ../include/term.h $(INCDIR)/tic.h -lib_cur_term lib $(srcdir) -lib_kernel lib $(srcdir) ../include/term.h +free_ttype lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h +getenv_num lib $(tinfo) +home_terminfo lib $(tinfo) +init_keytry lib $(tinfo) ../include/term.h $(INCDIR)/tic.h init_keytry.h +lib_acs lib $(tinfo) ../include/term.h +lib_baudrate lib $(tinfo) ../include/term.h +lib_cur_term lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h +lib_data lib $(tinfo) +lib_has_cap lib $(tinfo) ../include/term.h +lib_kernel lib $(tinfo) ../include/term.h lib_keyname lib . ../include/term.h -lib_options lib $(srcdir) ../include/term.h keys.tries -lib_raw lib $(srcdir) ../include/term.h -lib_termcap lib $(srcdir) ../include/term.h -lib_ti lib $(srcdir) ../include/term.h -lib_tparm lib $(srcdir) ../include/term.h -lib_tputs lib $(srcdir) ../include/term.h -lib_trace lib $(srcdir) -lib_tracechr lib $(srcdir) -lib_twait lib $(srcdir) -name_match lib $(srcdir) ../include/term.h $(INCDIR)/tic.h +lib_longname lib $(tinfo) +lib_napms lib $(tinfo) +lib_options lib $(tinfo) ../include/term.h +lib_raw lib $(tinfo) ../include/term.h +lib_setup lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h +lib_termcap lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h +lib_termname lib $(tinfo) $(INCDIR)/tic.h +lib_ti lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h +lib_tparm lib $(tinfo) ../include/term.h $(INCDIR)/tic.h +lib_tputs lib $(tinfo) ../include/term.h $(INCDIR)/tic.h +lib_trace lib $(trace) $(INCDIR)/tic.h +lib_tracebits lib $(trace) ../include/term.h +lib_tracechr lib $(trace) +lib_ttyflags lib $(tinfo) ../include/term.h +lib_twait lib $(serial) +name_match lib $(tinfo) ../include/term.h $(INCDIR)/tic.h names lib . -parse_entry lib $(srcdir) ../include/term.h ../include/parametrized.h -read_entry lib $(srcdir) ../include/term.h $(INCDIR)/tic.h -read_termcap lib $(srcdir) ../include/term.h -lib_setup lib $(srcdir) ../include/term.h -trace_buf lib $(srcdir) -tries lib $(srcdir) +parse_entry lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h ../include/parametrized.h +read_entry lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h +read_termcap lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h +setbuf lib $(tinfo) +trace_buf lib $(trace) +trace_tries lib $(trace) unctrl lib . +write_entry lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h diff --git a/ncurses/read_entry.c b/ncurses/read_entry.c deleted file mode 100644 index c783d0af..00000000 --- a/ncurses/read_entry.c +++ /dev/null @@ -1,302 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * - ****************************************************************************/ - - - -/* - * read_entry.c -- Routine for reading in a compiled terminfo file - * - */ - -#include - -#if HAVE_FCNTL_H -#include -#endif -#include - -#include -#include - -MODULE_ID("$Id: read_entry.c,v 1.35 1998/02/11 12:13:59 tom Exp $") - -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -/* - * int - * _nc_read_file_entry(filename, ptr) - * - * Read the compiled terminfo entry in the given file into the - * structure pointed to by ptr, allocating space for the string - * table. - */ - -#undef BYTE -#define BYTE(p,n) (unsigned char)((p)[n]) - -#define IS_NEG1(p) ((BYTE(p,0) == 0377) && (BYTE(p,1) == 0377)) -#define IS_NEG2(p) ((BYTE(p,0) == 0376) && (BYTE(p,1) == 0377)) -#define LOW_MSB(p) (BYTE(p,0) + 256*BYTE(p,1)) - -static bool have_tic_directory = FALSE; - -/* - * Record the "official" location of the terminfo directory, according to - * the place where we're writing to, or the normal default, if not. - */ -const char *_nc_tic_dir(const char *path) -{ - static const char *result = TERMINFO; - - if (path != 0) { - result = path; - have_tic_directory = TRUE; - } else if (!have_tic_directory) { - char *envp; - if ((envp = getenv("TERMINFO")) != 0) - return _nc_tic_dir(envp); - } - return result; -} - -int _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) -/* return 1 if read, 0 if not found or garbled */ -{ - int name_size, bool_count, num_count, str_count, str_size; - int i, fd, numread; - char buf[MAX_ENTRY_SIZE]; - - if ((fd = open(filename, O_RDONLY|O_BINARY)) < 0) - return(0); - - T(("read terminfo %s", filename)); - - /* grab the header */ - (void) read(fd, buf, 12); - if (LOW_MSB(buf) != MAGIC) - { - close(fd); - return(0); - } - name_size = LOW_MSB(buf + 2); - bool_count = LOW_MSB(buf + 4); - num_count = LOW_MSB(buf + 6); - str_count = LOW_MSB(buf + 8); - str_size = LOW_MSB(buf + 10); - - if (str_size) - { - /* try to allocate space for the string table */ - ptr->str_table = malloc((unsigned)str_size); - if (ptr->str_table == 0) - { - close(fd); - return(0); - } - } - - /* grab the name */ - read(fd, buf, min(MAX_NAME_SIZE, (unsigned)name_size)); - buf[MAX_NAME_SIZE] = '\0'; - ptr->term_names = calloc(strlen(buf) + 1, sizeof(char)); - (void) strcpy(ptr->term_names, buf); - if (name_size > MAX_NAME_SIZE) - lseek(fd, (off_t) (name_size - MAX_NAME_SIZE), 1); - - /* grab the booleans */ - read(fd, ptr->Booleans, min(BOOLCOUNT, (unsigned)bool_count)); - if (bool_count > BOOLCOUNT) - lseek(fd, (off_t) (bool_count - BOOLCOUNT), 1); - else - for (i=bool_count; i < BOOLCOUNT; i++) - ptr->Booleans[i] = 0; - - /* - * If booleans end on an odd byte, skip it. The machine they - * originally wrote terminfo on must have been a 16-bit - * word-oriented machine that would trap out if you tried a - * word access off a 2-byte boundary. - */ - if ((name_size + bool_count) % 2 != 0) - read(fd, buf, 1); - - /* grab the numbers */ - (void) read(fd, buf, min(NUMCOUNT*2, (unsigned)num_count*2)); - for (i = 0; i < min(num_count, NUMCOUNT); i++) - { - if (IS_NEG1(buf + 2*i)) - ptr->Numbers[i] = ABSENT_NUMERIC; - else if (IS_NEG2(buf + 2*i)) - ptr->Numbers[i] = CANCELLED_NUMERIC; - else - ptr->Numbers[i] = LOW_MSB(buf + 2*i); - } - if (num_count > NUMCOUNT) - lseek(fd, (off_t) (2 * (num_count - NUMCOUNT)), 1); - else - for (i=num_count; i < NUMCOUNT; i++) - ptr->Numbers[i] = ABSENT_NUMERIC; - - if (str_count) - { - if (str_count*2 >= MAX_ENTRY_SIZE) - { - close(fd); - return(0); - } - /* grab the string offsets */ - numread = read(fd, buf, (unsigned)(str_count*2)); - if (numread < str_count*2) - { - close(fd); - return(0); - } - for (i = 0; i < numread/2; i++) - { - if (i >= STRCOUNT) - break; - if (IS_NEG1(buf + 2*i)) - ptr->Strings[i] = ABSENT_STRING; - else if (IS_NEG2(buf + 2*i)) - ptr->Strings[i] = CANCELLED_STRING; - else - ptr->Strings[i] = (LOW_MSB(buf+2*i) + ptr->str_table); - } - } - - if (str_count > STRCOUNT) - lseek(fd, (off_t) (2 * (str_count - STRCOUNT)), 1); - else - for (i = str_count; i < STRCOUNT; i++) - ptr->Strings[i] = ABSENT_STRING; - - if (str_size) - { - /* finally, grab the string table itself */ - numread = read(fd, ptr->str_table, (unsigned)str_size); - if (numread != str_size) - { - close(fd); - return(0); - } - } - - close(fd); - return(1); -} - -/* - * Build a terminfo pathname and try to read the data. Returns 1 on success, - * 0 on failure. - */ -static int _nc_read_tic_entry(char *const filename, - const char *const dir, const char *ttn, TERMTYPE *const tp) -{ -/* maximum safe length of terminfo root directory name */ -#define MAX_TPATH (PATH_MAX - MAX_ALIAS - 6) - - if (strlen(dir) > MAX_TPATH) - return 0; - (void) sprintf(filename, "%s/%s", dir, ttn); - return _nc_read_file_entry(filename, tp); -} - -/* - * _nc_read_entry(char *tn, char *filename, TERMTYPE *tp) - * - * Find and read the compiled entry for a given terminal type, - * if it exists. We take pains here to make sure no combination - * of environment variables and terminal type name can be used to - * overrun the file buffer. - */ - -int _nc_read_entry(const char *const tn, char *const filename, TERMTYPE *const tp) -{ -char *envp; -char ttn[MAX_ALIAS + 3]; - - /* truncate the terminal name to prevent dangerous buffer airline */ - (void) sprintf(ttn, "%c/%.*s", *tn, MAX_ALIAS, tn); - - /* This is System V behavior, in conjunction with our requirements for - * writing terminfo entries. - */ - if (have_tic_directory - && _nc_read_tic_entry(filename, _nc_tic_dir(0), ttn, tp) == 1) - return 1; - - if ((envp = getenv("TERMINFO")) != 0 - && _nc_read_tic_entry(filename, _nc_tic_dir(envp), ttn, tp) == 1) - return 1; - - /* this is an ncurses extension */ - if ((envp = getenv("HOME")) != 0) - { - char *home = malloc(strlen(envp) + strlen(PRIVATE_INFO) + 2); - - (void) sprintf(home, PRIVATE_INFO, envp); - if (_nc_read_tic_entry(filename, home, ttn, tp) == 1) { - free(home); - return(1); - } - free(home); - } - - /* this is an ncurses extension */ - if ((envp = getenv("TERMINFO_DIRS")) != 0) - { - /* strtok modifies its argument, so we must copy */ - char *list = strcpy(malloc(strlen(envp)+1), envp); - const char *cp = strtok(list, ":"); - int code = 0; - - do { - if (cp[0] == '\0') - cp = TERMINFO; - if (_nc_read_tic_entry(filename, cp, ttn, tp) == 1) { - code = 1; - break; - } - } while - ((cp = strtok((char *)0, ":")) != 0); - - free(list); - return(code); - } - - /* try the system directory */ - return(_nc_read_tic_entry(filename, TERMINFO, ttn, tp)); -} - diff --git a/ncurses/softscroll.c b/ncurses/softscroll.c deleted file mode 100644 index 160d77c5..00000000 --- a/ncurses/softscroll.c +++ /dev/null @@ -1,257 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Thomas E. Dickey 1997 * - ****************************************************************************/ -#include -#include - -MODULE_ID("$Id: softscroll.c,v 1.6 1998/02/11 12:13:56 tom Exp $") - -/* - * Compute indices for the given WINDOW, preparing it for scrolling. - * - * TODO (this implementation is only for proof-of-concept) - * (a) ensure that curscr's oldindex values are cached properly so we - * don't have to recompute them on each pass. - * (b) investigate if there are gains to be made by iterating newscr's - * row indices outward from the current position, rather than by - * all rows. - */ -static void compute_curscr(void) -{ - int y, x, z; - for (y = 0; y < screen_lines; y++) { - struct ldat *nline = &curscr->_line[y]; - int found = y; - for (z = 0; z < y; z++) { - int same = TRUE; - struct ldat *oline = &curscr->_line[z]; - for (x = 0; x < screen_columns; x++) { - if (nline->text[x] != oline->text[x]) { - same = FALSE; - break; - } - } - if (same) { - found = z; - break; - } - } - nline->oldindex = found; - } -} - -static void compute_newscr(void) -{ - int y, x, z; - for (y = 0; y < screen_lines; y++) { - struct ldat *nline = &newscr->_line[y]; - int found = _NEWINDEX; - for (z = 0; z < screen_lines; z++) { - int same = TRUE; - struct ldat *oline = &curscr->_line[z]; - for (x = 0; x < screen_columns; x++) { - if (nline->text[x] != oline->text[x]) { - same = FALSE; - break; - } - } - if (same) { - found = z; - break; - } - } - nline->oldindex = found; - } -} - -void -_nc_setup_scroll(void) -{ -#ifdef TRACE - if (_nc_tracing & TRACE_UPDATE) { - _tracef("_nc_setup_scroll"); - _nc_linedump(); - } -#endif /* TRACE */ - compute_curscr(); - compute_newscr(); -#ifdef TRACE - if (_nc_tracing & TRACE_UPDATE) { - _tracef("..._nc_setup_scroll"); - _nc_linedump(); - } -#endif -} - -#define MINDISP 2 -#define NEWNUM(n) newscr->_line[n].oldindex -#define OLDNUM(n) curscr->_line[n].oldindex - -/* - * This performs essentially the same function as _nc_scroll_optimize(), but - * uses different assumptions about the .oldindex values. More than one line - * may have the same .oldindex value. We don't assume the values are ordered. - * - * (Neither algorithm takes into account the cost of constructing the lines - * which are scrolled) - */ -void -_nc_perform_scroll(void) -{ - int disp; - int row; - int top, bottom, maxdisp; - int partial; - - /* - * Find the top/bottom lines that are different between curscr and - * newscr, limited by the terminal's ability to scroll portions of the - * screen. - * - * FIXME: this doesn't account for special cases of insert/delete line. - */ - if (change_scroll_region - && (scroll_forward || parm_index) - && (scroll_reverse || parm_rindex)) { - partial = TRUE; - for (row = 0, top = -1; row < screen_lines; row++) { - if (OLDNUM(row) != NEWNUM(row)) { - break; - } - top = row; - } - top++; - - for (row = screen_lines-1, bottom = screen_lines; row >= 0; row--) { - if (OLDNUM(row) != NEWNUM(row)) { - break; - } - bottom = row; - } - bottom--; - } else { - partial = FALSE; - top = 0; - bottom = screen_lines - 1; - } - - maxdisp = (bottom - top + 1) / 2; - if (maxdisp < MINDISP) - return; - - T(("_nc_perform_scroll %d..%d (maxdisp=%d)", top, bottom, maxdisp)); - - for (disp = 1; disp < maxdisp; disp++) { - int n; - int fn, fwd = 0; - int bn, bak = 0; - int first, last; - int moved; - - do { - /* check for forward-movement */ - for (fn = top + disp; fn < screen_lines - disp; fn++) { - int eql = 0; - for (n = fn, fwd = 0; n < screen_lines; n++) { - if (NEWNUM(n) == _NEWINDEX - || NEWNUM(n) != OLDNUM(n-disp)) - break; - fwd++; - if (OLDNUM(n) == NEWNUM(n)) - eql++; - } - if (eql == fwd) - fwd = 0; - if (fwd >= disp) - break; - fwd = 0; - } - - /* check for backward-movement */ - for (bn = top + disp; bn < screen_lines - disp; bn++) { - int eql = 0; - for (n = bn, bak = 0; n < screen_lines; n++) { - if (OLDNUM(n) == _NEWINDEX - || OLDNUM(n) != NEWNUM(n-disp)) - break; - bak++; - if (OLDNUM(n-disp) == NEWNUM(n-disp)) - eql++; - } - if (eql == bak) - bak = 0; - if (bak >= disp) - break; - bak = 0; - } - - /* choose only one, in case they overlap */ - if (fwd > bak) { - first = fn - disp; - last = fn + fwd - 1; - moved = -disp; - } else if (bak) { - first = bn - disp; - last = bn + bak - 1; - moved = disp; - } else { - break; - } - - TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", first, last, moved)); - if (_nc_scrolln(moved, first, last, screen_lines - 1) == ERR) - { - TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); - break; - } - - /* If the scrolled text was at one end of the range - * of changed lines, adjust the loop limits. - */ - if (first == top) - top = last + 1; - if (last == bottom) - bottom = first - 1; - - maxdisp = (bottom - top + 1) / 2; - if (maxdisp < MINDISP) - return; - - /* In any case, mark the lines so we don't try to - * use them in a subsequent scroll. - */ - for (fn = first; fn <= last; fn++) { - OLDNUM(fn) = - NEWNUM(fn) = _NEWINDEX; - } - } while (partial); - } -} diff --git a/ncurses/MKcaptab.awk b/ncurses/tinfo/MKcaptab.awk similarity index 83% rename from ncurses/MKcaptab.awk rename to ncurses/tinfo/MKcaptab.awk index 7c2b58cc..910af94b 100644 --- a/ncurses/MKcaptab.awk +++ b/ncurses/tinfo/MKcaptab.awk @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: MKcaptab.awk,v 1.10 1997/09/11 17:40:46 tom Exp $ +# $Id: MKcaptab.awk,v 1.11 1999/01/24 02:46:42 Jeffrey.C.Honig Exp $ AWK=${1-awk} DATA=${2-../include/Caps} @@ -62,4 +62,9 @@ const struct name_table_entry *_nc_get_table(bool termcap) { return termcap ? _nc_cap_table: _nc_info_table ; } + +const struct name_table_entry * const * _nc_get_hash_table(bool termcap) +{ + return termcap ? _nc_cap_hash_table: _nc_info_hash_table ; +} EOF diff --git a/ncurses/MKfallback.sh b/ncurses/tinfo/MKfallback.sh similarity index 89% rename from ncurses/MKfallback.sh rename to ncurses/tinfo/MKfallback.sh index 4447611d..2a76f623 100755 --- a/ncurses/MKfallback.sh +++ b/ncurses/tinfo/MKfallback.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: MKfallback.sh,v 1.8 1996/09/15 01:44:13 tom Exp $ +# $Id: MKfallback.sh,v 1.9 1999/06/15 22:57:45 tom Exp $ # # MKfallback.sh -- create fallback table for entry reads # @@ -24,7 +24,14 @@ then #include /* fallback entries for: $* */ +EOF + for x in $* + do + echo "/* $x */" + infocmp -E $x + done + cat < "namehdr" print "" > "namehdr" print "#include " > "namehdr" print "" > "namehdr" - print "#ifdef __cplusplus" > "namehdr" - print "#define extern IT NCURSES_CONST char * const" > "namehdr" - print "#else" > "namehdr" print "#define IT NCURSES_CONST char * const" > "namehdr" - print "#endif" > "namehdr" print "" > "namehdr" print "#if BROKEN_LINKER" > "namehdr" print "#include " > "namehdr" diff --git a/ncurses/tinfo/README b/ncurses/tinfo/README new file mode 100644 index 00000000..8b092c1b --- /dev/null +++ b/ncurses/tinfo/README @@ -0,0 +1,8 @@ +-- $Id: README,v 1.1 1998/11/07 22:59:07 tom Exp $ + +The files in this directory (tinfo) are those that support the terminfo +database and interfaces for ncurses. The terminfo library can be built +separately, as a lower-level library for ncurses, but usually is bundled. + +In addition to the standard documented interfaces, ncurses uses internal +functions which reside in tinfo to satisfy linkage requirements. diff --git a/ncurses/tinfo/access.c b/ncurses/tinfo/access.c new file mode 100644 index 00000000..54e54949 --- /dev/null +++ b/ncurses/tinfo/access.c @@ -0,0 +1,55 @@ +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1998 * + ****************************************************************************/ + + +#include + +MODULE_ID("$Id: access.c,v 1.1 1998/07/25 20:17:09 tom Exp $") + +int _nc_access(const char *path, int mode) +{ + if (access(path, mode) < 0) { + if ((mode & W_OK) != 0 + && errno == ENOENT) { + char head[PATH_MAX]; + char *leaf = strrchr(strcpy(head, path), '/'); + if (leaf == 0) + leaf = head; + *leaf = '\0'; + if (head == leaf) + (void)strcpy(head, "."); + return access(head, R_OK|W_OK|X_OK); + } + return -1; + } + return 0; +} diff --git a/ncurses/tries.c b/ncurses/tinfo/add_tries.c similarity index 71% rename from ncurses/tries.c rename to ncurses/tinfo/add_tries.c index 52738866..95a9e965 100644 --- a/ncurses/tries.c +++ b/ncurses/tinfo/add_tries.c @@ -27,19 +27,19 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1997 * + * Author: Thomas E. Dickey 1998 * ****************************************************************************/ /* -** tries.c +** add_tries.c ** -** Functions to manage the tree of partial-completions for keycodes. +** Add keycode/string to tries-tree. ** */ #include -MODULE_ID("$Id: tries.c,v 1.7 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: add_tries.c,v 1.1 1998/11/08 00:04:18 tom Exp $") #define SET_TRY(dst,src) if ((dst->ch = *src++) == 128) dst->ch = '\0' #define CMP_TRY(a,b) ((a)? (a == b) : (b == 128)) @@ -122,64 +122,3 @@ void _nc_add_to_try(struct tries **tree, char *str, unsigned short code) ptr->value = code; return; } - -/* - * Expand a keycode into the string that it corresponds to, returning null if - * no match was found, otherwise allocating a string of the result. - */ -char *_nc_expand_try(struct tries *tree, unsigned short code, size_t len) -{ - struct tries *ptr = tree; - char *result = 0; - - if (code != 0) { - while (ptr != 0) { - if ((result = _nc_expand_try(ptr->child, code, len + 1)) != 0) { - break; - } - if (ptr->value == code) { - result = typeCalloc(char, len+2); - break; - } - ptr = ptr->sibling; - } - } - if (result != 0) { - if ((result[len] = ptr->ch) == 0) - *((unsigned char *)(result+len)) = 128; -#ifdef TRACE - if (len == 0) - _tracef("expand_key %s %s", _trace_key(code), _nc_visbuf(result)); -#endif - } - return result; -} - -/* - * Remove a code from the specified tree, freeing the unused nodes. Returns - * true if the code was found/removed. - */ -int _nc_remove_key(struct tries **tree, unsigned short code) -{ - if (code == 0) - return FALSE; - - while (*tree != 0) { - if (_nc_remove_key(&(*tree)->child, code)) { - return TRUE; - } - if ((*tree)->value == code) { - if((*tree)->child) { - /* don't cut the whole sub-tree */ - (*tree)->value = 0; - } else { - struct tries *to_free = *tree; - *tree = (*tree)->sibling; - free(to_free); - } - return TRUE; - } - tree = &(*tree)->sibling; - } - return FALSE; -} diff --git a/ncurses/alloc_entry.c b/ncurses/tinfo/alloc_entry.c similarity index 63% rename from ncurses/alloc_entry.c rename to ncurses/tinfo/alloc_entry.c index 169e71cd..570b48a9 100644 --- a/ncurses/alloc_entry.c +++ b/ncurses/tinfo/alloc_entry.c @@ -35,20 +35,23 @@ /* * alloc_entry.c -- allocation functions for terminfo entries * + * _nc_copy_entry() * _nc_init_entry() + * _nc_merge_entry() * _nc_save_str() - * _nc_merge_entry(); - * _nc_wrap_entry(); + * _nc_wrap_entry() * */ #include #include -#include #include -MODULE_ID("$Id: alloc_entry.c,v 1.13 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: alloc_entry.c,v 1.30 1999/03/01 02:03:45 tom Exp $") + +#define ABSENT_OFFSET -1 +#define CANCELLED_OFFSET -2 #define MAX_STRTAB 4096 /* documented maximum entry size */ @@ -60,16 +63,42 @@ void _nc_init_entry(TERMTYPE *const tp) { int i; - for (i=0; i < BOOLCOUNT; i++) - tp->Booleans[i] = FALSE; +#if NCURSES_XNAMES + tp->num_Booleans = BOOLCOUNT; + tp->num_Numbers = NUMCOUNT; + tp->num_Strings = STRCOUNT; + tp->ext_Booleans = 0; + tp->ext_Numbers = 0; + tp->ext_Strings = 0; +#endif + if (tp->Booleans == 0) + tp->Booleans = typeMalloc(char,BOOLCOUNT); + if (tp->Numbers == 0) + tp->Numbers = typeMalloc(short,NUMCOUNT); + if (tp->Strings == 0) + tp->Strings = typeMalloc(char *,STRCOUNT); + + for_each_boolean(i,tp) + tp->Booleans[i] = FALSE; + + for_each_number(i,tp) + tp->Numbers[i] = ABSENT_NUMERIC; + + for_each_string(i,tp) + tp->Strings[i] = ABSENT_STRING; - for (i=0; i < NUMCOUNT; i++) - tp->Numbers[i] = -1; + next_free = 0; +} - for (i=0; i < STRCOUNT; i++) - tp->Strings[i] = (char *)NULL; +ENTRY *_nc_copy_entry(ENTRY *oldp) +{ + ENTRY *newp = typeCalloc(ENTRY,1); - next_free = 0; + if (newp != 0) { + *newp = *oldp; + _nc_copy_termtype(&(newp->tterm), &(oldp->tterm)); + } + return newp; } char *_nc_save_str(const char *const string) @@ -91,42 +120,64 @@ size_t len = strlen(string) + 1; void _nc_wrap_entry(ENTRY *const ep) /* copy the string parts to allocated storage, preserving pointers to it */ { -int offsets[STRCOUNT], useoffsets[MAX_USES]; +int offsets[MAX_ENTRY_SIZE/2], useoffsets[MAX_USES]; int i, n; - - n = ep->tterm.term_names - stringbuf; - for (i=0; i < STRCOUNT; i++) - if (ep->tterm.Strings[i] == (char *)NULL) - offsets[i] = -1; - else if (ep->tterm.Strings[i] == CANCELLED_STRING) - offsets[i] = -2; +TERMTYPE *tp = &(ep->tterm); + + n = tp->term_names - stringbuf; + for_each_string(i, &(ep->tterm)) { + if (tp->Strings[i] == ABSENT_STRING) + offsets[i] = ABSENT_OFFSET; + else if (tp->Strings[i] == CANCELLED_STRING) + offsets[i] = CANCELLED_OFFSET; else - offsets[i] = ep->tterm.Strings[i] - stringbuf; + offsets[i] = tp->Strings[i] - stringbuf; + } - for (i=0; i < ep->nuses; i++) - if (ep->uses[i].parent == (void *)NULL) - useoffsets[i] = -1; + for (i=0; i < ep->nuses; i++) { + if (ep->uses[i].parent == (void *)0) + useoffsets[i] = ABSENT_OFFSET; else useoffsets[i] = (char *)(ep->uses[i].parent) - stringbuf; + } - if ((ep->tterm.str_table = (char *)malloc(next_free)) == (char *)NULL) + if ((tp->str_table = typeMalloc(char, next_free)) == (char *)0) _nc_err_abort("Out of memory"); - (void) memcpy(ep->tterm.str_table, stringbuf, next_free); - - ep->tterm.term_names = ep->tterm.str_table + n; - for (i=0; i < STRCOUNT; i++) - if (offsets[i] == -1) - ep->tterm.Strings[i] = (char *)NULL; - else if (offsets[i] == -2) - ep->tterm.Strings[i] = CANCELLED_STRING; + (void) memcpy(tp->str_table, stringbuf, next_free); + + tp->term_names = tp->str_table + n; + for_each_string(i, &(ep->tterm)) { + if (offsets[i] == ABSENT_OFFSET) + tp->Strings[i] = ABSENT_STRING; + else if (offsets[i] == CANCELLED_OFFSET) + tp->Strings[i] = CANCELLED_STRING; else - ep->tterm.Strings[i] = ep->tterm.str_table + offsets[i]; + tp->Strings[i] = tp->str_table + offsets[i]; + } - for (i=0; i < ep->nuses; i++) - if (useoffsets[i] == -1) - ep->uses[i].parent = (void *)NULL; +#if NCURSES_XNAMES + if ((n = NUM_EXT_NAMES(tp)) != 0) { + unsigned length = 0; + for (i = 0; i < n; i++) { + length += strlen(tp->ext_Names[i]) + 1; + offsets[i] = tp->ext_Names[i] - stringbuf; + } + if ((tp->ext_str_table = typeMalloc(char, length)) == 0) + _nc_err_abort("Out of memory"); + for (i = 0, length = 0; i < n; i++) { + tp->ext_Names[i] = tp->ext_str_table + length; + strcpy(tp->ext_Names[i], stringbuf + offsets[i]); + length += strlen(tp->ext_Names[i]) + 1; + } + } +#endif + + for (i=0; i < ep->nuses; i++) { + if (useoffsets[i] == ABSENT_OFFSET) + ep->uses[i].parent = (void *)0; else - ep->uses[i].parent = (char *)(ep->tterm.str_table + useoffsets[i]); + ep->uses[i].parent = (char *)(tp->str_table + useoffsets[i]); + } } void _nc_merge_entry(TERMTYPE *const to, TERMTYPE *const from) @@ -134,7 +185,10 @@ void _nc_merge_entry(TERMTYPE *const to, TERMTYPE *const from) { int i; - for (i=0; i < BOOLCOUNT; i++) +#if NCURSES_XNAMES + _nc_align_termtype(to, from); +#endif + for_each_boolean(i, from) { int mergebool = from->Booleans[i]; @@ -144,7 +198,7 @@ void _nc_merge_entry(TERMTYPE *const to, TERMTYPE *const from) to->Booleans[i] = mergebool; } - for (i=0; i < NUMCOUNT; i++) + for_each_number(i, from) { int mergenum = from->Numbers[i]; @@ -159,7 +213,7 @@ void _nc_merge_entry(TERMTYPE *const to, TERMTYPE *const from) * storage. This is OK right now, but will be a problem if we * we ever want to deallocate entries. */ - for (i=0; i < STRCOUNT; i++) + for_each_string(i, from) { char *mergestring = from->Strings[i]; @@ -169,4 +223,3 @@ void _nc_merge_entry(TERMTYPE *const to, TERMTYPE *const from) to->Strings[i] = mergestring; } } - diff --git a/ncurses/tinfo/alloc_ttype.c b/ncurses/tinfo/alloc_ttype.c new file mode 100644 index 00000000..a1bf9b07 --- /dev/null +++ b/ncurses/tinfo/alloc_ttype.c @@ -0,0 +1,461 @@ +/**************************************************************************** + * Copyright (c) 1999 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1999 * + ****************************************************************************/ + + +/* + * align_ttype.c -- functions for TERMTYPE + * + * _nc_align_termtype() + * _nc_copy_termtype() + * + */ + +#include + +#include +#include + +MODULE_ID("$Id: alloc_ttype.c,v 1.6 1999/03/01 22:10:44 tom Exp $") + +#if NCURSES_XNAMES +/* + * Merge the a/b lists into dst. Both a/b are sorted (see _nc_extend_names()), + * so we do not have to worry about order dependencies. + */ +static int merge_names(char **dst, char **a, int na, char **b, int nb) +{ + int n = 0; + while (na && nb) { + int cmp = strcmp(*a, *b); + if (cmp < 0) { + dst[n++] = *a++; + na--; + } else if (cmp > 0) { + dst[n++] = *b++; + nb--; + } else if (cmp == 0) { + dst[n++] = *a; + a++, b++; + na--, nb--; + } + } + while (na-- > 0) { + dst[n++] = *a++; + } + while (nb-- > 0) { + dst[n++] = *b++; + } + DEBUG(4, ("merge_names -> %d", n)); + return n; +} + +static bool find_name(char **table, int length, char *name) +{ + while (length-- > 0) { + if (!strcmp(*table++, name)) { + DEBUG(4, ("found name '%s'", name)); + return TRUE; + } + } + DEBUG(4, ("did not find name '%s'", name)); + return FALSE; +} + +static void realign_data(TERMTYPE *to, char **ext_Names, int ext_Booleans, int ext_Numbers, int ext_Strings) +{ + int n, m, base; + int limit = (to->ext_Booleans + to->ext_Numbers + to->ext_Strings); + + if (to->ext_Booleans != ext_Booleans) { + to->num_Booleans += (ext_Booleans - to->ext_Booleans); + to->Booleans = typeRealloc(char, to->num_Booleans, to->Booleans); + for (n = to->ext_Booleans-1, + m = ext_Booleans-1, + base = to->num_Booleans - (m+1); m >= 0; m--) { + if (find_name(to->ext_Names, limit, ext_Names[m])) { + to->Booleans[base + m] = to->Booleans[base + n--]; + } else { + to->Booleans[base + m] = FALSE; + } + } + to->ext_Booleans = ext_Booleans; + } + if (to->ext_Numbers != ext_Numbers) { + to->num_Numbers += (ext_Numbers - to->ext_Numbers); + to->Numbers = typeRealloc(short, to->num_Numbers, to->Numbers); + for (n = to->ext_Numbers-1, + m = ext_Numbers-1, + base = to->num_Numbers - (m+1); m >= 0; m--) { + if (find_name(to->ext_Names, limit, ext_Names[m+ext_Booleans])) { + to->Numbers[base + m] = to->Numbers[base + n--]; + } else { + to->Numbers[base + m] = ABSENT_NUMERIC; + } + } + to->ext_Numbers = ext_Numbers; + } + if (to->ext_Strings != ext_Strings) { + to->num_Strings += (ext_Strings - to->ext_Strings); + to->Strings = typeRealloc(char*, to->num_Strings, to->Strings); + for (n = to->ext_Strings-1, + m = ext_Strings-1, + base = to->num_Strings - (m+1); m >= 0; m--) { + if (find_name(to->ext_Names, limit, ext_Names[m+ext_Booleans+ext_Numbers])) { + to->Strings[base + m] = to->Strings[base + n--]; + } else { + to->Strings[base + m] = ABSENT_STRING; + } + } + to->ext_Strings = ext_Strings; + } +} + +/* + * Returns the first index in ext_Names[] for the given token-type + */ +static int _nc_first_ext_name(TERMTYPE *tp, int token_type) +{ + int first; + + switch (token_type) { + case BOOLEAN: + first = 0; + break; + case NUMBER: + first = tp->ext_Booleans; + break; + case STRING: + first = tp->ext_Booleans + tp->ext_Numbers; + break; + default: + first = 0; + break; + } + return first; +} + +/* + * Returns the last index in ext_Names[] for the given token-type + */ +static int _nc_last_ext_name(TERMTYPE *tp, int token_type) +{ + int last; + + switch (token_type) { + case BOOLEAN: + last = tp->ext_Booleans; + break; + case NUMBER: + last = tp->ext_Booleans + tp->ext_Numbers; + break; + default: + case STRING: + last = NUM_EXT_NAMES(tp); + break; + } + return last; +} + +/* + * Lookup an entry from extended-names, returning -1 if not found + */ +static int _nc_find_ext_name(TERMTYPE *tp, char *name, int token_type) +{ + unsigned j; + unsigned first = _nc_first_ext_name(tp, token_type); + unsigned last = _nc_last_ext_name(tp, token_type); + + for (j = first; j < last; j++) { + if (!strcmp(name, tp->ext_Names[j])) { + return j; + } + } + return -1; +} + +/* + * Translate an index into ext_Names[] into the corresponding index into data + * (e.g., Booleans[]). + */ +static int _nc_ext_data_index(TERMTYPE *tp, int n, int token_type) +{ + switch (token_type) { + case BOOLEAN: + n += (tp->num_Booleans - tp->ext_Booleans); + break; + case NUMBER: + n += (tp->num_Numbers - tp->ext_Numbers) + - (tp->ext_Booleans); + break; + default: + case STRING: + n += (tp->num_Strings - tp->ext_Strings) + - (tp->ext_Booleans + tp->ext_Numbers); + } + return n; +} + +/* + * Adjust tables to remove (not free) an extended name and its corresponding + * data. + */ +static void _nc_del_ext_name(TERMTYPE *tp, char *name, int token_type) +{ + int j; + int first, last; + + if ((first = _nc_find_ext_name(tp, name, token_type)) >= 0) { + last = NUM_EXT_NAMES(tp) - 1; + for (j = first; j < last; j++) { + tp->ext_Names[j] = tp->ext_Names[j+1]; + } + first = _nc_ext_data_index(tp, first, token_type); + switch (token_type) { + case BOOLEAN: + last = tp->num_Booleans - 1; + for (j = first; j < last; j++) + tp->Booleans[j] = tp->Booleans[j+1]; + tp->ext_Booleans -= 1; + tp->num_Booleans -= 1; + break; + case NUMBER: + last = tp->num_Numbers - 1; + for (j = first; j < last; j++) + tp->Numbers[j] = tp->Numbers[j+1]; + tp->ext_Numbers -= 1; + tp->num_Numbers -= 1; + break; + case STRING: + last = tp->num_Strings - 1; + for (j = first; j < last; j++) + tp->Strings[j] = tp->Strings[j+1]; + tp->ext_Strings -= 1; + tp->num_Strings -= 1; + break; + } + } +} + +/* + * Adjust tables to insert an extended name, making room for new data. The + * index into the corresponding data array is returned. + */ +static int _nc_ins_ext_name(TERMTYPE *tp, char *name, int token_type) +{ + unsigned first = _nc_first_ext_name(tp, token_type); + unsigned last = _nc_last_ext_name(tp, token_type); + unsigned total = NUM_EXT_NAMES(tp) + 1; + unsigned j, k; + + for (j = first; j < last; j++) { + int cmp = strcmp(name, tp->ext_Names[j]); + if (cmp == 0) + /* already present */ + return _nc_ext_data_index(tp, j, token_type); + if (cmp < 0) { + break; + } + } + + tp->ext_Names = typeRealloc(char *, total, tp->ext_Names); + for (k = total-1; k > j; k--) + tp->ext_Names[k] = tp->ext_Names[k-1]; + tp->ext_Names[j] = name; + j = _nc_ext_data_index(tp, j, token_type); + + switch (token_type) { + case BOOLEAN: + tp->ext_Booleans += 1; + tp->num_Booleans += 1; + tp->Booleans = typeRealloc(char, tp->num_Booleans, tp->Booleans); + for (k = tp->num_Booleans-1; k > j; k--) + tp->Booleans[k] = tp->Booleans[k-1]; + break; + case NUMBER: + tp->ext_Numbers += 1; + tp->num_Numbers += 1; + tp->Numbers = typeRealloc(short, tp->num_Numbers, tp->Numbers); + for (k = tp->num_Numbers-1; k > j; k--) + tp->Numbers[k] = tp->Numbers[k-1]; + break; + case STRING: + tp->ext_Strings += 1; + tp->num_Strings += 1; + tp->Strings = typeRealloc(char *, tp->num_Strings, tp->Strings); + for (k = tp->num_Strings-1; k > j; k--) + tp->Strings[k] = tp->Strings[k-1]; + break; + } + return j; +} + +/* + * Look for strings that are marked cancelled, which happen to be the same name + * as a boolean or number. We'll get this as a special case when we get a + * cancellation of a name that is inherited from another entry. + */ +static void adjust_cancels(TERMTYPE *to, TERMTYPE *from) +{ + int first = to->ext_Booleans + to->ext_Numbers; + int last = first + to->ext_Strings; + int j, k; + + for (j = first; j < last; ) { + char *name = to->ext_Names[j]; + unsigned j_str = to->num_Strings - first - to->ext_Strings; + + if (to->Strings[j + j_str] == CANCELLED_STRING) { + if ((k = _nc_find_ext_name(from, to->ext_Names[j], BOOLEAN)) >= 0) { + _nc_del_ext_name(to, name, STRING); + k = _nc_ins_ext_name(to, name, BOOLEAN); + to->Booleans[k] = FALSE; + } else if ((k = _nc_find_ext_name(from, to->ext_Names[j], NUMBER)) >= 0) { + _nc_del_ext_name(to, name, STRING); + k = _nc_ins_ext_name(to, name, NUMBER); + to->Numbers[k] = CANCELLED_NUMERIC; + } + } else { + j++; + } + } +} + +void _nc_align_termtype(TERMTYPE *to, TERMTYPE *from) +{ + int na = NUM_EXT_NAMES(to); + int nb = NUM_EXT_NAMES(from); + int n; + bool same; + char **ext_Names; + int ext_Booleans, ext_Numbers, ext_Strings; + + DEBUG(2, ("align_termtype to(%d:%s), from(%d:%s)", na, to->term_names, nb, from->term_names)); + + if (na != 0 || nb != 0) { + if ((na == nb) /* check if the arrays are equivalent */ + && (to->ext_Booleans == from->ext_Booleans) + && (to->ext_Numbers == from->ext_Numbers) + && (to->ext_Strings == from->ext_Strings)) { + for (n = 0, same = TRUE; n < na; n++) { + if (strcmp(to->ext_Names[n], from->ext_Names[n])) { + same = FALSE; + break; + } + } + if (same) + return; + } + /* + * This is where we pay for having a simple extension representation. + * Allocate a new ext_Names array and merge the two ext_Names arrays + * into it, updating to's counts for booleans, etc. Fortunately we do + * this only for the terminfo compiler (tic) and comparer (infocmp). + */ + ext_Names = typeMalloc(char *, na+nb); + + if (to->ext_Strings && (from->ext_Booleans + from->ext_Numbers)) + adjust_cancels(to, from); + + if (from->ext_Strings && (to->ext_Booleans + to->ext_Numbers)) + adjust_cancels(from, to); + + ext_Booleans = merge_names(ext_Names, + to->ext_Names, + to->ext_Booleans, + from->ext_Names, + from->ext_Booleans); + ext_Numbers = merge_names(ext_Names + ext_Booleans, + to->ext_Names + + to->ext_Booleans, + to->ext_Numbers, + from->ext_Names + + from->ext_Booleans, + from->ext_Numbers); + ext_Strings = merge_names(ext_Names + ext_Numbers + ext_Booleans, + to->ext_Names + + to->ext_Booleans + + to->ext_Numbers, + to->ext_Strings, + from->ext_Names + + from->ext_Booleans + + from->ext_Numbers, + from->ext_Strings); + /* + * Now we must reallocate the Booleans, etc., to allow the data to be + * overlaid. + */ + if (na != (ext_Booleans + ext_Numbers + ext_Strings)) { + realign_data(to, ext_Names, ext_Booleans, ext_Numbers, ext_Strings); + free(to->ext_Names); + to->ext_Names = ext_Names; + DEBUG(2, ("realigned %d extended names for '%s' (to)", NUM_EXT_NAMES(to), to->term_names)); + } + if (nb != (ext_Booleans + ext_Numbers + ext_Strings)) { + nb = (ext_Booleans + ext_Numbers + ext_Strings); + realign_data(from, ext_Names, ext_Booleans, ext_Numbers, ext_Strings); + from->ext_Names = typeRealloc(char *, nb, from->ext_Names); + memcpy(from->ext_Names, ext_Names, sizeof(char *) * nb); + DEBUG(2, ("realigned %d extended names for '%s' (from)", NUM_EXT_NAMES(from), from->term_names)); + } + } +} +#endif + +void _nc_copy_termtype(TERMTYPE *dst, TERMTYPE *src) +{ + int i; + + *dst = *src; /* ...to copy the sizes and string-tables */ + dst->Booleans = typeMalloc(char, NUM_BOOLEANS(dst)); + dst->Numbers = typeMalloc(short, NUM_NUMBERS(dst)); + dst->Strings = typeMalloc(char *, NUM_STRINGS(dst)); + + /* FIXME: use memcpy for these and similar loops */ + for_each_boolean(i,dst) + dst->Booleans[i] = src->Booleans[i]; + for_each_number(i,dst) + dst->Numbers[i] = src->Numbers[i]; + for_each_string(i,dst) + dst->Strings[i] = src->Strings[i]; + + /* FIXME: we probably should also copy str_table and ext_str_table, + * but tic and infocmp are not written to exploit that (yet). + */ + +#if NCURSES_XNAMES + if ((i = NUM_EXT_NAMES(src)) != 0) { + dst->ext_Names = typeMalloc(char *, i); + memcpy(dst->ext_Names, src->ext_Names, i * sizeof(char *)); + } +#endif + +} diff --git a/ncurses/captoinfo.c b/ncurses/tinfo/captoinfo.c similarity index 98% rename from ncurses/captoinfo.c rename to ncurses/tinfo/captoinfo.c index 387fabd3..d0881ecd 100644 --- a/ncurses/captoinfo.c +++ b/ncurses/tinfo/captoinfo.c @@ -94,7 +94,7 @@ #include #include -MODULE_ID("$Id: captoinfo.c,v 1.17 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: captoinfo.c,v 1.24 1999/07/24 20:06:13 tom Exp $") #define MAX_PUSHED 16 /* max # args we can push onto the stack */ #define MAX_ENTRY 2048 /* maximum chars in a translated capability */ @@ -115,7 +115,7 @@ static char *init_string(void) /* initialize 'my_string', 'my_length' */ { if (my_string == 0) - my_string = malloc(my_length = 256); + my_string = typeMalloc(char, my_length = 256); if (my_string == 0) _nc_err_abort("Out of memory"); @@ -128,7 +128,9 @@ static char *save_string(char *d, const char *const s) size_t have = (d - my_string); size_t need = have + strlen(s) + 2; if (need > my_length) { - my_string = realloc(my_string, my_length = (need + need)); + my_string = (char *)realloc(my_string, my_length = (need + need)); + if (my_string == 0) + _nc_err_abort("Out of memory"); d = my_string + have; } (void) strcpy(d, s); @@ -154,11 +156,12 @@ static void push(void) static void pop(void) /* pop the top of the stack into onstack */ { - if (stackptr == 0) + if (stackptr == 0) { if (onstack == 0) _nc_warning("I'm confused"); else onstack = 0; + } else onstack = stack[--stackptr]; param++; @@ -374,13 +377,14 @@ int const parametrized) /* do % translations if 1, pad translations if >=0 */ *dp++ = '%'; *dp++ = '/'; break; case '=': - if (seenr) + if (seenr) { if (param == 1) onstack = 2; else if (param == 2) onstack = 1; else onstack = param; + } else onstack = param; break; @@ -423,7 +427,7 @@ int const parametrized) /* do % translations if 1, pad translations if >=0 */ pop(); break; case '0': /* not clear any of the historical termcaps did this */ - if (*s == '3') + if (*s == '3') goto see03; else if (*s != '2') goto invalid; @@ -582,7 +586,7 @@ int const parametrized) /* do % translations if 1, pad translations if >=0 */ for (; *str && str != trimmed; str++) { int c1, c2; - char *cp; + char *cp = 0; if (str[0] == '\\' && (str[1] == '^' || str[1] == ',')) { @@ -600,9 +604,7 @@ int const parametrized) /* do % translations if 1, pad translations if >=0 */ else if (sscanf(str, "%%?%%{%d}%%>%%t%%{%d}%%+%%;", &c1,&c2) == 2) { str = strchr(str, ';'); - (void) sprintf(temp, "%%>"); - (void) strcat(temp, unctrl(c1)); - (void) strcat(temp, unctrl(c2)); + (void) sprintf(temp, "%%>%s%s", unctrl(c1), unctrl(c2)); bufptr = save_string(bufptr, temp); } else if (sscanf(str, "%%?%%{%d}%%>%%t%%'%c'%%+%%;", &c1,&ch2) == 2) diff --git a/ncurses/comp_error.c b/ncurses/tinfo/comp_error.c similarity index 93% rename from ncurses/comp_error.c rename to ncurses/tinfo/comp_error.c index 8517e9a3..2b2d5030 100644 --- a/ncurses/comp_error.c +++ b/ncurses/tinfo/comp_error.c @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: comp_error.c,v 1.14 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: comp_error.c,v 1.16 1998/08/01 23:39:51 tom Exp $") bool _nc_suppress_warnings; int _nc_curr_line; /* current line # in input */ @@ -118,5 +118,15 @@ va_list argp; vfprintf (stderr, fmt, argp); fprintf (stderr, "\n"); va_end(argp); + + /* If we're debugging, try to show where the problem occurred - this + * will dump core. + */ +#if defined(TRACE) || !defined(NDEBUG) abort(); +#else + /* Dumping core in production code is not a good idea. + */ + exit(EXIT_FAILURE); +#endif } diff --git a/ncurses/comp_expand.c b/ncurses/tinfo/comp_expand.c similarity index 63% rename from ncurses/comp_expand.c rename to ncurses/tinfo/comp_expand.c index 6cdf188a..eb552fad 100644 --- a/ncurses/comp_expand.c +++ b/ncurses/tinfo/comp_expand.c @@ -35,7 +35,7 @@ #include #include -MODULE_ID("$Id: comp_expand.c,v 1.4 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: comp_expand.c,v 1.11 1999/03/07 00:51:07 tom Exp $") static int trailing_spaces(const char *src) { @@ -49,7 +49,7 @@ static int trailing_spaces(const char *src) #define REALCTL(s) (CHAR_OF(s) < 127 && iscntrl(CHAR_OF(s))) #define REALPRINT(s) (CHAR_OF(s) < 127 && isprint(CHAR_OF(s))) -char *_nc_tic_expand(const char *srcp, bool tic_format) +char *_nc_tic_expand(const char *srcp, bool tic_format, int numbers) { static char * buffer; static size_t length; @@ -60,62 +60,114 @@ bool islong = (strlen(str) > 3); size_t need = (2 + strlen(str)) * 4; int ch; - if (buffer == 0) { - buffer = malloc(length = need); - } else if (need > length) { - buffer = realloc(buffer, length = need); + if (buffer == 0 || need > length) { + if ((buffer = typeRealloc(char, length = need, buffer)) == 0) + return 0; } - bufp = 0; - ptr = str; - while ((ch = (*str & 0xff)) != 0) { + bufp = 0; + ptr = str; + while ((ch = (*str & 0xff)) != 0) { if (ch == '%' && REALPRINT(str+1)) { - buffer[bufp++] = *str++; - buffer[bufp++] = *str; + buffer[bufp++] = *str++; + /* + * Though the character literals are more compact, most + * terminal descriptions use numbers and are not easy + * to read in character-literal form. + */ + switch (numbers) { + case -1: + if (str[0] == S_QUOTE + && str[1] != '\\' + && REALPRINT(str+1) + && str[2] == S_QUOTE) { + sprintf(buffer+bufp, "{%d}", str[1]); + bufp += strlen(buffer+bufp); + str += 2; + } else { + buffer[bufp++] = *str; + } + break; + /* + * If we have a "%{number}", try to translate it into + * a "%'char'" form, since that will run a little faster + * when we're interpreting it. Also, having one form + * for the constant makes it simpler to compare terminal + * descriptions. + */ + case 1: + if (str[0] == L_BRACE + && isdigit(str[1])) { + char *dst = 0; + long value = strtol(str+1, &dst, 0); + if (dst != 0 + && *dst == R_BRACE + && value < 127 + && value != '\\' /* FIXME */ + && isprint((int)value)) { + ch = (int)value; + buffer[bufp++] = S_QUOTE; + if (ch == '\\' + || ch == S_QUOTE) + buffer[bufp++] = '\\'; + buffer[bufp++] = ch; + buffer[bufp++] = S_QUOTE; + str = dst; + } else { + buffer[bufp++] = *str; + } + } else { + buffer[bufp++] = *str; + } + break; + default: + buffer[bufp++] = *str; + break; + } } else if (ch == 128) { - buffer[bufp++] = '\\'; - buffer[bufp++] = '0'; + buffer[bufp++] = '\\'; + buffer[bufp++] = '0'; } else if (ch == '\033') { - buffer[bufp++] = '\\'; - buffer[bufp++] = 'E'; + buffer[bufp++] = '\\'; + buffer[bufp++] = 'E'; } else if (ch == '\\' && tic_format && (str == srcp || str[-1] != '^')) { - buffer[bufp++] = '\\'; - buffer[bufp++] = '\\'; + buffer[bufp++] = '\\'; + buffer[bufp++] = '\\'; } else if (ch == ' ' && tic_format && (str == srcp || trailing_spaces(str))) { - buffer[bufp++] = '\\'; - buffer[bufp++] = 's'; + buffer[bufp++] = '\\'; + buffer[bufp++] = 's'; } else if ((ch == ',' || ch == ':' || ch == '^') && tic_format) { - buffer[bufp++] = '\\'; - buffer[bufp++] = ch; + buffer[bufp++] = '\\'; + buffer[bufp++] = ch; } else if (REALPRINT(str) && (ch != ',' && ch != ':' && !(ch == '!' && !tic_format) && ch != '^')) - buffer[bufp++] = ch; + buffer[bufp++] = ch; #if 0 /* FIXME: this would be more readable (in fact the whole 'islong' logic should be removed) */ else if (ch == '\b') { - buffer[bufp++] = '\\'; - buffer[bufp++] = 'b'; + buffer[bufp++] = '\\'; + buffer[bufp++] = 'b'; } else if (ch == '\f') { - buffer[bufp++] = '\\'; - buffer[bufp++] = 'f'; + buffer[bufp++] = '\\'; + buffer[bufp++] = 'f'; } else if (ch == '\t' && islong) { - buffer[bufp++] = '\\'; - buffer[bufp++] = 't'; + buffer[bufp++] = '\\'; + buffer[bufp++] = 't'; } #endif else if (ch == '\r' && (islong || (strlen(srcp) > 2 && str[1] == '\0'))) { - buffer[bufp++] = '\\'; - buffer[bufp++] = 'r'; + buffer[bufp++] = '\\'; + buffer[bufp++] = 'r'; } else if (ch == '\n' && islong) { - buffer[bufp++] = '\\'; - buffer[bufp++] = 'n'; + buffer[bufp++] = '\\'; + buffer[bufp++] = 'n'; } #define UnCtl(c) ((c) + '@') else if (REALCTL(str) && ch != '\\' && (!islong || isdigit(str[1]))) @@ -130,8 +182,8 @@ int ch; } str++; - } + } - buffer[bufp] = '\0'; - return(buffer); + buffer[bufp] = '\0'; + return(buffer); } diff --git a/ncurses/comp_hash.c b/ncurses/tinfo/comp_hash.c similarity index 96% rename from ncurses/comp_hash.c rename to ncurses/tinfo/comp_hash.c index bd9d52d7..7e0bdd05 100644 --- a/ncurses/comp_hash.c +++ b/ncurses/tinfo/comp_hash.c @@ -49,7 +49,7 @@ #define DEBUG(level, params) /*nothing*/ #endif -MODULE_ID("$Id: comp_hash.c,v 1.16 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: comp_hash.c,v 1.21 1999/06/26 21:25:11 tom Exp $") static int hash_function(const char *); @@ -63,6 +63,11 @@ static int hash_function(const char *); */ #ifdef MAIN_PROGRAM + +#undef MODULE_ID +#define MODULE_ID(id) /*nothing*/ +#include + static void _nc_make_hash_table(struct name_table_entry *table, struct name_table_entry **hash_table) { @@ -180,18 +185,6 @@ struct name_table_entry const *ptr; * performance enhancement). */ -#if !HAVE_STRDUP -static char *strdup (char *s) -{ - char *p; - - p = malloc(strlen(s)+1); - if (p) - strcpy(p,s); - return(p); -} -#endif /* not HAVE_STRDUP */ - #define MAX_COLUMNS BUFSIZ /* this _has_ to be worst-case */ static char **parse_columns(char *buffer) @@ -200,8 +193,8 @@ static char **parse_columns(char *buffer) int col = 0; - if (list == 0) - list = typeCalloc(char *, MAX_COLUMNS); + if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0) + return(0); if (*buffer != '#') { while (*buffer != '\0') { @@ -310,9 +303,9 @@ int main(int argc, char **argv) printf("{\n"); for (n = 0; n < HASHTABSIZE; n++) { if (hash_table[n] != 0) { - sprintf(buffer, "_nc_%s_table + %3d", + sprintf(buffer, "_nc_%s_table + %3ld", root_name, - hash_table[n] - name_table); + (long) (hash_table[n] - name_table)); } else { strcpy(buffer, "0"); } diff --git a/ncurses/comp_parse.c b/ncurses/tinfo/comp_parse.c similarity index 84% rename from ncurses/comp_parse.c rename to ncurses/tinfo/comp_parse.c index 1b7ae1e8..be419ca3 100644 --- a/ncurses/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -52,12 +52,12 @@ #include #include -#include #include -MODULE_ID("$Id: comp_parse.c,v 1.21 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.34 1999/02/27 22:13:02 tom Exp $") static void sanity_check(TERMTYPE *); +void (*_nc_check_termtype)(TERMTYPE *) = sanity_check; /**************************************************************************** * @@ -85,13 +85,11 @@ ENTRY *_nc_head, *_nc_tail; static void enqueue(ENTRY *ep) /* add an entry to the in-core list */ { - ENTRY *newp = (ENTRY *)malloc(sizeof(ENTRY)); + ENTRY *newp = _nc_copy_entry(ep); if (newp == NULL) _nc_err_abort("Out of memory"); - (void) memcpy(newp, ep, sizeof(ENTRY)); - newp->last = _nc_tail; _nc_tail = newp; @@ -131,14 +129,16 @@ bool _nc_entry_match(char *n1, char *n2) if (strchr(n1, '|') == NULL) { - (void) strcpy(nc1, n1); + (void) strncpy(nc1, n1, sizeof(nc1) - 2); + nc1[sizeof(nc1) - 2] = '\0'; (void) strcat(nc1, "|"); n1 = nc1; } if (strchr(n2, '|') == NULL) { - (void) strcpy(nc2, n2); + (void) strncpy(nc2, n2, sizeof(nc2) - 2); + nc2[sizeof(nc2) - 2] = '\0'; (void) strcat(nc2, "|"); n2 = nc2; } @@ -170,6 +170,7 @@ void _nc_read_entry_source(FILE *fp, char *buf, if (silent) _nc_suppress_warnings = TRUE; /* shut the lexer up, too */ + memset(&thisentry, 0, sizeof(thisentry)); for (_nc_reset_input(fp, buf); _nc_parse_entry(&thisentry, literal, silent) != ERR; ) { if (!isalnum(thisentry.tterm.term_names[0])) @@ -195,8 +196,10 @@ void _nc_read_entry_source(FILE *fp, char *buf, DEBUG(1, ("head = %s", _nc_head->tterm.term_names)); DEBUG(1, ("tail = %s", _nc_tail->tterm.term_names)); } +#ifdef TRACE else if (!immediate) DEBUG(1, ("no entries parsed")); +#endif _nc_suppress_warnings = oldsuppress; } @@ -279,13 +282,16 @@ int _nc_resolve_uses(void) TERMTYPE thisterm; char filename[PATH_MAX]; + memset(&thisterm, 0, sizeof(thisterm)); if (_nc_read_entry(lookfor, filename, &thisterm) == 1) { DEBUG(2, ("%s: resolving use=%s (compiled)", child, lookfor)); - rp = (ENTRY *)malloc(sizeof(ENTRY)); - memcpy(&rp->tterm, &thisterm, sizeof(TERMTYPE)); + rp = typeMalloc(ENTRY,1); + if (rp == NULL) + _nc_err_abort("Out of memory"); + rp->tterm = thisterm; rp->nuses = 0; rp->next = lastread; lastread = rp; @@ -326,6 +332,7 @@ int _nc_resolve_uses(void) keepgoing = FALSE; for_entry_list(qp) + { if (qp->nuses > 0) { DEBUG(2, ("%s: attempting merge", _nc_first_name(qp->tterm.term_names))); @@ -347,7 +354,7 @@ int _nc_resolve_uses(void) * as a side effect, copy into the merged entry the name * field and string table pointer. */ - memcpy(&merged, &qp->tterm, sizeof(TERMTYPE)); + _nc_copy_termtype(&merged, &(qp->tterm)); /* * Now merge in each use entry in the proper @@ -365,7 +372,10 @@ int _nc_resolve_uses(void) /* * Replace the original entry with the merged one. */ - memcpy(&qp->tterm, &merged, sizeof(TERMTYPE)); + FreeIfNeeded(qp->tterm.Booleans); + FreeIfNeeded(qp->tterm.Numbers); + FreeIfNeeded(qp->tterm.Strings); + qp->tterm = merged; /* * We know every entry is resolvable because name resolution @@ -375,6 +385,7 @@ int _nc_resolve_uses(void) incomplete: keepgoing = TRUE; } + } } while (keepgoing); @@ -387,13 +398,13 @@ int _nc_resolve_uses(void) */ for_entry_list(qp) { - for (j = 0; j < BOOLCOUNT; j++) + for_each_boolean(j, &(qp->tterm)) if (qp->tterm.Booleans[j] == CANCELLED_BOOLEAN) qp->tterm.Booleans[j] = FALSE; - for (j = 0; j < NUMCOUNT; j++) + for_each_number(j, &(qp->tterm)) if (qp->tterm.Numbers[j] == CANCELLED_NUMERIC) qp->tterm.Numbers[j] = ABSENT_NUMERIC; - for (j = 0; j < STRCOUNT; j++) + for_each_string(j, &(qp->tterm)) if (qp->tterm.Strings[j] == CANCELLED_STRING) qp->tterm.Strings[j] = ABSENT_STRING; } @@ -407,16 +418,18 @@ int _nc_resolve_uses(void) DEBUG(2, ("RESOLUTION FINISHED")); - _nc_curr_col = -1; - for_entry_list(qp) + if (_nc_check_termtype != 0) { - _nc_curr_line = qp->startline; - _nc_set_type(_nc_first_name(qp->tterm.term_names)); - sanity_check(&qp->tterm); + _nc_curr_col = -1; + for_entry_list(qp) + { + _nc_curr_line = qp->startline; + _nc_set_type(_nc_first_name(qp->tterm.term_names)); + _nc_check_termtype(&qp->tterm); + } + DEBUG(2, ("SANITY CHECK FINISHED")); } - DEBUG(2, ("SANITY CHECK FINISHED")); - return(TRUE); } @@ -429,33 +442,12 @@ int _nc_resolve_uses(void) #undef CUR #define CUR tp-> -/* - * Note that WANTED and PRESENT are not simple inverses! If a capability - * has been explicitly cancelled, it's not considered WANTED. - */ -#define WANTED(s) ((s) == ABSENT_STRING) -#define PRESENT(s) (((s) != ABSENT_STRING) && ((s) != CANCELLED_STRING)) - -#define ANDMISSING(p,q) \ - {if (PRESENT(p) && !PRESENT(q)) _nc_warning(#p " but no " #q);} - -#define PAIRED(p,q) \ - { \ - if (PRESENT(q) && !PRESENT(p)) \ - _nc_warning(#q " but no " #p); \ - if (PRESENT(p) && !PRESENT(q)) \ - _nc_warning(#p " but no " #q); \ - } - static void sanity_check(TERMTYPE *tp) { -#ifdef __UNUSED__ /* this casts too wide a net */ - bool terminal_entry = !strchr(tp->term_names, '+'); -#endif - if (!PRESENT(exit_attribute_mode)) { #ifdef __UNUSED__ /* this casts too wide a net */ + bool terminal_entry = !strchr(tp->term_names, '+'); if (terminal_entry && (PRESENT(set_attributes) || PRESENT(enter_standout_mode) @@ -473,10 +465,6 @@ static void sanity_check(TERMTYPE *tp) } /* listed in structure-member order of first argument */ -#ifdef __UNUSED__ - ANDMISSING(cursor_invisible, cursor_normal) - ANDMISSING(cursor_visible, cursor_normal) -#endif /* __UNUSED__ */ PAIRED(enter_alt_charset_mode, exit_alt_charset_mode) ANDMISSING(enter_alt_charset_mode, acs_chars) ANDMISSING(exit_alt_charset_mode, acs_chars) @@ -499,30 +487,4 @@ static void sanity_check(TERMTYPE *tp) ANDMISSING(label_off, label_on) PAIRED(display_clock, remove_clock) ANDMISSING(set_color_pair, initialize_pair) - - /* Some checks that we should make, but don't want to confuse people - * with. Put those under the tic -v option so we can still get them. - */ - if (_nc_tracing) { - - /* - * From XSI & O'Reilly, we gather that sc/rc are required if csr is - * given, because the cursor position after the scrolling operation is - * performed is undefined. - */ - ANDMISSING(change_scroll_region, save_cursor) - ANDMISSING(change_scroll_region, restore_cursor) - - /* - * Some non-curses applications (e.g., jove) get confused if we have - * both ich/ich1 and smir/rmir. Let's be nice and warn about that, - * too, even though ncurses handles it. - */ - if ((PRESENT(enter_insert_mode) || PRESENT(exit_insert_mode)) - && (PRESENT(insert_character) || PRESENT(parm_ich))) { - _nc_warning("non-curses applications may be confused by ich/ich1 with smir/rmir"); - } - } -#undef PAIRED -#undef ANDMISSING } diff --git a/ncurses/comp_scan.c b/ncurses/tinfo/comp_scan.c similarity index 96% rename from ncurses/comp_scan.c rename to ncurses/tinfo/comp_scan.c index e1258905..15293088 100644 --- a/ncurses/comp_scan.c +++ b/ncurses/tinfo/comp_scan.c @@ -49,7 +49,7 @@ #include #include -MODULE_ID("$Id: comp_scan.c,v 1.30 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.34 1998/11/01 00:56:39 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -76,6 +76,7 @@ static char separator; /* capability separator */ static int pushtype; /* type of pushback token */ static char pushname[MAX_NAME_SIZE+1]; +static int last_char(void); static int next_char(void); static long stream_pos(void); static bool end_of_stream(void); @@ -129,7 +130,9 @@ static const char terminfo_punct[] = "@%&*!#"; long number; int type; int ch; -bool found; +char * numchk; +char numbuf[80]; +unsigned found; static char buffer[MAX_ENTRY_SIZE]; char *ptr; int dot_flag = FALSE; @@ -203,7 +206,7 @@ start_token: { if (ch == EOF) _nc_err_abort("premature EOF"); - else if (ch == ':') + else if (ch == ':' && last_char() != ',') { _nc_syntax = SYN_TERMCAP; separator = ':'; @@ -268,11 +271,12 @@ start_token: * description field for syntax-checking purposes. */ desc = strrchr(buffer, '|'); - if (desc) + if (desc) { if (*desc == '\0') _nc_warning("empty longname field"); else if (strchr(desc, ' ') == (char *)NULL) _nc_warning("older tic versions may treat the description field as an alias"); + } if (!desc) desc = buffer + strlen(buffer); @@ -337,15 +341,17 @@ start_token: break; case '#': - number = 0; - found = FALSE; - while (isdigit(ch = next_char())) { - number = number * 10 + ch - '0'; - found = TRUE; + found = 0; + while (isalnum(ch = next_char())) { + numbuf[found++] = ch; + if (found >= sizeof(numbuf)-1) + break; } - if (found == FALSE) + numbuf[found] = '\0'; + number = strtol(numbuf, &numchk, 0); + if (numchk == numbuf) _nc_warning("no value given for `%s'", buffer); - if (ch != separator) + if ((*numchk != '\0') || (ch != separator)) _nc_warning("Missing separator"); _nc_curr_token.tk_name = buffer; _nc_curr_token.tk_valnumber = number; @@ -374,6 +380,8 @@ start_token: } /* end else (ch != EOF) */ end_of_token: + +#ifdef TRACE if (dot_flag == TRUE) DEBUG(8, ("Commented out ")); @@ -418,6 +426,7 @@ end_of_token: _nc_warning("Bad token type"); } } +#endif if (dot_flag == TRUE) /* if commented out, use the next one */ type = _nc_get_token(); @@ -633,6 +642,22 @@ void _nc_reset_input(FILE *fp, char *buf) _nc_curr_col = 0; } +/* + * int last_char() + * + * Returns the final nonblank character on the current input buffer + */ +static int +last_char(void) +{ + size_t len = strlen(bufptr); + while (len--) { + if (!isspace(bufptr[len])) + return bufptr[len]; + } + return 0; +} + /* * int next_char() * diff --git a/ncurses/tinfo/doalloc.c b/ncurses/tinfo/doalloc.c new file mode 100644 index 00000000..84471fb6 --- /dev/null +++ b/ncurses/tinfo/doalloc.c @@ -0,0 +1,74 @@ +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1998 * + ****************************************************************************/ + + +/* + * Wrapper for malloc/realloc. Standard implementations allow realloc with + * a null pointer, but older libraries may not (e.g., SunOS). + * + * Also if realloc fails, we discard the old memory to avoid leaks. + */ + +#include + +MODULE_ID("$Id: doalloc.c,v 1.5 1999/03/14 12:25:27 tom Exp $") + +void *_nc_doalloc(void *oldp, size_t amount) +{ + void *newp; + + if (oldp != 0) { + if ((newp = realloc(oldp, amount)) == 0) { + free(oldp); + errno = ENOMEM; /* just in case 'free' reset */ + } + } else { + newp = typeMalloc(char, amount); + } + return newp; +} + +#if !HAVE_STRDUP +char *_nc_strdup(const char *src) +{ + char *dst; + if (src != 0) { + dst = typeMalloc(char, strlen(src) + 1); + if (dst != 0) { + (void)strcpy(dst, src); + } + } else { + dst = 0; + } + return dst; +} +#endif diff --git a/ncurses/tinfo/free_ttype.c b/ncurses/tinfo/free_ttype.c new file mode 100644 index 00000000..203ec89e --- /dev/null +++ b/ncurses/tinfo/free_ttype.c @@ -0,0 +1,72 @@ +/**************************************************************************** + * Copyright (c) 1999 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1999 * + ****************************************************************************/ + + +/* + * free_ttype.c -- allocation functions for TERMTYPE + * + * _nc_free_termtype() + * use_extended_names() + * + */ + +#include + +#include +#include + +MODULE_ID("$Id: free_ttype.c,v 1.2 1999/03/01 00:30:35 tom Exp $") + +void _nc_free_termtype(TERMTYPE *ptr) +{ + FreeIfNeeded(ptr->str_table); + FreeIfNeeded(ptr->term_names); +#if NCURSES_XNAMES + FreeIfNeeded(ptr->ext_str_table); + FreeIfNeeded(ptr->Booleans); + FreeIfNeeded(ptr->Numbers); + FreeIfNeeded(ptr->Strings); + FreeIfNeeded(ptr->ext_Names); +#endif + memset(ptr, 0, sizeof(TERMTYPE)); +} + +#if NCURSES_XNAMES +bool _nc_user_definable = TRUE; + +int use_extended_names(bool flag) +{ + int oldflag = _nc_user_definable; + _nc_user_definable = flag; + return oldflag; +} +#endif diff --git a/ncurses/tinfo/getenv_num.c b/ncurses/tinfo/getenv_num.c new file mode 100644 index 00000000..62944048 --- /dev/null +++ b/ncurses/tinfo/getenv_num.c @@ -0,0 +1,56 @@ +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1998 * + ****************************************************************************/ + +/* + * getenv_num.c -- obtain a number from the environment + */ + +#include + +MODULE_ID("$Id: getenv_num.c,v 1.1 1998/09/19 21:30:23 tom Exp $") + +int +_nc_getenv_num(const char *name) +{ + char *dst = 0; + char *src = getenv(name); + long value; + + if ((src == 0) + || (value = strtol(src, &dst, 0)) < 0 + || (dst == src) + || (*dst != '\0') + || (int)value < value) + value = -1; + + return (int) value; +} diff --git a/ncurses/tinfo/home_terminfo.c b/ncurses/tinfo/home_terminfo.c new file mode 100644 index 00000000..7aa4ca11 --- /dev/null +++ b/ncurses/tinfo/home_terminfo.c @@ -0,0 +1,62 @@ +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1998 * + ****************************************************************************/ + +/* + * home_terminfo.c -- return the $HOME/.terminfo string, expanded + */ + +#include +#include + +MODULE_ID("$Id: home_terminfo.c,v 1.2 1999/02/27 19:58:46 tom Exp $") + +#define my_length (strlen(home) + sizeof(PRIVATE_INFO)) + +/* ncurses extension...fall back on user's private directory */ + +char * +_nc_home_terminfo(void) +{ + char *home; + static char *temp = 0; + + if (temp == 0) { + if ((home = getenv("HOME")) != 0 + && my_length <= PATH_MAX) { + temp = typeMalloc(char, my_length); + if (temp == 0) + _nc_err_abort("Out of memory"); + (void) sprintf(temp, PRIVATE_INFO, home); + } + } + return temp; +} diff --git a/ncurses/tinfo/init_keytry.c b/ncurses/tinfo/init_keytry.c new file mode 100644 index 00000000..a720da18 --- /dev/null +++ b/ncurses/tinfo/init_keytry.c @@ -0,0 +1,78 @@ +/**************************************************************************** + * Copyright (c) 1999 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +#include + +#include /* keypad_xmit, keypad_local, meta_on, meta_off */ + /* cursor_visible,cursor_normal,cursor_invisible */ +#include /* struct tinfo_fkeys */ + +MODULE_ID("$Id: init_keytry.c,v 1.2 1999/09/11 17:32:57 Jeffrey.Honig Exp $") + +/* +** _nc_init_keytry() +** +** Construct the try for the current terminal's keypad keys. +** +*/ + +#ifdef BROKEN_LINKER +#undef _nc_tinfo_fkeys +#endif + +/* LINT_PREPRO +#if 0*/ +#include +/* LINT_PREPRO +#endif*/ + +#ifdef BROKEN_LINKER +struct tinfo_fkeys *_nc_tinfo_fkeysf(void) +{ + return _nc_tinfo_fkeys; +} +#endif + +void _nc_init_keytry(void) +{ + size_t n; + + /* The SP->_keytry value is initialized in newterm(), where the SP + * structure is created, because we can not tell where keypad() or + * mouse_activate() (which will call keyok()) are first called. + */ + + for (n = 0; _nc_tinfo_fkeys[n].code; n++) + if (_nc_tinfo_fkeys[n].offset < STRCOUNT) + _nc_add_to_try(&(SP->_keytry), + CUR Strings[_nc_tinfo_fkeys[n].offset], + _nc_tinfo_fkeys[n].code); +#ifdef TRACE + _nc_trace_tries(SP->_keytry); +#endif +} diff --git a/ncurses/keys.list b/ncurses/tinfo/keys.list similarity index 100% rename from ncurses/keys.list rename to ncurses/tinfo/keys.list diff --git a/ncurses/lib_acs.c b/ncurses/tinfo/lib_acs.c similarity index 97% rename from ncurses/lib_acs.c rename to ncurses/tinfo/lib_acs.c index a1f7c03f..d3c782e8 100644 --- a/ncurses/lib_acs.c +++ b/ncurses/tinfo/lib_acs.c @@ -36,11 +36,11 @@ #include #include /* ena_acs, acs_chars */ -MODULE_ID("$Id: lib_acs.c,v 1.13 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: lib_acs.c,v 1.15 1999/02/18 11:31:43 tom Exp $") chtype acs_map[ACS_LEN]; -void init_acs(void) +void _nc_init_acs(void) { T(("initializing ACS map")); @@ -82,15 +82,12 @@ void init_acs(void) ACS_NEQUAL = '!'; /* should be not-equal */ ACS_STERLING = 'f'; /* should be pound-sterling symbol */ -#ifdef ena_acs if (ena_acs != NULL) { TPUTS_TRACE("ena_acs"); putp(ena_acs); } -#endif /* ena_acs */ -#ifdef acs_chars #define ALTCHAR(c) ((chtype)(((unsigned char)(c)) | A_ALTCHARSET)) if (acs_chars != NULL) { @@ -139,6 +136,4 @@ void init_acs(void) _nc_visbuf(show)); } #endif /* TRACE */ -#endif /* acs_char */ } - diff --git a/ncurses/lib_baudrate.c b/ncurses/tinfo/lib_baudrate.c similarity index 77% rename from ncurses/lib_baudrate.c rename to ncurses/tinfo/lib_baudrate.c index dca02ff7..4077ba38 100644 --- a/ncurses/lib_baudrate.c +++ b/ncurses/tinfo/lib_baudrate.c @@ -39,8 +39,9 @@ #include #include /* cur_term, pad_char */ +#include /* ospeed */ -MODULE_ID("$Id: lib_baudrate.c,v 1.11 1998/02/11 12:13:58 tom Exp $") +MODULE_ID("$Id: lib_baudrate.c,v 1.15 1999/01/31 03:05:25 tom Exp $") /* * int @@ -98,14 +99,52 @@ static struct speed const speeds[] = { #endif }; +int _nc_baudrate(int OSpeed) +{ + static int last_OSpeed; + static int last_baudrate; + + int result; + unsigned i; + + if (OSpeed == last_OSpeed) { + result = last_baudrate; + } else { + result = ERR; + if (OSpeed >= 0) { + for (i = 0; i < SIZEOF(speeds); i++) { + if (speeds[i].s == (speed_t)OSpeed) { + result = speeds[i].sp; + break; + } + } + } + last_baudrate = result; + } + return (result); +} + + +int _nc_ospeed(int BaudRate) +{ + speed_t result = 1; + unsigned i; + + if (BaudRate >= 0) { + for (i = 0; i < SIZEOF(speeds); i++) { + if (speeds[i].sp == BaudRate) { + result = speeds[i].s; + break; + } + } + } + return (result); +} + int baudrate(void) { -size_t i; -int ret; -#ifdef TRACE -char *debug_rate; -#endif +int result; T((T_CALLED("baudrate()"))); @@ -116,27 +155,24 @@ char *debug_rate; */ #ifdef TRACE if (SP && !isatty(fileno(SP->_ofp)) - && (debug_rate = getenv("BAUDRATE")) != 0) { - if (sscanf(debug_rate, "%d", &ret) != 1) + && getenv("BAUDRATE") != 0) { + int ret; + if ((ret = _nc_getenv_num("BAUDRATE")) <= 0) ret = 9600; + ospeed = _nc_ospeed(ret); returnCode(ret); } else #endif #ifdef TERMIOS - ret = cfgetospeed(&cur_term->Nttyb); + ospeed = cfgetospeed(&cur_term->Nttyb); #else - ret = cur_term->Nttyb.sg_ospeed; + ospeed = cur_term->Nttyb.sg_ospeed; #endif - if(ret < 0 || (speed_t)ret > speeds[SIZEOF(speeds)-1].s) - returnCode(ERR); - cur_term->_baudrate = ERR; - for (i = 0; i < SIZEOF(speeds); i++) - if (speeds[i].s == (speed_t)ret) - { - cur_term->_baudrate = speeds[i].sp; - break; - } - returnCode(cur_term->_baudrate); + result = _nc_baudrate(ospeed); + if (cur_term != 0) + cur_term->_baudrate = result; + + returnCode(result); } diff --git a/ncurses/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c similarity index 81% rename from ncurses/lib_cur_term.c rename to ncurses/tinfo/lib_cur_term.c index c757decd..3250147c 100644 --- a/ncurses/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -37,44 +37,33 @@ */ #include -#include /* TTY, cur_term */ +#include /* TTY, cur_term */ +#include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.2 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.8 1999/07/24 20:08:19 tom Exp $") TERMINAL *cur_term; -int _nc_get_curterm(TTY *buf) -{ - if (cur_term == 0 - || GET_TTY(cur_term->Filedes, buf) != 0) - return(ERR); - return (OK); -} - -int _nc_set_curterm(TTY *buf) -{ - if (cur_term == 0 - || SET_TTY(cur_term->Filedes, buf) != 0) - return(ERR); - return (OK); -} - -TERMINAL *set_curterm(TERMINAL *term) +TERMINAL *set_curterm(TERMINAL *termp) { TERMINAL *oldterm = cur_term; - cur_term = term; + if ((cur_term = termp) != 0) { + ospeed = _nc_ospeed(cur_term->_baudrate); + PC = (pad_char != NULL) ? pad_char[0] : 0; + } return oldterm; } -int del_curterm(TERMINAL *term) +int del_curterm(TERMINAL *termp) { - T((T_CALLED("del_curterm(%p)"), term)); + T((T_CALLED("del_curterm(%p)"), termp)); - if (term != 0) { - FreeIfNeeded(term->type.str_table); - FreeIfNeeded(term->type.term_names); - free(term); + if (termp != 0) { + _nc_free_termtype(&(termp->type)); + free(termp); + if (termp == cur_term) + cur_term = 0; returnCode(OK); } returnCode(ERR); diff --git a/ncurses/lib_data.c b/ncurses/tinfo/lib_data.c similarity index 94% rename from ncurses/lib_data.c rename to ncurses/tinfo/lib_data.c index baa1db81..d2d0d3ff 100644 --- a/ncurses/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.13 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.14 1999/01/31 01:34:33 Ilya.Zakharevich Exp $") /* * OS/2's native linker complains if we don't initialize public data when @@ -80,5 +80,5 @@ void _nc_set_screen(SCREEN *sp) my_screen = sp; } #else -SCREEN *SP; +SCREEN *SP = NULL; /* Some linkers require initialized data... */ #endif diff --git a/ncurses/lib_ti.c b/ncurses/tinfo/lib_has_cap.c similarity index 76% rename from ncurses/lib_ti.c rename to ncurses/tinfo/lib_has_cap.c index b77076f0..7121fc75 100644 --- a/ncurses/lib_ti.c +++ b/ncurses/tinfo/lib_has_cap.c @@ -32,51 +32,32 @@ ****************************************************************************/ +/* +** lib_has_cap.c +** +** The routines to query terminal capabilities +** +*/ + #include #include -#include -MODULE_ID("$Id: lib_ti.c,v 1.9 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: lib_has_cap.c,v 1.1 1998/10/23 15:32:21 tom Exp $") -int tigetflag(const char *str) +bool has_ic(void) { -int i; - - T(("tigetflag(%s)", str)); - - if (cur_term != 0) - for (i = 0; i < BOOLCOUNT; i++) - if (!strcmp(str, boolnames[i])) - return cur_term->type.Booleans[i]; - - return ABSENT_BOOLEAN; + T((T_CALLED("has_ic()"))); + returnCode(cur_term && + (insert_character || parm_ich + || (enter_insert_mode && exit_insert_mode)) + && (delete_character || parm_dch)); } -int tigetnum(const char *str) +bool has_il(void) { -int i; - - T(("tigetnum(%s)", str)); - - if (cur_term != 0) - for (i = 0; i < NUMCOUNT; i++) - if (!strcmp(str, numnames[i])) - return cur_term->type.Numbers[i]; - - return CANCELLED_NUMERIC; -} - -char *tigetstr(const char *str) -{ -int i; - - T(("tigetstr(%s)", str)); - - if (cur_term != 0) - for (i = 0; i < STRCOUNT; i++) - if (!strcmp(str, strnames[i])) - return cur_term->type.Strings[i]; - - return CANCELLED_STRING; + T((T_CALLED("has_il()"))); + returnCode(cur_term + && (insert_line || parm_insert_line) + && (delete_line || parm_delete_line)); } diff --git a/ncurses/lib_kernel.c b/ncurses/tinfo/lib_kernel.c similarity index 82% rename from ncurses/lib_kernel.c rename to ncurses/tinfo/lib_kernel.c index 56f06a4c..3c8c88ee 100644 --- a/ncurses/lib_kernel.c +++ b/ncurses/tinfo/lib_kernel.c @@ -36,13 +36,9 @@ * lib_kernel.c * * Misc. low-level routines: - * reset_prog_mode() - * reset_shell_mode() * erasechar() * killchar() * flushinp() - * savetty() - * resetty() * * The baudrate() and delay_output() functions could logically live here, * but are in other modules to reduce the static-link size of programs @@ -52,36 +48,7 @@ #include #include /* cur_term */ -MODULE_ID("$Id: lib_kernel.c,v 1.17 1998/02/11 12:13:57 tom Exp $") - -int reset_prog_mode(void) -{ - T((T_CALLED("reset_prog_mode()"))); - - if (cur_term != 0) { - _nc_set_curterm(&cur_term->Nttyb); - if (SP && stdscr && stdscr->_use_keypad) - _nc_keypad(TRUE); - returnCode(OK); - } - returnCode(ERR); -} - - -int reset_shell_mode(void) -{ - T((T_CALLED("reset_shell_mode()"))); - - if (cur_term != 0) { - if (SP) - { - fflush(SP->_ofp); - _nc_keypad(FALSE); - } - returnCode(_nc_set_curterm(&cur_term->Ottyb)); - } - returnCode(ERR); -} +MODULE_ID("$Id: lib_kernel.c,v 1.19 1998/12/20 00:18:45 tom Exp $") /* * erasechar() @@ -161,24 +128,3 @@ int flushinp(void) } returnCode(ERR); } - -/* -** savetty() and resetty() -** -*/ - -static TTY buf; - -int savetty(void) -{ - T((T_CALLED("savetty()"))); - - returnCode(_nc_get_curterm(&buf)); -} - -int resetty(void) -{ - T((T_CALLED("resetty()"))); - - returnCode(_nc_set_curterm(&buf)); -} diff --git a/ncurses/lib_longname.c b/ncurses/tinfo/lib_longname.c similarity index 95% rename from ncurses/lib_longname.c rename to ncurses/tinfo/lib_longname.c index 0b39207e..766e56c0 100644 --- a/ncurses/lib_longname.c +++ b/ncurses/tinfo/lib_longname.c @@ -41,18 +41,18 @@ #include -MODULE_ID("$Id: lib_longname.c,v 1.6 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: lib_longname.c,v 1.7 1999/01/03 01:47:45 tom Exp $") char * longname(void) { char *ptr; - T(("longname() called")); + T((T_CALLED("longname()"))); for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--) if (*ptr == '|') - return(ptr + 1); + returnPtr(ptr + 1); - return(ttytype); + returnPtr(ttytype); } diff --git a/ncurses/lib_napms.c b/ncurses/tinfo/lib_napms.c similarity index 95% rename from ncurses/lib_napms.c rename to ncurses/tinfo/lib_napms.c index eec7b0a2..a85304bf 100644 --- a/ncurses/lib_napms.c +++ b/ncurses/tinfo/lib_napms.c @@ -41,7 +41,9 @@ #include -#if USE_FUNC_POLL +#if HAVE_NANOSLEEP +#include +#elif USE_FUNC_POLL #include #include #if HAVE_SYS_TIME_H @@ -54,9 +56,9 @@ #if HAVE_SYS_SELECT_H #include #endif -#endif +#endif -MODULE_ID("$Id: lib_napms.c,v 1.4 1998/02/13 10:24:54 jbuhler Exp $") +MODULE_ID("$Id: lib_napms.c,v 1.6 1999/10/21 23:01:41 tom Exp $") int napms(int ms) { @@ -69,8 +71,6 @@ int napms(int ms) ts.tv_nsec = (ms % 1000) * 1000000; nanosleep(&ts, NULL); } -#elif HAVE_USLEEP - usleep(1000*(unsigned)ms); #elif USE_FUNC_POLL { struct pollfd fds[1]; diff --git a/ncurses/lib_options.c b/ncurses/tinfo/lib_options.c similarity index 83% rename from ncurses/lib_options.c rename to ncurses/tinfo/lib_options.c index 926a8aec..0bc14156 100644 --- a/ncurses/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -44,22 +44,7 @@ #include /* keypad_xmit, keypad_local, meta_on, meta_off */ /* cursor_visible,cursor_normal,cursor_invisible */ -MODULE_ID("$Id: lib_options.c,v 1.29 1998/02/11 12:13:55 tom Exp $") - -int has_ic(void) -{ - T((T_CALLED("has_ic()"))); - returnCode((insert_character || parm_ich - || (enter_insert_mode && exit_insert_mode)) - && (delete_character || parm_dch)); -} - -int has_il(void) -{ - T((T_CALLED("has_il()"))); - returnCode((insert_line || parm_insert_line) - && (delete_line || parm_delete_line)); -} +MODULE_ID("$Id: lib_options.c,v 1.36 1999/10/22 21:38:57 tom Exp $") int idlok(WINDOW *win, bool flag) { @@ -122,16 +107,13 @@ int notimeout(WINDOW *win, bool f) returnCode(ERR); } -int wtimeout(WINDOW *win, int delay) +void wtimeout(WINDOW *win, int delay) { T((T_CALLED("wtimeout(%p,%d)"), win, delay)); if (win) { win->_delay = delay; - returnCode(OK); } - else - returnCode(ERR); } int keypad(WINDOW *win, bool flag) @@ -211,7 +193,7 @@ int cursor = SP->_cursor; break; } SP->_cursor = vis; - (void) fflush(SP->_ofp); + _nc_flush(); returnCode(cursor==-1 ? 1 : cursor); } @@ -230,7 +212,7 @@ int typeahead(int fd) ** */ - +#ifdef NCURSES_EXT_FUNCS static int has_key_internal(int keycode, struct tries *tp) { if (tp == 0) @@ -247,34 +229,7 @@ int has_key(int keycode) T((T_CALLED("has_key(%d)"), keycode)); returnCode(has_key_internal(keycode, SP->_keytry)); } - -/* -** init_keytry() -** -** Construct the try for the current terminal's keypad keys. -** -*/ - -static void init_keytry(void) -{ -/* LINT_PREPRO -#if 0*/ -#include -/* LINT_PREPRO -#endif*/ - size_t n; - - /* The SP->_keytry value is initialized in newterm(), where the SP - * structure is created, because we can not tell where keypad() or - * mouse_activate() (which will call keyok()) are first called. - */ - - for (n = 0; n < SIZEOF(table); n++) - if (table[n].offset < STRCOUNT) - _nc_add_to_try(&(SP->_keytry), - CUR Strings[table[n].offset], - table[n].code); -} +#endif /* NCURSES_EXT_FUNCS */ /* Turn the keypad on/off * @@ -289,17 +244,17 @@ int _nc_keypad(bool flag) { TPUTS_TRACE("keypad_xmit"); putp(keypad_xmit); - (void) fflush(SP->_ofp); + _nc_flush(); } else if (! flag && keypad_local) { TPUTS_TRACE("keypad_local"); putp(keypad_local); - (void) fflush(SP->_ofp); + _nc_flush(); } - if (!SP->_tried) { - init_keytry(); + if (flag && !SP->_tried) { + _nc_init_keytry(); SP->_tried = TRUE; } return(OK); diff --git a/ncurses/lib_print.c b/ncurses/tinfo/lib_print.c similarity index 94% rename from ncurses/lib_print.c rename to ncurses/tinfo/lib_print.c index 0ad322b4..63ac648b 100644 --- a/ncurses/lib_print.c +++ b/ncurses/tinfo/lib_print.c @@ -36,7 +36,7 @@ #include -MODULE_ID("$Id: lib_print.c,v 1.9 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: lib_print.c,v 1.11 1999/02/27 19:59:05 tom Exp $") int mcprint(char *data, int len) /* ship binary character data to the printer via mc4/mc5/mc5p */ @@ -45,7 +45,7 @@ int mcprint(char *data, int len) size_t onsize, offsize, res; errno = 0; - if (!prtr_non && (!prtr_on || !prtr_off)) + if (!cur_term || (!prtr_non && (!prtr_on || !prtr_off))) { errno = ENODEV; return(ERR); @@ -64,7 +64,7 @@ int mcprint(char *data, int len) offsize = strlen(prtr_off); } - if ((mybuf = malloc(onsize + len + offsize + 1)) == (char *)NULL) + if ((mybuf = typeMalloc(char, onsize + len + offsize + 1)) == (char *)0) { errno = ENOMEM; return(ERR); diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c new file mode 100644 index 00000000..61b422c1 --- /dev/null +++ b/ncurses/tinfo/lib_raw.c @@ -0,0 +1,233 @@ +/**************************************************************************** + * 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: Zeyd M. Ben-Halim 1992,1995 * + * and: Eric S. Raymond * + ****************************************************************************/ + + +/* + * raw.c + * + * Routines: + * raw() + * cbreak() + * noraw() + * nocbreak() + * qiflush() + * noqiflush() + * intrflush() + * + */ + +#include +#include /* cur_term */ + +MODULE_ID("$Id: lib_raw.c,v 1.3 1999/03/06 22:28:24 tom Exp $") + +#if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE) +#define _POSIX_SOURCE +#endif + +#if HAVE_SYS_TERMIO_H +#include /* needed for ISC */ +#endif + +#ifdef __EMX__ +#include +#include +#endif + +#define COOKED_INPUT (IXON|BRKINT|PARMRK) + +#ifdef TRACE +#define BEFORE(N) if (_nc_tracing&TRACE_BITS) _tracef("%s before bits: %s", N, _nc_tracebits()) +#define AFTER(N) if (_nc_tracing&TRACE_BITS) _tracef("%s after bits: %s", N, _nc_tracebits()) +#else +#define BEFORE(s) +#define AFTER(s) +#endif /* TRACE */ + +int raw(void) +{ + T((T_CALLED("raw()"))); + if (SP != 0 && cur_term != 0) { + + SP->_raw = TRUE; + SP->_cbreak = 1; + +#ifdef __EMX__ + setmode(SP->_ifd, O_BINARY); +#endif + +#ifdef TERMIOS + BEFORE("raw"); + cur_term->Nttyb.c_lflag &= ~(ICANON|ISIG); + cur_term->Nttyb.c_iflag &= ~(COOKED_INPUT); + cur_term->Nttyb.c_cc[VMIN] = 1; + cur_term->Nttyb.c_cc[VTIME] = 0; + AFTER("raw"); +#else + cur_term->Nttyb.sg_flags |= RAW; +#endif + returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); + } + returnCode(ERR); +} + +int cbreak(void) +{ + T((T_CALLED("cbreak()"))); + + SP->_cbreak = 1; + +#ifdef __EMX__ + setmode(SP->_ifd, O_BINARY); +#endif + +#ifdef TERMIOS + BEFORE("cbreak"); + cur_term->Nttyb.c_lflag &= ~ICANON; + cur_term->Nttyb.c_iflag &= ~ICRNL; + cur_term->Nttyb.c_lflag |= ISIG; + cur_term->Nttyb.c_cc[VMIN] = 1; + cur_term->Nttyb.c_cc[VTIME] = 0; + AFTER("cbreak"); +#else + cur_term->Nttyb.sg_flags |= CBREAK; +#endif + returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); +} + +void qiflush(void) +{ + T((T_CALLED("qiflush()"))); + + /* + * Note: this implementation may be wrong. See the comment under + * intrflush(). + */ + +#ifdef TERMIOS + BEFORE("qiflush"); + cur_term->Nttyb.c_lflag &= ~(NOFLSH); + AFTER("qiflush"); + (void)_nc_set_tty_mode( &cur_term->Nttyb); + returnVoid; +#endif +} + + +int noraw(void) +{ + T((T_CALLED("noraw()"))); + + SP->_raw = FALSE; + SP->_cbreak = 0; + +#ifdef __EMX__ + setmode(SP->_ifd, O_TEXT); +#endif + +#ifdef TERMIOS + BEFORE("noraw"); + cur_term->Nttyb.c_lflag |= ISIG|ICANON; + cur_term->Nttyb.c_iflag |= COOKED_INPUT; + AFTER("noraw"); +#else + cur_term->Nttyb.sg_flags &= ~(RAW|CBREAK); +#endif + returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); +} + + +int nocbreak(void) +{ + T((T_CALLED("nocbreak()"))); + + SP->_cbreak = 0; + +#ifdef __EMX__ + setmode(SP->_ifd, O_TEXT); +#endif + +#ifdef TERMIOS + BEFORE("nocbreak"); + cur_term->Nttyb.c_lflag |= ICANON; + cur_term->Nttyb.c_iflag |= ICRNL; + AFTER("nocbreak"); +#else + cur_term->Nttyb.sg_flags &= ~CBREAK; +#endif + returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); +} + +void noqiflush(void) +{ + T((T_CALLED("noqiflush()"))); + + /* + * Note: this implementation may be wrong. See the comment under + * intrflush(). + */ + +#ifdef TERMIOS + BEFORE("noqiflush"); + cur_term->Nttyb.c_lflag |= NOFLSH; + AFTER("noqiflush"); + (void)_nc_set_tty_mode( &cur_term->Nttyb); + returnVoid; +#endif +} + +int intrflush(WINDOW *win GCC_UNUSED, bool flag) +{ + T((T_CALLED("intrflush(%d)"), flag)); + + /* + * This call does the same thing as the qiflush()/noqiflush() + * pair. We know for certain that SVr3 intrflush() tweaks the + * NOFLSH bit; on the other hand, the match (in the SVr4 man + * pages) between the language describing NOFLSH in termio(7) + * and the language describing qiflush()/noqiflush() in + * curs_inopts(3x) is too exact to be coincidence. + */ + +#ifdef TERMIOS + BEFORE("intrflush"); + if (flag) + cur_term->Nttyb.c_lflag &= ~(NOFLSH); + else + cur_term->Nttyb.c_lflag |= (NOFLSH); + AFTER("intrflush"); + returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); +#else + returnCode(ERR); +#endif +} diff --git a/ncurses/lib_setup.c b/ncurses/tinfo/lib_setup.c similarity index 72% rename from ncurses/lib_setup.c rename to ncurses/tinfo/lib_setup.c index 88242974..64aa73fa 100644 --- a/ncurses/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -40,6 +40,8 @@ */ #include +#include /* for MAX_NAME_SIZE */ +#include #if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -47,7 +49,7 @@ #include /* lines, columns, cur_term */ -MODULE_ID("$Id: lib_setup.c,v 1.37 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.55 1999/08/21 23:06:08 tom Exp $") /**************************************************************************** * @@ -56,7 +58,7 @@ MODULE_ID("$Id: lib_setup.c,v 1.37 1998/02/11 12:13:56 tom Exp $") ****************************************************************************/ #if HAVE_SIZECHANGE -# if !defined(sun) || !HAVE_TERMIOS_H +# if !defined(sun) || !TERMIOS # if HAVE_SYS_IOCTL_H # include # endif @@ -89,8 +91,6 @@ MODULE_ID("$Id: lib_setup.c,v 1.37 1998/02/11 12:13:56 tom Exp $") # endif #endif -extern TERMINAL *cur_term; - static int _use_env = TRUE; static void do_prototype(void); @@ -105,8 +105,6 @@ int LINES, COLS, TABSIZE; static void _nc_get_screensize(int *linep, int *colp) /* Obtain lines/columns values from the environment and/or terminfo entry */ { -char *rows, *cols; - /* figure out the size of the screen */ T(("screen size: terminfo lines = %d columns = %d", lines, columns)); @@ -117,17 +115,29 @@ char *rows, *cols; } else /* usually want to query LINES and COLUMNS from environment */ { + int value; + *linep = *colp = 0; /* first, look for environment variables */ - rows = getenv("LINES"); - if (rows != 0) - *linep = atoi(rows); - cols = getenv("COLUMNS"); - if (cols != 0) - *colp = atoi(cols); + if ((value = _nc_getenv_num("LINES")) > 0) { + *linep = value; + } + if ((value = _nc_getenv_num("COLUMNS")) > 0) { + *colp = value; + } T(("screen size: environment LINES = %d COLUMNS = %d",*linep,*colp)); +#ifdef __EMX__ + if (*linep <= 0 || *colp <= 0) + { + int screendata[2]; + _scrsize(screendata); + *colp = screendata[0]; + *linep = screendata[1]; + T(("EMX screen size: environment LINES = %d COLUMNS = %d",*linep,*colp)); + } +#endif #if HAVE_SIZECHANGE /* if that didn't work, maybe we can try asking the OS */ if (*linep <= 0 || *colp <= 0) @@ -144,8 +154,14 @@ char *rows, *cols; } while (errno == EINTR); - *linep = WINSIZE_ROWS(size); - *colp = WINSIZE_COLS(size); + /* + * Solaris lets users override either dimension with an + * environment variable. + */ + if (*linep <= 0) + *linep = WINSIZE_ROWS(size); + if (*colp <= 0) + *colp = WINSIZE_COLS(size); } /* FALLTHRU */ failure:; @@ -177,11 +193,9 @@ char *rows, *cols; T(("screen size is %dx%d", *linep, *colp)); -#ifdef init_tabs if (init_tabs != -1) TABSIZE = (int)init_tabs; else -#endif /* init_tabs */ TABSIZE = 8; T(("TABSIZE = %d", TABSIZE)); @@ -227,18 +241,41 @@ static int grab_entry(const char *const tn, TERMTYPE *const tp) char filename[PATH_MAX]; int status; - if ((status = _nc_read_entry(tn, filename, tp)) == 1) - return(1); - -#ifndef PURE_TERMINFO /* - * Try falling back on the termcap file. Note: allowing this call - * links the entire terminfo/termcap compiler into the startup code. - * It's preferable to build a real terminfo database and use that. + * $TERM shouldn't contain pathname delimiters. */ - status = _nc_read_termcap_entry(tn, tp); + if (strchr(tn, '/')) + return 0; + + if ((status = _nc_read_entry(tn, filename, tp)) != 1) { + +#ifndef PURE_TERMINFO + /* + * Try falling back on the termcap file. + * Note: allowing this call links the entire terminfo/termcap + * compiler into the startup code. It's preferable to build a + * real terminfo database and use that. + */ + status = _nc_read_termcap_entry(tn, tp); #endif /* PURE_TERMINFO */ + } + + /* + * If we have an entry, force all of the cancelled strings to null + * pointers so we don't have to test them in the rest of the library. + * (The terminfo compiler bypasses this logic, since it must know if + * a string is cancelled, for merging entries). + */ + if (status == 1) { + int n; + for_each_boolean(n,tp) + if (!VALID_BOOLEAN(tp->Booleans[n])) + tp->Booleans[n] = FALSE; + for_each_string(n,tp) + if (tp->Strings[n] == CANCELLED_STRING) + tp->Strings[n] = ABSENT_STRING; + } return(status); } #endif @@ -253,25 +290,31 @@ char ttytype[NAMESIZE]; * */ -int setupterm(const char *tname, int Filedes, int *errret) +int setupterm(NCURSES_CONST char *tname, int Filedes, int *errret) { struct term *term_ptr; int status; - T((T_CALLED("setupterm(\"%s\",%d,%p)"), tname, Filedes, errret)); + T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, errret)); if (tname == 0) { tname = getenv("TERM"); - if (tname == 0 || *tname == '\0') + if (tname == 0 || *tname == '\0') { ret_error0(-1, "TERM environment variable not set.\n"); + } + } + if (strlen(tname) > MAX_NAME_SIZE) { + ret_error(-1, "TERM environment must be <= %d characters.\n", + MAX_NAME_SIZE); } T(("your terminal name is %s", tname)); term_ptr = typeCalloc(TERMINAL, 1); - if (term_ptr == 0) + if (term_ptr == 0) { ret_error0(-1, "Not enough memory to create terminal structure.\n") ; + } #if USE_DATABASE status = grab_entry(tname, &term_ptr->type); #else @@ -285,7 +328,7 @@ int status; if (fallback) { - memcpy(&term_ptr->type, fallback, sizeof(TERMTYPE)); + term_ptr->type = *fallback; status = 1; } } @@ -299,6 +342,24 @@ int status; ret_error(0, "'%s': unknown terminal type.\n", tname); } + /* + * Improve on SVr4 curses. If an application mixes curses and termcap + * calls, it may call both initscr and tgetent. This is not really a + * good thing to do, but can happen if someone tries using ncurses with + * the readline library. The problem we are fixing is that when + * tgetent calls setupterm, the resulting Ottyb struct in cur_term is + * zeroed. A subsequent call to endwin uses the zeroed terminal + * settings rather than the ones saved in initscr. So we check if + * cur_term appears to contain terminal settings for the same output + * file as our current call - and copy those terminal settings. (SVr4 + * curses does not do this, however applications that are working + * around the problem will still work properly with this feature). + */ + if (cur_term != 0) { + if (cur_term->Filedes == Filedes) + term_ptr->Ottyb = cur_term->Ottyb; + } + set_curterm(term_ptr); if (command_character && getenv("CC")) @@ -323,11 +384,12 @@ int status; T((T_CREATE("screen %s %dx%d"), tname, LINES, COLS)); - if (generic_type) + if (generic_type) { ret_error(0, "'%s': I need something more specific.\n", tname); - if (hard_copy) + } + if (hard_copy) { ret_error(1, "'%s': I can't handle hardcopy terminals.\n", tname); - + } returnCode(OK); } @@ -342,7 +404,7 @@ int status; static void do_prototype(void) { -int i, j; +int i; char CC; char proto; char *tmp; @@ -351,12 +413,10 @@ char *tmp; CC = *tmp; proto = *command_character; - for (i=0; i < STRCOUNT; i++) { - j = 0; - while (cur_term->type.Strings[i][j]) { - if (cur_term->type.Strings[i][j] == proto) - cur_term->type.Strings[i][j] = CC; - j++; - } + for_each_string(i, &(cur_term->type)) { + for (tmp = cur_term->type.Strings[i]; *tmp; tmp++) { + if (*tmp == proto) + *tmp = CC; + } } } diff --git a/ncurses/lib_termcap.c b/ncurses/tinfo/lib_termcap.c similarity index 68% rename from ncurses/lib_termcap.c rename to ncurses/tinfo/lib_termcap.c index d8dcf3e9..8238b368 100644 --- a/ncurses/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.c @@ -37,19 +37,17 @@ #include #define __INTERNAL_CAPS_VISIBLE -#include +#include -MODULE_ID("$Id: lib_termcap.c,v 1.17 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.29 1999/09/05 01:06:43 tom Exp $") /* some of the code in here was contributed by: Magnus Bengtsson, d6mbeng@dtek.chalmers.se */ -char PC; char *UP; char *BC; -short ospeed; /*************************************************************************** * @@ -69,86 +67,26 @@ short ospeed; int tgetent(char *bufp GCC_UNUSED, const char *name) { int errcode; -#if defined(TERMIOS) -speed_t speed; -#endif - - T(("calling tgetent")); - setupterm(name, STDOUT_FILENO, &errcode); - - if (errcode != 1) - return(errcode); - - if (cursor_left) - if ((backspaces_with_bs = !strcmp(cursor_left, "\b")) == 0) - backspace_if_not_bs = cursor_left; - - /* we're required to export these */ - if (pad_char != NULL) - PC = pad_char[0]; - if (cursor_up != NULL) - UP = cursor_up; - if (backspace_if_not_bs != NULL) - BC = backspace_if_not_bs; -#if defined(TERMIOS) - /* - * Back-convert to the funny speed encoding used by the old BSD - * curses library. Method suggested by Andrey Chernov - * - */ - if ((speed = cfgetospeed(&cur_term->Nttyb)) < 1) - ospeed = 1; /* assume lowest non-hangup speed */ - else - { - const speed_t *sp; - static const speed_t speeds[] = { -#ifdef B115200 - B115200, -#endif -#ifdef B57600 - B57600, -#endif -#ifdef B38400 - B38400, -#else -#ifdef EXTB - EXTB, -#endif -#endif /* B38400 */ -#ifdef B19200 - B19200, -#else -#ifdef EXTA - EXTA, -#endif -#endif /* B19200 */ - B9600, - B4800, - B2400, - B1800, - B1200, - B600, - B300, - B200, - B150, - B134, - B110, - B75, - B50, - B0, - }; -#define MAXSPEED SIZEOF(speeds) - - for (sp = speeds; sp < speeds + MAXSPEED; sp++) { - if (sp[0] <= speed) { - break; - } - } - ospeed = MAXSPEED - (sp - speeds); - } -#else - ospeed = cur_term->Nttyb.sg_ospeed; -#endif + + T((T_CALLED("tgetent()"))); + + setupterm((NCURSES_CONST char *)name, STDOUT_FILENO, &errcode); + + if (errcode == 1) { + + if (cursor_left) + if ((backspaces_with_bs = !strcmp(cursor_left, "\b")) == 0) + backspace_if_not_bs = cursor_left; + + /* we're required to export these */ + if (pad_char != NULL) + PC = pad_char[0]; + if (cursor_up != NULL) + UP = cursor_up; + if (backspace_if_not_bs != NULL) + BC = backspace_if_not_bs; + + (void) baudrate(); /* sets ospeed as a side-effect */ /* LINT_PREPRO #if 0*/ @@ -156,7 +94,8 @@ speed_t speed; /* LINT_PREPRO #endif*/ - return errcode; + } + returnCode(errcode); } /*************************************************************************** @@ -168,17 +107,22 @@ speed_t speed; * ***************************************************************************/ -int tgetflag(const char *id) +int tgetflag(NCURSES_CONST char *id) { int i; - T(("tgetflag: %s", id)); + T((T_CALLED("tgetflag(%s)"), id)); if (cur_term != 0) { - for (i = 0; i < BOOLCOUNT; i++) - if (!strcmp(id, boolcodes[i])) - return cur_term->type.Booleans[i]; + TERMTYPE *tp = &(cur_term->type); + for_each_boolean(i, tp) { + const char *capname = ExtBoolname(tp, i, boolcodes); + if (!strncmp(id, capname, 2)) { + /* setupterm forces invalid booleans to false */ + returnCode(tp->Booleans[i]); + } + } } - return ERR; + returnCode(0); /* Solaris does this */ } /*************************************************************************** @@ -190,17 +134,23 @@ int i; * ***************************************************************************/ -int tgetnum(const char *id) +int tgetnum(NCURSES_CONST char *id) { int i; - T(("tgetnum: %s", id)); + T((T_CALLED("tgetnum(%s)"), id)); if (cur_term != 0) { - for (i = 0; i < NUMCOUNT; i++) - if (!strcmp(id, numcodes[i])) - return cur_term->type.Numbers[i]; + TERMTYPE *tp = &(cur_term->type); + for_each_number(i, tp) { + const char *capname = ExtNumname(tp, i, numcodes); + if (!strncmp(id, capname, 2)) { + if (!VALID_NUMERIC(tp->Numbers[i])) + return -1; + returnCode(tp->Numbers[i]); + } + } } - return ERR; + returnCode(ERR); } /*************************************************************************** @@ -212,21 +162,30 @@ int i; * ***************************************************************************/ -char *tgetstr(const char *id, char **area GCC_UNUSED) +char *tgetstr(NCURSES_CONST char *id, char **area) { int i; - T(("tgetstr: %s", id)); + T((T_CALLED("tgetstr(%s,%p)"), id, area)); if (cur_term != 0) { - for (i = 0; i < STRCOUNT; i++) { - T(("trying %s", strcodes[i])); - if (!strcmp(id, strcodes[i])) { - T(("found match : %s", cur_term->type.Strings[i])); - return cur_term->type.Strings[i]; - } + TERMTYPE *tp = &(cur_term->type); + for_each_string(i, tp) { + const char *capname = ExtStrname(tp, i, strcodes); + T(("trying %s", capname)); + if (!strncmp(id, capname, 2)) { + T(("found match : %s", _nc_visbuf(tp->Strings[i]))); + /* setupterm forces cancelled strings to null */ + if (area != 0 + && *area != 0 + && VALID_STRING(tp->Strings[i])) { + (void) strcpy(*area, tp->Strings[i]); + *area += strlen(*area) + 1; + } + returnPtr(tp->Strings[i]); } + } } - return NULL; + returnPtr(NULL); } /* @@ -240,5 +199,6 @@ int i; char *tgoto(const char *string, int x, int y) { - return(tparm(string, y, x)); + T((T_CALLED("tgoto(%s,%d,%d)"), string, x, y)); + returnPtr(tparm((NCURSES_CONST char *)string, y, x)); } diff --git a/ncurses/tinfo/lib_termname.c b/ncurses/tinfo/lib_termname.c new file mode 100644 index 00000000..e7057383 --- /dev/null +++ b/ncurses/tinfo/lib_termname.c @@ -0,0 +1,46 @@ +/**************************************************************************** + * 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. * + ****************************************************************************/ + +#include +#include /* for MAX_ALIAS */ + +MODULE_ID("$Id: lib_termname.c,v 1.2 1999/07/24 21:02:40 tom Exp $") + +char *termname(void) +{ +char *name = getenv("TERM"); +static char ret[MAX_ALIAS+1]; + + T(("termname() called")); + + if (name != 0) { + (void) strncpy(ret, name, sizeof(ret) - 1); + name = ret; + } + return name; +} diff --git a/ncurses/tinfo/lib_ti.c b/ncurses/tinfo/lib_ti.c new file mode 100644 index 00000000..7b2b2f91 --- /dev/null +++ b/ncurses/tinfo/lib_ti.c @@ -0,0 +1,101 @@ +/**************************************************************************** + * 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: Zeyd M. Ben-Halim 1992,1995 * + * and: Eric S. Raymond * + ****************************************************************************/ + + +#include + +#include +#include + +MODULE_ID("$Id: lib_ti.c,v 1.16 1999/02/28 23:11:28 tom Exp $") + +int tigetflag(NCURSES_CONST char *str) +{ +int i; + + T((T_CALLED("tigetflag(%s)"), str)); + + if (cur_term != 0) { + TERMTYPE *tp = &(cur_term->type); + for_each_boolean(i,tp) { + const char *capname = ExtBoolname(tp, i, boolnames); + if (!strcmp(str, capname)) { + /* setupterm forces invalid booleans to false */ + returnCode(tp->Booleans[i]); + } + } + } + + returnCode(ABSENT_BOOLEAN); +} + +int tigetnum(NCURSES_CONST char *str) +{ +int i; + + T((T_CALLED("tigetnum(%s)"), str)); + + if (cur_term != 0) { + TERMTYPE *tp = &(cur_term->type); + for_each_number(i, tp) { + const char *capname = ExtNumname(tp, i, numnames); + if (!strcmp(str, capname)) { + if (!VALID_NUMERIC(tp->Numbers[i])) + return -1; + returnCode(tp->Numbers[i]); + } + } + } + + returnCode(CANCELLED_NUMERIC); /* Solaris returns a -1 instead */ +} + +char *tigetstr(NCURSES_CONST char *str) +{ +int i; + + T((T_CALLED("tigetstr(%s)"), str)); + + if (cur_term != 0) { + TERMTYPE *tp = &(cur_term->type); + for_each_string(i, tp) { + const char *capname = ExtStrname(tp, i, strnames); + if (!strcmp(str, capname)) { + /* setupterm forces cancelled strings to null */ + returnPtr(tp->Strings[i]); + } + } + } + + returnPtr(CANCELLED_STRING); +} diff --git a/ncurses/lib_tparm.c b/ncurses/tinfo/lib_tparm.c similarity index 72% rename from ncurses/lib_tparm.c rename to ncurses/tinfo/lib_tparm.c index 02125b67..71b82916 100644 --- a/ncurses/lib_tparm.c +++ b/ncurses/tinfo/lib_tparm.c @@ -39,9 +39,11 @@ #include +#include #include +#include -MODULE_ID("$Id: lib_tparm.c,v 1.22 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.39 1999/06/06 00:04:55 tom Exp $") /* * char * @@ -59,33 +61,29 @@ MODULE_ID("$Id: lib_tparm.c,v 1.22 1998/02/11 12:13:54 tom Exp $") * screen visible to the user, not to any unseen memory.) If * the terminal has memory relative cursor addressing, that can * be indicated by - * + * * The parameter mechanism uses a stack and special % * codes to manipulate it. Typically a sequence will push one * of the parameters onto the stack and then print it in some * format. Often more complex operations are necessary. - * + * * The % encodings have the following meanings: - * + * * %% outputs `%' - * %d print pop() like %d in printf() - * %2d print pop() like %2d in printf() - * %02d print pop() like %02d in printf() - * %3d print pop() like %3d in printf() - * %03d print pop() like %03d in printf() - * %2x print pop() like %2x in printf() - * %02x print pop() like %02x in printf() - * %3x print pop() like %3x in printf() - * %03x print pop() like %03x in printf() * %c print pop() like %c in printf() * %s print pop() like %s in printf() - * + * %[[:]flags][width[.precision]][doxXs] + * as in printf, flags are [-+#] and space + * * %p[1-9] push ith parm - * %P[a-z] set variable [a-z] to pop() - * %g[a-z] get variable [a-z] and push it + * %P[a-z] set dynamic variable [a-z] to pop() + * %g[a-z] get dynamic variable [a-z] and push it + * %P[A-Z] set static variable [A-Z] to pop() + * %g[A-Z] get static variable [A-Z] and push it + * %l push strlen(pop) * %'c' push char constant c * %{nn} push integer constant nn - * + * * %+ %- %* %/ %m * arithmetic (%m is mod): push(pop() op pop()) * %& %| %^ bit operations: push(pop() op pop()) @@ -93,21 +91,18 @@ MODULE_ID("$Id: lib_tparm.c,v 1.22 1998/02/11 12:13:54 tom Exp $") * %A %O logical and & or operations for conditionals * %! %~ unary operations push(op pop()) * %i add 1 to first two parms (for ANSI terminals) - * + * * %? expr %t thenpart %e elsepart %; * if-then-else, %e elsepart is optional. * else-if's are possible ala Algol 68: * %? c1 %t b1 %e c2 %t b2 %e c3 %t b3 %e c4 %t b4 %e b5 %; - * + * * For those of the above operators which are binary and not commutative, * the stack works in the usual way, with * %gx %gy %m * resulting in x mod y, not the reverse. */ -#define L_BRACE '{' -#define R_BRACE '}' - #define STACKSIZE 20 typedef union { @@ -136,44 +131,58 @@ void _nc_free_tparm(void) } #endif -static void save_text(char *s) +static void really_get_space(size_t need) { - size_t want = strlen(s); - size_t need = want + out_used + 1; - - if (need > out_size) { - out_size = need * 2; - if (out_buff == 0) - out_buff = malloc(out_size); - else - out_buff = realloc(out_buff, out_size); - } - (void)strcpy(out_buff + out_used, s); - out_used += want; + out_size = need * 2; + out_buff = typeRealloc(char, out_size, out_buff); + if (out_buff == 0) + _nc_err_abort("Out of memory"); +} + +static inline void get_space(size_t need) +{ + need += out_used; + if (need > out_size) + really_get_space(need); +} + +static inline void save_text(const char *fmt, char *s, int len) +{ + size_t s_len = strlen(s); + if (len > (int)s_len) + s_len = len; + + get_space(s_len + 1); + + (void)sprintf(out_buff+out_used, fmt, s); + out_used += strlen(out_buff+out_used); } -static void save_number(const char *fmt, int number) +static inline void save_number(const char *fmt, int number, int len) { - char temp[80]; - (void)sprintf(temp, fmt, number); - save_text(temp); + if (len < 30) + len = 30; /* actually log10(MAX_INT)+1 */ + + get_space(len + 1); + + (void)sprintf(out_buff+out_used, fmt, number); + out_used += strlen(out_buff+out_used); } static inline void save_char(int c) { - static char text[2]; if (c == 0) c = 0200; - text[0] = c; - save_text(text); + get_space(1); + out_buff[out_used++] = c; } static inline void npush(int x) { if (stack_ptr < STACKSIZE) { stack[stack_ptr].num = x; - stack_ptr++; - } + stack_ptr++; + } } static inline int npop(void) @@ -183,22 +192,88 @@ static inline int npop(void) static inline char *spop(void) { - return (stack_ptr > 0 ? stack[--stack_ptr].str : 0); + static char dummy[] = ""; /* avoid const-cast */ + return (stack_ptr > 0 ? stack[--stack_ptr].str : dummy); +} + +static inline const char *parse_format(const char *s, char *format, int *len) +{ + bool done = FALSE; + bool allowminus = FALSE; + bool dot = FALSE; + int prec = 0; + int width = 0; + + *len = 0; + *format++ = '%'; + while (*s != '\0' && !done) { + switch (*s) { + case 'c': /* FALLTHRU */ + case 'd': /* FALLTHRU */ + case 'o': /* FALLTHRU */ + case 'x': /* FALLTHRU */ + case 'X': /* FALLTHRU */ + case 's': + *format++ = *s; + done = TRUE; + break; + case '.': + *format++ = *s++; + dot = TRUE; + break; + case '#': + *format++ = *s++; + break; + case ' ': + *format++ = *s++; + break; + case ':': + s++; + allowminus = TRUE; + break; + case '-': + if (allowminus) { + *format++ = *s++; + } else { + done = TRUE; + } + break; + default: + if (isdigit(*s)) { + if (dot) + prec = (prec * 10) + (*s - '0'); + else + width = (width * 10) + (*s - '0'); + *format++ = *s++; + } else { + done = TRUE; + } + } + } + *format = '\0'; + /* return maximum string length in print */ + *len = (prec > width) ? prec : width; + return s; } +#define isUPPER(c) ((c) >= 'A' && (c) <= 'Z') +#define isLOWER(c) ((c) >= 'a' && (c) <= 'z') + static inline char *tparam_internal(const char *string, va_list ap) { #define NUM_VARS 26 int param[9]; int popcount; -int variable[NUM_VARS]; -char len; int number; +int len; int level; int x, y; int i; -int varused = -1; register const char *cp; +static size_t len_fmt; +static char *format; +static int dynamic_var[NUM_VARS]; +static int static_vars[NUM_VARS]; out_used = 0; if (string == NULL) @@ -235,6 +310,11 @@ register const char *cp; } } } + if ((size_t)(cp - string) > len_fmt) { + len_fmt = (cp - string) + len_fmt + 2; + if ((format = typeRealloc(char, len_fmt, format)) == 0) + return 0; + } if (number > 9) number = 9; for (i = 0; i < max(popcount, number); i++) { @@ -247,7 +327,7 @@ register const char *cp; /* * This is a termcap compatibility hack. If there are no explicit pop - * operations in the string, load the stack in such a way that + * operations in the string, load the stack in such a way that * successive pops will grab successive parameters. That will make * the expansion of (for example) \E[%d;%dH work correctly in termcap * style, which means tparam() will expand termcap strings OK. @@ -262,17 +342,18 @@ register const char *cp; #ifdef TRACE if (_nc_tracing & TRACE_CALLS) { for (i = 0; i < popcount; i++) - save_number(", %d", param[i]); + save_number(", %d", param[i], 0); _tracef(T_CALLED("%s(%s%s)"), tname, _nc_visbuf(string), out_buff); out_used = 0; - } + } #endif /* TRACE */ while (*string) { - if (*string != '%') + if (*string != '%') { save_char(*string); - else { + } else { string++; + string = parse_format(string, format, &len); switch (*string) { default: break; @@ -280,61 +361,20 @@ register const char *cp; save_char('%'); break; - case 'd': - save_number("%d", npop()); - break; - - case 'x': - save_number("%x", npop()); - break; - - case '0': - string++; - len = *string; - if (len == '2' || len == '3') - { - ++string; - if (*string == 'd') { - if (len == '2') - save_number("%02d", npop()); - else - save_number("%03d", npop()); - } - else if (*string == 'x') { - if (len == '2') - save_number("%02x", npop()); - else - save_number("%03x", npop()); - } - } - break; - - case '2': - string++; - if (*string == 'd') { - save_number("%2d", npop()); - } - else if (*string == 'x') { - save_number("%2x", npop()); - } - break; - - case '3': - string++; - if (*string == 'd') { - save_number("%3d", npop()); - } - else if (*string == 'x') { - save_number("%3x", npop()); - } + case 'd': /* FALLTHRU */ + case 'o': /* FALLTHRU */ + case 'x': /* FALLTHRU */ + case 'X': /* FALLTHRU */ + case 'c': + save_number(format, npop(), len); break; - case 'c': - save_char(npop()); + case 'l': + save_number("%d", strlen(spop()), 0); break; case 's': - save_text(spop()); + save_text(format, spop(), len); break; case 'p': @@ -345,25 +385,27 @@ register const char *cp; case 'P': string++; - i = (*string - 'a'); - if (i >= 0 && i < NUM_VARS) { - while (varused < i) - variable[++varused] = 0; - variable[i] = npop(); + if (isUPPER(*string)) { + i = (*string - 'A'); + static_vars[i] = npop(); + } else if (isLOWER(*string)) { + i = (*string - 'a'); + dynamic_var[i] = npop(); } break; case 'g': string++; - i = (*string - 'a'); - if (i >= 0 && i < NUM_VARS) { - while (varused < i) - variable[++varused] = 0; - npush(variable[i]); + if (isUPPER(*string)) { + i = (*string - 'A'); + npush(static_vars[i]); + } else if (isLOWER(*string)) { + i = (*string - 'a'); + npush(dynamic_var[i]); } break; - case '\'': + case S_QUOTE: string++; npush(*string); string++; @@ -396,13 +438,13 @@ register const char *cp; case '/': y = npop(); x = npop(); - npush(x / y); + npush(y ? (x / y) : 0); break; case 'm': y = npop(); x = npop(); - npush(x % y); + npush(y ? (x % y) : 0); break; case 'A': @@ -520,16 +562,15 @@ register const char *cp; string++; } /* endwhile (*string) */ - if (out_buff == 0) - out_buff = calloc(1,1); - if (out_used == 0) - *out_buff = '\0'; + if (out_buff == 0 && (out_buff = typeCalloc(char,1)) == NULL) + return(NULL); + out_buff[out_used] = '\0'; T((T_RETURN("%s"), _nc_visbuf(out_buff))); return(out_buff); } -char *tparm(const char *string, ...) +char *tparm(NCURSES_CONST char *string, ...) { va_list ap; char *result; @@ -542,21 +583,3 @@ char *result; va_end(ap); return result; } - -#ifdef __UNUSED__ /* we never documented this, and it confuses Emacs */ -char *tparam(const char *string, char *buffer, int bufsiz, ...) -{ -va_list ap; -char *result = 0; - - va_start(ap, bufsiz); -#ifdef TRACE - tname = "tparam"; -#endif /* TRACE */ - if (tparam_internal(string, ap) != 0 - && (int)out_used < bufsiz) - result = strcpy(buffer, out_buff); - va_end(ap); - return result; -} -#endif /* __UNUSED__ */ diff --git a/ncurses/lib_tputs.c b/ncurses/tinfo/lib_tputs.c similarity index 84% rename from ncurses/lib_tputs.c rename to ncurses/tinfo/lib_tputs.c index e5b4a6bc..d3fd4627 100644 --- a/ncurses/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -43,11 +43,13 @@ #include #include #include /* padding_baud_rate, xon_xoff */ +#include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.30 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.41 1999/10/22 23:31:24 tom Exp $") -#define OUTPUT ((SP != 0) ? SP->_ofp : stdout) +char PC; /* used by termcap library */ +speed_t ospeed; /* used by termcap library */ int _nc_nulls_sent; /* used by 'tack' program */ @@ -57,28 +59,16 @@ int delay_output(int ms) { T((T_CALLED("delay_output(%d)"), ms)); - if (cur_term == 0 || cur_term->_baudrate <= 0) { - (void) fflush(OUTPUT); - _nc_timed_wait(0, ms, (int *)0); - } -#ifdef no_pad_char - else if (no_pad_char) + if (no_pad_char) napms(ms); -#endif /* no_pad_char */ else { register int nullcount; - char null = '\0'; - -#ifdef pad_char - if (pad_char) - null = pad_char[0]; -#endif /* pad_char */ - nullcount = ms * cur_term->_baudrate / 10000; + nullcount = (ms * _nc_baudrate(ospeed)) / 10000; for (_nc_nulls_sent += nullcount; nullcount > 0; nullcount--) - my_outch(null); + my_outch(PC); if (my_outch == _nc_outch) - (void) fflush(OUTPUT); + _nc_flush(); } returnCode(OK); @@ -90,7 +80,17 @@ int _nc_outch(int ch) _nc_outchars++; #endif /* TRACE */ - putc(ch, OUTPUT); + if (SP != 0 + && SP->_cleanup) { + char tmp = ch; + /* + * POSIX says write() is safe in a signal handler, but the + * buffered I/O is not. + */ + write(fileno(NC_OUTPUT), &tmp, 1); + } else { + putc(ch, NC_OUTPUT); + } return OK; } @@ -109,7 +109,7 @@ int trailpad; #endif /* BSD_TPUTS */ #ifdef TRACE -char addrbuf[17]; +char addrbuf[32]; if (_nc_tracing & TRACE_TPUTS) { @@ -117,15 +117,17 @@ char addrbuf[17]; (void) strcpy(addrbuf, "_nc_outch"); else (void) sprintf(addrbuf, "%p", outc); - if (_nc_tputs_trace) + if (_nc_tputs_trace) { TR(TRACE_MAXIMUM, ("tputs(%s = %s, %d, %s) called", _nc_tputs_trace, _nc_visbuf(string), affcnt, addrbuf)); - else + } + else { TR(TRACE_MAXIMUM, ("tputs(%s, %d, %s) called", _nc_visbuf(string), affcnt, addrbuf)); + } _nc_tputs_trace = (char *)NULL; } #endif /* TRACE */ - if (string == ABSENT_STRING || string == CANCELLED_STRING) + if (!VALID_STRING(string)) return ERR; if (cur_term == 0) { @@ -135,11 +137,11 @@ char addrbuf[17]; always_delay = (string == bell) || (string == flash_screen); normal_delay = !xon_xoff -#ifdef padding_baud_rate && padding_baud_rate - && (!cur_term || cur_term->_baudrate >= padding_baud_rate) +#ifdef NCURSES_NO_PADDING + && (SP == 0 || !(SP->_no_padding)) #endif - ; + && (_nc_baudrate(ospeed) >= padding_baud_rate); } #ifdef BSD_TPUTS @@ -148,24 +150,26 @@ char addrbuf[17]; * (like nethack) actually do the likes of tputs("50") to get delays. */ trailpad = 0; - while (isdigit(*string)) { - trailpad = trailpad * 10 + (*string - '0'); - string++; - } - trailpad *= 10; - if (*string == '.') { - string++; - if (isdigit(*string)) { - trailpad += (*string - '0'); + if (isdigit(*string)) { + while (isdigit(*string)) { + trailpad = trailpad * 10 + (*string - '0'); string++; } - while (isdigit(*string)) + trailpad *= 10; + if (*string == '.') { string++; - } + if (isdigit(*string)) { + trailpad += (*string - '0'); + string++; + } + while (isdigit(*string)) + string++; + } - if (*string == '*') { - trailpad *= affcnt; - string++; + if (*string == '*') { + trailpad *= affcnt; + string++; + } } #endif /* BSD_TPUTS */ diff --git a/ncurses/tinfo/lib_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c new file mode 100644 index 00000000..0e57c512 --- /dev/null +++ b/ncurses/tinfo/lib_ttyflags.c @@ -0,0 +1,163 @@ +/**************************************************************************** + * 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. * + ****************************************************************************/ + +/* + * def_prog_mode() + * def_shell_mode() + * reset_prog_mode() + * reset_shell_mode() + * savetty() + * resetty() + */ + +#include +#include /* cur_term */ + +MODULE_ID("$Id: lib_ttyflags.c,v 1.3 1999/10/22 21:38:55 tom Exp $") + +#undef tabs + +#ifdef TAB3 +# define tabs TAB3 +#else +# ifdef XTABS +# define tabs XTABS +# else +# ifdef OXTABS +# define tabs OXTABS +# else +# define tabs 0 +# endif +# endif +#endif + +int _nc_get_tty_mode(TTY *buf) +{ + if (cur_term == 0 + || GET_TTY(cur_term->Filedes, buf) != 0) + return(ERR); + TR(TRACE_BITS,("_nc_get_tty_mode: %s", _nc_tracebits())); + return (OK); +} + +int _nc_set_tty_mode(TTY *buf) +{ + if (cur_term == 0 + || SET_TTY(cur_term->Filedes, buf) != 0) + return(ERR); + TR(TRACE_BITS,("_nc_set_tty_mode: %s", _nc_tracebits())); + return (OK); +} + +int def_shell_mode(void) +{ + T((T_CALLED("def_shell_mode()"))); + + /* + * Turn off the XTABS bit in the tty structure if it was on. If XTABS + * was on, remove the tab and backtab capabilities. + */ + + if (_nc_get_tty_mode(&cur_term->Ottyb) != OK) + returnCode(ERR); +#ifdef TERMIOS + if (cur_term->Ottyb.c_oflag & tabs) + tab = back_tab = NULL; +#else + if (cur_term->Ottyb.sg_flags & XTABS) + tab = back_tab = NULL; +#endif + returnCode(OK); +} + +int def_prog_mode(void) +{ + T((T_CALLED("def_prog_mode()"))); + + if (_nc_get_tty_mode(&cur_term->Nttyb) != OK) + returnCode(ERR); +#ifdef TERMIOS + cur_term->Nttyb.c_oflag &= ~tabs; +#else + cur_term->Nttyb.sg_flags &= ~XTABS; +#endif + returnCode(OK); +} + +int reset_prog_mode(void) +{ + T((T_CALLED("reset_prog_mode()"))); + + if (cur_term != 0) { + _nc_set_tty_mode(&cur_term->Nttyb); + if (SP) { + if (stdscr && stdscr->_use_keypad) + _nc_keypad(TRUE); + NC_BUFFERED(TRUE); + } + returnCode(OK); + } + returnCode(ERR); +} + +int reset_shell_mode(void) +{ + T((T_CALLED("reset_shell_mode()"))); + + if (cur_term != 0) { + if (SP) + { + _nc_keypad(FALSE); + _nc_flush(); + NC_BUFFERED(FALSE); + } + returnCode(_nc_set_tty_mode(&cur_term->Ottyb)); + } + returnCode(ERR); +} + +/* +** savetty() and resetty() +** +*/ + +static TTY buf; + +int savetty(void) +{ + T((T_CALLED("savetty()"))); + + returnCode(_nc_get_tty_mode(&buf)); +} + +int resetty(void) +{ + T((T_CALLED("resetty()"))); + + returnCode(_nc_set_tty_mode(&buf)); +} diff --git a/ncurses/make_keys.c b/ncurses/tinfo/make_keys.c similarity index 95% rename from ncurses/make_keys.c rename to ncurses/tinfo/make_keys.c index c244b0c9..a1fd1d0b 100644 --- a/ncurses/make_keys.c +++ b/ncurses/tinfo/make_keys.c @@ -37,7 +37,7 @@ */ #include -MODULE_ID("$Id: make_keys.c,v 1.4 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: make_keys.c,v 1.7 1999/09/11 17:32:57 Jeffrey.Honig Exp $") #include @@ -103,14 +103,14 @@ int main(int argc, char *argv[]) "", "/* This file was generated by MAKE_KEYS */", "", - "static const struct {", - "\tunsigned offset;", - "\tchtype code;", - "} table[] = {", + "#ifdef BROKEN_LINKER", + "static", + "#endif", + "struct tinfo_fkeys _nc_tinfo_fkeys[] = {", 0 }; static const char *suffix[] = { - "};", + "\t{ 0, 0} };", "", "#endif /* NCU_KEYS_H */", 0 diff --git a/ncurses/name_match.c b/ncurses/tinfo/name_match.c similarity index 74% rename from ncurses/name_match.c rename to ncurses/tinfo/name_match.c index 457f6376..a9e83969 100644 --- a/ncurses/name_match.c +++ b/ncurses/tinfo/name_match.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,15 +27,14 @@ ****************************************************************************/ /**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * + * Author: Thomas E. Dickey 1999 * ****************************************************************************/ #include #include #include -MODULE_ID("$Id: name_match.c,v 1.4 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: name_match.c,v 1.8 1999/03/07 01:58:36 tom Exp $") /* * _nc_first_name(char *names) @@ -46,16 +45,16 @@ MODULE_ID("$Id: name_match.c,v 1.4 1998/02/11 12:13:55 tom Exp $") char *_nc_first_name(const char *const sp) /* get the first name from the given name list */ { - static char buf[MAX_NAME_SIZE]; - register char *cp; + static char buf[MAX_NAME_SIZE+1]; + register unsigned n; - (void) strcpy(buf, sp); - - cp = strchr(buf, '|'); - if (cp) - *cp = '\0'; - - return(buf); + for (n = 0; n < sizeof(buf)-1; n++) { + if ((buf[n] = sp[n]) == '\0' + || (buf[n] == '|')) + break; + } + buf[n] = '\0'; + return(buf); } /* @@ -65,21 +64,33 @@ char *_nc_first_name(const char *const sp) */ int _nc_name_match(const char *const namelst, const char *const name, const char *const delim) -/* microtune this, it occurs in several critical loops */ { -char namecopy[MAX_ENTRY_SIZE]; /* this may get called on a TERMCAP value */ -register char *cp; + const char *s, *d, *t; + int code, found; - if (namelst == 0) - return(FALSE); - (void) strcpy(namecopy, namelst); - if ((cp = strtok(namecopy, delim)) != 0) { - do { - /* avoid strcmp() function-call cost if possible */ - if (cp[0] == name[0] && strcmp(cp, name) == 0) - return(TRUE); - } while - ((cp = strtok((char *)0, delim)) != 0); + if ((s = namelst) != 0) { + while (*s != '\0') { + for (d = name; *d != '\0'; d++) { + if (*s != *d) + break; + s++; + } + found = FALSE; + for (code = TRUE; *s != '\0'; code = FALSE, s++) { + for (t = delim; *t != '\0'; t++) { + if (*s == *t) { + found = TRUE; + break; + } + } + if (found) + break; + } + if (code && *d == '\0') + return code; + if (*s++ == 0) + break; + } } - return(FALSE); + return FALSE; } diff --git a/ncurses/parse_entry.c b/ncurses/tinfo/parse_entry.c similarity index 85% rename from ncurses/parse_entry.c rename to ncurses/tinfo/parse_entry.c index fd41019b..07f3868e 100644 --- a/ncurses/parse_entry.c +++ b/ncurses/tinfo/parse_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -46,10 +46,9 @@ #include #include #define __INTERNAL_CAPS_VISIBLE -#include #include -MODULE_ID("$Id: parse_entry.c,v 1.22 1998/02/11 12:13:59 tom Exp $") +MODULE_ID("$Id: parse_entry.c,v 1.39 1999/03/01 02:28:51 tom Exp $") #ifdef LINT static short const parametrized[] = { 0 }; @@ -63,6 +62,116 @@ static void postprocess_termcap(TERMTYPE *, bool); static void postprocess_terminfo(TERMTYPE *); static struct name_table_entry const * lookup_fullname(const char *name); +#if NCURSES_XNAMES + +static struct name_table_entry const * +_nc_extend_names(ENTRY *entryp, char *name, int token_type) +{ + static struct name_table_entry temp; + TERMTYPE *tp = &(entryp->tterm); + unsigned offset = 0; + unsigned actual; + unsigned tindex; + unsigned first, last, n; + bool found; + + switch (token_type) { + case BOOLEAN: + first = 0; + last = tp->ext_Booleans; + offset = tp->ext_Booleans; + tindex = tp->num_Booleans; + break; + case NUMBER: + first = tp->ext_Booleans; + last = tp->ext_Numbers + first; + offset = tp->ext_Booleans + tp->ext_Numbers; + tindex = tp->num_Numbers; + break; + case STRING: + first = tp->ext_Booleans + tp->ext_Numbers; + last = tp->ext_Strings + first; + offset = tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings; + tindex = tp->num_Strings; + break; + case CANCEL: + actual = NUM_EXT_NAMES(tp); + for (n = 0; n < actual; n++) { + if (!strcmp(name, tp->ext_Names[n])) { + if (n > (unsigned)(tp->ext_Booleans + tp->ext_Numbers)) { + token_type = STRING; + } else if (n > tp->ext_Booleans) { + token_type = NUMBER; + } else { + token_type = BOOLEAN; + } + return _nc_extend_names(entryp, name, token_type); + } + } + /* Well, we are given a cancel for a name that we don't recognize */ + return _nc_extend_names(entryp, name, STRING); + default: + return 0; + } + + /* Adjust the 'offset' (insertion-point) to keep the lists of extended + * names sorted. + */ + for (n = first, found = FALSE; n < last; n++) { + int cmp = strcmp(tp->ext_Names[n], name); + if (cmp == 0) + found = TRUE; + if (cmp >= 0) { + offset = n; + tindex = n - first; + switch (token_type) { + case BOOLEAN: tindex += BOOLCOUNT; break; + case NUMBER: tindex += NUMCOUNT; break; + case STRING: tindex += STRCOUNT; break; + } + break; + } + } + if (!found) { + switch (token_type) { + case BOOLEAN: + tp->ext_Booleans += 1; + tp->num_Booleans += 1; + tp->Booleans = typeRealloc(char, tp->num_Booleans, tp->Booleans); + for (last = tp->num_Booleans-1; last > tindex; last--) + tp->Booleans[last] = tp->Booleans[last-1]; + break; + case NUMBER: + tp->ext_Numbers += 1; + tp->num_Numbers += 1; + tp->Numbers = typeRealloc(short, tp->num_Numbers, tp->Numbers); + for (last = tp->num_Numbers-1; last > tindex; last--) + tp->Numbers[last] = tp->Numbers[last-1]; + break; + case STRING: + tp->ext_Strings += 1; + tp->num_Strings += 1; + tp->Strings = typeRealloc(char *, tp->num_Strings, tp->Strings); + for (last = tp->num_Strings-1; last > tindex; last--) + tp->Strings[last] = tp->Strings[last-1]; + break; + } + actual = NUM_EXT_NAMES(tp); + tp->ext_Names = typeRealloc(char *, actual, tp->ext_Names); + while (--actual > offset) + tp->ext_Names[actual] = tp->ext_Names[actual-1]; + tp->ext_Names[offset] = _nc_save_str(name); + } + + temp.nte_name = tp->ext_Names[offset]; + temp.nte_type = token_type; + temp.nte_index = tindex; + temp.nte_link = -1; + + return &temp; +} +#endif /* NCURSES_XNAMES */ + /* * int * _nc_parse_entry(entry, literal, silent) @@ -124,12 +233,12 @@ int _nc_parse_entry(struct entry *entryp, int literal, bool silent) /* check for overly-long names and aliases */ (void) strncpy(namecpy, entryp->tterm.term_names, MAX_NAME_SIZE); namecpy[MAX_NAME_SIZE] = '\0'; - if ((ptr = strrchr(namecpy, '|')) != (char *)NULL) + if ((ptr = strrchr(namecpy, '|')) != (char *)0) *ptr = '\0'; ptr = strtok(namecpy, "|"); if (strlen(ptr) > MAX_ALIAS) _nc_warning("primary name may be too long"); - while ((ptr = strtok((char *)NULL, "|")) != (char *)NULL) + while ((ptr = strtok((char *)0, "|")) != (char *)0) if (strlen(ptr) > MAX_ALIAS) _nc_warning("alias `%s' may be too long", ptr); @@ -166,7 +275,7 @@ int _nc_parse_entry(struct entry *entryp, int literal, bool silent) for (ap = _nc_capalias_table; ap->from; ap++) if (strcmp(ap->from, _nc_curr_token.tk_name) == 0) { - if (ap->to == (char *)NULL) + if (ap->to == (char *)0) { _nc_warning("%s (%s termcap extension) ignored", ap->from, ap->source); @@ -184,7 +293,7 @@ int _nc_parse_entry(struct entry *entryp, int literal, bool silent) for (ap = _nc_infoalias_table; ap->from; ap++) if (strcmp(ap->from, _nc_curr_token.tk_name) == 0) { - if (ap->to == (char *)NULL) + if (ap->to == (char *)0) { _nc_warning("%s (%s terminfo extension) ignored", ap->from, ap->source); @@ -197,13 +306,24 @@ int _nc_parse_entry(struct entry *entryp, int literal, bool silent) break; } - /* last chance: a full-name */ if (entry_ptr == NOTFOUND) { entry_ptr = lookup_fullname(_nc_curr_token.tk_name); } } } +#if NCURSES_XNAMES + /* + * If we have extended-names active, we will automatically + * define a name based on its context. + */ + if (entry_ptr == NOTFOUND + && _nc_user_definable + && (entry_ptr = _nc_extend_names(entryp, _nc_curr_token.tk_name, token_type)) != 0) { + _nc_warning("extended capability '%s'", _nc_curr_token.tk_name); + } +#endif /* NCURSES_XNAMES */ + /* can't find this cap name, not even as an alias */ if (entry_ptr == NOTFOUND) { if (!silent) @@ -322,7 +442,7 @@ int _nc_parse_entry(struct entry *entryp, int literal, bool silent) * space-efficient to call this after use resolution, but it has * to be done before entry allocation is wrapped up. */ - if (!literal) + if (!literal) { if (_nc_syntax == SYN_TERMCAP) { bool has_base_entry = FALSE; @@ -341,14 +461,14 @@ int _nc_parse_entry(struct entry *entryp, int literal, bool silent) * have picked up defaults via translation. */ for (i = 0; i < entryp->nuses; i++) - if (!strchr(entryp->uses[i].parent, '+')) + if (!strchr((char *)entryp->uses[i].parent, '+')) has_base_entry = TRUE; postprocess_termcap(&entryp->tterm, has_base_entry); } else postprocess_terminfo(&entryp->tterm); - + } _nc_wrap_entry(entryp); return(OK); @@ -418,7 +538,7 @@ static assoc const ko_xlate[] = {"st", "khts"}, /* set-tab key -> KEY_STAB */ {"ta", CANCELLED_STRING}, {"up", "kcuu1"}, /* up-arrow key -> KEY_UP */ - {(char *)NULL, (char *)NULL}, + {(char *)0, (char *)0}, }; /* @@ -436,8 +556,8 @@ static const char C_HT[] = "\t"; * Note that WANTED and PRESENT are not simple inverses! If a capability * has been explicitly cancelled, it's not considered WANTED. */ -#define WANTED(s) ((s) == (char *)NULL) -#define PRESENT(s) (((s) != (char *)NULL) && ((s) != CANCELLED_STRING)) +#define WANTED(s) ((s) == ABSENT_STRING) +#define PRESENT(s) (((s) != ABSENT_STRING) && ((s) != CANCELLED_STRING)) /* * This bit of legerdemain turns all the terminfo variable names into @@ -467,8 +587,8 @@ void postprocess_termcap(TERMTYPE *tp, bool has_base) if (WANTED(init_3string) && termcap_init2) init_3string = _nc_save_str(termcap_init2); - if (WANTED(reset_1string) && termcap_reset) - reset_1string = _nc_save_str(termcap_reset); + if (WANTED(reset_2string) && termcap_reset) + reset_2string = _nc_save_str(termcap_reset); if (WANTED(carriage_return)) { if (carriage_return_delay > 0) { @@ -549,7 +669,7 @@ void postprocess_termcap(TERMTYPE *tp, bool has_base) * space allocated for it is wasted. */ if (return_does_clr_eol == 1 || no_correctly_working_cr == 1) - carriage_return = NULL; + carriage_return = ABSENT_STRING; /* * Supposedly most termcap entries have ta now and '\t' is no longer a @@ -575,7 +695,7 @@ void postprocess_termcap(TERMTYPE *tp, bool has_base) /* * Translate the old termcap :pt: capability to it#8 + ht=\t */ - if (has_hardware_tabs == TRUE) + if (has_hardware_tabs == TRUE) { if (init_tabs != 8 && init_tabs != ABSENT_NUMERIC) _nc_warning("hardware tabs with a width other than 8: %d", init_tabs); else @@ -590,7 +710,7 @@ void postprocess_termcap(TERMTYPE *tp, bool has_base) init_tabs = 8; } } - + } /* * Now translate the ko capability, if there is one. This * isn't from mytinfo... @@ -671,7 +791,7 @@ void postprocess_termcap(TERMTYPE *tp, bool has_base) tp->Strings[to_ptr->nte_index] = _nc_save_str(buf2); } while - ((cp = strtok((char *)NULL, ",")) != 0); + ((cp = strtok((char *)0, ",")) != 0); /* * Note: ko=im and ko=ic both want to grab the `Insert' @@ -783,6 +903,12 @@ void postprocess_termcap(TERMTYPE *tp, bool has_base) _nc_warning("acsc string synthesized from XENIX capabilities"); } } + else if (acs_chars == 0 + && enter_alt_charset_mode != 0 + && exit_alt_charset_mode != 0) + { + acs_chars = _nc_save_str("``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~"); + } } static diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c new file mode 100644 index 00000000..f60a4863 --- /dev/null +++ b/ncurses/tinfo/read_entry.c @@ -0,0 +1,482 @@ +/**************************************************************************** + * Copyright (c) 1999 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Zeyd M. Ben-Halim 1992,1995 * + * and: Eric S. Raymond * + ****************************************************************************/ + + + +/* + * read_entry.c -- Routine for reading in a compiled terminfo file + * + */ + +#include + +#if HAVE_FCNTL_H +#include +#endif + +#include +#include + +MODULE_ID("$Id: read_entry.c,v 1.61 1999/07/24 20:07:20 tom Exp $") + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#if 0 +#define TRACE_IN(p) DEBUG(2, p) +#else +#define TRACE_IN(p) /*nothing*/ +#endif + +/* + * int + * _nc_read_file_entry(filename, ptr) + * + * Read the compiled terminfo entry in the given file into the + * structure pointed to by ptr, allocating space for the string + * table. + */ + +#undef BYTE +#define BYTE(p,n) (unsigned char)((p)[n]) + +#define IS_NEG1(p) ((BYTE(p,0) == 0377) && (BYTE(p,1) == 0377)) +#define IS_NEG2(p) ((BYTE(p,0) == 0376) && (BYTE(p,1) == 0377)) +#define LOW_MSB(p) (BYTE(p,0) + 256*BYTE(p,1)) + +static bool have_tic_directory = FALSE; +static bool keep_tic_directory = FALSE; + +/* + * Record the "official" location of the terminfo directory, according to + * the place where we're writing to, or the normal default, if not. + */ +const char *_nc_tic_dir(const char *path) +{ + static const char *result = TERMINFO; + + if (!keep_tic_directory) { + if (path != 0) { + result = path; + have_tic_directory = TRUE; + } else if (!have_tic_directory) { + char *envp; + if ((envp = getenv("TERMINFO")) != 0) + return _nc_tic_dir(envp); + } + } + return result; +} + +/* + * Special fix to prevent the terminfo directory from being moved after tic + * has chdir'd to it. If we let it be changed, then if $TERMINFO has a + * relative path, we'll lose track of the actual directory. + */ +void _nc_keep_tic_dir(const char *path) +{ + _nc_tic_dir(path); + keep_tic_directory = TRUE; +} + +static void convert_shorts(char *buf, short *Numbers, int count) +{ + int i; + for (i = 0; i < count; i++) + { + if (IS_NEG1(buf + 2*i)) + Numbers[i] = ABSENT_NUMERIC; + else if (IS_NEG2(buf + 2*i)) + Numbers[i] = CANCELLED_NUMERIC; + else + Numbers[i] = LOW_MSB(buf + 2*i); + TRACE_IN(("get Numbers[%d]=%d", i, Numbers[i])); + } +} + +static void convert_strings(char *buf, char **Strings, int count, int size, char *table) +{ + int i; + char *p; + + for (i = 0; i < count; i++) { + if (IS_NEG1(buf + 2*i)) { + Strings[i] = ABSENT_STRING; + } else if (IS_NEG2(buf + 2*i)) { + Strings[i] = CANCELLED_STRING; + } else if (LOW_MSB(buf + 2*i) > size) { + Strings[i] = ABSENT_STRING; + } else { + Strings[i] = (LOW_MSB(buf+2*i) + table); + TRACE_IN(("Strings[%d] = %s", i, _nc_visbuf(Strings[i]))); + } + + /* make sure all strings are NUL terminated */ + if (VALID_STRING(Strings[i])) { + for (p = Strings[i]; p <= table + size; p++) + if (*p == '\0') + break; + /* if there is no NUL, ignore the string */ + if (p > table + size) + Strings[i] = ABSENT_STRING; + } + } +} + +#define read_shorts(fd, buf, count) (read(fd, buf, (count)*2) == (count)*2) + +#define even_boundary(value) \ + if ((value) % 2 != 0) read(fd, buf, 1) + +static int read_termtype(int fd, TERMTYPE *ptr) +/* return 1 if read, 0 if not found or garbled */ +{ + int name_size, bool_count, num_count, str_count, str_size; + int i; + char buf[MAX_ENTRY_SIZE]; + + TRACE_IN(("READ termtype header @%d", tell(fd))); + + /* grab the header */ + if (!read_shorts(fd, buf, 6) + || LOW_MSB(buf) != MAGIC) { + return(0); + } + + _nc_free_termtype(ptr); + name_size = LOW_MSB(buf + 2); + bool_count = LOW_MSB(buf + 4); + num_count = LOW_MSB(buf + 6); + str_count = LOW_MSB(buf + 8); + str_size = LOW_MSB(buf + 10); + + TRACE_IN(("header is %d/%d/%d/%d(%d)", name_size, bool_count, num_count, str_count, str_size)); + if (name_size < 0 + || bool_count < 0 + || num_count < 0 + || str_count < 0 + || str_size < 0) { + return(0); + } + + if (str_size) { + /* try to allocate space for the string table */ + if (str_count*2 >= (int) sizeof(buf) + || (ptr->str_table = typeMalloc(char, (unsigned)str_size)) == 0) { + return(0); + } + } else { + str_count = 0; + } + + /* grab the name (a null-terminate string) */ + read(fd, buf, min(MAX_NAME_SIZE, (unsigned)name_size)); + buf[MAX_NAME_SIZE] = '\0'; + ptr->term_names = typeCalloc(char, strlen(buf) + 1); + if (ptr->term_names == NULL) { + return(0); + } + (void) strcpy(ptr->term_names, buf); + if (name_size > MAX_NAME_SIZE) + lseek(fd, (off_t) (name_size - MAX_NAME_SIZE), 1); + + /* grab the booleans */ + if ((ptr->Booleans = typeCalloc(char, max(BOOLCOUNT, bool_count))) == 0 + || read(fd, ptr->Booleans, (unsigned)bool_count) < bool_count) { + return(0); + } + + /* + * If booleans end on an odd byte, skip it. The machine they + * originally wrote terminfo on must have been a 16-bit + * word-oriented machine that would trap out if you tried a + * word access off a 2-byte boundary. + */ + even_boundary(name_size + bool_count); + + /* grab the numbers */ + if ((ptr->Numbers = typeCalloc(short, max(NUMCOUNT, num_count))) == 0 + || !read_shorts(fd, buf, num_count)) { + return(0); + } + convert_shorts(buf, ptr->Numbers, num_count); + + if ((ptr->Strings = typeCalloc(char *, max(STRCOUNT, str_count))) == 0) + return(0); + + if (str_count) + { + /* grab the string offsets */ + if (!read_shorts(fd, buf, str_count)) { + return(0); + } + /* finally, grab the string table itself */ + if (read(fd, ptr->str_table, (unsigned)str_size) != str_size) + return(0); + convert_strings(buf, ptr->Strings, str_count, str_size, ptr->str_table); + } + +#if NCURSES_XNAMES + + ptr->num_Booleans = BOOLCOUNT; + ptr->num_Numbers = NUMCOUNT; + ptr->num_Strings = STRCOUNT; + + /* + * Read extended entries, if any, after the normal end of terminfo data. + */ + even_boundary(str_size); + TRACE_IN(("READ extended_header @%d", tell(fd))); + if (_nc_user_definable && read_shorts(fd, buf, 5)) { + int ext_bool_count = LOW_MSB(buf + 0); + int ext_num_count = LOW_MSB(buf + 2); + int ext_str_count = LOW_MSB(buf + 4); + int ext_str_size = LOW_MSB(buf + 6); + int ext_str_limit = LOW_MSB(buf + 8); + int need = (ext_bool_count + ext_num_count + ext_str_count); + int base = 0; + + if (need >= (int) sizeof(buf) + || ext_str_size >= (int) sizeof(buf) + || ext_str_limit >= (int) sizeof(buf) + || ext_bool_count < 0 + || ext_num_count < 0 + || ext_str_count < 0 + || ext_str_size < 0 + || ext_str_limit < 0) + return(0); + + ptr->num_Booleans = BOOLCOUNT + ext_bool_count; + ptr->num_Numbers = NUMCOUNT + ext_num_count; + ptr->num_Strings = STRCOUNT + ext_str_count; + + ptr->Booleans = typeRealloc(char, ptr->num_Booleans,ptr->Booleans); + ptr->Numbers = typeRealloc(short, ptr->num_Numbers, ptr->Numbers); + ptr->Strings = typeRealloc(char*, ptr->num_Strings, ptr->Strings); + + TRACE_IN(("extended header is %d/%d/%d(%d:%d)", ext_bool_count, ext_num_count, ext_str_count, ext_str_size, ext_str_limit)); + + TRACE_IN(("READ %d extended-booleans @%d", ext_bool_count, tell(fd))); + if ((ptr->ext_Booleans = ext_bool_count) != 0) { + if (read(fd, ptr->Booleans + BOOLCOUNT, (unsigned)ext_bool_count) != ext_bool_count) + return(0); + } + even_boundary(ext_bool_count); + + TRACE_IN(("READ %d extended-numbers @%d", ext_num_count, tell(fd))); + if ((ptr->ext_Numbers = ext_num_count) != 0) { + if (!read_shorts(fd, buf, ext_num_count)) + return(0); + TRACE_IN(("Before converting extended-numbers")); + convert_shorts(buf, ptr->Numbers + NUMCOUNT, ext_num_count); + } + + TRACE_IN(("READ extended-offsets @%d", tell(fd))); + if ((ext_str_count || need) + && !read_shorts(fd, buf, ext_str_count+need)) + return(0); + + TRACE_IN(("READ %d bytes of extended-strings @%d", ext_str_limit, tell(fd))); + if (ext_str_limit) { + if ((ptr->ext_str_table = typeMalloc(char, ext_str_limit)) == 0) + return(0); + if (read(fd, ptr->ext_str_table, ext_str_limit) != ext_str_limit) + return(0); + TRACE_IN(("first extended-string is %s", _nc_visbuf(ptr->ext_str_table))); + } + + if ((ptr->ext_Strings = ext_str_count) != 0) { + TRACE_IN(("Before computing extended-string capabilities str_count=%d, ext_str_count=%d", str_count, ext_str_count)); + convert_strings(buf, ptr->Strings + str_count, ext_str_count, ext_str_limit, ptr->ext_str_table); + for (i = ext_str_count-1; i >= 0; i--) { + TRACE_IN(("MOVE from [%d:%d] %s", i, i+str_count, _nc_visbuf(ptr->Strings[i+str_count]))); + ptr->Strings[i+STRCOUNT] = ptr->Strings[i+str_count]; + if (VALID_STRING(ptr->Strings[i+STRCOUNT])) + base += (strlen(ptr->Strings[i+STRCOUNT]) + 1); + TRACE_IN(("... to [%d] %s", i+STRCOUNT, _nc_visbuf(ptr->Strings[i+STRCOUNT]))); + } + } + + if (need) { + if ((ptr->ext_Names = typeCalloc(char *, need)) == 0) + return(0); + TRACE_IN(("ext_NAMES starting @%d in extended_strings, first = %s", base, _nc_visbuf(ptr->ext_str_table+base))); + convert_strings(buf + (2 * ext_str_count), ptr->ext_Names, need, ext_str_limit, ptr->ext_str_table + base); + } + + T(("...done reading terminfo bool %d(%d) num %d(%d) str %d(%d)", + ptr->num_Booleans, ptr->ext_Booleans, + ptr->num_Numbers, ptr->ext_Numbers, + ptr->num_Strings, ptr->ext_Strings)); + + TRACE_IN(("extend: num_Booleans:%d", ptr->num_Booleans)); + } else +#endif /* NCURSES_XNAMES */ + { + T(("...done reading terminfo bool %d num %d str %d", + bool_count, + num_count, + str_count)); + TRACE_IN(("normal: num_Booleans:%d", ptr->num_Booleans)); + } + + for (i = bool_count; i < BOOLCOUNT; i++) + ptr->Booleans[i] = FALSE; + for (i = num_count; i < NUMCOUNT; i++) + ptr->Numbers[i] = ABSENT_NUMERIC; + for (i = str_count; i < STRCOUNT; i++) + ptr->Strings[i] = ABSENT_STRING; + + return(1); +} + +int _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) +/* return 1 if read, 0 if not found or garbled */ +{ + int code, fd = -1; + + if (_nc_access(filename, R_OK) < 0 + || (fd = open(filename, O_RDONLY|O_BINARY)) < 0) { + T(("cannot open terminfo %s (errno=%d)", filename, errno)); + return(0); + } + + T(("read terminfo %s", filename)); + if ((code = read_termtype(fd, ptr)) == 0) + _nc_free_termtype(ptr); + close(fd); + + return (code); +} + +/* + * Build a terminfo pathname and try to read the data. Returns 1 on success, + * 0 on failure. + */ +static int _nc_read_tic_entry(char *const filename, + const char *const dir, const char *ttn, TERMTYPE *const tp) +{ +/* maximum safe length of terminfo root directory name */ +#define MAX_TPATH (PATH_MAX - MAX_ALIAS - 6) + + if (strlen(dir) > MAX_TPATH) + return 0; + (void) sprintf(filename, "%s/%s", dir, ttn); + return _nc_read_file_entry(filename, tp); +} + +/* + * Process the list of :-separated directories, looking for the terminal type. + * We don't use strtok because it does not show us empty tokens. + */ +static int _nc_read_terminfo_dirs(const char *dirs, char *const filename, const char *const ttn, TERMTYPE *const tp) +{ + char *list, *a; + const char *b; + int code = 0; + + /* we'll modify the argument, so we must copy */ + if ((b = a = list = strdup(dirs)) == NULL) + return(0); + + for (;;) { + int c = *a; + if (c == 0 || c == ':') { + *a = 0; + if ((b + 1) >= a) + b = TERMINFO; + if (_nc_read_tic_entry(filename, b, ttn, tp) == 1) { + code = 1; + break; + } + b = a + 1; + if (c == 0) + break; + } + a++; + } + + free(list); + return(code); +} + +/* + * _nc_read_entry(char *tn, char *filename, TERMTYPE *tp) + * + * Find and read the compiled entry for a given terminal type, + * if it exists. We take pains here to make sure no combination + * of environment variables and terminal type name can be used to + * overrun the file buffer. + */ + +int _nc_read_entry(const char *const tn, char *const filename, TERMTYPE *const tp) +{ +char *envp; +char ttn[MAX_ALIAS + 3]; + + /* truncate the terminal name to prevent dangerous buffer airline */ + (void) sprintf(ttn, "%c/%.*s", *tn, MAX_ALIAS, tn); + + /* This is System V behavior, in conjunction with our requirements for + * writing terminfo entries. + */ + if (have_tic_directory + && _nc_read_tic_entry(filename, _nc_tic_dir(0), ttn, tp) == 1) + return 1; + + if ((envp = getenv("TERMINFO")) != 0 + && _nc_read_tic_entry(filename, _nc_tic_dir(envp), ttn, tp) == 1) + return 1; + + if ((envp = _nc_home_terminfo()) != 0) { + if (_nc_read_tic_entry(filename, envp, ttn, tp) == 1) { + return(1); + } + } + + /* this is an ncurses extension */ + if ((envp = getenv("TERMINFO_DIRS")) != 0) + return _nc_read_terminfo_dirs(envp, filename, ttn, tp); + + /* Try the system directory. Note that the TERMINFO_DIRS value, if + * defined by the configure script, begins with a ":", which will be + * interpreted as TERMINFO. + */ +#ifdef TERMINFO_DIRS + return _nc_read_terminfo_dirs(TERMINFO_DIRS, filename, ttn, tp); +#else + return _nc_read_tic_entry(filename, TERMINFO, ttn, tp); +#endif +} + diff --git a/ncurses/read_termcap.c b/ncurses/tinfo/read_termcap.c similarity index 93% rename from ncurses/read_termcap.c rename to ncurses/tinfo/read_termcap.c index d67a3bc9..d60a92d6 100644 --- a/ncurses/read_termcap.c +++ b/ncurses/tinfo/read_termcap.c @@ -53,7 +53,6 @@ #include #include -#include #include #include @@ -61,7 +60,9 @@ #include #endif -MODULE_ID("$Id: read_termcap.c,v 1.27 1998/02/11 12:13:58 tom Exp $") +MODULE_ID("$Id: read_termcap.c,v 1.43 1999/04/10 20:52:52 tom Exp $") + +#ifndef PURE_TERMINFO #ifdef __EMX__ #define is_pathname(s) ((((s) != 0) && ((s)[0] == '/')) \ @@ -155,7 +156,7 @@ _nc_cgetset(const char *ent) return (0); } topreclen = strlen(ent); - if ((toprec = malloc (topreclen + 1)) == 0) { + if ((toprec = typeMalloc(char, topreclen + 1)) == 0) { errno = ENOMEM; return (-1); } @@ -258,6 +259,7 @@ _nc_cgetent(char **buf, int *oline, char **db_array, const char *name) * names interpolated, a name can't be found, or depth exceeds * MAX_RECURSION. */ +#define DOALLOC(size) typeRealloc(char, size, record) static int _nc_getent( char **cap, /* termcap-content */ @@ -272,7 +274,7 @@ _nc_getent( { register char *r_end, *rp; int myfd = FALSE; - char *record; + char *record = 0; int tc_not_resolved; int current; int lineno; @@ -288,7 +290,7 @@ _nc_getent( * Check if we have a top record from cgetset(). */ if (depth == 0 && toprec != 0 && _nc_cgetmatch(toprec, name) == 0) { - if ((record = malloc (topreclen + BFRAG)) == 0) { + if ((record = DOALLOC(topreclen + BFRAG)) == 0) { errno = ENOMEM; return (TC_SYS_ERR); } @@ -302,7 +304,7 @@ _nc_getent( /* * Allocate first chunk of memory. */ - if ((record = malloc(BFRAG)) == 0) { + if ((record = DOALLOC(BFRAG)) == 0) { errno = ENOMEM; return (TC_SYS_ERR); } @@ -320,15 +322,14 @@ _nc_getent( */ if (fd >= 0) { (void)lseek(fd, (off_t)0, SEEK_SET); + } else if ((_nc_access(db_array[current], R_OK) < 0) + || (fd = open(db_array[current], O_RDONLY, 0)) < 0) { + /* No error on unfound file. */ + if (errno == ENOENT) + continue; + free(record); + return (TC_SYS_ERR); } else { - fd = open(db_array[current], O_RDONLY, 0); - if (fd < 0) { - /* No error on unfound file. */ - if (errno == ENOENT) - continue; - free(record); - return (TC_SYS_ERR); - } myfd = TRUE; } lineno = 0; @@ -398,11 +399,11 @@ _nc_getent( pos = rp - record; newsize = r_end - record + BFRAG; - record = realloc(record, newsize); + record = DOALLOC(newsize); if (record == 0) { - errno = ENOMEM; if (myfd) (void)close(fd); + errno = ENOMEM; return (TC_SYS_ERR); } r_end = record + newsize; @@ -533,12 +534,12 @@ _nc_getent( newsize = r_end - record + diff + BFRAG; tcpos = tcstart - record; tcposend = tcend - record; - record = realloc(record, newsize); + record = DOALLOC(newsize); if (record == 0) { - errno = ENOMEM; if (myfd) (void)close(fd); free(icap); + errno = ENOMEM; return (TC_SYS_ERR); } r_end = record + newsize; @@ -570,9 +571,9 @@ _nc_getent( */ if (myfd) (void)close(fd); - *len = rp - record - 1; /* don't count NUL */ + *len = rp - record - 1; /* don't count NUL */ if (r_end > rp) { - if ((record = realloc(record, (size_t)(rp - record))) == 0) { + if ((record = DOALLOC((size_t)(rp - record))) == 0) { errno = ENOMEM; return (TC_SYS_ERR); } @@ -800,19 +801,21 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) */ if (!is_pathname(cp)) { /* no TERMCAP or it holds an entry */ if ((termpath = getenv("TERMPATH")) != 0) { - strncpy(pathbuf, termpath, sizeof(pathbuf)-1); + strncpy(pathbuf, termpath, PBUFSIZ - 1); } else { - if ((home = getenv("HOME")) != 0) { /* setup path */ + if ((home = getenv("HOME")) != 0 && + strlen(home) < PBUFSIZ) { /* setup path */ p += strlen(home); /* path, looking in */ strcpy(pathbuf, home); /* $HOME first */ *p++ = '/'; } /* if no $HOME look in current directory */ #define MY_PATH_DEF ".termcap /etc/termcap /usr/share/misc/termcap" - strncpy(p, MY_PATH_DEF, (size_t)(PBUFSIZ - (p - pathbuf))); + strncpy(p, MY_PATH_DEF, (size_t)(PBUFSIZ - (p - pathbuf) - 1)); } } else /* user-defined name in TERMCAP */ - strncpy(pathbuf, cp, PBUFSIZ); /* still can be tokenized */ + strncpy(pathbuf, cp, PBUFSIZ - 1); /* still can be tokenized */ + pathbuf[PBUFSIZ - 1] = '\0'; *fname++ = pathbuf; /* tokenize path into vector of names */ while (*++p) { @@ -884,9 +887,8 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) * cgetent, then it is the actual filename). */ if (i >= 0) { - the_source = malloc(strlen(pathvec[i]) + 1); - if (the_source != 0) - *sourcename = strcpy(the_source, pathvec[i]); + if ((the_source = strdup(pathvec[i])) != 0) + *sourcename = the_source; } return(i); @@ -894,6 +896,24 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) #endif /* USE_BSD_TGETENT */ #endif /* USE_GETCAP */ +#define MAXPATHS 32 + +/* + * Add a filename to the list in 'termpaths[]', checking that we really have + * a right to open the file. + */ +#if !USE_GETCAP +static int add_tc(char *termpaths[], char *path, int count) +{ + if (count < MAXPATHS + && _nc_access(path, R_OK) == 0) + termpaths[count++] = path; + termpaths[count] = 0; + return count; +} +#define ADD_TC(path, count) filecount = add_tc(termpaths, path, count) +#endif /* !USE_GETCAP */ + int _nc_read_termcap_entry(const char *const tn, TERMTYPE *const tp) { int found = FALSE; @@ -941,19 +961,18 @@ int _nc_read_termcap_entry(const char *const tn, TERMTYPE *const tp) * if the database is not accessible. */ FILE *fp; -#define MAXPATHS 32 char *tc, *termpaths[MAXPATHS]; - int filecount = 0; + int filecount = 0; bool use_buffer = FALSE; char tc_buf[1024]; char pathbuf[PATH_MAX]; + termpaths[filecount] = 0; if ((tc = getenv("TERMCAP")) != 0) { if (is_pathname(tc)) /* interpret as a filename */ { - termpaths[0] = tc; - termpaths[filecount = 1] = 0; + ADD_TC(tc, 0); } else if (_nc_name_match(tc, tn, "|:")) /* treat as a capability file */ { @@ -970,13 +989,9 @@ int _nc_read_termcap_entry(const char *const tn, TERMTYPE *const tp) *cp = '\0'; else if (cp == tc || cp[-1] == '\0') { - if (filecount >= MAXPATHS - 1) - return(-1); - - termpaths[filecount++] = cp; + ADD_TC(cp, filecount); } } - termpaths[filecount] = 0; } } else /* normal case */ @@ -989,21 +1004,21 @@ int _nc_read_termcap_entry(const char *const tn, TERMTYPE *const tp) * Probably /etc/termcap is a symlink to /usr/share/misc/termcap. * Avoid reading the same file twice. */ - if (access("/etc/termcap", R_OK) == 0) - termpaths[filecount++] = "/etc/termcap"; - else if (access("/usr/share/misc/termcap", R_OK) == 0) - termpaths[filecount++] = "/usr/share/misc/termcap"; + if (_nc_access("/etc/termcap", F_OK) == 0) + ADD_TC("/etc/termcap", filecount); + else + ADD_TC("/usr/share/misc/termcap", filecount); + +#define PRIVATE_CAP "%s/.termcap" - if ((h = getenv("HOME")) != (char *)NULL) + if ((h = getenv("HOME")) != NULL + && (strlen(h) + sizeof(PRIVATE_CAP)) < PATH_MAX) { - /* user's .termcap, if any, should override it */ - (void) strncpy(envhome, h, PATH_MAX - 10); - envhome[PATH_MAX - 10] = '\0'; - (void) sprintf(pathbuf, "%s/.termcap", envhome); - termpaths[filecount++] = pathbuf; + /* user's .termcap, if any, should override it */ + (void) strcpy(envhome, h); + (void) sprintf(pathbuf, PRIVATE_CAP, envhome); + ADD_TC(pathbuf, filecount); } - - termpaths[filecount] = 0; } /* parse the sources */ @@ -1062,7 +1077,7 @@ int _nc_read_termcap_entry(const char *const tn, TERMTYPE *const tp) * we disconnected from the list by NULLing out * ep->tterm.str_table above). */ - memcpy(tp, &ep->tterm, sizeof(TERMTYPE)); + *tp = ep->tterm; ep->tterm.str_table = (char *)0; /* @@ -1095,3 +1110,7 @@ int _nc_read_termcap_entry(const char *const tn, TERMTYPE *const tp) _nc_free_entries(_nc_head); return(found); } +#else +extern void _nc_read_termcap(void); + void _nc_read_termcap(void) { } +#endif /* PURE_TERMINFO */ diff --git a/ncurses/tinfo/setbuf.c b/ncurses/tinfo/setbuf.c new file mode 100644 index 00000000..c0e73565 --- /dev/null +++ b/ncurses/tinfo/setbuf.c @@ -0,0 +1,144 @@ +/**************************************************************************** + * 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: Zeyd M. Ben-Halim 1992,1995 * + * and: Eric S. Raymond * + ****************************************************************************/ + + + +/* +** setbuf.c +** +** Support for set_term(), reset_shell_mode(), reset_prog_mode(). +** +*/ + +#include + +MODULE_ID("$Id: setbuf.c,v 1.5 1999/02/27 20:00:15 tom Exp $") + +/* + * If the output file descriptor is connected to a tty (the typical case) it + * will probably be line-buffered. Keith Bostic pointed out that we don't want + * this; it hoses people running over networks by forcing out a bunch of small + * packets instead of one big one, so screen updates on ptys look jerky. + * Restore block buffering to prevent this minor lossage. + * + * The buffer size is a compromise. Ideally we'd like a buffer that can hold + * the maximum possible update size (the whole screen plus cup commands to + * change lines as it's painted). On a 66-line xterm this can become + * excessive. So we min it with the amount of data we think we can get through + * two Ethernet packets (maximum packet size - 100 for TCP/IP overhead). + * + * Why two ethernet packets? It used to be one, on the theory that said + * packets define the maximum size of atomic update. But that's less than the + * 2000 chars on a 25 x 80 screen, and we don't want local updates to flicker + * either. Two packet lengths will handle up to a 35 x 80 screen. + * + * The magic '6' is the estimated length of the end-of-line cup sequence to go + * to the next line. It's generous. We used to mess with the buffering in + * init_mvcur() after cost computation, but that lost the sequences emitted by + * init_acs() in setupscreen(). + * + * "The setvbuf function may be used only after the stream pointed to by stream + * has been associated with an open file and before any other operation is + * performed on the stream." (ISO 7.9.5.6.) + * + * Grrrr... + * + * On a lighter note, many implementations do in fact allow an application to + * reset the buffering after it has been written to. We try to do this because + * otherwise we leave stdout in buffered mode after endwin() is called. (This + * also happens with SVr4 curses). + * + * There are pros/cons: + * + * con: + * There is no guarantee that we can reestablish buffering once we've + * dropped it. + * + * We _may_ lose data if the implementation does not coordinate this with + * fflush. + * + * pro: + * An implementation is more likely to refuse to change the buffering than + * to do it in one of the ways mentioned above. + * + * The alternative is to have the application try to change buffering + * itself, which is certainly no improvement. + * + * Just in case it does not work well on a particular system, the calls to + * change buffering are all via the macro NC_BUFFERED. Some implementations + * do indeed get confused by changing setbuf on/off, and will overrun the + * buffer. So we disable this by default (there may yet be a workaround). + */ +void _nc_set_buffer(FILE *ofp, bool buffered) +{ + /* optional optimization hack -- do before any output to ofp */ +#if HAVE_SETVBUF || HAVE_SETBUFFER + unsigned buf_len; + char *buf_ptr; + + if (getenv("NCURSES_NO_SETBUF") != 0) + return; + + fflush(ofp); + if ((SP->_buffered = buffered) != 0) { + buf_len = min(LINES * (COLS + 6), 2800); + if ((buf_ptr = SP->_setbuf) == 0) { + if ((buf_ptr = typeMalloc(char, buf_len)) == NULL) + return; + SP->_setbuf = buf_ptr; + /* Don't try to free this! */ + } +#if !USE_SETBUF_0 + else return; +#endif + } else { +#if !USE_SETBUF_0 + return; +#else + buf_len = 0; + buf_ptr = 0; +#endif + } + +#if HAVE_SETVBUF +#ifdef SETVBUF_REVERSED /* pre-svr3? */ + (void) setvbuf(ofp, buf_ptr, buf_len, buf_len ? _IOFBF : _IOLBF); +#else + (void) setvbuf(ofp, buf_ptr, buf_len ? _IOFBF : _IOLBF, buf_len); +#endif +#elif HAVE_SETBUFFER + (void) setbuffer(ofp, buf_ptr, (int)buf_len); +#endif + +#endif /* HAVE_SETVBUF || HAVE_SETBUFFER */ +} diff --git a/ncurses/write_entry.c b/ncurses/tinfo/write_entry.c similarity index 61% rename from ncurses/write_entry.c rename to ncurses/tinfo/write_entry.c index c0b24547..4829fa93 100644 --- a/ncurses/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -42,14 +42,19 @@ #include #include -#include #include #ifndef S_ISDIR #define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR) #endif -MODULE_ID("$Id: write_entry.c,v 1.22 1998/02/11 12:13:59 tom Exp $") +#if 0 +#define TRACE_OUT(p) DEBUG(2, p) +#else +#define TRACE_OUT(p) /*nothing*/ +#endif + +MODULE_ID("$Id: write_entry.c,v 1.47 1999/07/10 20:29:22 tom Exp $") static int total_written; @@ -57,7 +62,7 @@ static int write_object(FILE *, TERMTYPE *); static void write_file(char *filename, TERMTYPE *tp) { - FILE *fp = fopen(filename, "wb"); + FILE *fp = (_nc_access(filename, W_OK) == 0) ? fopen(filename, "wb") : 0; if (fp == 0) { perror(filename); _nc_syserr_abort("can't open %s/%s", _nc_tic_dir(0), filename); @@ -82,15 +87,20 @@ struct stat statbuf; char fullpath[PATH_MAX]; const char *destination = _nc_tic_dir(0); - if (path == destination || *path == '/') + if (path == destination || *path == '/') { + if (strlen(path) + 1 > sizeof(fullpath)) + return(-1); (void)strcpy(fullpath, path); - else + } else { + if (strlen(destination) + strlen(path) + 2 > sizeof(fullpath)) + return(-1); (void)sprintf(fullpath, "%s/%s", destination, path); + } if ((rc = stat(path, &statbuf)) < 0) { rc = mkdir(path, 0777); } else { - if (access(path, R_OK|W_OK|X_OK) < 0) { + if (_nc_access(path, R_OK|W_OK|X_OK) < 0) { rc = -1; /* permission denied */ } else if (!(S_ISDIR(statbuf.st_mode))) { rc = -1; /* not a directory */ @@ -103,6 +113,7 @@ void _nc_set_writedir(char *dir) /* set the write directory for compiled entries */ { const char *destination; + char actual[PATH_MAX]; if (dir != 0) (void) _nc_tic_dir(dir); @@ -112,15 +123,10 @@ void _nc_set_writedir(char *dir) destination = _nc_tic_dir(0); if (make_directory(destination) < 0) { - char *home; - - /* ncurses extension...fall back on user's private directory */ - if ((home = getenv("HOME")) != (char *)NULL) - { - char *temp = malloc(sizeof(PRIVATE_INFO) + strlen(home)); - (void) sprintf(temp, PRIVATE_INFO, home); - destination = temp; + char *home = _nc_home_terminfo(); + if (home != 0) { + destination = home; if (make_directory(destination) < 0) _nc_err_abort("%s: permission denied (errno %d)", destination, errno); @@ -131,8 +137,10 @@ void _nc_set_writedir(char *dir) * Note: because of this code, this logic should be exercised * *once only* per run. */ - if (chdir(_nc_tic_dir(destination)) < 0) + if (chdir(_nc_tic_dir(destination)) < 0 + || getcwd(actual, sizeof(actual)) == 0) _nc_err_abort("%s: not a directory", destination); + _nc_keep_tic_dir(strdup(actual)); } /* @@ -279,6 +287,10 @@ static time_t start_time; /* time at start of writes */ _nc_warning("terminal alias %s too long.", ptr); continue; } + if (strchr(ptr, '/') != 0) { + _nc_warning("cannot link alias %s.", ptr); + continue; + } check_writeable(ptr[0]); sprintf(linkname, "%c/%s", ptr[0], ptr); @@ -291,25 +303,45 @@ static time_t start_time; /* time at start of writes */ { _nc_warning("alias %s multiply defined.", ptr); } - else + else if (_nc_access(linkname, W_OK) == 0) #if HAVE_LINK { + int code; #if USE_SYMLINKS strcpy(symlinkname, "../"); - strcat(symlinkname, filename); + strncat(symlinkname, filename, sizeof(symlinkname) - 4); + symlinkname[sizeof(symlinkname) - 1] = '\0'; #endif /* USE_SYMLINKS */ #if HAVE_REMOVE - remove(linkname); + code = remove(linkname); #else - unlink(linkname); + code = unlink(linkname); #endif + if (code != 0 && errno == ENOENT) + code = 0; #if USE_SYMLINKS if (symlink(symlinkname, linkname) < 0) #else if (link(filename, linkname) < 0) #endif /* USE_SYMLINKS */ - _nc_syserr_abort("can't link %s to %s", filename, linkname); - DEBUG(1, ("Linked %s", linkname)); + { + /* + * If there wasn't anything there, and we cannot + * link to the target because it is the same as the + * target, then the source must be on a filesystem + * that uses caseless filenames, such as Win32, etc. + */ + if (code == 0 && errno == EEXIST) + _nc_warning("can't link %s to %s", filename, linkname); + else if (code == 0 && errno == EPERM) + write_file(linkname, tp); + else + _nc_syserr_abort("can't link %s to %s", filename, linkname); + } + else + { + DEBUG(1, ("Linked %s", linkname)); + } } #else /* just make copies */ write_file(linkname, tp); @@ -322,6 +354,46 @@ static time_t start_time; /* time at start of writes */ #define LO(x) ((x) % 256) #define LITTLE_ENDIAN(p, x) (p)[0] = LO(x), (p)[1] = HI(x) +#define WRITE_STRING(str) (fwrite(str, sizeof(char), strlen(str) + 1, fp) == strlen(str) + 1) + +static int compute_offsets(char **Strings, int strmax, short *offsets) +{ + size_t nextfree = 0; + int i; + + for (i = 0; i < strmax; i++) { + if (Strings[i] == ABSENT_STRING) { + offsets[i] = -1; + } else if (Strings[i] == CANCELLED_STRING) { + offsets[i] = -2; + } else { + offsets[i] = nextfree; + nextfree += strlen(Strings[i]) + 1; + TRACE_OUT(("put Strings[%d]=%s(%d)", i, _nc_visbuf(Strings[i]), nextfree)); + } + } + return nextfree; +} + +static void convert_shorts(unsigned char *buf, short *Numbers, int count) +{ + int i; + for (i = 0; i < count; i++) { + if (Numbers[i] == -1) { /* HI/LO won't work */ + buf[2*i] = buf[2*i + 1] = 0377; + } else if (Numbers[i] == -2) { /* HI/LO won't work */ + buf[2*i] = 0376; + buf[2*i + 1] = 0377; + } else { + LITTLE_ENDIAN(buf + 2*i, Numbers[i]); + TRACE_OUT(("put Numbers[%d]=%d", i, Numbers[i])); + } + } +} + +#define even_boundary(value) \ + ((value) % 2 != 0 && fwrite(&zero, sizeof(char), 1, fp) != 1) + static int write_object(FILE *fp, TERMTYPE *tp) { char *namelist; @@ -329,38 +401,35 @@ size_t namelen, boolmax, nummax, strmax; char zero = '\0'; size_t i; short nextfree; -short offsets[STRCOUNT]; +short offsets[MAX_ENTRY_SIZE/2]; unsigned char buf[MAX_ENTRY_SIZE]; namelist = tp->term_names; namelen = strlen(namelist) + 1; + /* + * BOOLWRITE, etc., are less than BOOLCOUNT because we store some + * values internally. + */ boolmax = 0; - for (i = 0; i < BOOLWRITE; i++) - if (tp->Booleans[i]) - boolmax = i+1; + for (i = 0; i < BOOLWRITE; i++) { + if (tp->Booleans[i]) + boolmax = i+1; + } nummax = 0; - for (i = 0; i < NUMWRITE; i++) - if (tp->Numbers[i] != ABSENT_NUMERIC) - nummax = i+1; + for (i = 0; i < NUMWRITE; i++) { + if (tp->Numbers[i] != ABSENT_NUMERIC) + nummax = i+1; + } strmax = 0; - for (i = 0; i < STRWRITE; i++) - if (tp->Strings[i] != ABSENT_STRING) - strmax = i+1; + for (i = 0; i < STRWRITE; i++) { + if (tp->Strings[i] != ABSENT_STRING) + strmax = i+1; + } - nextfree = 0; - for (i = 0; i < strmax; i++) - if (tp->Strings[i] == ABSENT_STRING) - offsets[i] = -1; - else if (tp->Strings[i] == CANCELLED_STRING) - offsets[i] = -2; - else - { - offsets[i] = nextfree; - nextfree += strlen(tp->Strings[i]) + 1; - } + nextfree = compute_offsets(tp->Strings, strmax, offsets); /* fill in the header */ LITTLE_ENDIAN(buf, MAGIC); @@ -371,60 +440,112 @@ unsigned char buf[MAX_ENTRY_SIZE]; LITTLE_ENDIAN(buf+10, nextfree); /* write out the header */ + TRACE_OUT(("Header of %s @%ld", namelist, ftell(fp))); if (fwrite(buf, 12, 1, fp) != 1 - || fwrite(namelist, sizeof(char), (size_t)namelen, fp) != namelen - || fwrite(tp->Booleans, sizeof(char), (size_t)boolmax, fp) != boolmax) - return(ERR); + || fwrite(namelist, sizeof(char), namelen, fp) != namelen + || fwrite(tp->Booleans, sizeof(char), boolmax, fp) != boolmax) + return(ERR); - /* the even-boundary padding byte */ - if ((namelen+boolmax) % 2 != 0 && fwrite(&zero, sizeof(char), 1, fp) != 1) - return(ERR); + if (even_boundary(namelen+boolmax)) + return(ERR); -#ifdef SHOWOFFSET - (void) fprintf(stderr, "Numerics begin at %04lx\n", ftell(fp)); -#endif /* SHOWOFFSET */ + TRACE_OUT(("Numerics begin at %04lx", ftell(fp))); /* the numerics */ - for (i = 0; i < nummax; i++) - { - if (tp->Numbers[i] == -1) /* HI/LO won't work */ - buf[2*i] = buf[2*i + 1] = 0377; - else - LITTLE_ENDIAN(buf + 2*i, tp->Numbers[i]); - } - if (fwrite(buf, 2, (size_t)nummax, fp) != nummax) - return(ERR); + convert_shorts(buf, tp->Numbers, nummax); + if (fwrite(buf, 2, nummax, fp) != nummax) + return(ERR); -#ifdef SHOWOFFSET - (void) fprintf(stderr, "String offets begin at %04lx\n", ftell(fp)); -#endif /* SHOWOFFSET */ + TRACE_OUT(("String offsets begin at %04lx", ftell(fp))); /* the string offsets */ - for (i = 0; i < strmax; i++) - if (offsets[i] == -1) /* HI/LO won't work */ - buf[2*i] = buf[2*i + 1] = 0377; - else if (offsets[i] == -2) /* HI/LO won't work */ - { - buf[2*i] = 0376; - buf[2*i + 1] = 0377; - } - else - LITTLE_ENDIAN(buf + 2*i, offsets[i]); - if (fwrite(buf, 2, (size_t)strmax, fp) != strmax) - return(ERR); + convert_shorts(buf, offsets, strmax); + if (fwrite(buf, 2, strmax, fp) != strmax) + return(ERR); -#ifdef SHOWOFFSET - (void) fprintf(stderr, "String table begins at %04lx\n", ftell(fp)); -#endif /* SHOWOFFSET */ + TRACE_OUT(("String table begins at %04lx", ftell(fp))); /* the strings */ for (i = 0; i < strmax; i++) - if (tp->Strings[i] != ABSENT_STRING && tp->Strings[i] != CANCELLED_STRING) - if (fwrite(tp->Strings[i], sizeof(char), strlen(tp->Strings[i]) + 1, fp) != strlen(tp->Strings[i]) + 1) + if (VALID_STRING(tp->Strings[i])) + if (!WRITE_STRING(tp->Strings[i])) + return(ERR); + +#if NCURSES_XNAMES + if (NUM_EXT_NAMES(tp)) { + unsigned extcnt = NUM_EXT_NAMES(tp); + + if (even_boundary(nextfree)) + return(ERR); + + nextfree = compute_offsets(tp->Strings + STRCOUNT, tp->ext_Strings, offsets); + TRACE_OUT(("after extended string capabilities, nextfree=%d", nextfree)); + nextfree += compute_offsets(tp->ext_Names, extcnt, offsets + tp->ext_Strings); + TRACE_OUT(("after extended capnames, nextfree=%d", nextfree)); + strmax = tp->ext_Strings + extcnt; + + /* + * Write the extended header + */ + LITTLE_ENDIAN(buf+0, tp->ext_Booleans); + LITTLE_ENDIAN(buf+2, tp->ext_Numbers); + LITTLE_ENDIAN(buf+4, tp->ext_Strings); + LITTLE_ENDIAN(buf+6, strmax); + LITTLE_ENDIAN(buf+8, nextfree); + TRACE_OUT(("WRITE extended-header @%ld", ftell(fp))); + if (fwrite(buf, 10, 1, fp) != 1) + return(ERR); + + TRACE_OUT(("WRITE %d booleans @%ld", tp->ext_Booleans, ftell(fp))); + if (tp->ext_Booleans + && fwrite(tp->Booleans + BOOLCOUNT, sizeof(char), tp->ext_Booleans, fp) != tp->ext_Booleans) + return(ERR); + + if (even_boundary(tp->ext_Booleans)) + return(ERR); + + TRACE_OUT(("WRITE %d numbers @%ld", tp->ext_Numbers, ftell(fp))); + if (tp->ext_Numbers) { + convert_shorts(buf, tp->Numbers + NUMCOUNT, tp->ext_Numbers); + if (fwrite(buf, 2, tp->ext_Numbers, fp) != tp->ext_Numbers) return(ERR); + } + + /* + * Convert the offsets for the ext_Strings and ext_Names tables, + * in that order. + */ + convert_shorts(buf, offsets, strmax); + TRACE_OUT(("WRITE offsets @%ld", ftell(fp))); + if (fwrite(buf, 2, strmax, fp) != strmax) + return(ERR); + + /* + * Write the string table after the offset tables so we do not + * have to do anything about alignment. + */ + for (i = 0; i < tp->ext_Strings; i++) { + if (VALID_STRING(tp->Strings[i+STRCOUNT])) { + TRACE_OUT(("WRITE ext_Strings[%d]=%s", i, _nc_visbuf(tp->Strings[i+STRCOUNT]))); + if (!WRITE_STRING(tp->Strings[i+STRCOUNT])) + return(ERR); + } + } + + /* + * Write the extended names + */ + for (i = 0; i < extcnt; i++) { + TRACE_OUT(("WRITE ext_Names[%d]=%s", i, tp->ext_Names[i])); + if (!WRITE_STRING(tp->ext_Names[i])) + return(ERR); + } + + } +#endif /* NCURSES_XNAMES */ total_written++; - return(OK); + return(OK); } /* diff --git a/ncurses/trace/README b/ncurses/trace/README new file mode 100644 index 00000000..a627a537 --- /dev/null +++ b/ncurses/trace/README @@ -0,0 +1,5 @@ +-- $Id: README,v 1.1 1998/11/08 00:11:01 tom Exp $ + +The files in this directory (trace) support both the terminfo and ncurses +libraries. Most of the functions are linked in only when the libraries +are compiled with TRACE defined. diff --git a/ncurses/lib_trace.c b/ncurses/trace/lib_trace.c similarity index 92% rename from ncurses/lib_trace.c rename to ncurses/trace/lib_trace.c index a9accd56..aa4b8871 100644 --- a/ncurses/lib_trace.c +++ b/ncurses/trace/lib_trace.c @@ -35,35 +35,37 @@ * lib_trace.c - Tracing/Debugging routines */ -#ifndef TRACE -#define TRACE /* turn on internal defs for this module */ -#endif - #include +#include -MODULE_ID("$Id: lib_trace.c,v 1.25 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.30 1998/10/03 23:41:42 tom Exp $") #include #if HAVE_FCNTL_H #include #endif -unsigned _nc_tracing = 0; +unsigned _nc_tracing = 0; /* always define this */ + +#ifdef TRACE const char *_nc_tputs_trace = ""; long _nc_outchars; -int _nc_optimize_enable = OPTIMIZE_ALL; static FILE * tracefp; /* default to writing to stderr */ +#endif -void trace(const unsigned int tracelevel) +void trace(const unsigned int tracelevel GCC_UNUSED) { +#ifdef TRACE static bool been_here = FALSE; +static char my_name[] = "trace"; _nc_tracing = tracelevel; if (! been_here && tracelevel) { been_here = TRUE; - if ((tracefp = fopen("trace", "w")) == 0) { + if (_nc_access(my_name, W_OK) < 0 + || (tracefp = fopen(my_name, "w")) == 0) { perror("curses: Can't open 'trace' file: "); exit(EXIT_FAILURE); } @@ -79,6 +81,7 @@ static bool been_here = FALSE; _tracef("TRACING NCURSES version %s (%d)", NCURSES_VERSION, NCURSES_VERSION_PATCH); } +#endif } const char *_nc_visbuf2(int bufnum, const char *buf) @@ -90,6 +93,8 @@ int c; if (buf == 0) return("(null)"); + if (buf == CANCELLED_STRING) + return("(cancelled)"); tp = vbuf = _nc_trace_buf(bufnum, (strlen(buf) * 4) + 5); *tp++ = '"'; @@ -123,6 +128,7 @@ const char *_nc_visbuf(const char *buf) return _nc_visbuf2(0, buf); } +#ifdef TRACE void _tracef(const char *fmt, ...) { @@ -191,3 +197,4 @@ WINDOW *_nc_retrace_win(WINDOW *code) T((T_RETURN("%p"), code)); return code; } +#endif /* TRACE */ diff --git a/ncurses/lib_traceatr.c b/ncurses/trace/lib_traceatr.c similarity index 97% rename from ncurses/lib_traceatr.c rename to ncurses/trace/lib_traceatr.c index c6023b2b..d9e00751 100644 --- a/ncurses/lib_traceatr.c +++ b/ncurses/trace/lib_traceatr.c @@ -37,17 +37,14 @@ * lib_traceatr.c - Tracing/Debugging routines (attributes) */ -#ifndef TRACE -#define TRACE /* turn on internal defs for this module */ -#endif - #include #include /* acs_chars */ -MODULE_ID("$Id: lib_traceatr.c,v 1.25 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: lib_traceatr.c,v 1.28 1998/03/21 18:39:36 tom Exp $") #define COLOR_OF(c) (c < 0 || c > 7 ? "default" : colors[c].name) +#ifdef TRACE char *_traceattr2(int bufnum, attr_t newmode) { char *buf = _nc_trace_buf(bufnum, BUFSIZ); @@ -215,3 +212,7 @@ char *_tracechtype(chtype ch) { return _tracechtype2(0, ch); } +#else +extern void _nc_lib_traceatr(void); + void _nc_lib_traceatr(void) { } +#endif /* TRACE */ diff --git a/ncurses/lib_raw.c b/ncurses/trace/lib_tracebits.c similarity index 64% rename from ncurses/lib_raw.c rename to ncurses/trace/lib_tracebits.c index e2573c72..a92e00a8 100644 --- a/ncurses/lib_raw.c +++ b/ncurses/trace/lib_tracebits.c @@ -31,25 +31,10 @@ * and: Eric S. Raymond * ****************************************************************************/ - -/* - * raw.c - * - * Routines: - * raw() - * cbreak() - * noraw() - * nocbreak() - * qiflush() - * noqiflush() - * intrflush() - * - */ - #include #include /* cur_term */ -MODULE_ID("$Id: lib_raw.c,v 1.25 1998/02/11 12:13:59 tom Exp $") +MODULE_ID("$Id: lib_tracebits.c,v 1.3 1999/08/21 21:43:48 tom Exp $") #if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -72,8 +57,6 @@ MODULE_ID("$Id: lib_raw.c,v 1.25 1998/02/11 12:13:59 tom Exp $") #define IEXTEN 0 #endif -#define COOKED_INPUT (IXON|BRKINT|PARMRK) - #ifdef TRACE typedef struct {unsigned int val; const char *name;} BITNAMES; @@ -96,7 +79,7 @@ static void lookup_bits(char *buf, const BITNAMES *table, const char *label, uns (void) strcat(buf,"} "); } -char *_tracebits(void) +char *_nc_tracebits(void) /* describe the state of the terminal control bits exactly */ { char *buf; @@ -173,10 +156,18 @@ lflags[] = #if defined(CS5) && defined(CS8) switch (cur_term->Nttyb.c_cflag & CSIZE) { +#if defined(CS5) && (CS5 != 0) case CS5: strcat(buf, "CS5 "); break; +#endif +#if defined(CS6) && (CS6 != 0) case CS6: strcat(buf, "CS6 "); break; +#endif +#if defined(CS7) && (CS7 != 0) case CS7: strcat(buf, "CS7 "); break; +#endif +#if defined(CS8) && (CS8 != 0) case CS8: strcat(buf, "CS8 "); break; +#endif default: strcat(buf, "CSIZE? "); break; } #endif @@ -229,170 +220,6 @@ cflags[] = #endif return(buf); } - -#define BEFORE(N) if (_nc_tracing&TRACE_BITS) _tracef("%s before bits: %s", N, _tracebits()) -#define AFTER(N) if (_nc_tracing&TRACE_BITS) _tracef("%s after bits: %s", N, _tracebits()) #else -#define BEFORE(s) -#define AFTER(s) +char *_nc_tracebits(void) { static char tmp[] = ""; return tmp; } #endif /* TRACE */ - -int raw(void) -{ - T((T_CALLED("raw()"))); - if (SP != 0 && cur_term != 0) { - - SP->_raw = TRUE; - SP->_cbreak = TRUE; - -#ifdef __EMX__ - setmode(SP->_ifd, O_BINARY); -#endif - -#ifdef TERMIOS - BEFORE("raw"); - cur_term->Nttyb.c_lflag &= ~(ICANON|ISIG); - cur_term->Nttyb.c_iflag &= ~(COOKED_INPUT); - cur_term->Nttyb.c_cc[VMIN] = 1; - cur_term->Nttyb.c_cc[VTIME] = 0; - AFTER("raw"); -#else - cur_term->Nttyb.sg_flags |= RAW; -#endif - returnCode(_nc_set_curterm(&cur_term->Nttyb)); - } - returnCode(ERR); -} - -int cbreak(void) -{ - T((T_CALLED("cbreak()"))); - - SP->_cbreak = TRUE; - -#ifdef __EMX__ - setmode(SP->_ifd, O_BINARY); -#endif - -#ifdef TERMIOS - BEFORE("cbreak"); - cur_term->Nttyb.c_lflag &= ~ICANON; - cur_term->Nttyb.c_iflag &= ~ICRNL; - cur_term->Nttyb.c_lflag |= ISIG; - cur_term->Nttyb.c_cc[VMIN] = 1; - cur_term->Nttyb.c_cc[VTIME] = 0; - AFTER("cbreak"); -#else - cur_term->Nttyb.sg_flags |= CBREAK; -#endif - returnCode(_nc_set_curterm( &cur_term->Nttyb)); -} - -int qiflush(void) -{ - T((T_CALLED("qiflush()"))); - - /* - * Note: this implementation may be wrong. See the comment under - * intrflush(). - */ - -#ifdef TERMIOS - BEFORE("qiflush"); - cur_term->Nttyb.c_lflag &= ~(NOFLSH); - AFTER("qiflush"); - returnCode(_nc_set_curterm( &cur_term->Nttyb)); -#else - returnCode(ERR); -#endif -} - - -int noraw(void) -{ - T((T_CALLED("noraw()"))); - - SP->_raw = FALSE; - SP->_cbreak = FALSE; - -#ifdef __EMX__ - setmode(SP->_ifd, O_TEXT); -#endif - -#ifdef TERMIOS - BEFORE("noraw"); - cur_term->Nttyb.c_lflag |= ISIG|ICANON; - cur_term->Nttyb.c_iflag |= COOKED_INPUT; - AFTER("noraw"); -#else - cur_term->Nttyb.sg_flags &= ~(RAW|CBREAK); -#endif - returnCode(_nc_set_curterm( &cur_term->Nttyb)); -} - - -int nocbreak(void) -{ - T((T_CALLED("nocbreak()"))); - - SP->_cbreak = FALSE; - -#ifdef __EMX__ - setmode(SP->_ifd, O_TEXT); -#endif - -#ifdef TERMIOS - BEFORE("nocbreak"); - cur_term->Nttyb.c_lflag |= ICANON; - cur_term->Nttyb.c_iflag |= ICRNL; - AFTER("nocbreak"); -#else - cur_term->Nttyb.sg_flags &= ~CBREAK; -#endif - returnCode(_nc_set_curterm( &cur_term->Nttyb)); -} - -int noqiflush(void) -{ - T((T_CALLED("noqiflush()"))); - - /* - * Note: this implementation may be wrong. See the comment under - * intrflush(). - */ - -#ifdef TERMIOS - BEFORE("noqiflush"); - cur_term->Nttyb.c_lflag |= NOFLSH; - AFTER("noqiflush"); - returnCode(_nc_set_curterm( &cur_term->Nttyb)); -#else - returnCode(ERR); -#endif -} - -int intrflush(WINDOW *win GCC_UNUSED, bool flag) -{ - T((T_CALLED("intrflush(%d)"), flag)); - - /* - * This call does the same thing as the qiflush()/noqiflush() - * pair. We know for certain that SVr3 intrflush() tweaks the - * NOFLSH bit; on the other hand, the match (in the SVr4 man - * pages) between the language describing NOFLSH in termio(7) - * and the language describing qiflush()/noqiflush() in - * curs_inopts(3x) is too exact to be coincidence. - */ - -#ifdef TERMIOS - BEFORE("intrflush"); - if (flag) - cur_term->Nttyb.c_lflag &= ~(NOFLSH); - else - cur_term->Nttyb.c_lflag |= (NOFLSH); - AFTER("intrflush"); - returnCode(_nc_set_curterm( &cur_term->Nttyb)); -#else - returnCode(ERR); -#endif -} diff --git a/ncurses/lib_tracechr.c b/ncurses/trace/lib_tracechr.c similarity index 97% rename from ncurses/lib_tracechr.c rename to ncurses/trace/lib_tracechr.c index 3e726547..e97e6793 100644 --- a/ncurses/lib_tracechr.c +++ b/ncurses/trace/lib_tracechr.c @@ -45,6 +45,7 @@ #include +#ifdef TRACE char *_tracechar(const unsigned char ch) { static char crep[20]; @@ -62,3 +63,7 @@ char *_tracechar(const unsigned char ch) (void) sprintf(crep, "0x%02x", (unsigned)ch); return(crep); } +#else +extern void _nc_lib_tracechr(void); + void _nc_lib_tracechr(void) { } +#endif diff --git a/ncurses/lib_tracedmp.c b/ncurses/trace/lib_tracedmp.c similarity index 96% rename from ncurses/lib_tracedmp.c rename to ncurses/trace/lib_tracedmp.c index be1cd7cd..a67a37ef 100644 --- a/ncurses/lib_tracedmp.c +++ b/ncurses/trace/lib_tracedmp.c @@ -35,14 +35,11 @@ * lib_tracedmp.c - Tracing/Debugging routines */ -#ifndef TRACE -#define TRACE /* turn on internal defs for this module */ -#endif - #include -MODULE_ID("$Id: lib_tracedmp.c,v 1.11 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: lib_tracedmp.c,v 1.13 1998/03/21 18:39:44 tom Exp $") +#ifdef TRACE void _tracedump(const char *name, WINDOW *win) { int i, j, n, width; @@ -125,3 +122,7 @@ void _tracedump(const char *name, WINDOW *win) } } } +#else +extern void _nc_lib_tracedmp(void); + void _nc_lib_tracedmp(void) { } +#endif /* TRACE */ diff --git a/ncurses/lib_tracemse.c b/ncurses/trace/lib_tracemse.c similarity index 95% rename from ncurses/lib_tracemse.c rename to ncurses/trace/lib_tracemse.c index 9a64dfbb..fbdd2c00 100644 --- a/ncurses/lib_tracemse.c +++ b/ncurses/trace/lib_tracemse.c @@ -37,13 +37,11 @@ * lib_tracemse.c - Tracing/Debugging routines (mouse events) */ -#ifndef TRACE -#define TRACE /* turn on internal defs for this module */ -#endif - #include -MODULE_ID("$Id: lib_tracemse.c,v 1.5 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: lib_tracemse.c,v 1.6 1998/11/16 14:28:17 Alexander.V.Lukyanov Exp $") + +#ifdef TRACE char *_tracemouse(MEVENT const *ep) { @@ -90,5 +88,8 @@ char *_tracemouse(MEVENT const *ep) return(buf); } - - +#else /* !TRACE */ +/* don't make empty module */ +void _nc_lib_tracemouse(void); +void _nc_lib_tracemouse(void) {} +#endif diff --git a/ncurses/trace_buf.c b/ncurses/trace/trace_buf.c similarity index 85% rename from ncurses/trace_buf.c rename to ncurses/trace/trace_buf.c index 688ee3ee..48f93d43 100644 --- a/ncurses/trace_buf.c +++ b/ncurses/trace/trace_buf.c @@ -35,14 +35,16 @@ #include -MODULE_ID("$Id: trace_buf.c,v 1.3 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: trace_buf.c,v 1.7 1999/02/27 19:50:58 tom Exp $") + +typedef struct { + char *text; + size_t size; +} LIST; char * _nc_trace_buf(int bufnum, size_t want) { - static struct { - char *text; - size_t size; - } *list; + static LIST *list; static size_t have; #if NO_LEAKS @@ -59,21 +61,20 @@ char * _nc_trace_buf(int bufnum, size_t want) if ((size_t)(bufnum+1) > have) { size_t need = (bufnum + 1) * 2; - size_t used = sizeof(*list) * need; - list = (list == 0) ? malloc(used) : realloc(list, used); + if ((list = typeRealloc(LIST, need, list)) == 0) + return(0); while (need > have) list[have++].text = 0; } - if (list[bufnum].text == 0) + if (list[bufnum].text == 0 + || want > list[bufnum].size) { - list[bufnum].text = malloc(want); - list[bufnum].size = want; - } - else if (want > list[bufnum].size) { - list[bufnum].text = realloc(list[bufnum].text, want); - list[bufnum].size = want; + if ((list[bufnum].text = typeRealloc(char, want, list[bufnum].text)) != 0) + list[bufnum].size = want; } - *(list[bufnum].text) = '\0'; + + if (list[bufnum].text != 0) + *(list[bufnum].text) = '\0'; return list[bufnum].text; } diff --git a/ncurses/trace/trace_tries.c b/ncurses/trace/trace_tries.c new file mode 100644 index 00000000..abd5db47 --- /dev/null +++ b/ncurses/trace/trace_tries.c @@ -0,0 +1,74 @@ +/**************************************************************************** + * Copyright (c) 1999 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1999 * + ****************************************************************************/ +/* + * trace_tries.c - Tracing/Debugging buffers (keycode tries-trees) + */ + +#include + +MODULE_ID("$Id: trace_tries.c,v 1.6 1999/03/06 22:51:07 tom Exp $") + +#ifdef TRACE +static unsigned char *buffer; +static unsigned len; + +static void recur_tries(struct tries *tree, unsigned level) +{ + if (level > len) + buffer = (unsigned char *)realloc(buffer, len = (level + 1) * 4); + + while (tree != 0) { + if ((buffer[level] = tree->ch) == 0) + buffer[level] = 128; + buffer[level+1] = 0; + if (tree->value != 0) { + _tracef("%5d: %s (%s)", tree->value, _nc_visbuf((char *)buffer), keyname(tree->value)); + } + if (tree->child) + recur_tries(tree->child, level+1); + tree = tree->sibling; + } +} + +void _nc_trace_tries(struct tries *tree) +{ + buffer = typeMalloc(unsigned char, len = 80); + _tracef("BEGIN tries %p", tree); + recur_tries(tree, 0); + _tracef(". . . tries %p", tree); + free(buffer); +} +#else +void _nc_trace_tries(struct tries *tree GCC_UNUSED) +{ +} +#endif diff --git a/ncurses/trace/trace_xnames.c b/ncurses/trace/trace_xnames.c new file mode 100644 index 00000000..6287fc85 --- /dev/null +++ b/ncurses/trace/trace_xnames.c @@ -0,0 +1,74 @@ +/**************************************************************************** + * Copyright (c) 1999 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1999 * + ****************************************************************************/ +/* + * trace_xnames.c - Tracing/Debugging buffers (TERMTYPE extended names) + */ + +#include +#include + +MODULE_ID("$Id: trace_xnames.c,v 1.3 1999/03/02 01:20:38 tom Exp $") + +void _nc_trace_xnames(TERMTYPE *tp GCC_UNUSED) +{ +#ifdef TRACE +#if NCURSES_XNAMES + int limit = tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings; + int n, m; + if (limit) { + int begin_num = tp->ext_Booleans; + int begin_str = tp->ext_Booleans + tp->ext_Numbers; + + _tracef("extended names (%s) %d = %d+%d+%d of %d+%d+%d", + tp->term_names, + limit, + tp->ext_Booleans, tp->ext_Numbers, tp->ext_Strings, + tp->num_Booleans, tp->num_Numbers, tp->num_Strings); + for (n = 0; n < limit; n++) { + if ((m = n - begin_str) >= 0) { + _tracef("[%d] %s = %s", n, + tp->ext_Names[n], + _nc_visbuf(tp->Strings[tp->num_Strings + m - tp->ext_Strings])); + } else if ((m = n - begin_num) >= 0) { + _tracef("[%d] %s = %d (num)", n, + tp->ext_Names[n], + tp->Numbers[tp->num_Numbers + m - tp->ext_Numbers]); + } else { + _tracef("[%d] %s = %d (bool)", n, + tp->ext_Names[n], + tp->Booleans[tp->num_Booleans + n - tp->ext_Booleans]); + } + } + } +#endif +#endif +} diff --git a/ncurses/MKexpanded.sh b/ncurses/tty/MKexpanded.sh similarity index 95% rename from ncurses/MKexpanded.sh rename to ncurses/tty/MKexpanded.sh index c0fca5f2..b008becc 100755 --- a/ncurses/MKexpanded.sh +++ b/ncurses/tty/MKexpanded.sh @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey 1997 # -# $Id: MKexpanded.sh,v 1.6 1998/02/11 12:13:54 tom Exp $ +# $Id: MKexpanded.sh,v 1.7 1998/11/11 20:15:39 Alexander.V.Lukyanov Exp $ # # Script to generate 'expanded.c', a dummy source that contains functions # corresponding to complex macros used in this library. By making functions, @@ -50,7 +50,7 @@ fi TMP=gen$$.c trap "rm -f $TMP" 0 1 2 5 15 -cat >expanded.c < #include @@ -94,9 +94,9 @@ void _nc_UpdateAttrs(chtype c) } EOF -$preprocessor $TMP 2>/dev/null | sed -e '1,/^IGNORE$/d' >>expanded.c +$preprocessor $TMP 2>/dev/null | sed -e '1,/^IGNORE$/d' -cat >>expanded.c < -MODULE_ID("$Id: hardscroll.c,v 1.29 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: hardscroll.c,v 1.33 1999/02/27 20:01:29 tom Exp $") #if defined(SCROLLDEBUG) || defined(HASHDEBUG) + +# undef screen_lines +# define screen_lines MAXLINES int oldnums[MAXLINES]; -#define OLDNUM(n) oldnums[n] -#undef T -#define T(x) (void) printf x ; (void) putchar('\n'); -#else -#include -#define OLDNUM(n) newscr->_line[n].oldindex -#ifndef _NEWINDEX -#define _NEWINDEX -1 -#endif /* _NEWINDEX */ +# define OLDNUM(n) oldnums[n] +# define _tracef printf +# undef TR +# define TR(n, a) if (_nc_tracing & (n)) { _tracef a ; putchar('\n'); } + +#else /* no debug */ + +/* OLDNUM(n) indicates which line will be shifted to the position n. + if OLDNUM(n) == _NEWINDEX, then the line n in new, not shifted from + somewhere. */ +# if USE_HASHMAP +int *_nc_oldnums = 0; +static int oldnums_allocated = 0; +# define oldnums _nc_oldnums +# define OLDNUM(n) oldnums[n] +# else /* !USE_HASHMAP */ +# define OLDNUM(n) newscr->_line[n].oldindex +# endif /* !USE_HASHMAP */ + #endif /* defined(SCROLLDEBUG) || defined(HASHDEBUG) */ @@ -170,6 +183,22 @@ void _nc_scroll_optimize(void) TR(TRACE_ICALLS, ("_nc_scroll_optimize() begins")); +#if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) +#if USE_HASHMAP + /* get enough storage */ + if (oldnums_allocated < screen_lines) + { + int *new_oldnums = typeRealloc(int, screen_lines, oldnums); + if (!new_oldnums) + return; + oldnums = new_oldnums; + oldnums_allocated = screen_lines; + } + /* calculate the indices */ + _nc_hash_map(); +#endif +#endif /* !defined(SCROLLDEBUG) && !defined(HASHDEBUG) */ + #ifdef TRACE if (_nc_tracing & (TRACE_UPDATE | TRACE_MOVE)) _nc_linedump(); @@ -182,10 +211,10 @@ void _nc_scroll_optimize(void) i++; if (i >= screen_lines) break; - + shift = OLDNUM(i) - i; /* shift > 0 */ start = i; - + i++; while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) i++; @@ -208,10 +237,10 @@ void _nc_scroll_optimize(void) i--; if (i < 0) break; - + shift = OLDNUM(i) - i; /* shift < 0 */ end = i; - + i--; while (i >= 0 && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) i--; @@ -228,7 +257,7 @@ void _nc_scroll_optimize(void) } } -#if defined(TRACE) || defined(SCROLLDEBUG) +#if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) void _nc_linedump(void) /* dump the state of the real and virtual oldnum fields */ { @@ -239,7 +268,7 @@ void _nc_linedump(void) size_t want = (screen_lines + 1) * 4; if (have < want) - buf = malloc(have = want); + buf = typeMalloc(char, have = want); (void) strcpy(buf, "virt"); for (n = 0; n < screen_lines; n++) diff --git a/ncurses/hashmap.c b/ncurses/tty/hashmap.c similarity index 78% rename from ncurses/hashmap.c rename to ncurses/tty/hashmap.c index 7a929f89..f6a58bc6 100644 --- a/ncurses/hashmap.c +++ b/ncurses/tty/hashmap.c @@ -63,34 +63,42 @@ hashmap: hashmap.c AUTHOR Eric S. Raymond , May 1996 + Bug fixes and improvements by Alexander V. Lukyanov , 1997 *****************************************************************************/ #include +#include /* for back_color_erase */ -MODULE_ID("$Id: hashmap.c,v 1.24 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: hashmap.c,v 1.33 1999/03/18 02:09:45 Alexander.V.Lukyanov Exp $") #ifdef HASHDEBUG -#define TEXTWIDTH 1 + +# define _tracef printf +# undef TR +# define TR(n, a) if (_nc_tracing & (n)) { _tracef a ; putchar('\n'); } +# undef screen_lines +# define screen_lines MAXLINES +# define TEXTWIDTH 1 int oldnums[MAXLINES], reallines[MAXLINES]; static chtype oldtext[MAXLINES][TEXTWIDTH], newtext[MAXLINES][TEXTWIDTH]; -#define OLDNUM(n) oldnums[n] -#define REAL(m) reallines[m] -#define OLDTEXT(n) oldtext[n] -#define NEWTEXT(m) newtext[m] -#undef T -#define T(x) (void) printf x ; (void) putchar('\n'); -#else -#include -#define OLDNUM(n) newscr->_line[n].oldindex -#define REAL(m) curscr->_line[m].oldindex -#define OLDTEXT(n) curscr->_line[n].text -#define NEWTEXT(m) newscr->_line[m].text -#define TEXTWIDTH (curscr->_maxx+1) -#ifndef _NEWINDEX -#define _NEWINDEX -1 -#endif /* _NEWINDEX */ -#endif /* HASHDEBUG */ +# define OLDNUM(n) oldnums[n] +# define OLDTEXT(n) oldtext[n] +# define NEWTEXT(m) newtext[m] +# define PENDING(n) 1 + +#else /* !HASHDEBUG */ + +# define OLDNUM(n) _nc_oldnums[n] +# define OLDTEXT(n) curscr->_line[n].text +# define NEWTEXT(m) newscr->_line[m].text +# define TEXTWIDTH (curscr->_maxx+1) +# define PENDING(n) (newscr->_line[n].firstchar != _NOCHANGE) + +#endif /* !HASHDEBUG */ + +#define oldhash (SP->oldhash) +#define newhash (SP->newhash) static inline unsigned long hash(chtype *text) { @@ -100,7 +108,7 @@ static inline unsigned long hash(chtype *text) for (i = TEXTWIDTH; i>0; i--) { ch = *text++; - result += (result<<5) + ch + (ch>>16); + result += (result<<5) + ch; } return result; } @@ -112,7 +120,7 @@ static int update_cost(chtype *from,chtype *to) int i; for (i=TEXTWIDTH; i>0; i--) - if (*from++ != *to++) + if (*from++ != *to++) cost++; return cost; @@ -121,10 +129,13 @@ static int update_cost_from_blank(chtype *to) { int cost=0; int i; + chtype blank = BLANK; + + if (back_color_erase) + blank |= (stdscr->_bkgd & A_COLOR); - /* FIXME: ClrBlank should be used */ for (i=TEXTWIDTH; i>0; i--) - if (BLANK != *to++) + if (blank != *to++) cost++; return cost; @@ -145,7 +156,7 @@ static inline bool cost_effective(const int from, const int to, const bool blank if (new_from == _NEWINDEX) new_from = from; - /* + /* * On the left side of >= is the cost before moving; * on the right side -- cost after moving. */ @@ -167,9 +178,7 @@ typedef struct sym; static sym *hashtab=0; -static int lines_alloc=0; -static long *oldhash=0; -static long *newhash=0; +static int lines_alloc=0; static void grow_hunks(void) { @@ -193,7 +202,7 @@ static void grow_hunks(void) { start = i; shift = OLDNUM(i) - i; - + /* get forward limit */ i = start+1; while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) @@ -231,7 +240,7 @@ static void grow_hunks(void) } i--; } - + i = end; /* grow forward */ if (shift > 0) @@ -255,7 +264,7 @@ static void grow_hunks(void) } i++; } - + back_ref_limit = back_limit = i; if (shift > 0) back_ref_limit += shift; @@ -273,7 +282,7 @@ void _nc_hash_map(void) { if (hashtab) free (hashtab); - hashtab = malloc (sizeof(*hashtab)*(screen_lines+1)*2); + hashtab = typeMalloc(sym, (screen_lines+1)*2); if (!hashtab) { if (oldhash) @@ -281,21 +290,43 @@ void _nc_hash_map(void) lines_alloc = 0; return; } - - if (oldhash) - free (oldhash); - oldhash = malloc (sizeof(*oldhash)*screen_lines*2); - if (!oldhash) + lines_alloc = screen_lines; + } + + if (oldhash && newhash) + { + /* re-hash only changed lines */ + for (i = 0; i < screen_lines; i++) + { + if (PENDING(i)) + newhash[i] = hash(NEWTEXT(i)); + } + } + else + { + /* re-hash all */ + if (oldhash == 0) + oldhash = typeCalloc (unsigned long, screen_lines); + if (newhash == 0) + newhash = typeCalloc (unsigned long, screen_lines); + if (!oldhash || !newhash) + return; /* malloc failure */ + for (i = 0; i < screen_lines; i++) { - if (hashtab) - FreeAndNull(hashtab); - lines_alloc = 0; - return; + newhash[i] = hash(NEWTEXT(i)); + oldhash[i] = hash(OLDTEXT(i)); } - - lines_alloc = screen_lines; } - newhash = oldhash + screen_lines; /* two arrays in the same memory block */ + +#ifdef HASH_VERIFY + for (i = 0; i < screen_lines; i++) + { + if(newhash[i] != hash(NEWTEXT(i))) + fprintf(stderr,"error in newhash[%d]\n",i); + if(oldhash[i] != hash(OLDTEXT(i))) + fprintf(stderr,"error in oldhash[%d]\n",i); + } +#endif /* * Set up and count line-hash values. @@ -303,34 +334,32 @@ void _nc_hash_map(void) memset(hashtab, '\0', sizeof(*hashtab)*(screen_lines+1)*2); for (i = 0; i < screen_lines; i++) { - unsigned long hashval = hash(OLDTEXT(i)); + unsigned long hashval = oldhash[i]; for (sp = hashtab; sp->hashval; sp++) if (sp->hashval == hashval) break; sp->hashval = hashval; /* in case this is a new entry */ - oldhash[i] = hashval; sp->oldcount++; sp->oldindex = i; } for (i = 0; i < screen_lines; i++) { - unsigned long hashval = hash(NEWTEXT(i)); + unsigned long hashval = newhash[i]; for (sp = hashtab; sp->hashval; sp++) if (sp->hashval == hashval) break; sp->hashval = hashval; /* in case this is a new entry */ - newhash[i] = hashval; sp->newcount++; sp->newindex = i; - - OLDNUM(i) = _NEWINDEX; + + OLDNUM(i) = _NEWINDEX; /* initialize old indices array */ } /* * Mark line pairs corresponding to unique hash pairs. - * + * * We don't mark lines with offset 0, because it can make fail * extending hunks by cost_effective. Otherwise, it does not * have any side effects. @@ -365,7 +394,7 @@ void _nc_hash_map(void) while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) i++; size = i - start; - if (size <= abs(shift)) + if (size < 3 || size+min(size/8,2) < abs(shift)) { while (start < i) { @@ -374,18 +403,65 @@ void _nc_hash_map(void) } } } - + /* After clearing invalid hunks, try grow the rest. */ grow_hunks(); #if NO_LEAKS FreeAndNull(hashtab); - FreeAndNull(oldhash); lines_alloc = 0; #endif } +void _nc_make_oldhash(int i) +{ + if (oldhash) + oldhash[i] = hash(OLDTEXT(i)); +} + +void _nc_scroll_oldhash(int n, int top, int bot) +{ + int size; + int i; + + if (!oldhash) + return; + + size = sizeof(*oldhash) * (bot-top+1-abs(n)); + if (n > 0) + { + memmove (oldhash+top, oldhash+top+n, size); + for (i = bot; i > bot-n; i--) + oldhash[i] = hash(OLDTEXT(i)); + } + else + { + memmove (oldhash+top-n, oldhash+top, size); + for (i = top; i < top-n; i++) + oldhash[i] = hash(OLDTEXT(i)); + } +} + + #ifdef HASHDEBUG +static void +usage(void) +{ + static const char *table[] = { + "hashmap test-driver", + "", + "# comment", + "l get initial line number vector", + "n use following letters as text of new lines", + "o use following letters as text of old lines", + "d dump state of test arrays", + "h apply hash mapper and see scroll optimization", + "? this message" + }; + size_t n; + for (n = 0; n < sizeof(table)/sizeof(table[0]); n++) + fprintf(stderr, "%s\n", table[n]); +} int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) @@ -393,6 +469,7 @@ main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) char line[BUFSIZ], *st; int n; + SP = typeCalloc(SCREEN,1); for (n = 0; n < screen_lines; n++) { reallines[n] = n; @@ -400,6 +477,9 @@ main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) oldtext[n][0] = newtext[n][0] = '.'; } + if (isatty(fileno(stdin))) + usage(); + #ifdef TRACE _nc_tracing = TRACE_MOVE; #endif @@ -474,6 +554,9 @@ main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) _nc_scroll_optimize(); (void) fputs("Done.\n", stderr); break; + case '?': + usage(); + break; } } return EXIT_SUCCESS; diff --git a/ncurses/lib_mvcur.c b/ncurses/tty/lib_mvcur.c similarity index 94% rename from ncurses/lib_mvcur.c rename to ncurses/tty/lib_mvcur.c index 2e9948f9..955eb8c6 100644 --- a/ncurses/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -153,7 +153,7 @@ #include #include -MODULE_ID("$Id: lib_mvcur.c,v 1.50 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.60 1999/10/03 01:08:27 Alexander.V.Lukyanov Exp $") #define STRLEN(s) (s != 0) ? strlen(s) : 0 @@ -175,6 +175,24 @@ static float diff; static int normalized_cost(const char *const cap, int affcnt); +#if !HAVE_STRSTR +char * _nc_strstr(const char *haystack, const char *needle) +{ + size_t len1 = strlen(haystack); + size_t len2 = strlen(needle); + char *result = 0; + + while ((len1 != 0) && (len1-- >= len2)) { + if (!strncmp(haystack, needle, len2)) { + result = haystack; + break; + } + haystack++; + } + return result; +} +#endif + /**************************************************************************** * * Initialization/wrapup (including cost pre-computation) @@ -228,10 +246,10 @@ int _nc_msec_cost(const char *const cap, int affcnt) { if (isdigit(*cp)) number = number * 10 + (*cp - '0'); - else if (*cp == '.') - number += (*++cp - 10) / 10.0; else if (*cp == '*') number *= affcnt; + else if (*cp == '.' && (*++cp != '>') && isdigit(*cp)) + number += (*cp - '0') / 10.0; } cum_cost += number * 10; @@ -284,7 +302,7 @@ void _nc_mvcur_resume(void) */ reset_scroll_region(); SP->_cursrow = SP->_curscol = -1; - + /* restore cursor shape */ if (SP->_cursor != -1) { @@ -318,6 +336,13 @@ void _nc_mvcur_init(void) SP->_cud1_cost = CostOf(cursor_down, 0); SP->_cuu1_cost = CostOf(cursor_up, 0); + SP->_smir_cost = CostOf(enter_insert_mode, 0); + SP->_rmir_cost = CostOf(exit_insert_mode, 0); + SP->_ip_cost = 0; + if (insert_padding) { + SP->_ip_cost = CostOf(insert_padding, 0); + } + /* * Assumption: if the terminal has memory_relative addressing, the * initialization strings or smcup will set single-page mode so we @@ -379,6 +404,20 @@ void _nc_mvcur_init(void) SP->_cursor_home_length = STRLEN(cursor_home); SP->_cursor_to_ll_length = STRLEN(cursor_to_ll); + /* + * If save_cursor is used within enter_ca_mode, we should not use it for + * scrolling optimization, since the corresponding restore_cursor is not + * nested on the various terminals (vt100, xterm, etc.) which use this + * feature. + */ + if (save_cursor != 0 + && enter_ca_mode != 0 + && strstr(enter_ca_mode, save_cursor) != 0) { + T(("...suppressed sc/rc capability due to conflict with smcup/rmcup")); + save_cursor = 0; + restore_cursor = 0; + } + /* * A different, possibly better way to arrange this would be to set * SP->_endwin = TRUE at window initialization time and let this be @@ -567,6 +606,20 @@ relative_move(char *result, int from_y,int from_x,int to_y,int to_x, bool ovw) #endif /* USE_HARD_TABS */ #if defined(REAL_ATTR) && defined(WANT_CHAR) +#ifdef BSD_TPUTS + /* + * If we're allowing BSD-style padding in tputs, don't generate + * a string with a leading digit. Otherwise, that will be + * interpreted as a padding value rather than sent to the + * screen. + */ + if (ovw + && n > 0 + && vcost == 0 + && str[0] == '\0' + && isdigit(TextOf(WANT_CHAR(to_y, from_x)))) + ovw = FALSE; +#endif /* * If we have no attribute changes, overwrite is cheaper. * Note: must suppress this by passing in ovw = FALSE whenever @@ -597,7 +650,7 @@ relative_move(char *result, int from_y,int from_x,int to_y,int to_x, bool ovw) *sp++ = WANT_CHAR(to_y, from_x + i); *sp = '\0'; lhcost += n * SP->_char_padding; - } + } else #endif /* defined(REAL_ATTR) && defined(WANT_CHAR) */ { @@ -681,6 +734,7 @@ onscreen_mvcur(int yold,int xold,int ynew,int xnew, bool ovw) { char use[OPT_SIZE], *sp; int tactic = 0, newcost, usecost = INFINITY; + int t5_cr_cost; #if defined(MAIN) || defined(NCURSES_TEST) struct timeval before, after; @@ -764,13 +818,14 @@ onscreen_mvcur(int yold,int xold,int ynew,int xnew, bool ovw) * tactic #5: use left margin for wrap to right-hand side, * unless strange wrap behavior indicated by xenl might hose us. */ + t5_cr_cost = (xold>0 ? SP->_cr_cost : 0); if (auto_left_margin && !eat_newline_glitch && yold > 0 && cursor_left && ((newcost=relative_move(NULL, yold-1, screen_columns-1, ynew, xnew, ovw)) != INFINITY) - && SP->_cr_cost + SP->_cub1_cost + newcost + newcost < usecost) + && t5_cr_cost + SP->_cub1_cost + newcost < usecost) { tactic = 5; - usecost = SP->_cr_cost + SP->_cub1_cost + newcost; + usecost = t5_cr_cost + SP->_cub1_cost + newcost; } /* @@ -890,6 +945,10 @@ int mvcur(int yold, int xold, int ynew, int xnew) return(onscreen_mvcur(yold, xold, ynew, xnew, TRUE)); } +#if defined(TRACE) || defined(NCURSES_TEST) +int _nc_optimize_enable = OPTIMIZE_ALL; +#endif + #if defined(MAIN) || defined(NCURSES_TEST) /**************************************************************************** * @@ -950,17 +1009,7 @@ int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) baudrate(); _nc_mvcur_init(); -#if HAVE_SETVBUF || HAVE_SETBUFFER - /* - * Undo the effects of our optimization hack, otherwise our interactive - * prompts don't flush properly. - */ -#if HAVE_SETVBUF - (void) setvbuf(SP->_ofp, malloc(BUFSIZ), _IOLBF, BUFSIZ); -#elif HAVE_SETBUFFER - (void) setbuffer(SP->_ofp, malloc(BUFSIZ), BUFSIZ); -#endif -#endif /* HAVE_SETVBUF || HAVE_SETBUFFER */ + NC_BUFFERED(FALSE); (void) puts("The mvcur tester. Type ? for help"); @@ -1057,8 +1106,8 @@ int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) } else if (buf[0] == 'i') { - dump_init((char *)NULL, F_TERMINFO, S_TERMINFO, 70, 0); - dump_entry(&cur_term->type, 0, 0); + dump_init((char *)NULL, F_TERMINFO, S_TERMINFO, 70, 0, FALSE); + dump_entry(&cur_term->type, FALSE, TRUE, 0); putchar('\n'); } else if (buf[0] == 'o') diff --git a/ncurses/lib_tstp.c b/ncurses/tty/lib_tstp.c similarity index 85% rename from ncurses/lib_tstp.c rename to ncurses/tty/lib_tstp.c index 0fb8b848..6fb912cf 100644 --- a/ncurses/lib_tstp.c +++ b/ncurses/tty/lib_tstp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -48,7 +48,13 @@ #define _POSIX_SOURCE #endif -MODULE_ID("$Id: lib_tstp.c,v 1.15 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$Id: lib_tstp.c,v 1.20 1999/10/22 23:11:09 tom Exp $") + +#if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) +#define USE_SIGTSTP 1 +#else +#define USE_SIGTSTP 0 +#endif /* * Note: This code is fragile! Its problem is that different OSs @@ -93,18 +99,32 @@ MODULE_ID("$Id: lib_tstp.c,v 1.15 1998/02/11 12:13:57 tom Exp $") * the future. If nothing else, it's simpler... */ -#ifdef SIGTSTP +#if USE_SIGTSTP static void tstp(int dummy GCC_UNUSED) { sigset_t mask, omask; sigaction_t act, oact; +#ifdef SIGTTOU + int sigttou_blocked; +#endif + T(("tstp() called")); /* * The user may have changed the prog_mode tty bits, so save them. + * + * But first try to detect whether we still are in the foreground + * process group - if not, an interactive shell may already have + * taken ownership of the tty and modified the settings when our + * parent was stopped before us, and we would likely pick up the + * settings already modified by the shell. */ - def_prog_mode(); + if (SP != 0 && !SP->_endwin) /* don't do this if we're not in curses */ +#if HAVE_TCGETPGRP + if (tcgetpgrp(STDIN_FILENO) == getpgrp()) +#endif + def_prog_mode(); /* * Block window change and timer signals. The latter @@ -118,6 +138,15 @@ static void tstp(int dummy GCC_UNUSED) #endif (void)sigprocmask(SIG_BLOCK, &mask, &omask); +#ifdef SIGTTOU + sigttou_blocked = sigismember(&omask, SIGTTOU); + if (!sigttou_blocked) { + (void)sigemptyset(&mask); + (void)sigaddset(&mask, SIGTTOU); + (void)sigprocmask(SIG_BLOCK, &mask, NULL); + } +#endif + /* * End window mode, which also resets the terminal state to the * original (pre-curses) modes. @@ -127,6 +156,12 @@ static void tstp(int dummy GCC_UNUSED) /* Unblock SIGTSTP. */ (void)sigemptyset(&mask); (void)sigaddset(&mask, SIGTSTP); +#ifdef SIGTTOU + if (!sigttou_blocked) { + /* Unblock this too if it wasn't blocked on entry */ + (void)sigaddset(&mask, SIGTTOU); + } +#endif (void)sigprocmask(SIG_UNBLOCK, &mask, NULL); /* Now we want to resend SIGSTP to this process and suspend it */ @@ -160,17 +195,20 @@ static void tstp(int dummy GCC_UNUSED) /* Reset the signals. */ (void)sigprocmask(SIG_SETMASK, &omask, NULL); } -#endif /* defined(SIGTSTP) */ +#endif /* USE_SIGTSTP */ static void cleanup(int sig) { + static int nested; + /* * Actually, doing any sort of I/O from within an signal handler is * "unsafe". But we'll _try_ to clean up the screen and terminal * settings on the way out. */ - if (sig == SIGINT - || sig == SIGQUIT) { + if (!nested++ + && (sig == SIGINT + || sig == SIGQUIT)) { #if HAVE_SIGACTION || HAVE_SIGVEC sigaction_t act; sigemptyset(&act.sa_mask); @@ -184,9 +222,15 @@ static void cleanup(int sig) SCREEN *scan = _nc_screen_chain; while(scan) { + if (SP != 0 + && SP->_ofp != 0 + && isatty(fileno(SP->_ofp))) { + SP->_cleanup = TRUE; + } set_term(scan); endwin(); - SP->_endwin = FALSE; /* in case we have an atexit! */ + if (SP) + SP->_endwin = FALSE; /* in case we have an atexit! */ scan = scan->_next_screen; } } @@ -227,9 +271,9 @@ static int CatchIfDefault(int sig, sigaction_t *act) return FALSE; } #else -static int CatchIfDefault(int sig, RETSIGTYPE (*handler)()) +static int CatchIfDefault(int sig, RETSIGTYPE (*handler)(int)) { - void (*ohandler)(); + void (*ohandler)(int); ohandler = signal(sig, SIG_IGN); if (ohandler == SIG_DFL @@ -259,7 +303,7 @@ static int CatchIfDefault(int sig, RETSIGTYPE (*handler)()) */ void _nc_signal_handler(bool enable) { -#ifdef SIGTSTP /* Xenix 2.x doesn't have this */ +#if USE_SIGTSTP /* Xenix 2.x doesn't have SIGTSTP, for example */ static sigaction_t act, oact; static int ignore; @@ -295,7 +339,7 @@ static int ignore; ignore = TRUE; } } -#else /* !SIGTSTP */ +#else /* !USE_SIGTSTP */ if (enable) { #if HAVE_SIGACTION || HAVE_SIGVEC @@ -321,5 +365,5 @@ static int ignore; #endif #endif /* !(HAVE_SIGACTION || HAVE_SIGVEC) */ } -#endif /* !SIGTSTP */ +#endif /* !USE_SIGTSTP */ } diff --git a/ncurses/lib_twait.c b/ncurses/tty/lib_twait.c similarity index 54% rename from ncurses/lib_twait.c rename to ncurses/tty/lib_twait.c index 93f24d72..f095c9b5 100644 --- a/ncurses/lib_twait.c +++ b/ncurses/tty/lib_twait.c @@ -40,6 +40,10 @@ ** comments, none of the original code remains - T.Dickey). */ +#ifdef __BEOS__ +#include +#endif + #include #if USE_FUNC_POLL @@ -57,37 +61,34 @@ # endif #endif -#ifdef __BEOS__ -/* BeOS select() only works on sockets. Use the tty hack instead */ -#include -#define select check_select -#endif - -MODULE_ID("$Id: lib_twait.c,v 1.30 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.34 1999/10/16 21:25:10 tom Exp $") -/* - * We want to define GOOD_SELECT if the last argument of select(2) is - * modified to indicate time left. The code will deal gracefully with - * the other case, this is just an optimization to reduce the number - * of system calls per input event. - * - * In general, expect System-V-like UNIXes to have this behavior and BSD-like - * ones to not have it. Check your manual page. If it doesn't explicitly - * say the last argument is modified, assume it's not. - * - * (We'd really like configure to autodetect this, but writing a proper test - * turns out to be hard.) - */ +static long _nc_gettime(bool first) +{ + long res; #if HAVE_GETTIMEOFDAY -#if (defined(TRACE) && !HAVE_USLEEP) || ! GOOD_SELECT -static void _nc_gettime(struct timeval *tp) -{ - gettimeofday(tp, (struct timezone *)0); - T(("time: %ld.%06ld", (long) tp->tv_sec, (long) tp->tv_usec)); -} -#endif +# define PRECISE_GETTIME 1 + static struct timeval t0; + struct timeval t1; + gettimeofday(&t1, (struct timezone *)0); + if (first) { + t0 = t1; + } + res = (t1.tv_sec - t0.tv_sec) * 1000 + + (t1.tv_usec - t0.tv_usec) / 1000; +#else +# define PRECISE_GETTIME 0 + static time_t t0; + time_t t1 = time((time_t*)0); + if (first) { + t0 = t1; + } + res = (t1 - t0) * 1000; #endif + T(("%s time: %ld msec", first ? "get" : "elapsed", res)); + return res; +} /* * Wait a specified number of milliseconds, returning nonzero if the timer @@ -105,132 +106,128 @@ static void _nc_gettime(struct timeval *tp) int _nc_timed_wait(int mode, int milliseconds, int *timeleft) { int fd; -int count = 0; -long whole_secs = milliseconds / 1000; -long micro_secs = (milliseconds % 1000) * 1000; +int count; -int result = 0; -struct timeval ntimeout; +int result; #if USE_FUNC_POLL struct pollfd fds[2]; +#elif defined(__BEOS__) #elif HAVE_SELECT static fd_set set; #endif -#if !GOOD_SELECT && HAVE_GETTIMEOFDAY -struct timeval starttime, returntime; -long delta; +long starttime, returntime; + + T(("start twait: %d milliseconds, mode: %d", milliseconds, mode)); - _nc_gettime(&starttime); +#if PRECISE_GETTIME +retry: #endif + starttime = _nc_gettime(TRUE); - if (milliseconds >= 0) { - ntimeout.tv_sec = whole_secs; - ntimeout.tv_usec = micro_secs; - } else { - ntimeout.tv_sec = 0; - ntimeout.tv_usec = 0; - } + count = 0; - T(("start twait: %lu.%06lu secs, mode: %d", (long) ntimeout.tv_sec, (long) ntimeout.tv_usec, mode)); +#if USE_FUNC_POLL + if (mode & 1) { + fds[count].fd = SP->_ifd; + fds[count].events = POLLIN; + count++; + } + if ((mode & 2) + && (fd = SP->_mouse_fd) >= 0) { + fds[count].fd = fd; + fds[count].events = POLLIN; + count++; + } + result = poll(fds, count, milliseconds); -#ifdef HIDE_EINTR +#elif defined(__BEOS__) /* - * The do loop tries to make it look like we have restarting signals, - * even if we don't. + * BeOS's select() is declared in socket.h, so the configure script does + * not see it. That's just as well, since that function works only for + * sockets. This (using snooze and ioctl) was distilled from Be's patch + * for ncurses which uses a separate thread to simulate select(). + * + * FIXME: the return values from the ioctl aren't very clear if we get + * interrupted. */ - do { -#endif /* HIDE_EINTR */ -#if !GOOD_SELECT && HAVE_GETTIMEOFDAY - retry: -#endif - count = 0; -#if USE_FUNC_POLL + result = 0; + if (mode & 1) { + bigtime_t d; + bigtime_t useconds = milliseconds * 1000; + int n, howmany; - if (mode & 1) { - fds[count].fd = SP->_ifd; - fds[count].events = POLLIN; - count++; - } - if ((mode & 2) - && (fd = SP->_mouse_fd) >= 0) { - fds[count].fd = fd; - fds[count].events = POLLIN; - count++; + if (useconds == 0) /* we're here to go _through_ the loop */ + useconds = 1; + + for (d = 0; d < useconds; d += 5000) { + n = 0; + howmany = ioctl(0, 'ichr', &n); + if (howmany >= 0 && n > 0) { + result = 1; + break; + } + if (useconds > 1) + snooze(5000); + milliseconds -= 5; } - result = poll(fds, count, milliseconds); + } else if (milliseconds > 0) { + snooze(milliseconds * 1000); + milliseconds = 0; + } #elif HAVE_SELECT - /* - * Some systems modify the fd_set arguments; do this in the - * loop. - */ - FD_ZERO(&set); + /* + * select() modifies the fd_set arguments; do this in the + * loop. + */ + FD_ZERO(&set); - if (mode & 1) { - FD_SET(SP->_ifd, &set); - count = SP->_ifd + 1; - } - if ((mode & 2) - && (fd = SP->_mouse_fd) >= 0) { - FD_SET(fd, &set); - count = max(fd, count) + 1; - } + if (mode & 1) { + FD_SET(SP->_ifd, &set); + count = SP->_ifd + 1; + } + if ((mode & 2) + && (fd = SP->_mouse_fd) >= 0) { + FD_SET(fd, &set); + count = max(fd, count) + 1; + } - errno = 0; - result = select(count, &set, NULL, NULL, milliseconds >= 0 ? &ntimeout : 0); + if (milliseconds >= 0) { + struct timeval ntimeout; + ntimeout.tv_sec = milliseconds / 1000; + ntimeout.tv_usec = (milliseconds % 1000) * 1000; + result = select(count, &set, NULL, NULL, &ntimeout); + } else { + result = select(count, &set, NULL, NULL, NULL); + } #endif -#if !GOOD_SELECT && HAVE_GETTIMEOFDAY - _nc_gettime(&returntime); - - /* The contents of ntimeout aren't guaranteed after return from - * 'select()', so we disregard its contents. Also, note that - * on some systems, tv_sec and tv_usec are unsigned. - */ - ntimeout.tv_sec = whole_secs; - ntimeout.tv_usec = micro_secs; - -#define DELTA(f) (long)ntimeout.f - (long)returntime.f + (long)starttime.f - - delta = DELTA(tv_sec); - if (delta < 0) - delta = 0; - ntimeout.tv_sec = delta; + returntime = _nc_gettime(FALSE); - delta = DELTA(tv_usec); - while (delta < 0 && ntimeout.tv_sec != 0) { - ntimeout.tv_sec--; - delta += 1000000; - } - ntimeout.tv_usec = delta; - if (delta < 0) - ntimeout.tv_sec = ntimeout.tv_usec = 0; + if (milliseconds >= 0) + milliseconds -= (returntime - starttime); - /* - * If the timeout hasn't expired, and we've gotten no data, - * this is probably a system where 'select()' needs to be left - * alone so that it can complete. Make this process sleep, - * then come back for more. - */ - if (result == 0 - && (ntimeout.tv_sec != 0 || ntimeout.tv_usec > 100000)) { - napms(100); - goto retry; - } -#endif -#ifdef HIDE_EINTR - } while (result == -1 && errno == EINTR); +#if PRECISE_GETTIME + /* + * If the timeout hasn't expired, and we've gotten no data, + * this is probably a system where 'select()' needs to be left + * alone so that it can complete. Make this process sleep, + * then come back for more. + */ + if (result == 0 && milliseconds > 100) { + napms(100); + milliseconds -= 100; + goto retry; + } #endif - /* return approximate time left on the ntimeout, in milliseconds */ + /* return approximate time left in milliseconds */ if (timeleft) - *timeleft = (ntimeout.tv_sec * 1000) + (ntimeout.tv_usec / 1000); + *timeleft = milliseconds; - T(("end twait: returned %d (%d), remaining time %lu.%06lu secs (%d msec)", - result, errno, - (long) ntimeout.tv_sec, (long) (ntimeout.tv_usec / 1000), - timeleft ? *timeleft : -1)); + T(("end twait: returned %d (%d), remaining time %d msec", + result, errno, milliseconds)); /* * Both 'poll()' and 'select()' return the number of file descriptors @@ -249,6 +246,8 @@ long delta; count++; } } +#elif defined(__BEOS__) + result = 1; /* redundant, but simple */ #elif HAVE_SELECT if ((mode & 2) && (fd = SP->_mouse_fd) >= 0 diff --git a/ncurses/lib_vidattr.c b/ncurses/tty/lib_vidattr.c similarity index 90% rename from ncurses/lib_vidattr.c rename to ncurses/tty/lib_vidattr.c index cbd4634a..20cc2b13 100644 --- a/ncurses/lib_vidattr.c +++ b/ncurses/tty/lib_vidattr.c @@ -64,7 +64,7 @@ #include #include -MODULE_ID("$Id: lib_vidattr.c,v 1.20 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_vidattr.c,v 1.23 1999/06/12 21:20:41 tom Exp $") #define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) @@ -74,11 +74,22 @@ MODULE_ID("$Id: lib_vidattr.c,v 1.20 1998/02/11 12:13:56 tom Exp $") #define TurnOff(mask,mode) \ if ((turn_off & mask) && mode) { doPut(mode); turn_off &= ~mask; } + /* if there is no current screen, assume we *can* do color */ +#define SetColorsIf(why,old_attr) \ + if ((!SP || SP->_coloron) && (why)) { \ + int old_pair = PAIR_NUMBER(old_attr); \ + T(("old pair = %d -- new pair = %d", old_pair, pair)); \ + if ((pair != old_pair) \ + || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \ + _nc_do_color(pair, reverse, outc); \ + } \ + } + int vidputs(attr_t newmode, int (*outc)(int)) { static attr_t previous_attr = A_NORMAL; attr_t turn_on, turn_off; -int pair, current_pair; +int pair; bool reverse = FALSE; bool used_ncv = FALSE; @@ -91,7 +102,8 @@ bool used_ncv = FALSE; T(("previous attribute was %s", _traceattr(previous_attr))); #if !USE_XMC_SUPPORT - if (magic_cookie_glitch > 0) + if ((SP != 0) + && (magic_cookie_glitch > 0)) newmode &= ~(SP->_xmc_suppress); #endif @@ -132,26 +144,15 @@ bool used_ncv = FALSE; returnCode(OK); pair = PAIR_NUMBER(newmode); - current_pair = PAIR_NUMBER(previous_attr); if (reverse) { newmode &= ~A_REVERSE; - pair = -pair; } - if (previous_attr & A_REVERSE) - current_pair = -current_pair; turn_off = (~newmode & previous_attr) & ALL_BUT_COLOR; turn_on = (newmode & ~previous_attr) & ALL_BUT_COLOR; - /* if there is no current screen, assume we *can* do color */ - if ((!SP || SP->_coloron) && pair == 0) { - T(("old pair = %d -- new pair = %d", current_pair, pair)); - if (pair != current_pair) { - _nc_do_color(pair, reverse, outc); - previous_attr &= ~A_COLOR; - } - } + SetColorsIf(pair == 0, previous_attr); if (newmode == A_NORMAL) { if((previous_attr & A_ALTCHARSET) && exit_alt_charset_mode) { @@ -163,6 +164,7 @@ bool used_ncv = FALSE; previous_attr &= ~A_COLOR; } + SetColorsIf(pair != 0, previous_attr); } else if (set_attributes && !used_ncv) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); @@ -178,19 +180,27 @@ bool used_ncv = FALSE; (newmode & A_ALTCHARSET) != 0), 1, outc); previous_attr &= ~A_COLOR; } + SetColorsIf(pair != 0, previous_attr); } else { T(("turning %s off", _traceattr(turn_off))); TurnOff(A_ALTCHARSET, exit_alt_charset_mode); - TurnOff(A_UNDERLINE, exit_underline_mode); - TurnOff(A_STANDOUT, exit_standout_mode); + + if (!SP || SP->_use_rmul) { + TurnOff(A_UNDERLINE, exit_underline_mode); + } + + if (!SP || SP->_use_rmso) { + TurnOff(A_STANDOUT, exit_standout_mode); + } if (turn_off && exit_attribute_mode) { doPut(exit_attribute_mode); turn_on |= (newmode & (chtype)(~A_COLOR)); previous_attr &= ~A_COLOR; } + SetColorsIf(pair != 0, previous_attr); T(("turning %s on", _traceattr(turn_on))); @@ -211,15 +221,6 @@ bool used_ncv = FALSE; TurnOn (A_VERTICAL, enter_vertical_hl_mode); } - /* if there is no current screen, assume we *can* do color */ - if ((!SP || SP->_coloron) && pair != 0) { - current_pair = PAIR_NUMBER(previous_attr); - T(("old pair = %d -- new pair = %d", current_pair, pair)); - if (pair != current_pair) { - _nc_do_color(pair, reverse, outc); - } - } - if (reverse) newmode |= A_REVERSE; diff --git a/ncurses/tty/tty_display.h b/ncurses/tty/tty_display.h new file mode 100644 index 00000000..1bc0d2d9 --- /dev/null +++ b/ncurses/tty/tty_display.h @@ -0,0 +1,146 @@ +/**************************************************************************** + * 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. * + ************************************************************************** */ + +#ifndef TTY_DISPLAY_H +#define TTY_DISPLAY_H 1 + +extern bool _nc_tty_beep(void); +extern bool _nc_tty_check_resize(void); +extern bool _nc_tty_cursor(int); +extern bool _nc_tty_flash(void); +extern bool _nc_tty_init_color(int,int,int,int); +extern bool _nc_tty_init_pair(int,int,int); +extern bool _nc_tty_slk_hide(bool); +extern bool _nc_tty_slk_update(int,const char *); +extern bool _nc_tty_start_color(void); +extern void _nc_tty_display_resume(void); +extern void _nc_tty_display_suspend(void); +extern void _nc_tty_dispose(void); /* frees SP->_term */ +extern void _nc_tty_switch_to(void); +extern void _nc_tty_update(void); + +struct tty_display_data { + int _fifohold; /* set if breakout marked */ + unsigned long _current_attr; /* terminal attribute current set */ + int _cursrow; /* physical cursor row (-1=unknown) */ + int _curscol; /* physical cursor column */ + + /* cursor movement costs; units are 10ths of milliseconds */ + int _char_padding; /* cost of character put */ + int _cr_cost; /* cost of (carriage_return) */ + int _cup_cost; /* cost of (cursor_address) */ + int _home_cost; /* cost of (cursor_home) */ + int _ll_cost; /* cost of (cursor_to_ll) */ +#if USE_HARD_TABS + int _ht_cost; /* cost of (tab) */ + int _cbt_cost; /* cost of (backtab) */ +#endif /* USE_HARD_TABS */ + int _cub1_cost; /* cost of (cursor_left) */ + int _cuf1_cost; /* cost of (cursor_right) */ + int _cud1_cost; /* cost of (cursor_down) */ + int _cuu1_cost; /* cost of (cursor_up) */ + int _cub_cost; /* cost of (parm_cursor_left) */ + int _cuf_cost; /* cost of (parm_cursor_right) */ + int _cud_cost; /* cost of (parm_cursor_down) */ + int _cuu_cost; /* cost of (parm_cursor_up) */ + int _hpa_cost; /* cost of (column_address) */ + int _vpa_cost; /* cost of (row_address) */ + /* used in lib_doupdate.c, must be chars */ + int _ed_cost; /* cost of (clr_eos) */ + int _el_cost; /* cost of (clr_eol) */ + int _el1_cost; /* cost of (clr_bol) */ + int _dch1_cost; /* cost of (delete_character) */ + int _ich1_cost; /* cost of (insert_character) */ + int _dch_cost; /* cost of (parm_dch) */ + int _ich_cost; /* cost of (parm_ich) */ + int _ech_cost; /* cost of (erase_chars) */ + int _rep_cost; /* cost of (repeat_char) */ + int _hpa_ch_cost; /* cost of (column_address) */ + int _cup_ch_cost; /* cost of (cursor_address) */ + int _smir_cost; /* cost of (enter_insert_mode) */ + int _rmir_cost; /* cost of (exit_insert_mode) */ + int _ip_cost; /* cost of (insert_padding) */ + /* used in lib_mvcur.c */ + char * _address_cursor; + int _carriage_return_length; + int _cursor_home_length; + int _cursor_to_ll_length; + + chtype _xmc_suppress; /* attributes to suppress if xmc */ + chtype _xmc_triggers; /* attributes to process if xmc */ + + bool _sig_winch; +}; + + +#define DelCharCost(count) \ + ((parm_dch != 0) \ + ? D->_dch_cost \ + : ((delete_character != 0) \ + ? (D->_dch1_cost * count) \ + : INFINITY)) + +#define InsCharCost(count) \ + ((parm_ich != 0) \ + ? D->_ich_cost \ + : ((enter_insert_mode && exit_insert_mode) \ + ? D->_smir_cost + D->_rmir_cost + (D->_ip_cost * count) \ + : ((insert_character != 0) \ + ? (D->_ich1_cost * count) \ + : INFINITY))) + +#if USE_XMC_SUPPORT +#define UpdateAttrs(c) if (D->_current_attr != AttrOf(c)) { \ + attr_t chg = D->_current_attr; \ + vidattr(AttrOf(c)); \ + if (magic_cookie_glitch > 0 \ + && XMC_CHANGES((chg ^ D->_current_attr))) { \ + T(("%s @%d before glitch %d,%d", \ + __FILE__, __LINE__, \ + D->_cursrow, \ + D->_curscol)); \ + _nc_do_xmc_glitch(chg); \ + } \ + } +#else +#define UpdateAttrs(c) if (D->_current_attr != AttrOf(c)) \ + vidattr(AttrOf(c)); +#endif + +/* + * Check whether the given character can be output by clearing commands. This + * includes test for being a space and not including any 'bad' attributes, such + * as A_REVERSE. All attribute flags which don't affect appearance of a space + * or can be output by clearing (A_COLOR in case of bce-terminal) are excluded. + */ +#define can_clear_with(ch) \ + ((ch & ~(NONBLANK_ATTR|(back_color_erase ? A_COLOR:0))) == BLANK) + +#define XMC_CHANGES(c) ((c) & D->_xmc_suppress) + +#endif /* TTY_DISPLAY_H */ diff --git a/ncurses/tty/tty_input.h b/ncurses/tty/tty_input.h new file mode 100644 index 00000000..41c22833 --- /dev/null +++ b/ncurses/tty/tty_input.h @@ -0,0 +1,61 @@ +/**************************************************************************** + * 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. * + ****************************************************************************/ + +/* + * $Id: tty_input.h,v 1.1 1998/12/19 22:42:57 tom Exp $ + */ + +#ifndef TTY_INPUT_H +#define TTY_INPUT_H 1 + +extern bool _nc_tty_mouse_mask(mmask_t); +extern bool _nc_tty_pending(void); +extern int _nc_tty_next_event(int); +extern void _nc_tty_flags_changed(void); +extern void _nc_tty_flush(void); +extern void _nc_tty_input_resume(void); +extern void _nc_tty_input_suspend(void); + +struct tty_input_data { + int _ifd; /* input file ptr for screen */ + int _keypad_xmit; /* current terminal state */ + int _meta_on; /* current terminal state */ + + /* + * These are the data that support the mouse interface. + */ + bool (*_mouse_event) (SCREEN *); + bool (*_mouse_inline)(SCREEN *); + bool (*_mouse_parse) (int); + void (*_mouse_resume)(SCREEN *); + void (*_mouse_wrap) (SCREEN *); + int _mouse_fd; /* file-descriptor, if any */ + int mousetype; +}; + +#endif /* TTY_INPUT_H */ diff --git a/ncurses/lib_doupdate.c b/ncurses/tty/tty_update.c similarity index 92% rename from ncurses/lib_doupdate.c rename to ncurses/tty/tty_update.c index b0daf4fc..a5a640f8 100644 --- a/ncurses/lib_doupdate.c +++ b/ncurses/tty/tty_update.c @@ -42,6 +42,10 @@ * *-----------------------------------------------------------------*/ +#ifdef __BEOS__ +#include +#endif + #include #if defined(TRACE) && HAVE_SYS_TIMES_H && HAVE_TIMES @@ -67,15 +71,9 @@ #endif #endif -#ifdef __BEOS__ -/* BeOS select() only works on sockets. Use the tty hack instead */ -#include -#define select check_select -#endif - #include -MODULE_ID("$Id: lib_doupdate.c,v 1.98 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.117 1999/10/22 23:28:46 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -97,10 +95,10 @@ MODULE_ID("$Id: lib_doupdate.c,v 1.98 1998/02/11 12:14:00 tom Exp $") static inline chtype ClrBlank ( WINDOW *win ); static int ClrBottom(int total); -static int InsStr( chtype *line, int count ); static void ClearScreen( chtype blank ); -static void ClrUpdate( WINDOW *win ); +static void ClrUpdate( void ); static void DelChar( int count ); +static void InsStr( chtype *line, int count ); static void TransformLine( int const lineno ); #ifdef POSITION_DEBUG @@ -110,29 +108,40 @@ static void TransformLine( int const lineno ); * ****************************************************************************/ -void position_check(int expected_y, int expected_x, char *legend) +static void position_check(int expected_y, int expected_x, char *legend) /* check to see if the real cursor position matches the virtual */ { - static char buf[9]; + char buf[20]; int y, x; - if (_nc_tracing) + if (!_nc_tracing || (expected_y < 0 && expected_x < 0)) return; memset(buf, '\0', sizeof(buf)); - (void) write(1, "\033[6n", 4); /* only works on ANSI-compatibles */ - (void) read(0, (void *)buf, 8); + putp("\033[6n"); /* only works on ANSI-compatibles */ + _nc_flush(); + (void) read(0, buf, sizeof(buf)-1); _tracef("probe returned %s", _nc_visbuf(buf)); /* try to interpret as a position report */ - if (sscanf(buf, "\033[%d;%dR", &y, &x) != 2) + if (sscanf(buf, "\033[%d;%dR", &y, &x) != 2) { _tracef("position probe failed in %s", legend); - else if (y - 1 != expected_y || x - 1 != expected_x) - _tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s", - y-1, x-1, expected_y, expected_x, legend); - else - _tracef("position matches OK in %s", legend); + } else { + if (expected_x < 0) + expected_x = x - 1; + if (expected_y < 0) + expected_y = y - 1; + if (y - 1 != expected_y || x - 1 != expected_x) { + beep(); + _tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s", + y-1, x-1, expected_y, expected_x, legend); + } else { + _tracef("position matches OK in %s", legend); + } + } } +#else +#define position_check(expected_y, expected_x, legend) /* nothing */ #endif /* POSITION_DEBUG */ /**************************************************************************** @@ -148,9 +157,7 @@ static inline void GoTo(int const row, int const col) TR(TRACE_MOVE, ("GoTo(%d, %d) from (%d, %d)", row, col, SP->_cursrow, SP->_curscol)); -#ifdef POSITION_DEBUG position_check(SP->_cursrow, SP->_curscol, "GoTo"); -#endif /* POSITION_DEBUG */ /* * Force restore even if msgr is on when we're in an alternate @@ -168,6 +175,7 @@ static inline void GoTo(int const row, int const col) mvcur(SP->_cursrow, SP->_curscol, row, col); SP->_cursrow = row; SP->_curscol = col; + position_check(SP->_cursrow, SP->_curscol, "GoTo2"); } static inline void PutAttrChar(chtype ch) @@ -179,10 +187,14 @@ static inline void PutAttrChar(chtype ch) _tracechtype(ch), SP->_cursrow, SP->_curscol)); UpdateAttrs(ch); - putc((int)TextOf(ch), SP->_ofp); + if (SP->_cleanup) { + _nc_outch((int)TextOf(ch)); + } else { + putc((int)TextOf(ch), SP->_ofp); /* macro's fastest... */ #ifdef TRACE - _nc_outchars++; + _nc_outchars++; #endif /* TRACE */ + } SP->_curscol++; if (char_padding) { TPUTS_TRACE("char_padding"); @@ -212,6 +224,21 @@ static bool check_pending(void) { have_pending = TRUE; } +#elif defined(__BEOS__) + /* + * BeOS's select() is declared in socket.h, so the configure script does + * not see it. That's just as well, since that function works only for + * sockets. This (using snooze and ioctl) was distilled from Be's patch + * for ncurses which uses a separate thread to simulate select(). + * + * FIXME: the return values from the ioctl aren't very clear if we get + * interrupted. + */ + int n = 0; + int howmany = ioctl(0, 'ichr', &n); + if (howmany >= 0 && n > 0) { + have_pending = TRUE; + } #elif HAVE_SELECT fd_set fdset; struct timeval ktimeout; @@ -221,7 +248,7 @@ static bool check_pending(void) FD_ZERO(&fdset); FD_SET(SP->_checkfd, &fdset); - if (select(SP->_checkfd+1, &fdset, NULL, NULL, &ktimeout) > 0) + if (select(SP->_checkfd+1, &fdset, NULL, NULL, &ktimeout) != 0) { have_pending = TRUE; } @@ -229,7 +256,7 @@ static bool check_pending(void) } if (have_pending) { SP->_fifohold = 5; - fflush(SP->_ofp); + _nc_flush(); } return FALSE; } @@ -261,6 +288,8 @@ static void PutCharLR(chtype const ch) putp(exit_am_mode); PutAttrChar(ch); + SP->_curscol--; + position_check(SP->_cursrow, SP->_curscol, "exit_am_mode"); TPUTS_TRACE("enter_am_mode"); putp(enter_am_mode); @@ -307,6 +336,7 @@ static void wrap_cursor(void) { SP->_curscol--; } + position_check(SP->_cursrow, SP->_curscol, "wrap_cursor"); } static inline void PutChar(chtype const ch) @@ -320,9 +350,7 @@ static inline void PutChar(chtype const ch) if (SP->_curscol >= screen_columns) wrap_cursor(); -#ifdef POSITION_DEBUG position_check(SP->_cursrow, SP->_curscol, "PutChar"); -#endif /* POSITION_DEBUG */ } /* @@ -680,19 +708,11 @@ struct tms before, after; #endif /* USE_XMC_SUPPORT */ nonempty = 0; - if (curscr->_clear) { /* force refresh ? */ - /* yes, clear all & update */ - T(("clearing and updating curscr")); - if (is_wintouched(newscr)) - ClrUpdate(newscr); - else - ClrUpdate(curscr); + if (curscr->_clear || newscr->_clear) { /* force refresh ? */ + T(("clearing and updating from scratch")); + ClrUpdate(); curscr->_clear = FALSE; /* reset flag */ newscr->_clear = FALSE; /* reset flag */ - } else if (newscr->_clear) { - T(("clearing and updating newscr")); - ClrUpdate(newscr); - newscr->_clear = FALSE; } else { int changedlines = CHECK_INTERVAL; @@ -702,22 +722,7 @@ struct tms before, after; nonempty = min(screen_lines, newscr->_maxy+1); if (SP->_scrolling) { -#if USE_HASHMAP -#if defined(TRACE) || defined(NCURSES_TEST) - if (_nc_optimize_enable & OPTIMIZE_HASHMAP) -#endif /*TRACE */ - _nc_hash_map(); -#elif !USE_SCROLL_HINTS - _nc_setup_scroll(); -#endif -#if defined(TRACE) || defined(NCURSES_TEST) - if (_nc_optimize_enable & OPTIMIZE_SCROLL) -#endif /*TRACE */ -#if USE_SCROLL_HINTS || USE_HASHMAP _nc_scroll_optimize(); -#else - _nc_perform_scroll(); -#endif } nonempty = ClrBottom(nonempty); @@ -761,10 +766,13 @@ struct tms before, after; for (i = nonempty; i <= curscr->_maxy; i++) MARK_NOCHANGE(curscr,i) - curscr->_curx = newscr->_curx; - curscr->_cury = newscr->_cury; + if (!newscr->_leaveok) + { + curscr->_curx = newscr->_curx; + curscr->_cury = newscr->_cury; - GoTo(curscr->_cury, curscr->_curx); + GoTo(curscr->_cury, curscr->_curx); + } cleanup: /* @@ -773,7 +781,7 @@ struct tms before, after; */ UpdateAttrs(A_NORMAL); - fflush(SP->_ofp); + _nc_flush(); curscr->_attrs = newscr->_attrs; /* curscr->_bkgd = newscr->_bkgd; */ @@ -812,29 +820,20 @@ chtype blank = BLANK; } /* -** ClrUpdate(win) +** ClrUpdate() ** ** Update by clearing and redrawing the entire screen. ** */ -static void ClrUpdate(WINDOW *win) +static void ClrUpdate(void) { int i; - chtype blank = ClrBlank(win); + chtype blank = ClrBlank(stdscr); int nonempty = min(screen_lines, newscr->_maxy+1); T(("ClrUpdate() called")); - if (win == curscr) { - /* discard updates */ - for (i = 0; i < screen_lines ; i++) { - memcpy( newscr->_line[i].text, - curscr->_line[i].text, - screen_columns * sizeof(chtype)); - } - } - ClearScreen(blank); T(("updating screen from scratch")); @@ -928,16 +927,16 @@ chtype blank = newscr->_line[total-1].text[last-1]; /* lower right char */ if(!clr_eos || !can_clear_with(blank)) return total; - if (tstLine == 0) - tstLine = (chtype *)malloc(length); - else if (length > lenLine) - tstLine = (chtype *)realloc(tstLine, length); + if ((tstLine == 0) || (last > (int)lenLine)) { + tstLine = typeRealloc(chtype, last, tstLine); + if (tstLine != 0) { + lenLine = last; + for (col = 0; col < last; col++) + tstLine[col] = blank; + } + } if (tstLine != 0) { - lenLine = length; - for (col = 0; col < last; col++) - tstLine[col] = blank; - for (row = total-1; row >= 0; row--) { if (memcmp(tstLine, newscr->_line[row].text, length)) break; @@ -950,10 +949,16 @@ chtype blank = newscr->_line[total-1].text[last-1]; /* lower right char */ GoTo(top,0); ClrToEOS(blank); total = top; + if (SP->oldhash && SP->newhash) + { + for (row = top; row < screen_lines; row++) + SP->oldhash[row] = SP->newhash[row]; + } } } #if NO_LEAKS - FreeAndNull(tstLine); + if (tstLine != 0) + FreeAndNull(tstLine); #endif return total; } @@ -987,6 +992,10 @@ bool attrchanged = FALSE; T(("TransformLine(%d) called", lineno)); + /* copy new hash value to old one */ + if (SP->oldhash && SP->newhash) + SP->oldhash[lineno] = SP->newhash[lineno]; + if(ceol_standout_glitch && clr_eol) { firstChar = 0; while(firstChar < screen_columns) { @@ -1141,8 +1150,9 @@ bool attrchanged = FALSE; if(newLine[firstChar] != blank ) PutChar(newLine[firstChar]); ClrToEOL(blank); - } else if( newLine[nLastChar] != oldLine[oLastChar] - || !(_nc_idcok && has_ic()) ) { + } else if( (nLastChar != oLastChar) + && (newLine[nLastChar] != oldLine[oLastChar] + || !(_nc_idcok && has_ic())) ) { GoTo(lineno, firstChar); if ((oLastChar - nLastChar) > SP->_el_cost) { if(PutRange(oldLine, newLine, lineno, firstChar, nLastChar)) @@ -1172,10 +1182,10 @@ bool attrchanged = FALSE; GoTo(lineno, firstChar); PutRange(oldLine, newLine, lineno, firstChar, n); } - GoTo(lineno, n+1); if (oLastChar < nLastChar) { int m = max(nLastNonblank, oLastNonblank); + GoTo(lineno, n+1); if (InsCharCost(nLastChar - oLastChar) > (m - n)) { PutRange(oldLine, newLine, lineno, n+1, m); @@ -1183,6 +1193,7 @@ bool attrchanged = FALSE; InsStr(&newLine[n+1], nLastChar - oLastChar); } } else if (oLastChar > nLastChar ) { + GoTo(lineno, n+1); if (DelCharCost(oLastChar - nLastChar) > SP->_el_cost + nLastNonblank - (n+1)) { if(PutRange(oldLine, newLine, lineno, @@ -1230,9 +1241,7 @@ static void ClearScreen(chtype blank) TPUTS_TRACE("clear_screen"); putp(clear_screen); SP->_cursrow = SP->_curscol = 0; -#ifdef POSITION_DEBUG position_check(SP->_cursrow, SP->_curscol, "ClearScreen"); -#endif /* POSITION_DEBUG */ } else if (clr_eos) { SP->_cursrow = SP->_curscol = -1; GoTo(0,0); @@ -1270,30 +1279,36 @@ static void ClearScreen(chtype blank) ** */ -static int InsStr(chtype *line, int count) +static void InsStr(chtype *line, int count) { T(("InsStr(%p,%d) called", line, count)); - if (enter_insert_mode && exit_insert_mode) { - TPUTS_TRACE("enter_insert_mode"); - putp(enter_insert_mode); + /* Prefer parm_ich as it has the smallest cost - no need to shift + * the whole line on each character. */ + /* The order must match that of InsCharCost. */ + if (parm_ich) { + TPUTS_TRACE("parm_ich"); + tputs(tparm(parm_ich, count), count, _nc_outch); while (count) { PutAttrChar(*line); line++; count--; } - TPUTS_TRACE("exit_insert_mode"); - putp(exit_insert_mode); - return(OK); - } else if (parm_ich) { - TPUTS_TRACE("parm_ich"); - tputs(tparm(parm_ich, count), count, _nc_outch); + } else if (enter_insert_mode && exit_insert_mode) { + TPUTS_TRACE("enter_insert_mode"); + putp(enter_insert_mode); while (count) { PutAttrChar(*line); + if (insert_padding) + { + TPUTS_TRACE("insert_padding"); + putp(insert_padding); + } line++; count--; } - return(OK); + TPUTS_TRACE("exit_insert_mode"); + putp(exit_insert_mode); } else { while (count) { TPUTS_TRACE("insert_character"); @@ -1307,8 +1322,8 @@ static int InsStr(chtype *line, int count) line++; count--; } - return(OK); } + position_check(SP->_cursrow, SP->_curscol, "InsStr"); } /* @@ -1342,14 +1357,8 @@ static void DelChar(int count) void _nc_outstr(const char *str) { - FILE *ofp = SP ? SP->_ofp : stdout; - - (void) fputs(str, ofp); - (void) fflush(ofp); - -#ifdef TRACE - _nc_outchars += strlen(str); -#endif /* TRACE */ + (void) putp(str); + _nc_flush(); } /* @@ -1652,17 +1661,17 @@ int _nc_scrolln(int n, int top, int bot, int maxy) if (res == ERR && change_scroll_region) { if (top != 0 && (SP->_cursrow == top || SP->_cursrow == top-1) - && save_cursor && restore_cursor) + && save_cursor && restore_cursor) { cursor_saved=TRUE; - TPUTS_TRACE("save_cursor"); + TPUTS_TRACE("save_cursor"); tputs(save_cursor, 0, _nc_outch); } TPUTS_TRACE("change_scroll_region"); tputs(tparm(change_scroll_region, top, bot), 0, _nc_outch); if (cursor_saved) { - TPUTS_TRACE("restore_cursor"); + TPUTS_TRACE("restore_cursor"); tputs(restore_cursor, 0, _nc_outch); } else @@ -1686,6 +1695,9 @@ int _nc_scrolln(int n, int top, int bot, int maxy) _nc_scroll_window(curscr, n, top, bot, blank); + /* shift hash values too - they can be reused */ + _nc_scroll_oldhash(n, top, bot); + return(OK); } diff --git a/panel/Makefile.in b/panel/Makefile.in index 645e2108..3110f830 100644 --- a/panel/Makefile.in +++ b/panel/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.26 1998/02/11 12:14:02 tom Exp $ +# $Id: Makefile.in,v 1.28 1998/11/29 01:03:31 Rick.Ohnemus Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -84,8 +84,11 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ -SHLIB_LIST = -lncurses @SHLIB_LIST@ +SHLIB_DIRS = -L../lib -L$(libdir) +SHLIB_LIST = $(SHLIB_DIRS) -lncurses @SHLIB_LIST@ + MK_SHARED_LIB = @MK_SHARED_LIB@ + REL_VERSION = @cf_cv_rel_version@ ABI_VERSION = @cf_cv_abi_version@ @@ -98,7 +101,7 @@ LINT_OPTS = @LINT_OPTS@ LINT_LIBS = -lpanel -lncurses @LIBS@ AUTO_SRC = \ - ../include/panel.h + ../include/panel.h ################################################################################ all install :: $(AUTO_SRC) $(LIBRARIES) @@ -127,7 +130,7 @@ TAGS: mostlyclean :: -rm -f core tags TAGS *~ *.ln *.atac trace -clean :: +clean :: mostlyclean -rm -f $(AUTO_SRC) distclean :: clean diff --git a/panel/p_above.c b/panel/p_above.c index 0c3d10fc..fa32196d 100644 --- a/panel/p_above.c +++ b/panel/p_above.c @@ -35,7 +35,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_above.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_above.c,v 1.3 1999/09/18 11:03:28 juergen Exp $") PANEL* panel_above(const PANEL *pan) @@ -44,7 +44,7 @@ panel_above(const PANEL *pan) { /* if top and bottom are equal, we have no or only the pseudo panel; if not, we return the panel above the pseudo panel */ - return(_nc_bottom_panel==_nc_top_panel ? (PANEL*)0 : _nc_bottom_panel->above); + return(EMPTY_STACK() ? (PANEL*)0 : _nc_bottom_panel->above); } else return(pan->above); diff --git a/panel/p_below.c b/panel/p_below.c index 7e0f2b24..a7eb4705 100644 --- a/panel/p_below.c +++ b/panel/p_below.c @@ -35,7 +35,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_below.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_below.c,v 1.3 1999/09/18 11:03:33 juergen Exp $") PANEL* panel_below(const PANEL *pan) @@ -43,11 +43,11 @@ panel_below(const PANEL *pan) if(!pan) { /* if top and bottom are equal, we have no or only the pseudo panel */ - return(_nc_top_panel==_nc_bottom_panel ? (PANEL*)0 : _nc_top_panel); + return(EMPTY_STACK() ? (PANEL*)0 : _nc_top_panel); } else { /* we must not return the pseudo panel */ - return(pan->below==_nc_bottom_panel ? (PANEL*) 0 : pan->below); + return(Is_Pseudo(pan->below) ? (PANEL*) 0 : pan->below); } } diff --git a/panel/p_bottom.c b/panel/p_bottom.c index 47abc694..4e6e11d1 100644 --- a/panel/p_bottom.c +++ b/panel/p_bottom.c @@ -36,18 +36,44 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_bottom.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_bottom.c,v 1.5 1999/09/29 15:22:32 juergen Exp $") + +/*+------------------------------------------------------------------------- + __panel_link_bottom(pan) - link panel into stack at bottom +--------------------------------------------------------------------------*/ +static void +panel_link_bottom(PANEL *pan) +{ +#ifdef TRACE + dStack("",1,pan); + if(_nc_panel_is_linked(pan)) + return; +#endif + + pan->above = (PANEL *)0; + pan->below = (PANEL *)0; + + assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); + + pan->below = _nc_bottom_panel; + pan->above = _nc_bottom_panel->above; + if (pan->above) + pan->above->below = pan; + _nc_bottom_panel->above = pan; + + dStack("",9,pan); +} int bottom_panel(PANEL *pan) { if(!pan) return(ERR); - if(pan == _nc_bottom_panel) + if(Is_Bottom(pan)) return(OK); dBug(("--> bottom_panel %s", USER_PTR(pan->user))); if(_nc_panel_is_linked(pan)) (void)hide_panel(pan); - _nc_panel_link_bottom(pan); + panel_link_bottom(pan); return(OK); } diff --git a/panel/p_hidden.c b/panel/p_hidden.c index 4b90a619..fa05e6ab 100644 --- a/panel/p_hidden.c +++ b/panel/p_hidden.c @@ -36,12 +36,12 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hidden.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_hidden.c,v 1.3 1999/09/18 11:04:19 juergen Exp $") int panel_hidden(const PANEL *pan) { if(!pan) return(ERR); - return(_nc_panel_is_linked(pan) ? TRUE : FALSE); + return(_nc_panel_is_linked(pan) ? FALSE : TRUE); } diff --git a/panel/p_hide.c b/panel/p_hide.c index bc7c1921..d6142953 100644 --- a/panel/p_hide.c +++ b/panel/p_hide.c @@ -36,7 +36,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hide.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_hide.c,v 1.3 1999/09/29 15:22:32 juergen Exp $") /*+------------------------------------------------------------------------- __panel_unlink(pan) - unlink panel from stack @@ -53,8 +53,7 @@ __panel_unlink(PANEL *pan) return; #endif - _nc_override(pan,P_TOUCH); - _nc_free_obscure(pan); + PANEL_UPDATE(pan,(PANEL*)0); prev = pan->below; next = pan->above; @@ -72,8 +71,6 @@ __panel_unlink(PANEL *pan) if(pan == _nc_top_panel) _nc_top_panel = prev; - _nc_calculate_obscure(); - pan->above = (PANEL *)0; pan->below = (PANEL *)0; dStack("",9,pan); diff --git a/panel/p_move.c b/panel/p_move.c index 6bec36b9..3bc6328f 100644 --- a/panel/p_move.c +++ b/panel/p_move.c @@ -36,7 +36,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_move.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_move.c,v 1.3 1999/09/29 15:22:32 juergen Exp $") int move_panel(PANEL *pan, int starty, int startx) @@ -46,14 +46,9 @@ move_panel(PANEL *pan, int starty, int startx) if(!pan) return(ERR); if(_nc_panel_is_linked(pan)) - _nc_override(pan,P_TOUCH); + PANEL_UPDATE(pan,(PANEL*)0); win = pan->win; if(mvwin(win,starty,startx)) return(ERR); - getbegyx(win, pan->wstarty, pan->wstartx); - pan->wendy = pan->wstarty + getmaxy(win); - pan->wendx = pan->wstartx + getmaxx(win); - if(_nc_panel_is_linked(pan)) - _nc_calculate_obscure(); return(OK); } diff --git a/panel/p_new.c b/panel/p_new.c index b4acc279..f2f208d6 100644 --- a/panel/p_new.c +++ b/panel/p_new.c @@ -36,7 +36,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_new.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_new.c,v 1.4 1999/09/29 15:22:32 juergen Exp $") /*+------------------------------------------------------------------------- Get root (i.e. stdscr's) panel. @@ -54,18 +54,14 @@ root_panel(void) PANEL* pan = _nc_stdscr_pseudo_panel; WINDOW* win = stdscr; pan->win = win; - getbegyx(win, pan->wstarty, pan->wstartx); - pan->wendy = pan->wstarty + getmaxy(win); - pan->wendx = pan->wstartx + getmaxx(win); pan->below = (PANEL*)0; pan->above = (PANEL*)0; - pan->obscure = (PANELCONS*)0; #ifdef TRACE pan->user = "stdscr"; #else pan->user = (void*)0; #endif - _nc_panel_link_bottom(pan); + _nc_bottom_panel = _nc_top_panel = pan; } } return _nc_stdscr_pseudo_panel; @@ -84,15 +80,11 @@ new_panel(WINDOW *win) pan->win = win; pan->above = (PANEL *)0; pan->below = (PANEL *)0; - getbegyx(win, pan->wstarty, pan->wstartx); - pan->wendy = pan->wstarty + getmaxy(win); - pan->wendx = pan->wstartx + getmaxx(win); #ifdef TRACE pan->user = "new"; #else pan->user = (char *)0; #endif - pan->obscure = (PANELCONS *)0; (void)show_panel(pan); } return(pan); diff --git a/panel/p_replace.c b/panel/p_replace.c index c34d51d3..3c4aca18 100644 --- a/panel/p_replace.c +++ b/panel/p_replace.c @@ -36,7 +36,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_replace.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_replace.c,v 1.3 1999/09/29 15:22:32 juergen Exp $") int replace_panel(PANEL *pan, WINDOW *win) @@ -44,9 +44,7 @@ replace_panel(PANEL *pan, WINDOW *win) if(!pan) return(ERR); if(_nc_panel_is_linked(pan)) - _nc_override(pan,P_TOUCH); + PANEL_UPDATE(pan,(PANEL*)0); pan->win = win; - if(_nc_panel_is_linked(pan)) - _nc_calculate_obscure(); return(OK); } diff --git a/panel/p_show.c b/panel/p_show.c index 10781efb..d129fd50 100644 --- a/panel/p_show.c +++ b/panel/p_show.c @@ -36,7 +36,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_show.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_show.c,v 1.5 1999/09/29 15:22:32 juergen Exp $") static void panel_link_top(PANEL *pan) @@ -47,17 +47,15 @@ panel_link_top(PANEL *pan) return; #endif + assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); + pan->above = (PANEL *)0; pan->below = (PANEL *)0; - if(_nc_top_panel) - { - _nc_top_panel->above = pan; - pan->below = _nc_top_panel; - } + + _nc_top_panel->above = pan; + pan->below = _nc_top_panel; _nc_top_panel = pan; - if(!_nc_bottom_panel) - _nc_bottom_panel = pan; - _nc_calculate_obscure(); + dStack("",9,pan); } @@ -66,11 +64,16 @@ show_panel(PANEL *pan) { if(!pan) return(ERR); - if(pan == _nc_top_panel) + + if (Is_Top(pan)) return(OK); + dBug(("--> show_panel %s", USER_PTR(pan->user))); + if(_nc_panel_is_linked(pan)) (void)hide_panel(pan); + panel_link_top(pan); + return(OK); } diff --git a/panel/p_update.c b/panel/p_update.c index e7e31ef6..692a3f33 100644 --- a/panel/p_update.c +++ b/panel/p_update.c @@ -36,7 +36,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_update.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_update.c,v 1.3 1999/09/29 15:22:32 juergen Exp $") void update_panels(void) @@ -45,9 +45,9 @@ update_panels(void) dBug(("--> update_panels")); pan = _nc_bottom_panel; - while(pan) + while(pan && pan->above) { - _nc_override(pan,P_UPDATE); + PANEL_UPDATE(pan,pan->above); pan = pan->above; } diff --git a/panel/panel.c b/panel/panel.c index c90ad4f5..1b79b77f 100644 --- a/panel/panel.c +++ b/panel/panel.c @@ -34,13 +34,13 @@ /* panel.c -- implementation of panels library, some core routines */ #include "panel.priv.h" -MODULE_ID("$Id: panel.c,v 1.15 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: panel.c,v 1.18 1999/09/29 15:22:32 juergen Exp $") #ifdef TRACE #ifndef TRACE_TXT const char *_nc_my_visbuf(const void *ptr) { - char temp[20]; + char temp[32]; if (ptr != 0) sprintf(temp, "ptr:%p", ptr); else @@ -62,7 +62,7 @@ _nc_dPanel(const char *text, const PANEL *pan) text, USER_PTR(pan->user), (pan->below) ? USER_PTR(pan->below->user) : "--", (pan->above) ? USER_PTR(pan->above->user) : "--", - pan->wstarty, pan->wstartx); + PSTARTY(pan), PSTARTX(pan)); } #endif @@ -128,181 +128,9 @@ _nc_Touchline(const PANEL *pan, int start, int count) } #endif -/*+------------------------------------------------------------------------- - __panels_overlapped(pan1,pan2) - check panel overlapped ---------------------------------------------------------------------------*/ -static INLINE bool -__panels_overlapped(register const PANEL *pan1, register const PANEL *pan2) -{ - if(!pan1 || !pan2) - return(FALSE); - - dBug(("__panels_overlapped %s %s", USER_PTR(pan1->user), USER_PTR(pan2->user))); - /* pan1 intersects with pan2 ? */ - if( (((pan1->wstarty >= pan2->wstarty) && (pan1->wstarty < pan2->wendy)) || - ((pan2->wstarty >= pan1->wstarty) && (pan2->wstarty < pan1->wendy))) && - (((pan1->wstartx >= pan2->wstartx) && (pan1->wstartx < pan2->wendx)) || - ((pan2->wstartx >= pan1->wstartx) && (pan2->wstartx < pan1->wendx))) - ) return(TRUE); - else { - dBug((" no")); - return(FALSE); - } -} - -/*+------------------------------------------------------------------------- - _nc_free_obscure(pan) ---------------------------------------------------------------------------*/ -void -_nc_free_obscure(PANEL *pan) -{ - PANELCONS *tobs = pan->obscure; /* "this" one */ - PANELCONS *nobs; /* "next" one */ - - while(tobs) - { - nobs = tobs->above; - free((char *)tobs); - tobs = nobs; - } - pan->obscure = (PANELCONS *)0; -} - -/*+------------------------------------------------------------------------- - __override(pan,show) ---------------------------------------------------------------------------*/ -void -_nc_override(const PANEL *pan, int show) -{ - int y; - PANEL *pan2; - PANELCONS *tobs = pan->obscure; /* "this" one */ - - dBug(("_nc_override %s,%d", USER_PTR(pan->user),show)); - - switch (show) - { - case P_TOUCH: - Touchpan(pan); - /* The following while loop will now mark all panel window lines - * obscured by use or obscuring us as touched, so they will be - * updated. - */ - break; - case P_UPDATE: - while(tobs && (tobs->pan != pan)) - tobs = tobs->above; - /* The next loop will now only go through the panels obscuring pan; - * it updates all the lines in the obscuring panels in sync. with - * the lines touched in pan itself. This is called in update_panels() - * in a loop from the bottom_panel to the top_panel, resulting in - * the desired update effect. - */ - break; - default: - return; - } - - while(tobs) - { - if((pan2 = tobs->pan) != pan) { - dBug(("test obs pan=%s pan2=%s", USER_PTR(pan->user), USER_PTR(pan2->user))); - for(y = pan->wstarty; y < pan->wendy; y++) { - if( (y >= pan2->wstarty) && (y < pan2->wendy) && - ((is_linetouched(pan->win,y - pan->wstarty) == TRUE)) ) - Touchline(pan2,y - pan2->wstarty,1); - } - } - tobs = tobs->above; - } -} - -/*+------------------------------------------------------------------------- - __calculate_obscure() ---------------------------------------------------------------------------*/ -void -_nc_calculate_obscure(void) -{ - PANEL *pan; - PANEL *pan2; - PANELCONS *tobs; /* "this" one */ - PANELCONS *lobs = (PANELCONS *)0; /* last one */ - - pan = _nc_bottom_panel; - while(pan) - { - if(pan->obscure) - _nc_free_obscure(pan); - dBug(("--> __calculate_obscure %s", USER_PTR(pan->user))); - lobs = (PANELCONS *)0; /* last one */ - pan2 = _nc_bottom_panel; - /* This loop builds a list of panels obsured by pan or obscuring - pan; pan itself is in the list; all panels before pan are - obscured by pan, all panels after pan are obscuring pan. */ - while(pan2) - { - if(__panels_overlapped(pan,pan2)) - { - if(!(tobs = (PANELCONS *)malloc(sizeof(PANELCONS)))) - return; - tobs->pan = pan2; - dPanel("obscured",pan2); - tobs->above = (PANELCONS *)0; - if(lobs) - lobs->above = tobs; - else - pan->obscure = tobs; - lobs = tobs; - } - pan2 = pan2->above; - } - _nc_override(pan,P_TOUCH); - pan = pan->above; - } -} - -/*+------------------------------------------------------------------------- - _nc_panel_is_linked(pan) - check to see if panel is in the stack ---------------------------------------------------------------------------*/ -bool -_nc_panel_is_linked(const PANEL *pan) -{ - /* This works! The only case where it would fail is, when the list has - only one element. But this could only be the pseudo panel at the bottom */ - return ( ((pan->above!=(PANEL *)0) || - (pan->below!=(PANEL *)0) || - (pan==_nc_bottom_panel)) ? TRUE : FALSE ); -} - - -/*+------------------------------------------------------------------------- - __panel_link_bottom(pan) - link panel into stack at bottom ---------------------------------------------------------------------------*/ -void -_nc_panel_link_bottom(PANEL *pan) -{ -#ifdef TRACE - dStack("",1,pan); - if(_nc_panel_is_linked(pan)) - return; +#ifndef TRACE +# ifndef __GNUC__ + /* Some C compilers need something defined in a source file */ + static char GCC_UNUSED dummy; +# endif #endif - - pan->above = (PANEL *)0; - pan->below = (PANEL *)0; - if(_nc_bottom_panel) - { /* the stdscr pseudo panel always stays real bottom; - so we insert after bottom panel*/ - pan->below = _nc_bottom_panel; - pan->above = _nc_bottom_panel->above; - if (pan->above) - pan->above->below = pan; - _nc_bottom_panel->above = pan; - } - else - _nc_bottom_panel = pan; - if(!_nc_top_panel) - _nc_top_panel = pan; - assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); - _nc_calculate_obscure(); - dStack("",9,pan); -} diff --git a/panel/panel.h b/panel/panel.h index 2ebc3292..dc33071b 100644 --- a/panel/panel.h +++ b/panel/panel.h @@ -40,37 +40,31 @@ typedef struct panel { - WINDOW *win; - int wstarty; - int wendy; - int wstartx; - int wendx; - struct panel *below; - struct panel *above; - NCURSES_CONST void *user; - struct panelcons *obscure; -} -PANEL; + WINDOW *win; + struct panel *below; + struct panel *above; + NCURSES_CONST void *user; +} PANEL; #if defined(__cplusplus) extern "C" { #endif -extern WINDOW *panel_window(const PANEL *); -extern void update_panels(void); -extern int hide_panel(PANEL *); -extern int show_panel(PANEL *); -extern int del_panel(PANEL *); -extern int top_panel(PANEL *); -extern int bottom_panel(PANEL *); -extern PANEL *new_panel(WINDOW *); -extern PANEL *panel_above(const PANEL *); -extern PANEL *panel_below(const PANEL *); -extern int set_panel_userptr(PANEL *, NCURSES_CONST void *); +extern WINDOW* panel_window(const PANEL *); +extern void update_panels(void); +extern int hide_panel(PANEL *); +extern int show_panel(PANEL *); +extern int del_panel(PANEL *); +extern int top_panel(PANEL *); +extern int bottom_panel(PANEL *); +extern PANEL* new_panel(WINDOW *); +extern PANEL* panel_above(const PANEL *); +extern PANEL* panel_below(const PANEL *); +extern int set_panel_userptr(PANEL *, NCURSES_CONST void *); extern NCURSES_CONST void* panel_userptr(const PANEL *); -extern int move_panel(PANEL *, int, int); -extern int replace_panel(PANEL *,WINDOW *); -extern int panel_hidden(const PANEL *); +extern int move_panel(PANEL *, int, int); +extern int replace_panel(PANEL *,WINDOW *); +extern int panel_hidden(const PANEL *); #if defined(__cplusplus) } diff --git a/panel/panel.priv.h b/panel/panel.priv.h index 80b1d8f9..cd470a98 100644 --- a/panel/panel.priv.h +++ b/panel/panel.priv.h @@ -1,4 +1,4 @@ -/* $Id: panel.priv.h,v 1.8 1997/10/21 10:19:37 juergen Exp $ */ +/* $Id: panel.priv.h,v 1.10 1999/09/29 15:21:58 juergen Exp $ */ #ifndef _PANEL_PRIV_H #define _PANEL_PRIV_H @@ -28,20 +28,12 @@ # define INLINE #endif -typedef struct panelcons -{ - struct panelcons *above; - struct panel *pan; -} PANELCONS; - #ifdef USE_RCS_IDS # define MODULE_ID(id) static const char Ident[] = id; #else # define MODULE_ID(id) /*nothing*/ #endif -#define P_TOUCH (0) -#define P_UPDATE (1) #ifdef TRACE extern const char *_nc_my_visbuf(const void *); @@ -76,10 +68,47 @@ typedef struct panelcons #define _nc_top_panel _nc_panelhook()->top_panel #define _nc_bottom_panel _nc_panelhook()->bottom_panel -extern void _nc_panel_link_bottom(PANEL*); -extern bool _nc_panel_is_linked(const PANEL*); -extern void _nc_calculate_obscure(void); -extern void _nc_free_obscure(PANEL*); -extern void _nc_override(const PANEL*,int); - +#define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel) +#define Is_Bottom(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p))) +#define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p))) +#define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel)) + +/*+------------------------------------------------------------------------- + _nc_panel_is_linked(pan) - check to see if panel is in the stack +--------------------------------------------------------------------------*/ +/* This works! The only case where it would fail is, when the list has + only one element. But this could only be the pseudo panel at the bottom */ +#define _nc_panel_is_linked(p) ((((p)->above!=(PANEL*)0)||((p)->below!=(PANEL*)0)||((p)==_nc_bottom_panel)) ? TRUE : FALSE) + +#define PSTARTX(pan) ((pan)->win->_begx) +#define PENDX(pan) ((pan)->win->_begx + getmaxx((pan)->win)) +#define PSTARTY(pan) ((pan)->win->_begy) +#define PENDY(pan) ((pan)->win->_begy + getmaxy((pan)->win)) + +/*+------------------------------------------------------------------------- + PANELS_OVERLAPPED(pan1,pan2) - check panel overlapped +---------------------------------------------------------------------------*/ +#define PANELS_OVERLAPPED(pan1,pan2) \ +(( !(pan1) || !(pan2) || \ + PSTARTY(pan1) >= PENDY(pan2) || PENDY(pan1) <= PSTARTY(pan2) ||\ + PSTARTX(pan1) >= PENDX(pan2) || PENDX(pan1) <= PSTARTX(pan2) ) \ + ? FALSE : TRUE) + + +#define PANEL_UPDATE(pan,panstart) { int y; PANEL* pan2 = panstart;\ + if (!pan2) {\ + Touchpan(pan);\ + pan2 = _nc_bottom_panel;\ + }\ + while(pan2) {\ + if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\ + for(y = PSTARTY(pan); y < PENDY(pan); y++) {\ + if( (y >= PSTARTY(pan2)) && (y < PENDY(pan2)) &&\ + ((is_linetouched(pan->win,y - PSTARTY(pan)) == TRUE)) )\ + Touchline(pan2,y - PSTARTY(pan2),1);\ + }\ + }\ + pan2 = pan2->above;\ + }\ +} #endif /* _PANEL_PRIV_H */ diff --git a/progs/Makefile.in b/progs/Makefile.in index 598c218e..f22a0168 100644 --- a/progs/Makefile.in +++ b/progs/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.35 1998/02/11 12:14:03 tom Exp $ +# $Id: Makefile.in,v 1.37 1998/05/31 00:07:33 tom Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -84,14 +84,14 @@ CFLAGS_SHARED = $(CCFLAGS) # @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LD = @LD@ -LINK = $(CC) +LINK = @LINK_PROGS@ $(CC) LDFLAGS = @EXTRA_LDFLAGS@ \ @PROG_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@ LDFLAGS_NORMAL = $(LDFLAGS) LDFLAGS_DEBUG = $(LDFLAGS) @CC_G_OPT@ LDFLAGS_PROFILE = $(LDFLAGS) -pg -LDFLAGS_SHARED = $(LDFLAGS) @CC_SHARED_OPTS@ # @LD_SHARED_OPTS@ +LDFLAGS_SHARED = $(LDFLAGS) @LD_SHARED_OPTS@ LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) diff --git a/progs/clear.c b/progs/clear.c index b813f0e4..d27b6254 100644 --- a/progs/clear.c +++ b/progs/clear.c @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: clear.c,v 1.7 1998/02/11 12:14:02 tom Exp $") +MODULE_ID("$Id: clear.c,v 1.8 1998/09/26 11:42:50 tom Exp $") static int putch(int c) { @@ -52,8 +52,7 @@ int main( char *argv[] GCC_UNUSED) { setupterm((char *) 0, STDOUT_FILENO, (int *) 0); - if (clear_screen == (char *) 0) - return EXIT_FAILURE; - tputs(clear_screen, lines > 0 ? lines : 1, putch); - return EXIT_SUCCESS; + return (tputs(clear_screen, lines > 0 ? lines : 1, putch) == ERR) + ? EXIT_FAILURE + : EXIT_SUCCESS; } diff --git a/progs/dump_entry.c b/progs/dump_entry.c index 605b14c7..8324fe22 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,12 +36,14 @@ #include "dump_entry.h" #include "termsort.c" /* this C file is generated */ -#include "parametrized.h" /* so is this */ +#include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.25 1998/02/11 12:14:02 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.37 1999/03/14 12:29:30 tom Exp $") #define INDENT 8 +#define DISCARD(string) string = ABSENT_STRING + static int tversion; /* terminfo version */ static int outform; /* output format to use */ static int sortmode; /* sort mode to use */ @@ -49,6 +51,7 @@ static int width = 60; /* max line width for listings */ static int column; /* current column, limited by 'width' */ static int oldcol; /* last value of column before wrap */ static int tracelevel; /* level of debug output */ +static bool pretty; /* true if we format if-then-else strings */ static char *outbuf; /* the output-buffer */ static size_t out_used; /* ...its current length */ @@ -71,6 +74,16 @@ static const char *separator, *trailer; #define OBSOLETE(n) (n[0] == 'O' && n[1] == 'T') +#if NCURSES_XNAMES +#define BoolIndirect(j) ((j >= BOOLCOUNT) ? (j) : ((sortmode == S_NOSORT) ? j : bool_indirect[j])) +#define NumIndirect(j) ((j >= NUMCOUNT) ? (j) : ((sortmode == S_NOSORT) ? j : num_indirect[j])) +#define StrIndirect(j) ((j >= STRCOUNT) ? (j) : ((sortmode == S_NOSORT) ? j : str_indirect[j])) +#else +#define BoolIndirect(j) ((sortmode == S_NOSORT) ? (j) : bool_indirect[j]) +#define NumIndirect(j) ((sortmode == S_NOSORT) ? (j) : num_indirect[j]) +#define StrIndirect(j) ((sortmode == S_NOSORT) ? (j) : str_indirect[j]) +#endif + #if NO_LEAKS void _nc_leaks_dump_entry(void) { @@ -86,7 +99,7 @@ NCURSES_CONST char *nametrans(const char *name) { const struct name_table_entry *np; - if ((np = _nc_find_entry(name, _nc_info_hash_table)) != NULL) + if ((np = _nc_find_entry(name, _nc_get_hash_table(0))) != 0) switch(np->nte_type) { case BOOLEAN: @@ -105,17 +118,18 @@ NCURSES_CONST char *nametrans(const char *name) break; } - return((char *)NULL); + return(0); } -void dump_init(const char *version, int mode, int sort, int twidth, int traceval) +void dump_init(const char *version, int mode, int sort, int twidth, int traceval, bool formatted) /* set up for entry display */ { width = twidth; + pretty = formatted; tracelevel = traceval; /* versions */ - if (version == (char *)NULL) + if (version == 0) tversion = V_ALLCAPS; else if (!strcmp(version, "SVr1") || !strcmp(version, "SVR1") || !strcmp(version, "Ultrix")) @@ -161,7 +175,7 @@ void dump_init(const char *version, int mode, int sort, int twidth, int traceval /* implement sort modes */ switch(sortmode = sort) - { + { case S_NOSORT: if (traceval) (void) fprintf(stderr, @@ -386,13 +400,75 @@ static int termcap_length(const char *src) #define termcap_length(src) strlen(src) #endif +static char * fmt_complex(char *dst, char *src, int level) +{ + int percent = 0; + int n; + + dst += strlen(dst); + while (*src != '\0') { + switch (*src) { + case '\\': + percent = 0; + *dst++ = *src++; + break; + case '%': + percent = 1; + break; + case '?': /* "if" */ + case 't': /* "then" */ + case 'e': /* "else" */ + if (percent) { + percent = 0; + dst[-1] = '\n'; + for (n = 0; n <= level; n++) + *dst++ = '\t'; + *dst++ = '%'; + *dst++ = *src; + *dst = '\0'; + if (*src++ == '?') { + src = fmt_complex(dst, src, level+1); + dst += strlen(dst); + } else if (level == 1) { + _nc_warning("%%%c without %%?", *src); + } + continue; + } + break; + case ';': /* "endif" */ + if (percent) { + percent = 0; + if (level > 1) { + dst[-1] = '\n'; + for (n = 0; n < level; n++) + *dst++ = '\t'; + *dst++ = '%'; + *dst++ = *src++; + *dst = '\0'; + return src; + } + _nc_warning("%%; without %%?"); + } + break; + default: + percent = 0; + break; + } + *dst++ = *src++; + } + *dst = '\0'; + return src; +} + int fmt_entry(TERMTYPE *tterm, int (*pred)(int type, int idx), bool suppress_untranslatable, - bool infodump) + bool infodump, + int numbers) { int i, j; char buffer[MAX_TERMINFO_LENGTH]; +NCURSES_CONST char *name; int predval, len; int num_bools = 0; int num_values = 0; @@ -405,32 +481,30 @@ bool outcount = 0; len = 12; /* terminfo file-header */ - if (pred == NULL) { + if (pred == 0) { cur_type = tterm; pred = dump_predicate; } - append_output(NULL); + append_output(0); append_output(tterm->term_names); append_output(separator); column = out_used; force_wrap(); - for (j=0; j < BOOLCOUNT; j++) { - if (sortmode == S_NOSORT) - i = j; - else - i = bool_indirect[j]; + for_each_boolean(j,tterm) { + i = BoolIndirect(j); + name = ExtBoolname(tterm,i,bool_names); if (!version_filter(BOOLEAN, i)) continue; else if ((outform == F_LITERAL || outform == F_TERMINFO || outform == F_VARIABLE) - && (OBSOLETE(bool_names[i]) && outform != F_LITERAL)) + && (OBSOLETE(name) && outform != F_LITERAL)) continue; predval = pred(BOOLEAN, i); if (predval != FAIL) { - (void) strcpy(buffer, bool_names[i]); + (void) strcpy(buffer, name); if (predval <= 0) (void) strcat(buffer, "@"); else if (i + 1 > num_bools) @@ -442,24 +516,22 @@ bool outcount = 0; if (column != INDENT) force_wrap(); - for (j=0; j < NUMCOUNT; j++) { - if (sortmode == S_NOSORT) - i = j; - else - i = num_indirect[j]; + for_each_number(j,tterm) { + i = NumIndirect(j); + name = ExtNumname(tterm,i,num_names); if (!version_filter(NUMBER, i)) continue; else if ((outform == F_LITERAL || outform == F_TERMINFO || outform == F_VARIABLE) - && (OBSOLETE(num_names[i]) && outform != F_LITERAL)) + && (OBSOLETE(name) && outform != F_LITERAL)) continue; predval = pred(NUMBER, i); if (predval != FAIL) { if (tterm->Numbers[i] < 0) { - sprintf(buffer, "%s@", num_names[i]); + sprintf(buffer, "%s@", name); } else { - sprintf(buffer, "%s#%d", num_names[i], tterm->Numbers[i]); + sprintf(buffer, "%s#%d", name, tterm->Numbers[i]); if (i + 1 > num_values) num_values = i + 1; } @@ -477,16 +549,14 @@ bool outcount = 0; len++; repair_acsc(tterm); - for (j=0; j < STRCOUNT; j++) { - if (sortmode == S_NOSORT) - i = j; - else - i = str_indirect[j]; + for_each_string(j, tterm) { + i = StrIndirect(j); + name = ExtStrname(tterm,i,str_names); if (!version_filter(STRING, i)) continue; else if ((outform == F_LITERAL || outform == F_TERMINFO || outform == F_VARIABLE) - && (OBSOLETE(str_names[i]) && outform != F_LITERAL)) + && (OBSOLETE(name) && outform != F_LITERAL)) continue; /* @@ -495,6 +565,7 @@ bool outcount = 0; * them to be output as defined and empty. */ if (outform==F_TERMCAP) + { #undef CUR #define CUR tterm-> if (insert_character || parm_ich) @@ -514,6 +585,17 @@ bool outcount = 0; } } + if (init_3string != 0 + && termcap_reset != 0 + && !strcmp(init_3string, termcap_reset)) + DISCARD(init_3string); + + if (reset_2string != 0 + && termcap_reset != 0 + && !strcmp(reset_2string, termcap_reset)) + DISCARD(reset_2string); + } + predval = pred(STRING, i); buffer[0] = '\0'; if (predval != FAIL) { @@ -521,28 +603,33 @@ bool outcount = 0; && i + 1 > num_strings) num_strings = i + 1; if (!VALID_STRING(tterm->Strings[i])) - sprintf(buffer, "%s@", str_names[i]); + sprintf(buffer, "%s@", name); else if (outform == F_TERMCAP || outform == F_TCONVERR) { - char *srccap = _nc_tic_expand(tterm->Strings[i], FALSE); - char *cv = _nc_infotocap(str_names[i], srccap, parametrized[i]); + char *srccap = _nc_tic_expand(tterm->Strings[i], FALSE, numbers); + char *cv = _nc_infotocap(name, srccap, parametrized[i]); - if (cv == (char *)NULL) + if (cv == 0) { if (outform == F_TCONVERR) - sprintf(buffer, "%s=!!! %s WILL NOT CONVERT !!!", str_names[i], srccap); + sprintf(buffer, "%s=!!! %s WILL NOT CONVERT !!!", name, srccap); else if (suppress_untranslatable) continue; else - sprintf(buffer, "..%s=%s", str_names[i], srccap); + sprintf(buffer, "..%s=%s", name, srccap); } else - sprintf(buffer, "%s=%s", str_names[i], cv); + sprintf(buffer, "%s=%s", name, cv); len += strlen(tterm->Strings[i]) + 1; } else { - sprintf(buffer, "%s=%s", str_names[i], _nc_tic_expand(tterm->Strings[i], outform==F_TERMINFO)); + char *src = _nc_tic_expand(tterm->Strings[i], outform==F_TERMINFO, numbers); + sprintf(buffer, "%s=", name); + if (pretty && outform==F_TERMINFO) + fmt_complex(buffer + strlen(buffer), src, 1); + else + strcat(buffer, src); len += strlen(tterm->Strings[i]) + 1; } @@ -596,7 +683,7 @@ bool outcount = 0; if (box_ok) { (void) strcpy(buffer, "box1="); - (void) strcat(buffer, _nc_tic_expand(boxchars, outform==F_TERMINFO)); + (void) strcat(buffer, _nc_tic_expand(boxchars, outform==F_TERMINFO, numbers)); WRAP_CONCAT; } } @@ -641,7 +728,7 @@ bool outcount = 0; return(infodump ? len : termcap_length(outbuf)); } -int dump_entry(TERMTYPE *tterm, bool limited, int (*pred)(int type, int idx)) +int dump_entry(TERMTYPE *tterm, bool limited, int numbers, int (*pred)(int type, int idx)) /* dump a single entry */ { int len, critlen; @@ -662,21 +749,21 @@ int dump_entry(TERMTYPE *tterm, bool limited, int (*pred)(int type, int idx)) infodump = TRUE; } - if (((len = fmt_entry(tterm, pred, FALSE, infodump)) > critlen) && limited) + if (((len = fmt_entry(tterm, pred, FALSE, infodump, numbers)) > critlen) && limited) { (void) printf("# (untranslatable capabilities removed to fit entry within %d bytes)\n", critlen); - if ((len = fmt_entry(tterm, pred, TRUE, infodump)) > critlen) + if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) { /* * We pick on sgr because it's a nice long string capability that * is really just an optimization hack. */ char *oldsgr = set_attributes; - set_attributes = ABSENT_STRING; + set_attributes = ABSENT_STRING; (void) printf("# (sgr removed to fit entry within %d bytes)\n", critlen); - if ((len = fmt_entry(tterm, pred, TRUE, infodump)) > critlen) + if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) { int oldversion = tversion; @@ -684,7 +771,7 @@ int dump_entry(TERMTYPE *tterm, bool limited, int (*pred)(int type, int idx)) (void) printf("# (terminfo-only capabilities suppressed to fit entry within %d bytes)\n", critlen); - if ((len = fmt_entry(tterm, pred, TRUE, infodump)) > critlen) + if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) { (void) fprintf(stderr, "warning: %s entry is %d bytes long\n", @@ -709,65 +796,60 @@ int dump_uses(const char *name, bool infodump) { char buffer[MAX_TERMINFO_LENGTH]; - append_output(NULL); + append_output(0); (void)sprintf(buffer, "%s%s", infodump ? "use=" : "tc=", name); wrap_concat(buffer); (void) fputs(outbuf, stdout); return out_used; } -void compare_entry(void (*hook)(int t, int i, const char *name)) +void compare_entry(void (*hook)(int t, int i, const char *name), TERMTYPE *tp GCC_UNUSED) /* compare two entries */ { int i, j; + NCURSES_CONST char * name; (void) fputs(" comparing booleans.\n", stdout); - for (j=0; j < BOOLCOUNT; j++) + for_each_boolean(j,tp) { - if (sortmode == S_NOSORT) - i = j; - else - i = bool_indirect[j]; + i = BoolIndirect(j); + name = ExtBoolname(tp,i,bool_names); if ((outform == F_LITERAL || outform == F_TERMINFO || outform == F_VARIABLE) - && (OBSOLETE(bool_names[i]) && outform != F_LITERAL)) + && (OBSOLETE(name) && outform != F_LITERAL)) continue; - (*hook)(BOOLEAN, i, bool_names[i]); + (*hook)(BOOLEAN, i, name); } (void) fputs(" comparing numbers.\n", stdout); - for (j=0; j < NUMCOUNT; j++) + for_each_number(j,tp) { - if (sortmode == S_NOSORT) - i = j; - else - i = num_indirect[j]; + i = NumIndirect(j); + name = ExtNumname(tp,i,num_names); if ((outform==F_LITERAL || outform==F_TERMINFO || outform==F_VARIABLE) - && (OBSOLETE(num_names[i]) && outform != F_LITERAL)) + && (OBSOLETE(name) && outform != F_LITERAL)) continue; - (*hook)(NUMBER, i, num_names[i]); + (*hook)(NUMBER, i, name); } (void) fputs(" comparing strings.\n", stdout); - for (j=0; j < STRCOUNT; j++) + for_each_string(j,tp) { - if (sortmode == S_NOSORT) - i = j; - else - i = str_indirect[j]; + i = StrIndirect(j); + name = ExtStrname(tp,i,str_names); if ((outform==F_LITERAL || outform==F_TERMINFO || outform==F_VARIABLE) - && (OBSOLETE(str_names[i]) && outform != F_LITERAL)) + && (OBSOLETE(name) && outform != F_LITERAL)) continue; - (*hook)(STRING, i, str_names[i]); + (*hook)(STRING, i, name); } } -#define NOTSET(s) ((s) == (char *)NULL) +#define NOTSET(s) ((s) == 0) /* * This bit of legerdemain turns all the terminfo variable names into diff --git a/progs/dump_entry.h b/progs/dump_entry.h index 2a24ea9d..d7e27c53 100644 --- a/progs/dump_entry.h +++ b/progs/dump_entry.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -51,10 +51,10 @@ #define S_TERMCAP 4 /* sort by termcap names */ extern NCURSES_CONST char *nametrans(const char *); -extern void dump_init(const char *, int, int, int, int); -extern int fmt_entry(TERMTYPE *, int (*)(int, int), bool, bool); -extern int dump_entry(TERMTYPE *, bool, int (*)(int, int)); +extern void dump_init(const char *, int, int, int, int, bool); +extern int fmt_entry(TERMTYPE *, int (*)(int, int), bool, bool, int); +extern int dump_entry(TERMTYPE *, bool, int, int (*)(int, int)); extern int dump_uses(const char *, bool); -extern void compare_entry(void (*)(int, int, const char *)); +extern void compare_entry(void (*)(int, int, const char *), TERMTYPE *); #define FAIL -1 diff --git a/progs/infocmp.c b/progs/infocmp.c index d603353b..59652240 100644 --- a/progs/infocmp.c +++ b/progs/infocmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,7 +42,7 @@ #include #include -MODULE_ID("$Id: infocmp.c,v 1.34 1998/02/11 12:14:03 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.44 1999/06/16 00:39:48 tom Exp $") #define L_CURL "{" #define R_CURL "}" @@ -65,6 +65,7 @@ static TERMTYPE term[MAXTERMS]; /* terminfo entries */ static int termcount; /* count of terminal entries */ static const char *tversion; /* terminfo version selected */ +static int numbers = 0; /* format "%'char'" to/from "%{number}" */ static int outform; /* output format */ static int sortmode; /* sort_mode */ static int itrace; /* trace flag for debugging */ @@ -85,7 +86,7 @@ static void ExitProgram(int code) GCC_NORETURN; static void ExitProgram(int code) { while (termcount-- > 0) - _nc_free_termtype(&term[termcount], FALSE); + _nc_free_termtype(&term[termcount]); _nc_leaks_dump_entry(); _nc_free_and_exit(code); } @@ -205,21 +206,23 @@ static bool entryeq(TERMTYPE *t1, TERMTYPE *t2) { int i; - for (i = 0; i < BOOLCOUNT; i++) + for (i = 0; i < NUM_BOOLEANS(t1); i++) if (t1->Booleans[i] != t2->Booleans[i]) return(FALSE); - for (i = 0; i < NUMCOUNT; i++) + for (i = 0; i < NUM_NUMBERS(t1); i++) if (t1->Numbers[i] != t2->Numbers[i]) return(FALSE); - for (i = 0; i < STRCOUNT; i++) + for (i = 0; i < NUM_STRINGS(t1); i++) if (capcmp(t1->Strings[i], t2->Strings[i])) return(FALSE); return(TRUE); } +#define TIC_EXPAND(result) _nc_tic_expand(result, outform==F_TERMINFO, numbers) + static void compare_predicate(int type, int idx, const char *name) /* predicate function to use for entry difference reports */ { @@ -289,7 +292,7 @@ static void compare_predicate(int type, int idx, const char *name) else { (void) strcpy(buf1, "'"); - (void) strcat(buf1, _nc_tic_expand(s1, outform==F_TERMINFO)); + (void) strcat(buf1, TIC_EXPAND(s1)); (void) strcat(buf1, "'"); } @@ -298,18 +301,19 @@ static void compare_predicate(int type, int idx, const char *name) else { (void) strcpy(buf2, "'"); - (void) strcat(buf2, _nc_tic_expand(s2, outform==F_TERMINFO)); + (void) strcat(buf2, TIC_EXPAND(s2)); (void) strcat(buf2, "'"); } - (void) printf("\t%s: %s, %s.\n", - name, buf1, buf2); + if (strcmp(buf1, buf2)) + (void) printf("\t%s: %s, %s.\n", + name, buf1, buf2); } break; case C_COMMON: if (s1 && s2 && !capcmp(s1, s2)) - (void) printf("\t%s= '%s'.\n", name, _nc_tic_expand(s1, outform==F_TERMINFO)); + (void) printf("\t%s= '%s'.\n", name, TIC_EXPAND(s1)); break; case C_NAND: @@ -580,7 +584,7 @@ static void analyze_string(const char *name, const char *cap, TERMTYPE *tp) /* couldn't match anything */ buf2[0] = *sp; buf2[1] = '\0'; - (void) strcat(buf, _nc_tic_expand(buf2, outform==F_TERMINFO)); + (void) strcat(buf, TIC_EXPAND(buf2)); } } (void) printf("%s\n", buf); @@ -602,7 +606,7 @@ static void file_comparison(int argc, char *argv[]) ENTRY *qp, *rp; int i, n; - dump_init((char *)NULL, F_LITERAL, S_TERMINFO, 0, itrace); + dump_init((char *)NULL, F_LITERAL, S_TERMINFO, 0, itrace, FALSE); for (n = 0; n < argc && n < MAXCOMPARE; n++) { @@ -736,12 +740,16 @@ static void file_comparison(int argc, char *argv[]) { rp = (ENTRY *)qp->uses[0].parent; +#if NCURSES_XNAMES + if (termcount > 1) + _nc_align_termtype(&qp->tterm, &rp->tterm); +#endif if (qp->nuses == 1 && !entryeq(&qp->tterm, &rp->tterm)) { char name1[NAMESIZE], name2[NAMESIZE]; - memcpy(&term[0], &qp->tterm, sizeof(TERMTYPE)); - memcpy(&term[1], &rp->tterm, sizeof(TERMTYPE)); + term[0] = qp->tterm; + term[1] = rp->tterm; (void) canonical_name(qp->tterm.term_names, name1); (void) canonical_name(rp->tterm.term_names, name2); @@ -752,7 +760,7 @@ static void file_comparison(int argc, char *argv[]) if (itrace) (void)fprintf(stderr, "infocmp: dumping differences\n"); (void) printf("comparing %s to %s.\n", name1, name2); - compare_entry(compare_predicate); + compare_entry(compare_predicate, term); break; case C_COMMON: @@ -760,7 +768,7 @@ static void file_comparison(int argc, char *argv[]) (void) fprintf(stderr, "infocmp: dumping common capabilities\n"); (void) printf("comparing %s to %s.\n", name1, name2); - compare_entry(compare_predicate); + compare_entry(compare_predicate, term); break; case C_NAND: @@ -768,7 +776,7 @@ static void file_comparison(int argc, char *argv[]) (void) fprintf(stderr, "infocmp: dumping differences\n"); (void) printf("comparing %s to %s.\n", name1, name2); - compare_entry(compare_predicate); + compare_entry(compare_predicate, term); break; } @@ -778,11 +786,202 @@ static void file_comparison(int argc, char *argv[]) static void usage(void) { - fprintf(stderr, -"usage: infocmp [-dcnILCuvV1T] [-s d| i| l| c] [-w width] [-A directory] [-B directory] [termname...]\n"); + static const char *tbl[] = { + "Usage: infocmp [options] [-A directory] [-B directory] [termname...]" + ,"" + ,"Options:" + ," -1 print single-column" + ," -C use termcap-names" + ," -F compare terminfo-files" + ," -I use terminfo-names" + ," -L use long names" + ," -R subset (see manpage)" + ," -T eliminate size limits (test)" + ," -V print version" + ," -c list common capabilities" + ," -d list different capabilities" + ," -e format output for C initializer" + ," -E format output as C tables" + ," -f with -1, format complex strings" + ," -G format %{number} to %'char'" + ," -g format %'char' to %{number}" + ," -i analyze initialization/reset" + ," -l output terminfo names" + ," -n list capabilities in neither" + ," -p ignore padding specifiers" + ," -r with -C, output in termcap form" + ," -s [d|i|l|c] sort fields" + ," -u produce source with 'use='" + ," -v number (verbose)" + ," -w number (width)" + }; + const size_t first = 3; + const size_t last = sizeof(tbl)/sizeof(tbl[0]); + const size_t left = (last - first + 1) / 2 + first; + size_t n; + + for (n = 0; n < left; n++) { + size_t m = (n < first) ? last : n + left - first; + if (m < last) + fprintf(stderr, "%-40.40s%s\n", tbl[n], tbl[m]); + else + fprintf(stderr, "%s\n", tbl[n]); + } exit(EXIT_FAILURE); } +static char * name_initializer(const char *type) +{ + static char *initializer; + char *s; + + if (initializer == 0) + initializer = malloc(strlen(term->term_names) + 20); + + (void) sprintf(initializer, "%s_data_%s", type, term->term_names); + for (s = initializer; *s != 0 && *s != '|'; s++) + { + if (!isalnum(*s)) + *s = '_'; + } + *s = 0; + return initializer; +} + +/* dump C initializers for the terminal type */ +static void dump_initializers(void) +{ + int n; + const char *str = 0; + int size; + + (void) printf("static bool %s[] = %s\n", name_initializer("bool"), L_CURL); + + for_each_boolean(n,term) + { + switch((int)(term->Booleans[n])) + { + case TRUE: + str = "TRUE"; + break; + + case FALSE: + str = "FALSE"; + break; + + case ABSENT_BOOLEAN: + str = "ABSENT_BOOLEAN"; + break; + + case CANCELLED_BOOLEAN: + str = "CANCELLED_BOOLEAN"; + break; + } + (void) printf("\t/* %3d: %-8s */\t%s,\n", + n, ExtBoolname(term,n,boolnames), str); + } + (void) printf("%s;\n", R_CURL); + + (void) printf("static short %s[] = %s\n", name_initializer("number"), L_CURL); + + for_each_number(n,term) + { + char buf[BUFSIZ]; + switch (term->Numbers[n]) + { + case ABSENT_NUMERIC: + str = "ABSENT_NUMERIC"; + break; + case CANCELLED_NUMERIC: + str = "CANCELLED_NUMERIC"; + break; + default: + sprintf(buf, "%d", term->Numbers[n]); + str = buf; + break; + } + (void) printf("\t/* %3d: %-8s */\t%s,\n", n, ExtNumname(term,n,numnames), str); + } + (void) printf("%s;\n", R_CURL); + + size = sizeof(TERMTYPE) + + (NUM_BOOLEANS(term) * sizeof(term->Booleans[0])) + + (NUM_NUMBERS(term) * sizeof(term->Numbers[0])); + + (void) printf("static char * %s[] = %s\n", name_initializer("string"), L_CURL); + + for_each_string(n,term) + { + char buf[BUFSIZ], *sp, *tp; + + if (term->Strings[n] == ABSENT_STRING) + str = "ABSENT_STRING"; + else if (term->Strings[n] == CANCELLED_STRING) + str = "CANCELLED_STRING"; + else + { + tp = buf; + *tp++ = '"'; + for (sp = term->Strings[n]; *sp; sp++) + { + if (isascii(*sp) && isprint(*sp) && *sp !='\\' && *sp != '"') + *tp++ = *sp; + else + { + (void) sprintf(tp, "\\%03o", *sp & 0xff); + tp += 4; + } + } + *tp++ = '"'; + *tp = '\0'; + size += (strlen(term->Strings[n]) + 1); + str = buf; + } +#if NCURSES_XNAMES + if (n == STRCOUNT) + { + (void) printf("%s;\n", R_CURL); + + (void) printf("static char * %s[] = %s\n", name_initializer("string_ext"), L_CURL); + } +#endif + (void) printf("\t/* %3d: %-8s */\t%s,\n", n, ExtStrname(term,n,strnames), str); + } + (void) printf("%s;\n", R_CURL); +} + +/* dump C initializers for the terminal type */ +static void dump_termtype(void) +{ + (void) printf("\t%s\n\t\t\"%s\",\n", L_CURL, term->term_names); + (void) printf("\t\t(char *)0,\t/* pointer to string table */\n"); + + (void) printf("\t\t%s,\n", name_initializer("bool")); + (void) printf("\t\t%s,\n", name_initializer("number")); + + (void) printf("\t\t%s,\n", name_initializer("string")); + +#if NCURSES_XNAMES + (void) printf("#if NCURSES_XNAMES\n"); + (void) printf("\t\t(char *)0,\t/* pointer to extended string table */\n"); + (void) printf("\t\t%s,\t/* ...corresponding names */\n", + (NUM_STRINGS(term) != STRCOUNT) + ? name_initializer("string_ext") + : "(char **)0"); + + (void) printf("\t\t%d,\t\t/* count total Booleans */\n", NUM_BOOLEANS(term)); + (void) printf("\t\t%d,\t\t/* count total Numbers */\n", NUM_NUMBERS(term)); + (void) printf("\t\t%d,\t\t/* count total Strings */\n", NUM_STRINGS(term)); + + (void) printf("\t\t%d,\t\t/* count extensions to Booleans */\n", NUM_BOOLEANS(term) - BOOLCOUNT); + (void) printf("\t\t%d,\t\t/* count extensions to Numbers */\n", NUM_NUMBERS(term) - NUMCOUNT); + (void) printf("\t\t%d,\t\t/* count extensions to Strings */\n", NUM_STRINGS(term) - STRCOUNT); + + (void) printf("#endif /* NCURSES_XNAMES */\n"); +#endif /* NCURSES_XNAMES */ + (void) printf("\t%s\n", R_CURL); +} + /*************************************************************************** * * Main sequence @@ -796,8 +995,9 @@ int main(int argc, char *argv[]) /* Also avoid overflowing smaller stacks on systems like AmigaOS */ path *tfile = malloc(sizeof(path)*MAXTERMS); int c, i, len; + bool formatted = FALSE; bool filecompare = FALSE; - bool initdump = FALSE; + int initdump = 0; bool init_analyze = FALSE; bool limited = TRUE; @@ -811,7 +1011,7 @@ int main(int argc, char *argv[]) /* where is the terminfo database location going to default to? */ restdir = firstdir = 0; - while ((c = getopt(argc, argv, "decCFIinlLprR:s:uv:Vw:A:B:1T")) != EOF) + while ((c = getopt(argc, argv, "deEcCfFGgIinlLprR:s:uv:Vw:A:B:1T")) != EOF) switch (c) { case 'd': @@ -819,7 +1019,11 @@ int main(int argc, char *argv[]) break; case 'e': - initdump = TRUE; + initdump |= 1; + break; + + case 'E': + initdump |= 2; break; case 'c': @@ -833,6 +1037,18 @@ int main(int argc, char *argv[]) sortmode = S_TERMCAP; break; + case 'f': + formatted = TRUE; + break; + + case 'G': + numbers = 1; + break; + + case 'g': + numbers = -1; + break; + case 'F': filecompare = TRUE; break; @@ -868,6 +1084,7 @@ int main(int argc, char *argv[]) case 'r': tversion = 0; + limited = FALSE; break; case 'R': @@ -920,6 +1137,7 @@ int main(int argc, char *argv[]) case '1': mwidth = 0; break; + case 'T': limited = FALSE; break; @@ -932,7 +1150,7 @@ int main(int argc, char *argv[]) sortmode = S_TERMINFO; /* set up for display */ - dump_init(tversion, outform, sortmode, mwidth, itrace); + dump_init(tversion, outform, sortmode, mwidth, itrace, formatted); /* make sure we have at least one terminal name to work with */ if (optind >= argc) @@ -1002,103 +1220,18 @@ int main(int argc, char *argv[]) } } +#if NCURSES_XNAMES + if (termcount > 1) + _nc_align_termtype(&term[0], &term[1]); +#endif + /* dump as C initializer for the terminal type */ if (initdump) { - int n; - const char *str = 0; - int size; - - (void) printf("\t%s\n\t\t\"%s\",\n", - L_CURL, term->term_names); - (void) printf("\t\t(char *)0,\n"); - - (void) printf("\t\t%s /* BOOLEANS */\n", L_CURL); - for (n = 0; n < BOOLCOUNT; n++) - { - switch((int)(term->Booleans[n])) - { - case TRUE: - str = "TRUE"; - break; - - case FALSE: - str = "FALSE"; - break; - - case ABSENT_BOOLEAN: - str = "ABSENT_BOOLEAN"; - break; - - case CANCELLED_BOOLEAN: - str = "CANCELLED_BOOLEAN"; - break; - } - (void) printf("\t\t/* %s */\t%s%s,\n", - boolnames[n], str, - n == BOOLCOUNT-1 ? R_CURL : ""); - } - - (void) printf("\t\t%s /* NUMERICS */\n", L_CURL); - for (n = 0; n < NUMCOUNT; n++) - { - char buf[BUFSIZ]; - switch (term->Numbers[n]) - { - case ABSENT_NUMERIC: - str = "ABSENT_NUMERIC"; - break; - case CANCELLED_NUMERIC: - str = "CANCELLED_NUMERIC"; - break; - default: - sprintf(buf, "%d", term->Numbers[n]); - str = buf; - break; - } - (void) printf("\t\t/* %s */\t%s%s,\n", - numnames[n], str, - n == NUMCOUNT-1 ? R_CURL : ""); - } - - size = sizeof(TERMTYPE) - + (BOOLCOUNT * sizeof(term->Booleans[0])) - + (NUMCOUNT * sizeof(term->Numbers[0])); - - (void) printf("\t\t%s /* STRINGS */\n", L_CURL); - for (n = 0; n < STRCOUNT; n++) - { - char buf[BUFSIZ], *sp, *tp; - - if (term->Strings[n] == ABSENT_STRING) - str = "ABSENT_STRING"; - else if (term->Strings[n] == CANCELLED_STRING) - str = "CANCELLED_STRING"; - else - { - tp = buf; - *tp++ = '"'; - for (sp = term->Strings[n]; *sp; sp++) - { - if (isascii(*sp) && isprint(*sp) && *sp !='\\' && *sp != '"') - *tp++ = *sp; - else - { - (void) sprintf(tp, "\\%03o", *sp & 0xff); - tp += 4; - } - } - *tp++ = '"'; - *tp = '\0'; - size += (strlen(term->Strings[n]) + 1); - str = buf; - } - (void) printf("\t\t/* %s */\t%s%s%s\n", - strnames[n], str, - n == STRCOUNT-1 ? R_CURL : "", - n == STRCOUNT-1 ? "" : ","); - } - (void) printf("\t%s /* size = %d */\n", R_CURL, size); + if (initdump & 1) + dump_termtype(); + if (initdump & 2) + dump_initializers(); ExitProgram(EXIT_SUCCESS); } @@ -1131,7 +1264,7 @@ int main(int argc, char *argv[]) tname[0]); (void) printf("#\tReconstructed via infocmp from file: %s\n", tfile[0]); - len = dump_entry(&term[0], limited, NULL); + len = dump_entry(&term[0], limited, numbers, NULL); putchar('\n'); if (itrace) (void)fprintf(stderr, "infocmp: length %d\n", len); @@ -1141,7 +1274,7 @@ int main(int argc, char *argv[]) if (itrace) (void)fprintf(stderr, "infocmp: dumping differences\n"); (void) printf("comparing %s to %s.\n", tname[0], tname[1]); - compare_entry(compare_predicate); + compare_entry(compare_predicate, term); break; case C_COMMON: @@ -1149,7 +1282,7 @@ int main(int argc, char *argv[]) (void) fprintf(stderr, "infocmp: dumping common capabilities\n"); (void) printf("comparing %s to %s.\n", tname[0], tname[1]); - compare_entry(compare_predicate); + compare_entry(compare_predicate, term); break; case C_NAND: @@ -1157,13 +1290,13 @@ int main(int argc, char *argv[]) (void) fprintf(stderr, "infocmp: dumping differences\n"); (void) printf("comparing %s to %s.\n", tname[0], tname[1]); - compare_entry(compare_predicate); + compare_entry(compare_predicate, term); break; case C_USEALL: if (itrace) (void) fprintf(stderr, "infocmp: dumping use entry\n"); - len = dump_entry(&term[0], limited, use_predicate); + len = dump_entry(&term[0], limited, numbers, use_predicate); for (i = 1; i < termcount; i++) len += dump_uses(tname[i], !(outform==F_TERMCAP || outform==F_TCONVERR)); putchar('\n'); diff --git a/progs/progs.priv.h b/progs/progs.priv.h index fb5a8476..3384d37c 100644 --- a/progs/progs.priv.h +++ b/progs/progs.priv.h @@ -30,7 +30,7 @@ * Author: Thomas E. Dickey 1997,1998 * ****************************************************************************/ /* - * $Id: progs.priv.h,v 1.17 1998/02/11 12:14:03 tom Exp $ + * $Id: progs.priv.h,v 1.19 1999/02/23 11:10:32 tom Exp $ * * progs.priv.h * @@ -68,16 +68,6 @@ # include #endif -#ifndef PATH_MAX -# if defined(_POSIX_PATH_MAX) -# define PATH_MAX _POSIX_PATH_MAX -# elif defined(MAXPATHLEN) -# define PATH_MAX MAXPATHLEN -# else -# define PATH_MAX 255 /* the Posix minimum pathsize */ -# endif -#endif - #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) @@ -112,7 +102,7 @@ extern int optind; #endif /* HAVE_GETOPT_H */ #include -#include +#include #include #include @@ -146,6 +136,17 @@ extern int optind; #define STDERR_FILENO 2 #endif +/* may be in limits.h, included from various places */ +#ifndef PATH_MAX +# if defined(_POSIX_PATH_MAX) +# define PATH_MAX _POSIX_PATH_MAX +# elif defined(MAXPATHLEN) +# define PATH_MAX MAXPATHLEN +# else +# define PATH_MAX 255 /* the Posix minimum pathsize */ +# endif +#endif + /* We use isascii only to guard against use of 7-bit ctype tables in the * isprint test in infocmp. */ diff --git a/progs/tic.c b/progs/tic.c index 6163e329..5f082709 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,14 +42,39 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.28 1998/02/11 12:14:02 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.52 1999/09/25 22:47:54 tom Exp $") const char *_nc_progname = "tic"; static FILE *log_fp; +static FILE *tmp_fp; static bool showsummary = FALSE; +static const char *to_remove; -static const char usage_string[] = "[-hc] [-v[n]] [-e names] [-CILNRTrsw1] source-file\n"; +static void (*save_check_termtype)(TERMTYPE *); +static void check_termtype(TERMTYPE *tt); + +static const char usage_string[] = "[-h] [-v[n]] [-e names] [-CILNRTcfrswx1] source-file\n"; + +static void cleanup(void) +{ + if (tmp_fp != 0) + fclose(tmp_fp); + if (to_remove != 0) { +#if HAVE_REMOVE + remove(to_remove); +#else + unlink(to_remove); +#endif + } +} + +static void failed(const char *msg) +{ + perror(msg); + cleanup(); + exit(EXIT_FAILURE); +} static void usage(void) { @@ -63,12 +88,18 @@ static void usage(void) " -R restrict translation to given terminfo/termcap version", " -T remove size-restrictions on compiled description", " -c check only, validate input without compiling or translating", + " -f format complex strings for readability", + " -G format %{number} to %'char'", + " -g format %'char' to %{number}", " -e translate/compile only entries named by comma-separated list", " -o

                        set output directory for compiled entry writes", " -r force resolution of all use entries in source translation", " -s print summary statistics", " -v[n] set verbosity level", " -w[n] set format width for translation output", +#if NCURSES_XNAMES + " -x treat unknown capabilities as user-defined", +#endif "", "Parameters:", " file to translate or compile" @@ -81,7 +112,60 @@ static void usage(void) exit(EXIT_FAILURE); } -static bool immedhook(ENTRY *ep) +#define L_BRACE '{' +#define R_BRACE '}' +#define S_QUOTE '\''; + +static void write_it(ENTRY *ep) +{ + unsigned n; + int ch; + char *s, *d, *t; + char result[MAX_ENTRY_SIZE]; + + /* + * Look for strings that contain %{number}, convert them to %'char', + * which is shorter and runs a little faster. + */ + for (n = 0; n < STRCOUNT; n++) { + s = ep->tterm.Strings[n]; + if (VALID_STRING(s) + && strchr(s, L_BRACE) != 0) { + d = result; + t = s; + while ((ch = *t++) != 0) { + *d++ = ch; + if (ch == '\\') { + *d++ = *t++; + } else if ((ch == '%') + && (*t == L_BRACE)) { + char *v = 0; + long value = strtol(t+1, &v, 0); + if (v != 0 + && *v == R_BRACE + && value > 0 + && value != '\\' /* FIXME */ + && value < 127 + && isprint((int)value)) { + *d++ = S_QUOTE; + *d++ = (int)value; + *d++ = S_QUOTE; + t = (v + 1); + } + } + } + *d = 0; + if (strlen(result) < strlen(s)) + strcpy(s, result); + } + } + + _nc_set_type(_nc_first_name(ep->tterm.term_names)); + _nc_curr_line = ep->startline; + _nc_write_entry(&ep->tterm); +} + +static bool immedhook(ENTRY *ep GCC_UNUSED) /* write out entries with no use capabilities immediately to save storage */ { #ifndef HAVE_BIG_CORE @@ -122,16 +206,13 @@ static bool immedhook(ENTRY *ep) { int oldline = _nc_curr_line; - _nc_set_type(_nc_first_name(ep->tterm.term_names)); - _nc_curr_line = ep->startline; - _nc_write_entry(&ep->tterm); + write_it(ep); _nc_curr_line = oldline; free(ep->tterm.str_table); return(TRUE); } - else #endif /* HAVE_BIG_CORE */ - return(FALSE); + return(FALSE); } static void put_translate(int c) @@ -217,15 +298,16 @@ static const char **make_namelist(char *src) const char **dst = 0; char *s, *base; - size_t pass, n, nn; + unsigned pass, n, nn; char buffer[BUFSIZ]; - if (strchr(src, '/') != 0) { /* a filename */ + if (src == 0) { + /* EMPTY */; + } else if (strchr(src, '/') != 0) { /* a filename */ FILE *fp = fopen(src, "r"); - if (fp == 0) { - perror(src); - exit(EXIT_FAILURE); - } + if (fp == 0) + failed(src); + for (pass = 1; pass <= 2; pass++) { nn = 0; while (fgets(buffer, sizeof(buffer), fp) != 0) { @@ -294,6 +376,7 @@ static bool matches(const char **needle, const char *haystack) int main (int argc, char *argv[]) { +char my_tmpname[PATH_MAX]; int v_opt = -1, debug_level; int smart_defaults = TRUE; char *termcap; @@ -305,6 +388,8 @@ int outform = F_TERMINFO; /* output format */ int sortmode = S_TERMINFO; /* sort_mode */ int width = 60; +bool formatted = FALSE; /* reformat complex strings? */ +int numbers = 0; /* format "%'char'" to/from "%{number}" */ bool infodump = FALSE; /* running as captoinfo? */ bool capdump = FALSE; /* running as infotocap? */ bool forceresolve = FALSE; /* force resolution */ @@ -324,13 +409,16 @@ bool check_only = FALSE; infodump = (strcmp(_nc_progname, "captoinfo") == 0); capdump = (strcmp(_nc_progname, "infotocap") == 0); +#if NCURSES_XNAMES + use_extended_names(FALSE); +#endif /* * Processing arguments is a little complicated, since someone made a * design decision to allow the numeric values for -w, -v options to * be optional. */ - while ((this_opt = getopt(argc, argv, "0123456789CILNR:TVce:o:rsvw")) != EOF) { + while ((this_opt = getopt(argc, argv, "0123456789CILNR:TVce:fGgo:rsvwx")) != EOF) { if (isdigit(this_opt)) { switch (last_opt) { case 'v': @@ -381,6 +469,15 @@ bool check_only = FALSE; case 'e': namelst = make_namelist(optarg); break; + case 'f': + formatted = TRUE; + break; + case 'G': + numbers = 1; + break; + case 'g': + numbers = -1; + break; case 'o': outdir = optarg; break; @@ -396,6 +493,11 @@ bool check_only = FALSE; case 'w': width = 0; break; +#if NCURSES_XNAMES + case 'x': + use_extended_names(TRUE); + break; +#endif default: usage(); } @@ -405,6 +507,32 @@ bool check_only = FALSE; debug_level = (v_opt > 0) ? v_opt : (v_opt == 0); _nc_tracing = (1 << debug_level) - 1; + if (_nc_tracing) + { + save_check_termtype = _nc_check_termtype; + _nc_check_termtype = check_termtype; + } + +#ifndef HAVE_BIG_CORE + /* + * Aaargh! immedhook seriously hoses us! + * + * One problem with immedhook is it means we can't do -e. Problem + * is that we can't guarantee that for each terminal listed, all the + * terminals it depends on will have been kept in core for reference + * resolution -- in fact it's certain the primitive types at the end + * of reference chains *won't* be in core unless they were explicitly + * in the select list themselves. + */ + if (namelst && (!infodump && !capdump)) + { + (void) fprintf(stderr, + "Sorry, -e can't be used without -I or -C\n"); + cleanup(); + return EXIT_FAILURE; + } +#endif /* HAVE_BIG_CORE */ + if (optind < argc) { source_file = argv[optind++]; if (optind < argc) { @@ -419,10 +547,20 @@ bool check_only = FALSE; if (infodump == TRUE) { /* captoinfo's no-argument case */ source_file = "/etc/termcap"; - if ((termcap = getenv("TERMCAP")) != NULL) { + if ((termcap = getenv("TERMCAP")) != 0 + && (namelst = make_namelist(getenv("TERM"))) != 0) { if (access(termcap, F_OK) == 0) { /* file exists */ source_file = termcap; + } else + if ((source_file = tmpnam(my_tmpname)) != 0 + && (tmp_fp = fopen(source_file, "w")) != 0) { + fprintf(tmp_fp, "%s\n", termcap); + fclose(tmp_fp); + tmp_fp = fopen(source_file, "r"); + to_remove = source_file; + } else { + failed("tmpnam"); } } } else { @@ -432,11 +570,13 @@ bool check_only = FALSE; _nc_progname, _nc_progname, usage_string); + cleanup(); return EXIT_FAILURE; } } - if (freopen(source_file, "r", stdin) == NULL) { + if (tmp_fp == 0 + && (tmp_fp = fopen(source_file, "r")) == 0) { fprintf (stderr, "%s: Can't open %s\n", _nc_progname, source_file); return EXIT_FAILURE; } @@ -446,11 +586,11 @@ bool check_only = FALSE; smart_defaults ? outform : F_LITERAL, - sortmode, width, debug_level); + sortmode, width, debug_level, formatted); else if (capdump) dump_init(tversion, outform, - sortmode, width, debug_level); + sortmode, width, debug_level, FALSE); /* parse entries out of the source file */ _nc_set_source(source_file); @@ -458,33 +598,17 @@ bool check_only = FALSE; if (!(check_only || infodump || capdump)) _nc_set_writedir(outdir); #endif /* HAVE_BIG_CORE */ - _nc_read_entry_source(stdin, (char *)NULL, + _nc_read_entry_source(tmp_fp, (char *)NULL, !smart_defaults, FALSE, (check_only || infodump || capdump) ? NULLHOOK : immedhook); /* do use resolution */ - if (check_only || (!infodump && !capdump) || forceresolve) - if (!_nc_resolve_uses() && !check_only) + if (check_only || (!infodump && !capdump) || forceresolve) { + if (!_nc_resolve_uses() && !check_only) { + cleanup(); return EXIT_FAILURE; - -#ifndef HAVE_BIG_CORE - /* - * Aaargh! immedhook seriously hoses us! - * - * One problem with immedhook is it means we can't do -e. Problem - * is that we can't guarantee that for each terminal listed, all the - * terminals it depends on will have been kept in core for reference - * resolution -- in fact it's certain the primitive types at the end - * of reference chains *won't* be in core unless they were explicitly - * in the select list themselves. - */ - if (namelst && (!infodump && !capdump)) - { - (void) fprintf(stderr, - "Sorry, -e can't be used without -I or -C\n"); - return EXIT_FAILURE; + } } -#endif /* HAVE_BIG_CORE */ /* length check */ if (check_only && (capdump || infodump)) @@ -493,7 +617,7 @@ bool check_only = FALSE; { if (matches(namelst, qp->tterm.term_names)) { - int len = fmt_entry(&qp->tterm, NULL, TRUE, infodump); + int len = fmt_entry(&qp->tterm, NULL, TRUE, infodump, numbers); if (len>(infodump?MAX_TERMINFO_LENGTH:MAX_TERMCAP_LENGTH)) (void) fprintf(stderr, @@ -512,11 +636,7 @@ bool check_only = FALSE; _nc_set_writedir(outdir); for_entry_list(qp) if (matches(namelst, qp->tterm.term_names)) - { - _nc_set_type(_nc_first_name(qp->tterm.term_names)); - _nc_curr_line = qp->startline; - _nc_write_entry(&qp->tterm); - } + write_it(qp); } else { @@ -532,16 +652,16 @@ bool check_only = FALSE; /* this is in case infotocap() generates warnings */ _nc_set_type(_nc_first_name(qp->tterm.term_names)); - (void) fseek(stdin, qp->cstart, SEEK_SET); + (void) fseek(tmp_fp, qp->cstart, SEEK_SET); while (j-- ) if (infodump) - (void) putchar(getchar()); + (void) putchar(fgetc(tmp_fp)); else - put_translate(getchar()); + put_translate(fgetc(tmp_fp)); - len = dump_entry(&qp->tterm, limited, NULL); + len = dump_entry(&qp->tterm, limited, numbers, NULL); for (j = 0; j < qp->nuses; j++) - len += dump_uses((char *)(qp->uses[j].parent), infodump); + len += dump_uses((char *)(qp->uses[j].parent), !capdump); (void) putchar('\n'); if (debug_level != 0 && !limited) printf("# length=%d\n", len); @@ -552,8 +672,8 @@ bool check_only = FALSE; bool in_comment = FALSE; bool trailing_comment = FALSE; - (void) fseek(stdin, _nc_tail->cend, SEEK_SET); - while ((c = getchar()) != EOF) + (void) fseek(tmp_fp, _nc_tail->cend, SEEK_SET); + while ((c = fgetc(tmp_fp)) != EOF) { if (oldc == '\n') { if (c == '#') { @@ -585,5 +705,108 @@ bool check_only = FALSE; else fprintf(log_fp, "No entries written\n"); } + cleanup(); return(EXIT_SUCCESS); } + +/* + * This bit of legerdemain turns all the terminfo variable names into + * references to locations in the arrays Booleans, Numbers, and Strings --- + * precisely what's needed (see comp_parse.c). + */ + +TERMINAL *cur_term; /* tweak to avoid linking lib_cur_term.c */ + +#undef CUR +#define CUR tp-> + +/* other sanity-checks (things that we don't want in the normal + * logic that reads a terminfo entry) + */ +static void check_termtype(TERMTYPE *tp) +{ + bool conflict = FALSE; + unsigned j, k; + char fkeys[STRCOUNT]; + + /* + * A terminal entry may contain more than one keycode assigned to + * a given string (e.g., KEY_END and KEY_LL). But curses will only + * return one (the last one assigned). + */ + memset(fkeys, 0, sizeof(fkeys)); + for (j = 0; _nc_tinfo_fkeys[j].code; j++) { + char *a = tp->Strings[_nc_tinfo_fkeys[j].offset]; + bool first = TRUE; + if (!VALID_STRING(a)) + continue; + for (k = j+1; _nc_tinfo_fkeys[k].code; k++) { + char *b = tp->Strings[_nc_tinfo_fkeys[k].offset]; + if (!VALID_STRING(b) + || fkeys[k]) + continue; + if (!strcmp(a,b)) { + fkeys[j] = 1; + fkeys[k] = 1; + if (first) { + if (!conflict) { + _nc_warning("Conflicting key definitions (using the last)"); + conflict = TRUE; + } + fprintf(stderr, "... %s is the same as %s", + keyname(_nc_tinfo_fkeys[j].code), + keyname(_nc_tinfo_fkeys[k].code)); + first = FALSE; + } else { + fprintf(stderr, ", %s", + keyname(_nc_tinfo_fkeys[k].code)); + } + } + } + if (!first) + fprintf(stderr, "\n"); + } + + /* + * Quick check for color. We could also check if the ANSI versus + * non-ANSI strings are misused. + */ + if ((max_colors > 0) != (max_pairs > 0) + || (max_colors > max_pairs)) + _nc_warning("inconsistent values for max_colors and max_pairs"); + + PAIRED(set_foreground, set_background) + PAIRED(set_a_foreground, set_a_background) + + /* + * These may be mismatched because the terminal description relies on + * restoring the cursor visibility by resetting it. + */ + ANDMISSING(cursor_invisible, cursor_normal) + ANDMISSING(cursor_visible, cursor_normal) + + /* + * From XSI & O'Reilly, we gather that sc/rc are required if csr is + * given, because the cursor position after the scrolling operation is + * performed is undefined. + */ + ANDMISSING(change_scroll_region, save_cursor) + ANDMISSING(change_scroll_region, restore_cursor) + + /* + * Some standard applications (e.g., vi) and some non-curses + * applications (e.g., jove) get confused if we have both ich/ich1 and + * smir/rmir. Let's be nice and warn about that, too, even though + * ncurses handles it. + */ + if ((PRESENT(enter_insert_mode) || PRESENT(exit_insert_mode)) + && (PRESENT(insert_character) || PRESENT(parm_ich))) { + _nc_warning("non-curses applications may be confused by ich/ich1 with smir/rmir"); + } + + /* + * Finally, do the non-verbose checks + */ + if (save_check_termtype != 0) + save_check_termtype(tp); +} diff --git a/progs/toe.c b/progs/toe.c index 85f135e3..f2c5c5ec 100644 --- a/progs/toe.c +++ b/progs/toe.c @@ -38,10 +38,12 @@ #include +#include + #include #include -MODULE_ID("$Id: toe.c,v 0.18 1998/02/11 12:14:02 tom Exp $") +MODULE_ID("$Id: toe.c,v 0.19 1998/03/08 01:02:46 tom Exp $") const char *_nc_progname; @@ -181,9 +183,11 @@ int main (int argc, char *argv[]) if ((home = getenv("HOME")) != (char *)NULL) { char personal[PATH_MAX]; + struct stat sb; (void) sprintf(personal, PRIVATE_INFO, home); - if (access(personal, F_OK) == 0) + if (stat(personal, &sb) == 0 + && (sb.st_mode & S_IFMT) == S_IFDIR) eargv[j++] = personal; } eargv[j++] = TERMINFO; diff --git a/progs/tput.c b/progs/tput.c index e14140eb..7a859f16 100644 --- a/progs/tput.c +++ b/progs/tput.c @@ -40,10 +40,11 @@ */ #include +#ifndef PURE_TERMINFO +#include +#endif -#include - -MODULE_ID("$Id: tput.c,v 1.11 1998/02/11 12:14:02 tom Exp $") +MODULE_ID("$Id: tput.c,v 1.14 1999/07/31 21:18:29 Goran.Uddeborg Exp $") #define PUTS(s) fputs(s, stdout) #define PUTCHAR(c) putchar(c) @@ -70,16 +71,18 @@ static void usage(void) static int tput(int argc, char *argv[]) { +char *name; char *s; int i, j, c; int reset, status; FILE *f; reset = 0; - if (strcmp(argv[0], "reset") == 0) { + name = argv[0]; + if (strcmp(name, "reset") == 0) { reset = 1; } - if (reset || strcmp(argv[0], "init") == 0) { + if (reset || strcmp(name, "init") == 0) { if (init_prog != NULL) { system(init_prog); } @@ -91,14 +94,14 @@ FILE *f; PUTS(init_1string); } FLUSH; - + if (reset && reset_2string != NULL) { PUTS(reset_2string); } else if (init_2string != NULL) { PUTS(init_2string); } FLUSH; - + if (set_lr_margin != NULL) { PUTS(tparm(set_lr_margin, 0, columns - 1)); } else if (set_left_margin_parm != NULL @@ -129,14 +132,14 @@ FILE *f; } } FLUSH; - + if (init_tabs != 8) { if (clear_all_tabs != NULL && set_tab != NULL) { for(i = 0; i < columns - 1; i += 8) { if (parm_right_cursor) { PUTS(tparm(parm_right_cursor, 8)); } else { - for(j = 0; j < 8; j++) + for(j = 0; j < 8; j++) PUTCHAR(' '); } PUTS(set_tab); @@ -144,7 +147,7 @@ FILE *f; FLUSH; } } - + if (reset && reset_file != NULL) { f = fopen(reset_file, "r"); if (f == NULL) { @@ -165,7 +168,7 @@ FILE *f; fclose(f); } FLUSH; - + if (reset && reset_3string != NULL) { PUTS(reset_3string); } else if (init_2string != NULL) { @@ -174,20 +177,45 @@ FILE *f; FLUSH; return 0; } - - if (strcmp(argv[0], "longname") == 0) { + + if (strcmp(name, "longname") == 0) { PUTS(longname()); return 0; } - if ((status = tigetflag(argv[0])) != -1) +#ifndef PURE_TERMINFO + { + const struct name_table_entry *np; + + if ((np = _nc_find_entry(name, _nc_get_hash_table(1))) != 0) + switch(np->nte_type) + { + case BOOLEAN: + if (bool_from_termcap[np->nte_index]) + name = boolnames[np->nte_index]; + break; + + case NUMBER: + if (num_from_termcap[np->nte_index]) + name = numnames[np->nte_index]; + break; + + case STRING: + if (str_from_termcap[np->nte_index]) + name = strnames[np->nte_index]; + break; + } + } +#endif + + if ((status = tigetflag(name)) != -1) return(status != 0); - else if ((status = tigetnum(argv[0])) != CANCELLED_NUMERIC) { + else if ((status = tigetnum(name)) != CANCELLED_NUMERIC) { (void) printf("%d\n", status); return(0); } - else if ((s = tigetstr(argv[0])) == CANCELLED_STRING) - quit(4, "%s: unknown terminfo capability '%s'", prg_name, argv[0]); + else if ((s = tigetstr(name)) == CANCELLED_STRING) + quit(4, "%s: unknown terminfo capability '%s'", prg_name, name); else if (s != (char *)NULL) { if (argc > 1) { int k; @@ -255,7 +283,7 @@ int errors = 0; if (term == NULL || *term == '\0') quit(2, "No value for $TERM and no -T specified"); - if (setupterm(term, STDOUT_FILENO, &errret) != OK) + if (setupterm(term, STDOUT_FILENO, &errret) != OK && errret <= 0) quit(3, "unknown terminal \"%s\"", term); if (cmdline) diff --git a/progs/tset.c b/progs/tset.c index 1df3fd64..cef980ad 100644 --- a/progs/tset.c +++ b/progs/tset.c @@ -103,7 +103,7 @@ char *ttyname(int fd); #include /* for bool typedef */ #include -MODULE_ID("$Id: tset.c,v 0.31 1998/02/11 12:14:02 tom Exp $") +MODULE_ID("$Id: tset.c,v 0.37 1999/03/14 12:30:02 tom Exp $") extern char **environ; @@ -135,15 +135,8 @@ CaselessCmp(const char *a, const char *b) /* strcasecmp isn't portable */ } #if !HAVE_STRDUP -static char *strdup (char *s) -{ - char *p; - - p = malloc(strlen(s)+1); - if (p) - strcpy(p,s); - return(p); -} +#define strdup _nc_strdup +extern char *_nc_strdup(const char *); #endif /* not HAVE_STRDUP */ static void @@ -246,7 +239,7 @@ typedef struct map { const char *porttype; /* Port type, or "" for any. */ const char *type; /* Terminal type to select. */ int conditional; /* Baud rate conditionals bitmask. */ - int speed; /* Baud rate to compare against. */ + speed_t speed; /* Baud rate to compare against. */ } MAP; static MAP *cur, *maplist; @@ -340,7 +333,7 @@ add_mapping(const char *port, char *arg) char *base = 0; copy = strdup(arg); - mapp = malloc((u_int)sizeof(MAP)); + mapp = malloc(sizeof(MAP)); if (copy == 0 || mapp == 0) failed("malloc"); mapp->next = 0; @@ -585,22 +578,21 @@ found: if ((p = getenv("TERMCAP")) != 0 && *p != '/') { * ttype now contains a pointer to the type of the terminal. * If the first character is '?', ask the user. */ - if (ttype[0] == '?') + if (ttype[0] == '?') { if (ttype[1] != '\0') ttype = askuser(ttype + 1); else ttype = askuser(0); - + } /* Find the terminfo entry. If it doesn't exist, ask the user. */ - while ((rval = setupterm(ttype, STDOUT_FILENO, &errret)) != OK) { + while ((rval = setupterm((NCURSES_CONST char *)ttype, STDOUT_FILENO, &errret)) != OK) { if (errret == 0) { (void)fprintf(stderr, "tset: unknown terminal type %s\n", ttype); ttype = 0; } else { - (void)fprintf(stderr, "tset: can't initialize terminal\ - type %s (error %d)\n", ttype, errret); + (void)fprintf(stderr, "tset: can't initialize terminal type %s (error %d)\n", ttype, errret); ttype = 0; } ttype = askuser(ttype); @@ -965,10 +957,10 @@ set_tabs() * Tell the user if a control key has been changed from the default value. */ static void -report(const char *name, int which, u_int def) +report(const char *name, int which, unsigned def) { #ifdef TERMIOS - u_int older, newer; + unsigned older, newer; char *p; newer = mode.c_cc[which]; @@ -986,7 +978,7 @@ report(const char *name, int which, u_int def) if (newer == 0177) (void)fprintf(stderr, "delete.\n"); else if ((p = key_backspace) != 0 - && newer == (u_int)p[0] + && newer == (unsigned char)p[0] && p[1] == '\0') (void)fprintf(stderr, "backspace.\n"); else if (newer < 040) { diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure index 6f4b789a..25d3f06d 100755 --- a/sysdeps/unix/sysv/linux/configure +++ b/sysdeps/unix/sysv/linux/configure @@ -23,7 +23,7 @@ rm -f ncurses/MKterm.h.awk \ ncurses/expanded.c \ ncurses/fallback.c \ ncurses/hashsize.h \ - ncurses/keys.tries \ + ncurses/init_keytry.h \ ncurses/lib_gen.c \ ncurses/lib_keyname.c \ ncurses/names.c \ @@ -46,6 +46,10 @@ s%@DEFS@%-DHAVE_CONFIG_H%g s%@NCURSES_MAJOR@%$NCURSES_MAJOR%g s%@NCURSES_MINOR@%$NCURSES_MINOR%g s%@NCURSES_PATCH@%$NCURSES_PATCH%g +s%@NCURSES_CONST@%%g +s%@NCURSES_XNAMES@%1%g +s%@OSPEED_TYPE@%speed_t%g +s%@OSPEED_INCLUDES@%#include %g s%@cf_cv_rel_version@%$cf_cv_rel_version%g s%@cf_cv_abi_version@%$cf_cv_abi_version%g s%@cf_cv_builtin_bool@%1%g @@ -54,6 +58,7 @@ s%@cf_cv_shift_limit@%32%g s%@cf_cv_widec_shift@%8%g s%@cf_cv_typeof_chtype@%long%g s%@cf_cv_1UL@%1UL%g +s%@cf_cv_cc_bool_type@%0%g EOF @@ -189,9 +194,9 @@ for nc_file in .. $NC_CONFIG_HEADERS; do if test "x$nc_file" != x..; then #define GCC_SCANF 1 #define GCC_UNUSED __attribute__((unused)) #define GOOD_SELECT 1 -#define HAVE_ISASCII 1 #define HAVE_BUILTIN_H 1 #define HAVE_DIRENT_H 1 +#define HAVE_ERRNO 1 #define HAVE_FCNTL_H 1 #define HAVE_FORM_H 1 #define HAVE_GETOPT_H 1 @@ -199,6 +204,7 @@ CEOF cat >> conftest.frag <> conftest.frag <> conftest.frag <> conftest.frag <> conftest.edit < ncurses/termsort.c echo creating ncurses/fallback.c -sh ${nc_given_srcdir}/ncurses/MKfallback.sh > ncurses/fallback.c +sh ${nc_given_srcdir}/ncurses/tinfo/MKfallback.sh > ncurses/fallback.c echo creating ncurses/lib_gen.c -sh ${nc_given_srcdir}/ncurses/MKlib_gen.sh "${NC_CPP}" "${NC_AWK}" < ncurses/curses.h > ncurses/lib_gen.c +sh ${nc_given_srcdir}/ncurses/base/MKlib_gen.sh "${NC_CPP}" "${NC_AWK}" < ncurses/curses.h > ncurses/lib_gen.c echo creating ncurses/nomacros.h -sh ${nc_given_srcdir}/ncurses/MKlib_gen.sh "${NC_CPP}" "${NC_AWK}" < ncurses/curses.h | fgrep undef > ncurses/nomacros.h +sh ${nc_given_srcdir}/ncurses/base/MKlib_gen.sh "${NC_CPP}" "${NC_AWK}" < ncurses/curses.h | fgrep undef > ncurses/nomacros.h echo creating ncurses/expanded.c -sh ${nc_given_srcdir}/ncurses/MKexpanded.sh "${NC_CPP}" -mv expanded.c ncurses/expanded.c +sh ${nc_given_srcdir}/ncurses/tty/MKexpanded.sh "${NC_CPP}" >ncurses/expanded.c echo creating ncurses/comp_captab.c -${NC_CC} -o make_hash -DMAIN_PROGRAM ${nc_given_srcdir}/ncurses/comp_hash.c -sh ${nc_given_srcdir}/ncurses/MKcaptab.awk "${NC_AWK}" ${nc_given_srcdir}/include/Caps > ncurses/comp_captab.c +${NC_CC} -o make_hash -DMAIN_PROGRAM ${nc_given_srcdir}/ncurses/tinfo/comp_hash.c +sh ${nc_given_srcdir}/ncurses/tinfo/MKcaptab.awk "${NC_AWK}" ${nc_given_srcdir}/include/Caps > ncurses/comp_captab.c rm -f make_hash echo creating ncurses/lib_keyname.c -${NC_AWK} -f ${nc_given_srcdir}/ncurses/MKkeyname.awk ${nc_given_srcdir}/ncurses/keys.list > ncurses/lib_keyname.c +${NC_AWK} -f ${nc_given_srcdir}/ncurses/base/MKkeyname.awk ${nc_given_srcdir}/ncurses/tinfo/keys.list > ncurses/lib_keyname.c echo creating ncurses/names.c and ncurses/codes.c -${NC_AWK} -f ${nc_given_srcdir}/ncurses/MKnames.awk ${nc_given_srcdir}/include/Caps +${NC_AWK} -f ${nc_given_srcdir}/ncurses/tinfo/MKnames.awk ${nc_given_srcdir}/include/Caps cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr >ncurses/names.c cat namehdr boolcodes numcodes strcodes codeftr > ncurses/codes.c rm -f namehdr nameftr codeftr boolnames boolfnames boolcodes numnames numfnames numcodes strnames strfnames strcodes -echo creating ncurses/keys.tries -${NC_CC} -o make_key ${nc_given_srcdir}/ncurses/make_keys.c -./make_key ${nc_given_srcdir}/ncurses/keys.list > ncurses/keys.tries +echo creating ncurses/init_keytry.h +${NC_CC} -o make_key ${nc_given_srcdir}/ncurses/tinfo/make_keys.c +./make_key ${nc_given_srcdir}/ncurses/keys.list > ncurses/init_keytry.h rm -f make_key echo creating ncurses/unctrl.c -echo | ${NC_AWK} -f ${nc_given_srcdir}/ncurses/MKunctrl.awk > ncurses/unctrl.c +echo | ${NC_AWK} -f ${nc_given_srcdir}/ncurses/base/MKunctrl.awk > ncurses/unctrl.c echo creating ncurses/terminfo.5 sh ${nc_given_srcdir}/man/MKterminfo.sh ${nc_given_srcdir}/man/terminfo.head ${nc_given_srcdir}/include/Caps ${nc_given_srcdir}/man/terminfo.tail > ncurses/terminfo.5 diff --git a/sysdeps/unix/sysv/linux/edit_man.sh b/sysdeps/unix/sysv/linux/edit_man.sh index 4488fad7..558fff88 100755 --- a/sysdeps/unix/sysv/linux/edit_man.sh +++ b/sysdeps/unix/sysv/linux/edit_man.sh @@ -23,7 +23,7 @@ case $i in $MKDIRS $mandir/man$section fi source=`basename $i` - target=`grep "^$source" man/man_db.renames | mawk '{print $2}'` + target=`grep "^$source" man/man_db.renames | awk '{print $2}'` if test -z "$target" ; then echo '? missing rename for '$source target="$source" diff --git a/tack/COPYING b/tack/COPYING new file mode 100644 index 00000000..60549be5 --- /dev/null +++ b/tack/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/tack/HISTORY b/tack/HISTORY new file mode 100644 index 00000000..b1de61d1 --- /dev/null +++ b/tack/HISTORY @@ -0,0 +1,42 @@ + +Current history: + +1999/05/16 Minor fix to build/link on CLIX +1999/05/09 Update to build/link on NeXT +1999/04/17 Update to work with ncurses 5.0 beta1 (TERMTYPE struct) +1999/02/07 Build with ncurses 4.2 981219 (renamed function) +1998/01/09 1.00 First release under GPL +1997/12/24 0.02 First version that requires ncurses +1997/10/29 0.01 Second beta release to the ncurses mailing list. +1997/10/06 0.00 First beta release to the ncurses mailing list. + +Ancient history: TACK -- the terminfo action checker + + The purpose of this program is to verify the correctness of +terminfos and to calculate the pads needed for each capability. +This program is not designed to test curses and therefore uses +as little of curses as possible. + + This program was originally called TED. In 1991 it was +released to USENET in comp.sources. TED was originally written to +test both terminfos and termcaps. The original intent was to +create a terminfo editor. This code fell quite short of its goal. +Tests were controled by command line switches and editing was done +with pen and paper. + + In 1995 Eric S. Raymond got interested in the program and added +a first cut at making the program menu driven. He also converted +the code from K&R C to an ANSI/POSIX-conforming C. He re-christened +the program TAC (Terminfo Action Checker). Eric also wrote a man +page for TAC. + + In 1997 I decided to dust off the code and make it easier to +use by the novice. I totally rewrote the menu system and added +the editing features I originally planned for TED. I also did +a total rewrite of the code that does the timings. In the process +of rewriting the code I changed it to be more tightly coupled +with ncurses. By this time someone had taken the name TAC so +I re-christened the program TACK. + +Daniel Weaver + diff --git a/tack/Makefile.in b/tack/Makefile.in index 1e5a011a..48f4619a 100644 --- a/tack/Makefile.in +++ b/tack/Makefile.in @@ -1,47 +1,11 @@ -# $Id: Makefile.in,v 1.6 1998/02/11 12:14:03 tom Exp $ -############################################################################## -# 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. # -############################################################################## +# $Id: Makefile.in,v 1.9 1999/09/18 23:33:48 tom Exp $ +# Makefile for tack # -# Author: Thomas E. Dickey 1997 +# The variable 'srcdir' refers to the source-distribution, and can be set with +# the configure script by "--srcdir=DIR". # -# Makefile for terminfo/termcap test program -# -# The following pre-processor variables may be set. -# -# SELECT Use this define if your operating system has the select -# system call. -# -# WAIT_MODE Use this define if your operating system cannot tell if -# a chracter is ready in the input queue. Funtion keys -# must be padded with blanks. -# -# If generated without pre-processor variables, a terminfo test -# program will be generated for System V Release 3. +# The rules are organized to produce the libraries for the configured models, +# and the programs with the configured default model. # turn off _all_ suffix rules; we'll generate our own .SUFFIXES: @@ -49,6 +13,10 @@ SHELL = /bin/sh THIS = Makefile +CF_MFLAGS = @cf_cv_makeflags@ +@SET_MAKE@ +x = @PROG_EXT@ + MODEL = ../@DFT_OBJ_SUBDIR@ INSTALL_PREFIX = @INSTALL_PREFIX@ srcdir = @srcdir@ @@ -56,16 +24,22 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ +includedir = @includedir@ +datadir = @datadir@ + +ticdir = $(datadir)/terminfo INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +AWK = @AWK@ +LN_S = @LN_S@ + CC = @CC@ CFLAGS = @CFLAGS@ INCDIR = $(srcdir)/../include -CPPFLAGS = -I../tack -I$(srcdir) @CPPFLAGS@ \ - -DHAVE_CONFIG_H -DSELECT +CPPFLAGS = -DHAVE_CONFIG_H -I../tack -I$(srcdir) @CPPFLAGS@ CCFLAGS = $(CPPFLAGS) $(CFLAGS) @@ -79,14 +53,12 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LD = @LD@ LINK = $(CC) LDFLAGS = @EXTRA_LDFLAGS@ \ - -L../lib \ - -L$(libdir) \ - -lncurses@DFT_ARG_SUFFIX@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@ + @PROG_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@ LDFLAGS_NORMAL = $(LDFLAGS) LDFLAGS_DEBUG = $(LDFLAGS) @CC_G_OPT@ LDFLAGS_PROFILE = $(LDFLAGS) -pg -LDFLAGS_SHARED = $(LDFLAGS) @CC_SHARED_OPTS@ @LD_SHARED_OPTS@ +LDFLAGS_SHARED = $(LDFLAGS) @CC_SHARED_OPTS@ # @LD_SHARED_OPTS@ LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) @@ -94,8 +66,37 @@ LINT = @LINT@ LINT_OPTS = @LINT_OPTS@ LINT_LIBS = -lncurses @LIBS@ -# This would be $(SHARED_OBJS), but make cannot handle this much forward ref. -TACK_DEPS = \ +PROGS = tack$x + +# Default library, for linking applications +DEPS_CURSES = ../lib/libncurses@DFT_DEP_SUFFIX@ + +################################################################################ +all: $(PROGS) + +sources: + +install: install.tack +uninstall: uninstall.tack + +# this line simplifies the configure-script +install.libs: +uninstall.libs: + +install.tack: $(PROGS) $(INSTALL_PREFIX)$(bindir) + $(INSTALL_PROGRAM) tack$x $(INSTALL_PREFIX)$(bindir)/tack$x + +uninstall.tack: + -@rm -f $(INSTALL_PREFIX)$(bindir)/tack$x + +$(INSTALL_PREFIX)$(bindir) : + $(srcdir)/../mkinstalldirs $@ + +# +# Rules for building tack +# + +DEPS_TACK = \ $(MODEL)/ansi.o \ $(MODEL)/charset.o \ $(MODEL)/color.o \ @@ -113,55 +114,45 @@ TACK_DEPS = \ $(MODEL)/sysdep.o \ $(MODEL)/tack.o -TARGET = tack - -all: $(TACK_DEPS) $(TARGET) - -sources: +tack$x: $(DEPS_TACK) $(DEPS_CURSES) + @ECHO_LINK@ $(LINK) $(DEPS_TACK) $(LDFLAGS_DEFAULT) -o $@ -$(TARGET): $(TACK_DEPS) - @ echo linking $@ ... ; $(LINK) $(TACK_DEPS) $(LDFLAGS_DEFAULT) -o $@ +# +# Utility productions start here +# -$(TACK_DEPS): $(srcdir)/tack.h +tags: + ctags *.[ch] -lint: - lint $(C_SRC) +TAGS: + etags *.[ch] -mostlyclean : - -rm -f core tags TAGS *~ *.ln *.atac trace - -clean :: mostlyclean - rm -f $(TACK_DEPS) $(TARGET) tack.tar tack.tar.gz +clean :: + -rm -f tags TAGS do.tic *~ + -rm -f $(PROGS) distclean :: clean -rm -f Makefile -realclean : distclean - -# vi tags -tags: $(C_SRC) $(DIR)/tack.h - ctags $(>) +mostlyclean :: clean -# emacs tags -TAGS: $(C_SRC) - etags $(C_SRC) +realclean :: distclean -install: $(TARGET) - $(INSTALL_PROGRAM) $(TARGET) $(INSTALL_PREFIX)$(bindir)/$(TARGET) +tack.tar: Makefile.in modules *.[ch] tack.1 HISTORY COPYING + tar -cvf tack.tar Makefile.in modules *.[ch] tack.1 HISTORY COPYING -list: $(srcdir)/tack.h $(C_SRC) - for name in $(>) ; \ - do \ - ucb cat -n $$name | ucb pr -h "$$name" | ucb lpr ; \ - done +# These rules are used to allow "make -n" to work on a clean directory-tree +../include/hashsize.h \ +../include/parametrized.h \ +../include/term.h : + cd ../include; $(MAKE) $(CF_MFLAGS) -# archive a backup copy -arch: $(srcdir)/Makefile $(srcdir)/tack.h $(C_SRC) - rm -f tack.a - ar q tack.a $(>) +$(DEPS_CURSES) : + cd ../ncurses; $(MAKE) $(CF_MFLAGS) -tack.tar.gz: tack.tar - gzip tack.tar +lint: + $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c $(LINT_LIBS) -tack.tar: makefile *.[ch] tack.1 HISTORY - tar -cvf tack.tar makefile *.[ch] tack.1 HISTORY +############################################################################### +# The remainder of this file is automatically generated during configuration +############################################################################### diff --git a/tack/README b/tack/README new file mode 100644 index 00000000..c1b0286b --- /dev/null +++ b/tack/README @@ -0,0 +1,5 @@ +-- $Id: README,v 1.1 1999/04/18 01:41:31 tom Exp $ + +The 'tack' program is distributed with ncurses, but is not an integral +part of ncurses (the two are licensed differently, and the tack directory +may be removed without causing ncurses to configure or build properly). diff --git a/tack/ansi.c b/tack/ansi.c new file mode 100644 index 00000000..a514a9c1 --- /dev/null +++ b/tack/ansi.c @@ -0,0 +1,889 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include + +MODULE_ID("$Id: ansi.c,v 1.2 1999/08/21 23:11:57 tom Exp $") + +/* + * Standalone tests for ANSI terminals. Three entry points: + * test_ansi_graphics(), test_ansi_reports() and test_ansi_sgr(). + */ + +/***************************************************************************** + * + * Test ANSI status reports + * + *****************************************************************************/ + +/* ASCII control characters */ +#define A_DC1 0x11 /* Control Q */ +#define A_DC3 0x13 /* Control S */ +#define A_ESC 0x1b +#define A_DCS 0x90 +#define A_CSI 0x9b +#define A_ST 0x9c + +#define MAX_MODES 256 + +static char default_bank[] = "\033(B\017"; +static int private_use, ape, terminal_class, got_escape; +static short ansi_value[256]; +static char ansi_buf[512], pack_buf[512]; +static char *ach, *pch; + +struct ansi_reports { + int lvl, final; + const char *text; + const char *request; +}; + +static struct ansi_reports report_list[] = { + {0, 'c', "(DA) Primary device attributes", "\033[0c"}, + {1, 0, "(DSR) Terminal status", "\033[5n"}, + {1, 'R', "(DSR) Cursor position", "\033[6n"}, + {62, 0, "(DA) Secondary device attributes", "\033[>0c"}, + {62, 0, "(DSR) Printer status", "\033[?15n"}, + {62, 0, "(DSR) Function key definition", "\033[?25n"}, + {62, 0, "(DSR) Keyboard language", "\033[?26n"}, + {63, 0, "(DECRQSS) Data destination", "\033P$q$}\033\\"}, + {63, 0, "(DECRQSS) Status line type", "\033P$q$~\033\\"}, + {63, 0, "(DECRQSS) Erase attribute", "\033P$q\"q\033\\"}, + {63, 0, "(DECRQSS) Personality", "\033P$q\"p\033\\"}, + {63, 0, "(DECRQSS) Top and bottom margins", "\033P$qr\033\\"}, + {63, 0, "(DECRQSS) Character attributes", "\033P$qm\033\\"}, + {63, 0, "(DECRQSS) Illegal request", "\033P$q@\033\\"}, + {63, 0, "(DECRQUPSS) User pref suplemental set", "\033[&u"}, + {63, 0, "(DECRQPSR) Cursor information", "\033[1$w"}, + {63, 0, "(DECRQPSR) Tab stop information", "\033[2$w"}, + {64, 0, "(DA) Tertiary device attributes", "\033[=0c"}, + {64, 0, "(DSR) Extended cursor position", "\033[?6n"}, + {64, 0, "(DSR) Macro space", "\033[?62n"}, + {64, 0, "(DSR) Memory checksum", "\033[?63n"}, + {64, 0, "(DSR) Data integrity", "\033[?75n"}, + {64, 0, "(DSR) Multiple session status", "\033[?85n"}, + {64, 0, "(DECRQSS) Attribute change extent", "\033P$q*x\033\\"}, + {64, 0, "(DECRQSS) Columns per page", "\033P$q$|\033\\"}, + {64, 0, "(DECRQSS) Lines per page", "\033P$qt\033\\"}, + {64, 0, "(DECRQSS) Lines per screen", "\033P$q*|\033\\"}, + {64, 0, "(DECRQSS) Left and right margins", "\033P$qs\033\\"}, + {64, 0, "(DECRQSS) Local functions", "\033P$q+q\033\\"}, + {64, 0, "(DECRQSS) Local function key control", "\033P$q=}\033\\"}, + {64, 0, "(DECRQSS) Select modifier key reporting", "\033P$q+r\033\\"}, + {64, 0, "(DECRQDE) Window report", "\033[\"v"}, + {0, 0, 0, 0} +}; + +struct request_control { + const char *text; + const char *expect; + const char *request; + const char *set_mode; + const char *reset_mode; +}; + +/* Request control function selection or setting */ +static const struct request_control rqss[] = { + {"Data sent to screen", "0", "$}", "\033[0$}", 0}, + {"Data sent to disabled status line", "0", "$}", 0, 0}, + {"\033[0$~\033[1$}", "\033[0$}", 0, 0, 0}, + {"Data sent to enabled status line", "1", "$}", 0, 0}, + {"\033[2$~\033[1$}", "\033[0$}", 0, 0, 0}, + {"Disbale status line", "0", "$~", "\033[0$~", 0}, + {"Top status line", "1", "$~", "\033[1$~", 0}, + {"Bottom status line", "2", "$~", "\033[2$~", 0}, + {"Eraseable character", "0", "\"q", "\033[0\"q", 0}, + {"Noneraseable character", "1", "\"q", "\033[1\"q", "\033[0\"q"}, + {"Top and bottom margins", "3;10", "r", "\0337\033[3;10r", 0}, + {"\033[r\0338", 0, 0, 0, 0}, + {"Top and bottom margins", "default", "r", "\0337\033[r", "\0338"}, + {"Character attributes, dim, bold", "1", "m", "\033[2;1m", "\033[m"}, + {"Character attributes, bold, dim", "2", "m", "\033[1;2m", "\033[m"}, + {"Character attributes, under, rev", "4;7", "m", "\033[4;7m", "\033[m"}, + {"Character attributes, color", "35;42", "m", "\033[35;42m", "\033[m"}, + {"All character attributes", "", "m", "\033[1;2;3;4;5;6;7;8;9m", 0}, + {"\033[m", 0, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +/* +** pack_ansi() +** +** read and pack an ANSI character +*/ +static int +pack_ansi(void) +{ + int ch; + + if (*pch) + return *pch++; + + while (1) { + ch = getchp(char_mask); + if (ch == EOF) + return EOF; + if (ch == A_DC1 || ch == A_DC3) + continue; + *ach++ = ch; + *ach = '\0'; + if (got_escape && ch >= ' ') { + got_escape = 0; + if (ch < '@' || ch > '_') { + *pch++ = A_ESC; + *pch = ch; + pch[1] = '\0'; + return A_ESC; + } + ch += 0x40; + break; + } else if (ch == A_ESC) { + got_escape = 1; + } else { + break; + } + } + *pch++ = ch; + *pch = '\0'; + return ch; +} + + +/* +** read_ansi() +** +** read an ANSI status report from terminal +*/ +static void +read_ansi(void) +{ + int ch; + + fflush(stdout); + ach = ansi_buf; + pch = pack_buf; + ansi_buf[0] = pack_buf[0] = '\0'; + got_escape = 0; + ch = pack_ansi(); + if (ch == A_ESC) + do { + ch = pack_ansi(); + if (ch == EOF) + return; + } while (ch < '0' || ch > '~'); + else + if (ch == A_CSI) + do { + ch = pack_ansi(); + if (ch == EOF) + return; + } while (ch < '@' || ch > '~'); + else + if (ch == A_DCS) + do { + ch = pack_ansi(); + if (ch == EOF) + return; + } while (ch != A_ST); + return; +} + +/* +** valid_mode(expected) +** +** read a terminal mode status report and parse the result +** Return TRUE if we got the expected terminating character. +*/ +static int +valid_mode(int expected) +{ + char *s; + int ch, terminator; + + read_ansi(); + + ape = 0; + ch = pack_buf[0] & 0xff; + ansi_value[0] = 0; + if (ch != A_CSI && ch != A_DCS) + return FALSE; + + s = pack_buf + 1; + private_use = 0; + if ((*s >= '<') & (*s <= '?')) { + private_use = *s++; + } + terminator = 0; + for (; (ch = *s); s++) { + if (ch >= '0' && ch <= '9') + ansi_value[ape] = ansi_value[ape] * 10 + ch - '0'; + else if (ch == ';' || ch == ':') + ansi_value[++ape] = 0; + else if (ch >= '<' && ch <= '?') + private_use = ch; + else if (ch >= ' ') + terminator = (terminator << 8) | ch; + else + break; + } + return terminator == expected; +} + +/* +** read_reports() +** +** read all the reports in the ANSI report structure +*/ +static int +read_reports(void) +{ + int i, j, k, tc, vcr, lc; + char *s; + + lc = 5; + terminal_class = tc = 0; + for (i = 0; report_list[i].text; i++, lc++) { + if (terminal_class < report_list[i].lvl && + tc < report_list[i].lvl) { + put_crlf(); + menu_prompt(); + ptext(" to continue > "); + j = wait_here(); + if (j != 'c' && j != 'C') + return j; + tc = report_list[i].lvl; + } else if (lc + 2 >= lines) { + put_crlf(); + ptext("Hit any key to continue "); + (void) wait_here(); + lc = 1; + } + sprintf(temp, "%s (%s) ", report_list[i].text, + expand_command(report_list[i].request)); + ptext(temp); + for (j = strlen(temp); j < 49; j++) + putchp(' '); + tc_putp(report_list[i].request); + vcr = 0; + if (report_list[i].final == 0) { + read_ansi(); + } else if (valid_mode(report_list[i].final)) + switch (report_list[i].final) { + case 'c': + terminal_class = ansi_value[0]; + break; + case 'R': + vcr = TRUE; + break; + } + j = pack_buf[0] & 0xff; + if (j == A_CSI || j == A_DCS) { + s = expand(ansi_buf); + if (char_count + expand_chars >= columns) { + put_str("\r\n "); + lc++; + } + put_str(s); + } + put_crlf(); + if (vcr) { /* find out how big the screen is */ + tc_putp(report_list[i].request); + if (!valid_mode('R')) + continue; + j = ansi_value[0]; + k = ansi_value[1]; + tc_putp("\033[255B\033[255C\033[6n"); + if (!valid_mode('R')) + continue; + sprintf(temp, "\033[%d;%dH", j, k); + tc_putp(temp); + ptext("(DSR) Screen size (CSI 6 n)"); + for (j = char_count; j < 50; j++) + putchp(' '); + sprintf(temp, "%d x %d", ansi_value[1], ansi_value[0]); + ptextln(temp); + + } + } + menu_prompt(); + ptext(" r->repeat test, to continue > "); + return wait_here(); +} + +/* +** request_cfss() +** +** Request Control function selection or settings +*/ +static int +request_cfss(void) +{ + int i, j, k, l, ch; + char *s; + + put_clear(); + ptextln("Request Expected Received"); + put_crlf(); + for (i = 0; rqss[i].text; i++) { + ptext(rqss[i].text); + j = strlen(rqss[i].text) + strlen(rqss[i].expect); + putchp(' '); + for (j++; j < 40; j++) + putchp(' '); + ptext(rqss[i].expect); + putchp(' '); + tc_putp(rqss[i].set_mode); + sprintf(temp, "\033P$q%s\033\\", rqss[i].request); + tc_putp(temp); + read_ansi(); + tc_putp(rqss[i].reset_mode); + putchp(' '); + for (j = 0; ansi_buf[j]; j++) { + if (ansi_buf[j] == 'r') { + for (k = j++; (ch = (ansi_buf[k] & 0xff)); k++) + if (ch == A_ESC) { + break; + } else if (ch == A_ST) { + break; + } + ansi_buf[k] = '\0'; + s = expand(&ansi_buf[j]); + if (char_count + expand_chars >= columns) + put_str("\r\n "); + put_str(s); + } + } + put_crlf(); + } + /* calculate the valid attributes */ + ptext("Valid attributes: 0"); + j = 0; + for (i = 1; i < 20; i++) { + sprintf(temp, "\033[0;%dm\033P$qm\033\\", i); + tc_putp(temp); + (void) valid_mode('m'); + if (ape > 0) { + j = i; + sprintf(temp, "\033[0m; %d", i); + tc_putp(temp); + } + } + put_crlf(); + /* calculate how many parameters can be sent */ + ptext("Max number of parameters: "); + sprintf(temp, "%dm\033P$qm\033\\", j); + l = -1; + if (j > 0) + for (l = 1; l < 33; l++) { + tc_putp("\033[0"); + for (ch = 1; ch <= l; ch++) + put_this(';'); + tc_putp(temp); + (void) valid_mode('m'); + if (ape == 0) + break; + } + tc_putp("\033[m"); + if (l >= 0) { + sprintf(temp, "%d", l); + ptext(temp); + } else + ptext("unknown"); + put_crlf(); + return wait_here(); +} + +/* +** mode_display(puc, mode, initial, set, reset) +** +** print the mode display entry +*/ +static void +mode_display(const char *p, int n, int c, char s, char r) +{ + int k; + + sprintf(temp, "%s%d (%c, %c, %c)", p, n, c, s, r); + k = strlen(temp); + if (char_count + k >= columns) + put_crlf(); + for (; k < 14; k++) + putchp(' '); + put_str(temp); +} + +/* +** terminal_state() +** +** test DECRQM status reports +*/ +static void +terminal_state(void) +{ + static const char *puc[] = {"", "<", "=", ">", "?", 0}; + + int i, j, k, l, modes_found; + char *s; + char buf[256], tms[256]; + int mode_puc[MAX_MODES], mode_number[MAX_MODES]; + char set_value[MAX_MODES], reset_value[MAX_MODES]; + char current_value[MAX_MODES]; + + ptext("Testing terminal mode status. (CSI 0 $ p)"); + tc_putp("\033[0$p"); + modes_found = 0; + tms[0] = '\0'; + if (valid_mode(('$' << 8) | 'y')) { + for (i = 0; puc[i]; i++) { + put_crlf(); + if (i) { + sprintf(temp, "Private use: %c", puc[i][0]); + } else { + strcpy(temp, "Standard modes:"); + } + k = strlen(temp); + ptext(temp); + for (j = 0; j < (int) sizeof(buf); buf[j++] = ' ') + ; + for (j = l = 0; j < 255 && j - l < 50; j++) { + sprintf(temp, "\033[%s%d$p", puc[i], j); + tc_putp(temp); + if (!valid_mode(('$' << 8) | 'y')) { + /* not valid, save terminating value */ + s = expand(ansi_buf); + sprintf(tms, "%s%s%d %s ", tms, + puc[i], j, s); + break; + } + if (private_use != puc[i][0]) + break; + if (ansi_value[0] != j) + break; + if (ansi_value[1]) { + l = j; + if (k > 70) { + buf[k] = '\0'; + put_crlf(); + ptextln(buf); + for (k = 0; k < (int) sizeof(buf);) { + buf[k++] = ' '; + } + k = 0; + } + sprintf(temp, " %d", j); + ptext(temp); + k += strlen(temp); + buf[k - 1] = ansi_value[1] + '0'; + if (modes_found >= MAX_MODES) + continue; + current_value[modes_found] = + ansi_value[1] + '0'; + /* some modes never return */ + if ((i == 0 && j == 13) /* control execution */ + || (puc[i][0] == '?' && j == 2)) /* VT52 */ + set_value[modes_found] = + reset_value[modes_found] = '-'; + else + set_value[modes_found] = + reset_value[modes_found] = ' '; + mode_puc[modes_found] = i; + mode_number[modes_found++] = j; + } + } + buf[k] = '\0'; + if (buf[k - 1] != ' ') { + put_crlf(); + ptext(buf); + } + } + + if ((i = modes_found) != 0) { + put_crlf(); + put_crlf(); + if (tms[0]) { + ptextln(tms); + } + ptext("Hit 'Y' to test mode set/reset states: "); + i = wait_here(); + } + if (i == 'y' || i == 'Y') + while (1) { +#ifdef STATUSFIX + FILE *fp; + +#ifdef TEDANSI + fp = fopen("ted.ansi", "w"); +#else + fp = fopen("/dev/console", "w"); +#endif +#endif + for (i = j = 0; j < modes_found; j = ++i >> 1) { + if (set_value[j] == '-') + continue; + k = (current_value[j] ^ i) & 1; + sprintf(temp, "\033[%s%d%c\033[%s%d$p", + puc[mode_puc[j]], mode_number[j], + k ? 'l' : 'h', + puc[mode_puc[j]], mode_number[j]); +#ifdef STATUSFIX + if (fp) { + fprintf(fp, "%s\n", expand(temp)); + fflush(fp); + } +#endif + tc_putp(temp); + if (!valid_mode(('$' << 8) | 'y')) + continue; + if (k) { + reset_value[j] = ansi_value[1] + '0'; + } else { + set_value[j] = ansi_value[1] + '0'; + } + } + put_str("\033[30l"); /* added for GORT bug + (WY-185) */ +#ifdef STATUSFIX + if (fp) + fclose(fp); +#endif + tty_set(); + /* print the results */ + put_clear(); + putln("mode (initial, set, reset)"); + for (j = 0; j < modes_found; j++) { + mode_display(puc[mode_puc[j]], mode_number[j], + current_value[j], set_value[j], reset_value[j]); + } + ptext("\n\nHit 'R' to repeat test. 'S' to sort results: "); + i = wait_here(); + if (i == 's' || i == 'S') { /* print the same stuff, + sorted by + current_value */ + put_crlf(); + for (i = '1'; i <= '4'; i++) { + for (j = 0; j < modes_found; j++) { + if (current_value[j] == i) + mode_display(puc[mode_puc[j]], + mode_number[j], current_value[j], + set_value[j], reset_value[j]); + } + } + ptext("\n\nHit 'R' to repeat test: "); + i = wait_here(); + } + if (i != 'r' && i != 'R') + break; + tty_raw(1, char_mask); + } + } else { + tty_set(); + } +} + + +/* +** ansi_report_help() +** +** Display the informational data for the ANSI report test. +*/ +static void +ansi_report_help(void) +{ + ptext("Begin ANSI status report testing. "); + ptext(" Parity bit set will be displayed in reverse video. "); + ptext(" If the terminal hangs, hit any alphabetic key. "); + ptextln(" Use c to continue testing. Use any other letter to quit."); + put_crlf(); +} + +/* +** test_ansi_reports() +** +** Test the ANSI status report functions +*/ +void +tools_status( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch) +{ + int i; + + put_clear(); + ansi_report_help(); + tty_raw(1, char_mask); + + do { + i = read_reports(); + if (i != 'r' && i != 'R') { + *ch = i; + return; + } + } while (i); + + if (terminal_class >= 63) { + do { + i = request_cfss(); + } while (i == 'r' || i == 'R'); + *ch = i; + terminal_state(); + } else { + tty_set(); + } +} + + +/* +** display_sgr() +** +** Test a range of ANSI sgr attributes +** puc -> Private Use Character +*/ +static void +display_sgr(int puc) +{ + int k; + + temp[0] = puc; + temp[1] = '\0'; + for (k = 0; k < 80; k++) { + if (char_count + 8 > 80) + put_crlf(); + else if (char_count + 8 > columns) + put_crlf(); + else if (k > 0) + printf(" "); + printf("\033[%s%dmMode %2d\033[0m", temp, k, k); + char_count += 8; + if (puc == '\0') { + if (k == 19) + printf("\033[10m"); + if (k == 39) + printf("\033[37m"); + if (k == 49) + printf("\033[40m"); + } + } + put_crlf(); + if (puc == '<') + printf("\033[<1m"); + else if (puc) + printf("\033[%s0m", temp); + set_attr(0); +} + +/* +** print_sgr20(on, off) +** +** print the sgr line for sgr20() +*/ +static void +print_sgr20(int on, int off) +{ + if (char_count > columns - 13) { + put_crlf(); + } else if (char_count) { + put_str(" "); + } + char_count += 11; + printf("%d/%d \033[%dmon\033[%dm off\033[0m", on, off, on, off); +} + +/* +** sgr20(void) +** +** display the enter/exit attributes 1-9 and 20-29 +*/ +static void +sgr20(void) +{ + int k; + + put_crlf(); + ptextln("Test enter/exit attributes 1-9 and 21-29."); + for (k = 1; k < 10; k++) { + print_sgr20(k, k + 20); + } + print_sgr20(1, 22); /* bold */ + print_sgr20(2, 22); /* dim */ + print_sgr20(8, 22); /* blank */ + printf("\033[0m"); + set_attr(0); +} + +/* +** tools_sgr(testlist, state, ch) +** +** Run the ANSI graphics rendition mode tool +** Return the last character typed. +*/ +void +tools_sgr( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch) +{ + int k; + + put_clear(); + for (k = 0;;) { + display_sgr(k); + put_crlf(); + menu_prompt(); + ptext("/sgr Enter =>] > "); + k = wait_here(); + if ((k == 'r') || (k == 'R')) { + k = 0; + } else if ((k < '<') || (k > '?')) { + break; + } + } + sgr20(); + + put_newlines(2); + *ch = REQUEST_PROMPT; +} + +/***************************************************************************** + * + * Test ANSI graphics + * + *****************************************************************************/ +/* +** select_bank(bank) +** +** select a graphics character set for ANSI terminals +*/ +static void +select_bank(char *bank) +{ + tc_putp(bank); + switch (bank[1] & 3) { + case 0: + putchp('O' & 0x1f); /* control O */ + break; + case 1: + putchp('N' & 0x1f); /* control N */ + tc_putp("\033~"); + break; + case 2: + tc_putp("\033n\033}"); + break; + case 3: + tc_putp("\033o\033|"); + break; + } +} + +/* +** show_characters(bank, bias) +** +** print the ANSI graphics characters +*/ +static void +show_characters(char *bank, int bias) +{ + int i; + + sprintf(temp, "G%d GL ", bank[1] & 3); + ptext(temp); + select_bank(bank); + for (i = ' '; i < 0x80; i++) { + if (char_count >= columns || + (i != ' ' && (i & 31) == 0)) + put_str("\n "); + putchp(i + bias); + } + select_bank(default_bank); + put_str(" DEL <"); + select_bank(bank); + putchp(0x7f + bias); + select_bank(default_bank); + putchp('>'); + put_crlf(); + put_crlf(); +} + + +/* ANSI graphics test + 94 96 character sets + G0 ( , + G1 ) - + G2 * . + G3 + / + +Standard Definitions + A UK + B US ASCII + +Dec extended definitions + 0 Special graphics + + */ + +/* +** tools_charset(testlist, state, ch) +** +** Run the ANSI alt-charset mode tool +*/ +void +tools_charset( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *chp GCC_UNUSED) +{ + int j, ch; + char bank[32]; + + put_clear(); + ptext("Enter the bank ()*+,-./ followed by the character set"); + ptext(" 0123456789:;<=>? for private use, and"); + ptextln(" @A...Z[\\]^_`a...z{|}~ for standard sets."); + strcpy(bank, "\033)0"); + for (; bank[0];) { + put_crlf(); + show_characters(bank, 0); + + /* G0 will not print in GR */ + if (bank[1] & 3) { + show_characters(bank, 0x80); + } + ptext("bank+set> "); + for (j = 1; (ch = getchp(char_mask)); j++) { + if (ch == EOF) + break; + putchp(ch); + if (j == 1 && ch > '/') + j++; + bank[j] = ch; + if (ch < ' ' || ch > '/') + break; + if (j + 1 >= (int) sizeof(bank)) + break; + } + if (j == 1) + break; + if (bank[j] < '0' || bank[j] > '~') + break; + bank[j + 1] = '\0'; + } + put_crlf(); +} diff --git a/tack/charset.c b/tack/charset.c new file mode 100644 index 00000000..c31b78b5 --- /dev/null +++ b/tack/charset.c @@ -0,0 +1,709 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include + +MODULE_ID("$Id: charset.c,v 1.2 1999/05/09 18:30:49 tom Exp $") + +/* + Menu definitions for alternate character set and SGR tests. +*/ + +static void charset_bel(struct test_list *t, int *state, int *ch); +static void charset_flash(struct test_list *t, int *state, int *ch); +static void charset_civis(struct test_list *t, int *state, int *ch); +static void charset_cvvis(struct test_list *t, int *state, int *ch); +static void charset_cnorm(struct test_list *t, int *state, int *ch); +static void charset_hs(struct test_list *t, int *state, int *ch); +static void charset_status(struct test_list *t, int *state, int *ch); +static void charset_dsl(struct test_list *t, int *state, int *ch); +static void charset_enacs(struct test_list *t, int *state, int *ch); +static void charset_smacs(struct test_list *t, int *state, int *ch); +static void charset_attributes(struct test_list *t, int *state, int *ch); +static void charset_sgr(struct test_list *t, int *state, int *ch); + +const struct test_list acs_test_list[] = { + {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, + {MENU_NEXT, 3, "bel", 0, 0, charset_bel, 0}, + {MENU_NEXT, 3, "flash", 0, 0, charset_flash, 0}, + {MENU_NEXT, 3, "civis", 0, 0, charset_civis, 0}, + {MENU_NEXT, 3, "cvvis", 0, 0, charset_cvvis, 0}, + {MENU_NEXT, 3, "cnorm", 0, 0, charset_cnorm, 0}, + {MENU_NEXT, 3, "hs", 0, 0, charset_hs, 0}, + {MENU_NEXT, 3, "tsl) (fsl) (wsl", "hs", 0, charset_status, 0}, + {MENU_NEXT, 3, "dsl", "hs", 0, charset_dsl, 0}, + {MENU_NEXT, 0, "acsc) (enacs) (smacs) (rmacs", 0, 0, charset_enacs, 0}, + {MENU_NEXT, 0, "smacs) (rmacs", 0, 0, charset_smacs, 0}, + {MENU_NEXT, 11, 0, 0, 0, charset_attributes, 0}, + {MENU_NEXT, 11, "sgr) (sgr0", "ma", 0, charset_sgr, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +const struct mode_list alt_modes[] = { + {"normal", "(sgr0)", "(sgr0)", 1}, + {"standout", "(smso)", "(rmso)", 2}, + {"underline", "(smul)", "(rmul)", 4}, + {"reverse", "(rev)", "(sgr0)", 8}, + {"blink", "(blink)", "(sgr0)", 16}, + {"dim", "(dim)", "(sgr0)", 32}, + {"bold", "(bold)", "(sgr0)", 64}, + {"invis", "(invis)", "(sgr0)", 128}, + {"protect", "(prot)", "(sgr0)", 256}, + {"altcharset", "(smacs)", "(rmacs)", 512} +}; + +/* On many terminals the underline attribute is the last scan line. + This is OK unless the following line is reverse video. + Then the underline attribute does not show up. The following map + will reorder the display so that the underline attribute will + show up. */ +const int mode_map[10] = {0, 1, 3, 4, 5, 6, 7, 8, 9, 2}; + +struct graphics_pair { + unsigned char c; + const char *name; +}; + +static struct graphics_pair glyph[] = { + {'+', "arrow pointing right"}, + {',', "arrow pointing left"}, + {'.', "arrow pointing down"}, + {'0', "solid square block"}, + {'i', "lantern symbol"}, + {'-', "arrow pointing up"}, + {'`', "diamond"}, + {'a', "checker board (stipple)"}, + {'f', "degree symbol"}, + {'g', "plus/minus"}, + {'h', "board of squares"}, + {'j', "lower right corner"}, + {'k', "upper right corner"}, + {'l', "upper left corner"}, + {'m', "lower left corner"}, + {'n', "plus"}, + {'o', "scan line 1"}, + {'p', "scan line 3"}, + {'q', "horizontal line"}, + {'r', "scan line 7"}, + {'s', "scan line 9"}, + {'t', "left tee (|-)"}, + {'u', "right tee (-|)"}, + {'v', "bottom tee(_|_)"}, + {'w', "top tee (T)"}, + {'x', "vertical line"}, + {'y', "less/equal"}, + {'z', "greater/equal"}, + {'{', "Pi"}, + {'|', "not equal"}, + {'}', "UK pound sign"}, + {'~', "bullet"}, + {'\0', "\0"} +}; + +/* +** charset_hs(test_list, status, ch) +** +** (hs) test Has status line +*/ +static void +charset_hs( + struct test_list *t, + int *state, + int *ch) +{ + if (has_status_line != 1) { + ptext("(hs) Has-status line is not defined. "); + generic_done_message(t, state, ch); + } +} + +/* +** charset_status(test_list, status, ch) +** +** (tsl) (fsl) (wsl) test Status line +*/ +static void +charset_status( + struct test_list *t, + int *state, + int *ch) +{ + int i, max; + char *s; + static char m[] = "*** status line *** 123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789."; + + if (has_status_line != 1) { + return; + } + put_clear(); + max = width_status_line == -1 ? columns : width_status_line; + sprintf(temp, "Terminal has status line of %d characters", max); + ptextln(temp); + + put_str("This line s"); + s = tparm(to_status_line, 0); + tc_putp(s); + for (i = 0; i < max; i++) + putchp(m[i]); + tc_putp(from_status_line); + putln("hould not be broken."); + ptextln("If the previous line is not a complete sentence then (tsl) to-status-line, (fsl) from-status-line, or (wsl) width-of-status-line is incorrect." ); + generic_done_message(t, state, ch); +} + +/* +** charset_dsl(test_list, status, ch) +** +** (dsl) test Disable status line +*/ +static void +charset_dsl( + struct test_list *t, + int *state, + int *ch) +{ + if (has_status_line != 1) { + return; + } + if (dis_status_line) { + ptextln("Disable status line (dsl)"); + tc_putp(dis_status_line); + ptext("If you can still see the status line then (dsl) disable-status-line has failed. "); + } else { + ptext("(dsl) Disable-status-line is not defined. "); + } + generic_done_message(t, state, ch); +} + + +void +eat_cookie(void) +{ /* put a blank if this is not a magic cookie + terminal */ + if (magic_cookie_glitch < 1) + putchp(' '); +} + + +void +put_mode(char *s) +{ /* send the attribute string (with or without + % execution) */ + tc_putp(tparm(s)); /* allow % execution */ +} + + +void +set_attr(int a) +{ /* set the attribute from the bits in a */ + int i, b[32]; + + if (magic_cookie_glitch > 0) { + char_count += magic_cookie_glitch; + } + if (a == 0 && exit_attribute_mode) { + put_mode(exit_attribute_mode); + return; + } + for (i = 0; i < 31; i++) { + b[i] = (a >> i) & 1; + } + tc_putp(tparm(set_attributes, b[1], b[2], b[3], b[4], b[5], + b[6], b[7], b[8], b[9])); +} + +/* +** charset_sgr(test_list, status, ch) +** +** (sgr) test Set Graphics Rendition +*/ +static void +charset_sgr( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!set_attributes) { + ptext("(sgr) Set-graphics-rendition is not defined. "); + generic_done_message(t, state, ch); + return; + } + if (!exit_attribute_mode) { + ptextln("(sgr0) Set-graphics-rendition-zero is not defined."); + /* go ahead and test anyway */ + } + ptext("Test video attributes (sgr)"); + + for (i = 0; i < (int) (sizeof(alt_modes) / sizeof(struct mode_list)); + i++) { + put_crlf(); + sprintf(temp, "%d %-20s", i, alt_modes[i].name); + put_str(temp); + set_attr(alt_modes[i].number); + sprintf(temp, "%s", alt_modes[i].name); + put_str(temp); + set_attr(0); + } + + putln("\n\nDouble mode test"); + for (i = 0; i <= 9; i++) { + sprintf(temp, " %2d ", mode_map[i]); + put_str(temp); + } + for (i = 0; i <= 9; i++) { + put_crlf(); + sprintf(temp, "%d", mode_map[i]); + put_str(temp); + for (j = 0; j <= 9; j++) { + eat_cookie(); + set_attr((1 << mode_map[i]) | (1 << mode_map[j])); + put_str("Aa"); + set_attr(0); + if (j < 9) + eat_cookie(); + } + } + put_crlf(); + + if (max_attributes >= 0) { + sprintf(temp, "(ma) Maximum attributes %d ", max_attributes); + ptext(temp); + } + generic_done_message(t, state, ch); +} + +/* +** test_one_attr(mode-number, begin-string, end-string) +** +** Display one attribute line. +*/ +static void +test_one_attr( + int n, + char *begin_mode, + char *end_mode) +{ + int i; + + sprintf(temp, "%-10s %s ", alt_modes[n].name, alt_modes[n].begin_mode); + ptext(temp); + for (; char_count < 19;) { + putchp(' '); + } + if (begin_mode) { + putchp('.'); + put_mode(begin_mode); + put_str(alt_modes[n].name); + for (i = strlen(alt_modes[n].name); i < 13; i++) { + putchp(' '); + } + if (end_mode) { + put_mode(end_mode); + sprintf(temp, ". %s", alt_modes[n].end_mode); + } else { + set_attr(0); + strcpy(temp, ". (sgr)"); + } + ptextln(temp); + } else { + for (i = 0; i < magic_cookie_glitch; i++) + putchp('*'); + put_str("*** missing ***"); + for (i = 0; i < magic_cookie_glitch; i++) + putchp('*'); + put_crlf(); + } +} + +/* +** charset_attributes(test_list, status, ch) +** +** Test SGR +*/ +static void +charset_attributes( + struct test_list *t, + int *state, + int *ch) +{ + putln("Test video attributes"); + test_one_attr(1, enter_standout_mode, exit_standout_mode); + test_one_attr(2, enter_underline_mode, exit_underline_mode); + test_one_attr(9, enter_alt_charset_mode, exit_alt_charset_mode); + if (!exit_attribute_mode && !set_attributes) { + ptextln("(sgr0) exit attribute mode is not defined."); + generic_done_message(t, state, ch); + return; + } + test_one_attr(3, enter_reverse_mode, exit_attribute_mode); + test_one_attr(4, enter_blink_mode, exit_attribute_mode); + test_one_attr(5, enter_dim_mode, exit_attribute_mode); + test_one_attr(6, enter_bold_mode, exit_attribute_mode); + test_one_attr(7, enter_secure_mode, exit_attribute_mode); + test_one_attr(8, enter_protected_mode, exit_attribute_mode); + generic_done_message(t, state, ch); +} + +#define GLYPHS 256 + +/* +** charset_smacs(test_list, status, ch) +** +** display all posible acs characters +** (smacs) (rmacs) +*/ +static void +charset_smacs( + struct test_list *t, + int *state, + int *ch) +{ + int i, c; + + if (enter_alt_charset_mode) { + put_clear(); + ptextln("The following characters are available. (smacs) (rmacs)"); + for (i = ' '; i <= '`'; i += 32) { + put_crlf(); + put_mode(exit_alt_charset_mode); + for (c = 0; c < 32; c++) { + putchp(c + i); + } + put_crlf(); + put_mode(enter_alt_charset_mode); + for (c = 0; c < 32; c++) { + putchp(c + i); + } + put_mode(exit_alt_charset_mode); + put_crlf(); + } + put_mode(exit_alt_charset_mode); + put_crlf(); + generic_done_message(t, state, ch); + } +} + + +static void +test_acs( + int attr) +{ /* alternate character set */ + int i, j; + char valid_glyph[GLYPHS]; + char acs_table[GLYPHS]; + static unsigned char vt100[] = "`afgjklmnopqrstuvwxyz{|}~"; + + line_count = 0; + for (i = 0; i < GLYPHS; i++) { + valid_glyph[i] = FALSE; + acs_table[i] = i; + } + if (acs_chars) { + sprintf(temp, "Alternate character set map: %s", + expand(acs_chars)); + putln(temp); + for (i = 0; acs_chars[i]; i += 2) { + if (acs_chars[i + 1] == 0) { + break; + } + for (j = 0;; j++) { + if (glyph[j].c == (unsigned char) acs_chars[i]) { + acs_table[glyph[j].c] = acs_chars[i + 1]; + valid_glyph[glyph[j].c] = TRUE; + break; + } + if (glyph[j].name[0] == '\0') { + if (isgraph(acs_chars[i])) { + sprintf(temp, " %c", + acs_chars[i]); + } else { + sprintf(temp, " 0x%02x", + (acs_chars[i] & 0xff)); + } + strcpy(&temp[5], " *** has no mapping ***"); + putln(temp); + break; + } + } + } + } else { + ptextln("acs_chars not defined (acsc)"); + /* enable the VT-100 graphics characters (default) */ + for (i = 0; vt100[i]; i++) { + valid_glyph[vt100[i]] = TRUE; + } + } + if (attr) { + set_attr(attr); + } + _nc_init_acs(); /* puts 'ena_acs' and incidentally links acs_map[] */ + for (i = 0; glyph[i].name[0]; i++) { + if (valid_glyph[glyph[i].c]) { + put_mode(enter_alt_charset_mode); + put_this(acs_table[glyph[i].c]); + char_count++; + put_mode(exit_alt_charset_mode); + if (magic_cookie_glitch >= 1) { + sprintf(temp, " %-30.30s", glyph[i].name); + put_str(temp); + if (char_count + 33 >= columns) + put_crlf(); + } else { + sprintf(temp, " %-24.24s", glyph[i].name); + put_str(temp); + if (char_count + 26 >= columns) + put_crlf(); + } + if (line_count >= lines) { + (void) wait_here(); + put_clear(); + } + } + } + if (char_count > 1) { + put_crlf(); + } +#ifdef ACS_ULCORNER + maybe_wait(5); + put_mode(enter_alt_charset_mode); + put_this(ACS_ULCORNER); + put_this(ACS_TTEE); + put_this(ACS_URCORNER); + put_this(ACS_ULCORNER); + put_this(ACS_HLINE); + put_this(ACS_URCORNER); + char_count += 6; + put_mode(exit_alt_charset_mode); + put_crlf(); + put_mode(enter_alt_charset_mode); + put_this(ACS_LTEE); + put_this(ACS_PLUS); + put_this(ACS_RTEE); + put_this(ACS_VLINE); + if (magic_cookie_glitch >= 1) + put_this(' '); + else { + put_mode(exit_alt_charset_mode); + put_this(' '); + put_mode(enter_alt_charset_mode); + } + put_this(ACS_VLINE); + char_count += 6; + put_mode(exit_alt_charset_mode); + put_str(" Here are 2 boxes"); + put_crlf(); + put_mode(enter_alt_charset_mode); + put_this(ACS_LLCORNER); + put_this(ACS_BTEE); + put_this(ACS_LRCORNER); + put_this(ACS_LLCORNER); + put_this(ACS_HLINE); + put_this(ACS_LRCORNER); + char_count += 6; + put_mode(exit_alt_charset_mode); + put_crlf(); +#endif +} + +/* +** charset_bel(test_list, status, ch) +** +** (bel) test Bell +*/ +static void +charset_bel( + struct test_list *t, + int *state, + int *ch) +{ + if (bell) { + ptextln("Testing bell (bel)"); + tc_putp(bell); + ptext("If you did not hear the Bell then (bel) has failed. "); + } else { + ptext("(bel) Bell is not defined. "); + } + generic_done_message(t, state, ch); +} + +/* +** charset_flash(test_list, status, ch) +** +** (flash) test Visual bell +*/ +static void +charset_flash( + struct test_list *t, + int *state, + int *ch) +{ + if (flash_screen) { + ptextln("Testing visual bell (flash)"); + tc_putp(flash_screen); + ptext("If you did not see the screen flash then (flash) has failed. "); + } else { + ptext("(flash) Flash is not defined. "); + } + generic_done_message(t, state, ch); +} + +/* +** charset_civis(test_list, status, ch) +** +** (civis) test Cursor invisible +*/ +static void +charset_civis( + struct test_list *t, + int *state, + int *ch) +{ + if (cursor_normal) { + if (cursor_invisible) { + ptext("(civis) Turn off the cursor. "); + tc_putp(cursor_invisible); + ptext("If you can still see the cursor then (civis) has failed. "); + } else { + ptext("(civis) Cursor-invisible is not defined. "); + } + generic_done_message(t, state, ch); + tc_putp(cursor_normal); + } +} + +/* +** charset_cvvis(test_list, status, ch) +** +** (cvvis) test Cursor very visible +*/ +static void +charset_cvvis( + struct test_list *t, + int *state, + int *ch) +{ + if (cursor_normal) { + if (cursor_visible) { + ptext("(cvvis) Make cursor very visible. "); + tc_putp(cursor_visible); + ptext("If the cursor is not very visible then (cvvis) has failed. "); + } else { + ptext("(cvvis) Cursor-very-visible is not defined. "); + } + generic_done_message(t, state, ch); + tc_putp(cursor_normal); + } +} + +/* +** charset_cnorm(test_list, status, ch) +** +** (cnorm) test Cursor normal +*/ +static void +charset_cnorm( + struct test_list *t, + int *state, + int *ch) +{ + if (cursor_normal) { + ptext("(cnorm) Normal cursor. "); + tc_putp(cursor_normal); + ptext("If the cursor is not normal then (cnorm) has failed. "); + } else { + ptext("(cnorm) Cursor-normal is not defined. "); + } + generic_done_message(t, state, ch); +} + +/* +** charset_enacs(test_list, status, ch) +** +** test Alternate character set mode and alternate characters +** (acsc) (enacs) (smacs) (rmacs) +*/ +static void +charset_enacs( + struct test_list *t, + int *state, + int *ch) +{ + int c, i; + + if (enter_alt_charset_mode || acs_chars) { + c = 0; + while (1) { + put_clear(); + /* + for terminals that use separate fonts for + attributes (such as X windows) the line + drawing characters must be checked for + each font. + */ + if (c >= '0' && c <= '9') { + test_acs(alt_modes[c - '0'].number); + set_attr(0); + } else { + test_acs(0); + } + + while (1) { + ptextln("[r] to repeat, [012345789] to test with attributes on, [?] for a list of attributes, anything else to go to next test. "); + generic_done_message(t, state, ch); + if (*ch != '?') { + break; + } + for (i = 0; i <= 9; i++) { + sprintf(temp, " %d %s %s", i, alt_modes[i].begin_mode, + alt_modes[i].name); + ptextln(temp); + } + } + if (*ch >= '0' && *ch <= '9') { + c = *ch; + } else + if (*ch != 'r') { + break; + } + } + } else { + ptext("(smacs) Enter-alt-char-set-mode and (acsc) Alternate-char-set are not defined. "); + generic_done_message(t, state, ch); + } +} + +/* +** charset_can_test() +** +** Initialize the can_test data base +*/ +void +charset_can_test(void) +{ + int i; + + for (i = 0; i < 9; i++) { + can_test(alt_modes[i].begin_mode, FLAG_CAN_TEST); + can_test(alt_modes[i].end_mode, FLAG_CAN_TEST); + } +} diff --git a/tack/color.c b/tack/color.c new file mode 100644 index 00000000..710538ae --- /dev/null +++ b/tack/color.c @@ -0,0 +1,767 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include + +MODULE_ID("$Id: color.c,v 1.1 1999/04/18 01:24:45 tom Exp $") + +/* + * Color terminal tests. Has only one entry point: test_color(). + */ + +static void color_check(struct test_list *, int *, int *); +static void color_setf(struct test_list *, int *, int *); +static void color_matrix(struct test_list *, int *, int *); +static void color_ncv(struct test_list *, int *, int *); +static void color_ccc(struct test_list *, int *, int *); +static void color_bce(struct test_list *, int *, int *); + +struct test_list color_test_list[] = { + {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, + {MENU_NEXT, 2, "colors) (pairs", 0, 0, color_check, 0}, + {MENU_NEXT, 12, "setf) (setb) (scp", 0, 0, color_setf, 0}, + {MENU_NEXT, 24, "op", 0, 0, color_matrix, 0}, + {MENU_NEXT, 16, "ncv", 0, 0, color_ncv, 0}, + {MENU_NEXT, 0, "bce", 0, 0, color_bce, 0}, + {MENU_NEXT | MENU_CLEAR, 0, "ccc) (initc) (initp", "hls op oc", 0, color_ccc, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +#ifndef COLOR_BLACK +#define COLOR_BLACK 0 +#define COLOR_BLUE 1 +#define COLOR_GREEN 2 +#define COLOR_CYAN 3 +#define COLOR_RED 4 +#define COLOR_MAGENTA 5 +#define COLOR_YELLOW 6 +#define COLOR_WHITE 7 +#endif + +struct color_table { + const char *name; + int index; + int r, g, b; + int h, l, s; +}; + +static struct color_table def_colors[8] = { + {"black ", COLOR_BLACK, 0, 0, 0, 0, 0, 0}, + {"blue ", COLOR_BLUE, 0, 0, 1000, 330, 50, 100}, + {"green ", COLOR_GREEN, 0, 1000, 0, 240, 50, 100}, + {"cyan ", COLOR_CYAN, 0, 1000, 1000, 300, 50, 100}, + {"red ", COLOR_RED, 1000, 0, 0, 120, 50, 100}, + {"magenta", COLOR_MAGENTA, 1000, 0, 1000, 60, 50, 100}, + {"yellow ", COLOR_YELLOW, 1000, 1000, 0, 180, 50, 100}, + {"white ", COLOR_WHITE, 1000, 1000, 1000, 0, 100, 0} +}; + +#define MAX_PAIR 256 +static int fg_color[MAX_PAIR] = {COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, +COLOR_CYAN, COLOR_RED, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE}; +static int bg_color[MAX_PAIR] = {COLOR_BLACK, COLOR_BLACK, COLOR_BLACK, +COLOR_BLACK, COLOR_BLACK, COLOR_BLACK, COLOR_BLACK, COLOR_BLACK}; +static int pairs_used = 8; +static int a_bright_color, bright_value; +static int cookie_monster, color_step, colors_per_line; +static int R, G, B; + +static int +color_trans(int c) +{ /* translate or load the color */ + int i; + + for (i = 0; i < pairs_used; i++) { + if (fg_color[i] == c) { + return i; + } + } + if (!can_change) { + return 0; + } + if (pairs_used > max_colors || pairs_used >= MAX_PAIR) { + pairs_used = 0; + ptextln("Ran out of colors"); + } + fg_color[pairs_used] = c; + bg_color[pairs_used] = c; + if (hue_lightness_saturation) { + tc_putp(tparm(initialize_color, pairs_used, + def_colors[c].h, def_colors[c].l, def_colors[c].s)); + } else { + tc_putp(tparm(initialize_color, pairs_used, + def_colors[c].r, def_colors[c].g, def_colors[c].b)); + } + return pairs_used++; +} + +static void +new_color( + int fg, + int bg, + int hungry) +{ /* change the color to fg and bg. */ + int i; + + if (hungry) { + eat_cookie(); + } + if (set_a_foreground) { + /* set ANSI color (setaf) (setab) */ + tc_putp(tparm(set_a_foreground, fg)); + tc_putp(tparm(set_a_background, bg)); + } else if (set_foreground) { + /* make sure black is zero */ + (void) color_trans(COLOR_BLACK); + tc_putp(tparm(set_foreground, color_trans(fg))); + tc_putp(tparm(set_background, color_trans(bg))); + } else { /* set color pair */ + for (i = 0; i < pairs_used; i++) { + if (fg_color[i] == fg && bg_color[i] == bg) { + tc_putp(tparm(set_color_pair, i)); + if (hungry) { + eat_cookie(); + } + return; + } + } + if (!can_change) { + /* try to set just the foreground */ + for (i = pairs_used - 1; i; i--) { + if (fg_color[i] == fg) + break; + } + tc_putp(tparm(set_color_pair, i)); + if (hungry) { + eat_cookie(); + } + return; + } + if (pairs_used > max_pairs || pairs_used >= MAX_PAIR) { + pairs_used = 0; + ptextln("Ran out of color pairs"); + } + fg_color[pairs_used] = fg; + bg_color[pairs_used] = bg; + if (hue_lightness_saturation) { + tc_putp(tparm(initialize_pair, pairs_used, + def_colors[fg].h, def_colors[fg].l, def_colors[fg].s, + def_colors[bg].h, def_colors[bg].l, def_colors[bg].s)); + } else { + tc_putp(tparm(initialize_pair, pairs_used, + def_colors[fg].r, def_colors[fg].g, def_colors[fg].b, + def_colors[bg].r, def_colors[bg].g, def_colors[bg].b)); + } + tc_putp(tparm(set_color_pair, pairs_used)); + pairs_used++; + } + if (hungry) { + eat_cookie(); + } +} + + +static void +set_color_step(void) +{ /* set the color_step for the (ccc) display */ + int i; + + for (i = 2; i < 1000; i++) { + if ((i * i * i) >= max_colors) { + break; + } + } + color_step = 1000 / (i - 1); +} + + +static void +rgb_2_hls(int r, int g, int b, int *h, int *l, int *s) +{ /* convert RGB to HLS system */ + int min, max, t; + + if ((min = g < r ? g : r) > b) { + min = b; + } + if ((max = g > r ? g : r) < b) { + max = b; + } + + /* calculate lightness */ + *l = (min + max) / 20; + + if (min == max) { /* black, white and all shades of gray */ + *h = 0; + *s = 0; + return; + } + /* calculate saturation */ + if (*l < 50) { + *s = ((max - min) * 100) / (max + min); + } else { + *s = ((max - min) * 100) / (2000 - max - min); + } + + /* calculate hue */ + if (r == max) { + t = 120 + ((g - b) * 60) / (max - min); + } else if (g == max) { + t = 240 + ((b - r) * 60) / (max - min); + } else { + t = 360 + ((r - g) * 60) / (max - min); + } + *h = t % 360; +} + + +static void +send_color(int p, int r, int g, int b) +{ /* send the initialize_color (initc) command */ + int h, l, s; + + if (hue_lightness_saturation) { + rgb_2_hls(r, g, b, &h, &l, &s); + tc_putp(tparm(initialize_color, p, h, l, s)); + } else { + tc_putp(tparm(initialize_color, p, r, g, b)); + } +} + + +static void +send_pair(int p, int fr, int fg, int fb, int br, int bg, int bb) +{ /* send the initialize_pair (initp) command */ + int fh, fl, fs, bh, bl, bs; + + if (hue_lightness_saturation) { + rgb_2_hls(fr, fg, fb, &fh, &fl, &fs); + rgb_2_hls(br, bg, bb, &bh, &bl, &bs); + tc_putp(tparm(initialize_pair, p, fh, fl, fs, bh, bl, bs)); + } else { + tc_putp(tparm(initialize_pair, p, fr, fg, fb, bb, bg, bb)); + } +} + + +static int +load_palette(int n) +{ /* load the color palette */ + int rgb; + + for (;;) { + if (pairs_used >= n) { + return FALSE; + } + if (set_a_foreground || set_foreground) { + if (pairs_used >= max_colors) { + return FALSE; + } + send_color(pairs_used, R, G, B); + rgb = R + G + B; + if (rgb > bright_value) { + bright_value = rgb; + a_bright_color = pairs_used; + } + } else { + if (pairs_used >= max_pairs) { + return FALSE; + } + if (pairs_used == 0) { + send_pair(pairs_used, 1000, 1000, 1000, R, G, B); + } else { + send_pair(pairs_used, R, G, B, R, G, B); + } + } + pairs_used++; + if ((B += color_step) > 1000) { + B = 0; + if ((G += color_step) > 1000) { + G = 0; + if ((R += color_step) > 1000) { + return TRUE; + } + } + } + } +} + + +static int +rainbow(int n) +{ /* print the programable color display */ + int i, c, d, palette_full, initial_pair; + static const struct { + const char *name; + char ch; + } splat[] = { + {"Bg normal", ' '}, + {"Fg normal", ' '}, + {0, 0} + }; + + if ((set_a_foreground || set_foreground) + ? pairs_used >= max_colors + : pairs_used >= max_pairs) { + ptext("New palette: "); + (void) wait_here(); + initial_pair = pairs_used = 1; + bright_value = 0; + } else if (line_count + 3 >= lines) { + ptext("Go: "); + (void) wait_here(); + put_clear(); + initial_pair = pairs_used = 1; + bright_value = 0; + n++; + } else { + initial_pair = pairs_used; + n += initial_pair; + } + palette_full = load_palette(n); + for (d = 0; splat[d].name; d++) { + c = splat[d].ch; + if (d == 1) { + put_mode(enter_reverse_mode); + } + for (i = initial_pair; i < n; i++) { + if (i >= pairs_used) { + break; + } + if (set_a_foreground) { + if (i >= max_colors) { + break; + } + tc_putp(tparm(set_a_foreground, i)); + tc_putp(tparm(set_a_background, i)); + } else if (set_foreground) { + if (i >= max_colors) { + break; + } + tc_putp(tparm(set_foreground, i)); + tc_putp(tparm(set_background, i)); + } else { + if (i >= max_pairs) { + break; + } + tc_putp(tparm(set_color_pair, i)); + } + putchp(c); + } + if (d == 1) { + put_mode(exit_attribute_mode); + } + if (set_a_foreground) { + tc_putp(tparm(set_a_foreground, a_bright_color)); + tc_putp(tparm(set_a_background, 0)); + } else if (set_foreground) { + tc_putp(tparm(set_foreground, a_bright_color)); + tc_putp(tparm(set_background, 0)); + } else { + tc_putp(tparm(set_color_pair, 0)); + } + put_str(" "); + put_str(splat[d].name); + put_crlf(); + } + return palette_full; +} + + +static void +ncv_display(int m) +{ /* print the no_color_video (ncv) test line */ + putchp('0' + m); + putchp(' '); + eat_cookie(); + set_attr(1 << m); + sprintf(temp, "%-11s", alt_modes[m].name); + put_str(temp); + + new_color(COLOR_BLUE, COLOR_BLACK, TRUE); + put_str("blue"); + + new_color(COLOR_BLACK, COLOR_GREEN, TRUE); + put_str("green"); + + new_color(COLOR_WHITE, COLOR_BLACK, TRUE); + put_str(alt_modes[m].name); + eat_cookie(); + set_attr(0); + put_crlf(); +} + + +static void +dump_colors(void) +{ /* display the colors in some esthetic + pattern */ + static int xmap[8] = {0, 3, 4, 7, 1, 2, 5, 6}; + int i, j, k, xi, xj, width, p, cs; + int found_one; + + cs = color_step <= 125 ? 125 : color_step; + width = (1000 / cs) + 1; + for (xi = 0; xi < 16; xi++) { + i = (xi & 8) ? xi ^ 15 : xi; + R = i * cs; + if (R <= 1000) { + found_one = FALSE; + for (xj = 0; xj < 32; xj++) { + j = ((xj & 8) ? xj ^ 15 : xj) & 7; + k = xmap[((xi >> 1) & 4) + (xj >> 3)]; + G = j * cs; + B = k * cs; + if (G <= 1000 && B <= 1000) { + p = (k * width + j) * width + i; + if (set_a_background) { + if (p >= max_colors) { + continue; + } + send_color(p, R, G, B); + tc_putp(tparm(set_a_background, p)); + } else if (set_background) { + if (p >= max_colors) { + continue; + } + send_color(p, R, G, B); + tc_putp(tparm(set_background, p)); + } else { + if (p >= max_pairs) { + continue; + } + send_pair(p, R, G, B, R, G, B); + tc_putp(tparm(set_color_pair, p)); + } + found_one = TRUE; + putchp(' '); + putchp(' '); + } + } + if (found_one) { + put_crlf(); + } + } + } +} + +/* +** color_check(test_list, status, ch) +** +** test (colors) and (pairs) +*/ +static void +color_check( + struct test_list *t, + int *state, + int *ch) +{ + if (max_colors <= 0 && max_pairs <= 0) { + ptext("This is not a color terminal; (colors) and (pairs) are missing. "); + *state |= MENU_STOP; + } else { + sprintf(temp, "This terminal can display %d colors and %d color pairs. (colors) (pairs)", + max_colors, max_pairs); + ptextln(temp); + } + generic_done_message(t, state, ch); +} + +/* +** color_setf(test_list, status, ch) +** +** test (setf) (setb) and (scp) +*/ +static void +color_setf( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (max_colors <= 0 && max_pairs <= 0) { + ptext("This is not a color terminal; (colors) and (pairs) are missing. "); + generic_done_message(t, state, ch); + *state |= MENU_STOP; + return; + } + if ((set_a_foreground == NULL || set_a_background == NULL) + && (set_foreground == NULL || set_background == NULL) + && set_color_pair == NULL) { + ptextln("Both set foreground (setaf/setf) and set color pair (scp) are not present."); + if (!set_a_background || !set_background) { + ptextln("(setab/setb) set background not present"); + } + ptext("These must be defined for color testing. "); + generic_done_message(t, state, ch); + *state |= MENU_STOP; + return; + } + /* initialize the color palette */ + pairs_used = max_colors >= 8 ? 8 : max_colors; + if (can_change) { + tc_putp(orig_colors); + } + tc_putp(tparm(orig_pair)); + new_color(COLOR_WHITE, COLOR_BLACK, FALSE); + + ptextln("(setf) (setb) (scp) The following colors are predefined:"); + ptextln("\n Foreground Background"); + put_crlf(); + j = max_colors > 8 ? 8 : max_colors; + /* + the black on white test is the same as the white on black test. + */ + for (i = 1; i < j; i++) { + putchp('0' + def_colors[i].index); + putchp(' '); + sprintf(temp, " %s ", def_colors[i].name); + + new_color(def_colors[i].index, COLOR_BLACK, TRUE); + put_str(temp); + + new_color(COLOR_BLACK, COLOR_BLACK, TRUE); + put_str(" "); + + new_color(COLOR_BLACK, def_colors[i].index, TRUE); + put_str(temp); + + new_color(COLOR_WHITE, COLOR_BLACK, FALSE); + put_crlf(); + } + put_crlf(); + generic_done_message(t, state, ch); +} + +/* +** color_matrix(test_list, status, ch) +** +** test (pairs) (op) +*/ +static void +color_matrix( + struct test_list *t, + int *state, + int *ch) +{ + int i, j, matrix_size, matrix_area, brightness; + + matrix_size = max_colors > 8 ? 8 : max_colors; + + sprintf(temp, "(pairs) There are %d color pairs.", max_pairs); + ptextln(temp); + + for ( ; matrix_size; matrix_size--) { + if (matrix_size * matrix_size <= max_pairs) { + break; + } + } + matrix_area = matrix_size * matrix_size; + for (brightness = 0; brightness < 2; brightness++) { + put_crlf(); + sprintf(temp, + "%dx%d matrix of foreground/background colors, bright *o%s*", + matrix_size, matrix_size, brightness ? "n" : "ff"); + put_str(temp); + + put_str("\n "); + for (i = 0; i < matrix_size; i++) { + (void) sprintf(temp, "%-8s", def_colors[i].name); + put_str(temp); + } + for (j = 0; j < matrix_area; j++) { + if (j % matrix_size == 0) { + tc_putp(tparm(orig_pair)); + put_crlf(); + if (brightness) { + tc_putp(exit_standout_mode); + } + (void) sprintf(temp, "%-8s", def_colors[j / matrix_size].name); + put_str(temp); + if (brightness) { + put_mode(enter_bold_mode); + } + } + new_color(def_colors[j % matrix_size].index, + def_colors[j / matrix_size].index, + FALSE); + put_str(" Hello "); + } + tc_putp(tparm(orig_pair)); + if (brightness) { + tc_putp(exit_standout_mode); + } + put_crlf(); + } + generic_done_message(t, state, ch); +} + +/* +** color_ncv(test_list, status, ch) +** +** test (ncv) +*/ +static void +color_ncv( + struct test_list *t, + int *state, + int *ch) +{ + int i; + + if (no_color_video == -1) { + /* I have no idea what this means */ + return; + } + sprintf(temp, "According to no_color_video (ncv) which is %d, the following attributes should work correctly with color.", no_color_video); + ptextln(temp); + put_crlf(); + set_attr(0); + ncv_display(0); + for (i = 1; i <= 9; i++) { + if (((no_color_video >> (mode_map[i] - 1)) & 1) == 0) { + ncv_display(mode_map[i]); + } + } + if (no_color_video & 0x3ff) { + ptextln("\nThe following attributes should not work correctly with color. (ncv)\n"); + for (i = 1; i <= 9; i++) { + if ((no_color_video >> (mode_map[i] - 1)) & 1) { + ncv_display(mode_map[i]); + } + } + } + tc_putp(orig_pair); + put_crlf(); + generic_done_message(t, state, ch); +} + +/* +** color_bce(test_list, status, ch) +** +** test (bce) background color erase +*/ +static void +color_bce( + struct test_list *t, + int *state, + int *ch) +{ + new_color(COLOR_BLACK, COLOR_WHITE, FALSE); + put_clear(); + put_newlines(2); + new_color(COLOR_WHITE, COLOR_BLACK, FALSE); + ptextln("If the two lines above are black then back_color_erase (bce) should be false."); + sprintf(temp, "(bce) is %s in the data base.", back_color_erase ? "true" : "false"); + ptextln(temp); + generic_done_message(t, state, ch); +} + +/* +** color_ccc(test_list, status, ch) +** +** test (ccc) color palette test (oc) (op) (initc) (initp) +*/ +static void +color_ccc( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!can_change) { + ptextln("Terminal can not change colors (ccc)"); + generic_done_message(t, state, ch); + return; + } + tc_putp(orig_colors); + pairs_used = 0; + new_color(COLOR_WHITE, COLOR_BLACK, FALSE); + sprintf(temp, "Reloading colors (init%c) using %s method", + set_foreground ? 'c' : 'p', + hue_lightness_saturation ? "HLS" : "RGB"); + ptextln(temp); + put_crlf(); + j = max_colors > 7 ? 7 : max_colors; + /* redisplay the above test with reinitialized colors */ + /* If these colors don't look right to you... */ + for (i = 0; i < j; i++) { + sprintf(temp, " %s ", def_colors[i ^ 7].name); + + new_color(i ^ 7, COLOR_BLACK, TRUE); + put_str(temp); + + new_color(COLOR_BLACK, COLOR_BLACK, TRUE); + put_str(" "); + + new_color(COLOR_BLACK, i ^ 7, TRUE); + put_str(temp); + + new_color(COLOR_WHITE, COLOR_BLACK, FALSE); + put_crlf(); + } + generic_done_message(t, state, ch); + if (*ch != 0 && *ch != 'n') { + tc_putp(orig_colors); + tc_putp(tparm(orig_pair)); + return; + } + + pairs_used = 0; + cookie_monster = 0; + if (magic_cookie_glitch > 0) { + cookie_monster = + ((set_a_foreground || set_foreground) + ? magic_cookie_glitch : 0) + + ((set_a_background || set_background) + ? magic_cookie_glitch : 0) + + (set_color_pair ? magic_cookie_glitch : 0); + } + set_color_step(); + colors_per_line = max_colors > max_pairs + ? max_pairs : max_colors; + j = (columns - 14) / (cookie_monster + 1); + if (colors_per_line > j) { + colors_per_line = (j / i) * i; + } + sprintf(temp, "RGB color step %d, cookies %d", color_step, + cookie_monster); + ptextln(temp); + + R = G = B = 0; + pairs_used = 0; + for (;;) { + if (rainbow(colors_per_line)) { + break; + } + } + generic_done_message(t, state, ch); + if (*ch != 0 && *ch != 'n') { + tc_putp(orig_colors); + tc_putp(tparm(orig_pair)); + return; + } + dump_colors(); + tc_putp(orig_colors); + tc_putp(tparm(orig_pair)); + generic_done_message(t, state, ch); +} diff --git a/tack/control.c b/tack/control.c new file mode 100644 index 00000000..4c2158e4 --- /dev/null +++ b/tack/control.c @@ -0,0 +1,657 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include + +#if HAVE_SYS_TIME_H +#include +#endif + +MODULE_ID("$Id: control.c,v 1.2 1999/06/16 00:45:59 tom Exp $") + +/* terminfo test program control subroutines */ + +#if HAVE_GETTIMEOFDAY +#define MY_TIMER struct timeval +#else +#define MY_TIMER time_t +#endif + +/* globals */ +int test_complete; /* counts number of tests completed */ + +char txt_longer_test_time[80]; /* +) use longer time */ +char txt_shorter_test_time[80]; /* -) use shorter time */ +int pad_test_duration = 1; /* number of seconds for a pad test */ +int auto_pad_mode; /* run the time tests */ +int no_alarm_event; /* TRUE if the alarm has not gone off yet */ +int usec_run_time; /* length of last test in microseconds */ +MY_TIMER stop_watch[MAX_TIMERS]; /* Hold the start timers */ + +char txt_longer_augment[80]; /* >) use bigger augment */ +char txt_shorter_augment[80]; /* <) use smaller augment */ + +/* caps under test data base */ +int tt_delay_max; /* max number of milliseconds we can delay */ +int tt_delay_used; /* number of milliseconds consumed in delay */ +const char *tt_cap[TT_MAX]; /* value of string */ +int tt_affected[TT_MAX]; /* lines or columns effected (repitition factor) */ +int tt_count[TT_MAX]; /* Number of times sent */ +int tt_delay[TT_MAX]; /* Number of milliseconds delay */ +int ttp; /* number of entries used */ + +/* Saved value of the above data base */ +const char *tx_cap[TT_MAX]; /* value of string */ +int tx_affected[TT_MAX]; /* lines or columns effected (repitition factor) */ +int tx_count[TT_MAX]; /* Number of times sent */ +int tx_index[TT_MAX]; /* String index */ +int tx_delay[TT_MAX]; /* Number of milliseconds delay */ +int txp; /* number of entries used */ +int tx_characters; /* printing characters sent by test */ +int tx_cps; /* characters per second */ +struct test_list *tx_source; /* The test that generated this data */ + +extern struct test_menu pad_menu; /* Pad menu structure */ +extern struct test_list pad_test_list[]; + +#define RESULT_BLOCK 1024 +static int blocks; /* number of result blocks available */ +static struct test_results *results; /* pointer to next available */ +struct test_results *pads[STRCOUNT]; /* save pad results here */ + +/* +** event_start(number) +** +** Begin the stopwatch at the current time-of-day. +*/ +void +event_start(int n) +{ +#if HAVE_GETTIMEOFDAY + (void) gettimeofday(&stop_watch[n], (struct timezone *)0); +#else + stop_watch[n] = time((time_t *)0); +#endif +} + +/* +** event_time(number) +** +** Return the number of milliseconds since this stop watch began. +*/ +long +event_time(int n) +{ +#if HAVE_GETTIMEOFDAY + MY_TIMER current_time; + + (void) gettimeofday(¤t_time, (struct timezone *)0); + return ((current_time.tv_sec - stop_watch[n].tv_sec) * 1000000) + + current_time.tv_usec - stop_watch[n].tv_usec; +#else + return (time((time_t *)0) - stop_watch[n]) * 1000; +#endif +} + +/***************************************************************************** + * + * Execution control for string capability tests + * + *****************************************************************************/ + +/* +** get_next_block() +** +** Get a results block for pad test data. +*/ +static struct test_results * +get_next_block(void) +{ + if (blocks <= 0) { + results = (struct test_results *) + malloc(sizeof(struct test_results) * RESULT_BLOCK); + if (!results) { + ptextln("Malloc failed"); + return (struct test_results *) 0; + } + blocks = RESULT_BLOCK; + } + blocks--; + return results++; +} + +/* +** set_augment_txt() +** +** Initialize the augment menu selections +*/ +void +set_augment_txt(void) +{ + sprintf(txt_longer_augment, + ">) Change lines/characters effected to %d", augment << 1); + sprintf(txt_shorter_augment, + "<) Change lines/characters effected to %d", augment >> 1); +} + +void +control_init(void) +{ + sprintf(txt_longer_test_time, "+) Change test time to %d seconds", + pad_test_duration + 1); + sprintf(txt_shorter_test_time, "-) Change test time to %d seconds", + pad_test_duration - 1); + set_augment_txt(); +} + +/* +** msec_cost(cap, affected-count) +** +** Return the number of milliseconds delay needed by the cap. +*/ +int +msec_cost( + const char *const cap, + int affcnt) +{ + int dec, value, total, star, ch; + const char *cp; + + if (!cap) { + return 0; + } + total = 0; + for (cp = cap; *cp; cp++) { + if (*cp == '$' && cp[1] == '<') { + star = 1; + value = dec = 0; + for (cp += 2; (ch = *cp); cp++) { + if (ch >= '0' && ch <= '9') { + value = value * 10 + (ch - '0'); + dec *= 10; + } else + if (ch == '.') { + dec = 1; + } else + if (ch == '*') { + star = affcnt; + } else + if (ch == '>') { + break; + } + } + if (dec > 1) { + total += (value * star) / dec; + } else { + total += (value * star); + } + } + } + return total; +} + +/* +** liberated(cap) +** +** Return the cap without padding +*/ +char * +liberated(char *cap) +{ + static char cb[1024]; + char *ts, *ls; + + cb[0] = '\0'; + ls = NULL; + if (cap) { + for (ts = cb; (*ts = *cap); ++cap) { + if (*cap == '$' && cap[1] == '<') { + ls = ts; + } + ++ts; + if (*cap == '>') { + if (ls) { + ts = ls; + ls = NULL; + } + } + } + } + return cb; +} + +/* +** page_loop() +** +** send CR/LF or go home and bump letter +*/ +void +page_loop(void) +{ + if (line_count + 2 >= lines) { + NEXT_LETTER; + go_home(); + } else { + put_crlf(); + } +} + +/* +** skip_pad_test(test-list-entry, state, ch, text) +** +** Print the start test line. Handle start up commands. +** Return TRUE if a return is requested. +*/ +int +skip_pad_test( + struct test_list *test, + int *state, + int *ch, + const char *text) +{ + char rep_text[16]; + + while(1) { + if (text) { + ptext(text); + } + if ((test->flags & MENU_LC_MASK)) { + sprintf(rep_text, " *%d", augment); + ptext(rep_text); + } + ptext(" [n] > "); + *ch = wait_here(); + if (*ch == 's') { + /* Skip is converted to next */ + *ch = 'n'; + return TRUE; + } + if (*ch == 'q') { + /* Quit is converted to help */ + *ch = '?'; + return TRUE; + } + if (*ch == '\r' || *ch == '\n' || *ch == 'n' || *ch == 'r') { + /* this is the only response that allows the test to run */ + *ch = 0; + } + if (subtest_menu(pad_test_list, state, ch)) { + continue; + } + return (*ch != 0); + } +} + +/* +** pad_done_message(test_list) +** +** Print the Done message and request input. +*/ +void +pad_done_message( + struct test_list *test, + int *state, + int *ch) +{ + int default_action = 0; + char done_message[128]; + char rep_text[16]; + + while (1) { + if ((test->flags & MENU_LC_MASK)) { + sprintf(rep_text, "*%d", augment); + } else { + rep_text[0] = '\0'; + } + if (test->caps_done) { + sprintf(done_message, "(%s)%s Done ", test->caps_done, + rep_text); + ptext(done_message); + } else { + if (rep_text[0]) { + ptext(rep_text); + ptext(" "); + } + ptext("Done "); + } + if (debug_level & 2) { + dump_test_stats(test, state, ch); + } else { + *ch = wait_here(); + } + if (*ch == '\r' || *ch == '\n') { + *ch = default_action; + return; + } + if (*ch == 's' || *ch == 'n') { + *ch = 0; + return; + } + if (strchr(pad_repeat_test, *ch)) { + /* default action is now repeat */ + default_action = 'r'; + } + if (subtest_menu(pad_test_list, state, ch)) { + continue; + } + return; + } +} + +/* +** sliding_scale(dividend, factor, divisor) +** +** Return (dividend * factor) / divisor +*/ +int +sliding_scale( + int dividend, + int factor, + int divisor) +{ + double d = dividend; + + if (divisor) { + d = (d * (double) factor) / (double) divisor; + return (int) (d + 0.5); + } + return 0; +} + +/* +** pad_test_startup() +** +** Do the stuff needed to begin a test. +*/ +void +pad_test_startup( + int do_clear) +{ + if (do_clear) { + put_clear(); + } + repeats = augment; + raw_characters_sent = 0; + test_complete = ttp = char_count = tt_delay_used = 0; + letter = letters[letter_number = 0]; + if (pad_test_duration <= 0) { + pad_test_duration = 1; + } + tt_delay_max = pad_test_duration * 1000; + set_alarm_clock(pad_test_duration); + event_start(TIME_TEST); +} + +/* +** still_testing() +** +** This function is called to see if the test loop should be terminated. +*/ +int +still_testing(void) +{ + fflush(stdout); + test_complete++; + return EXIT_CONDITION; +} + +/* +** pad_test_shutdown() +** +** Do the stuff needed to end a test. +*/ +void +pad_test_shutdown( + struct test_list *t, + int crlf) +{ + int i; + int counts; /* total counts */ + int ss; /* Save string index */ + int cpo; /* characters per operation */ + int delta; /* difference in characters */ + int bogus; /* Time is inaccurate */ + struct test_results *r; /* Results of current test */ + int ss_index[TT_MAX]; /* String index */ + + if (tty_can_sync == SYNC_TESTED) { + bogus = tty_sync_error(); + } else { + bogus = 1; + } + usec_run_time = event_time(TIME_TEST); + tx_source = t; + tx_characters = raw_characters_sent; + tx_cps = sliding_scale(tx_characters, 1000000, usec_run_time); + + /* save the data base */ + for (txp = ss = counts = 0; txp < ttp; txp++) { + tx_cap[txp] = tt_cap[txp]; + tx_count[txp] = tt_count[txp]; + tx_delay[txp] = tt_delay[txp]; + tx_affected[txp] = tt_affected[txp]; + tx_index[txp] = get_string_cap_byvalue(tt_cap[txp]); + if (tx_index[txp] >= 0) { + if (cap_match(t->caps_done, strnames[tx_index[txp]])) { + ss_index[ss++] = txp; + counts += tx_count[txp]; + } + } + } + + if (crlf) { + put_crlf(); + } + if (counts == 0 || tty_cps == 0 || bogus) { + /* nothing to do */ + return; + } + /* calculate the suggested pad times */ + delta = usec_run_time - sliding_scale(tx_characters, 1000000, tty_cps); + if (delta < 0) { + /* probably should bump tx_characters */ + delta = 0; + } + cpo = delta / counts; + for (i = 0; i < ss; i++) { + if (!(r = get_next_block())) { + return; + } + r->next = pads[tx_index[ss_index[i]]]; + pads[tx_index[ss_index[i]]] = r; + r->test = t; + r->reps = tx_affected[ss_index[i]]; + r->delay = cpo; + } +} + +/* +** show_cap_results(index) +** +** Display the previous results +*/ +static void +show_cap_results( + int x) +{ + struct test_results *r; /* a result */ + int delay; + + if ((r = pads[x])) { + sprintf(temp, "(%s)", strnames[x]); + ptext(temp); + while (r) { + sprintf(temp, "$<%d>", r->delay / 1000); + put_columns(temp, strlen(temp), 10); + r = r->next; + } + r = pads[x]; + while (r) { + if (r->reps > 1) { + delay = r->delay / (r->reps * 100); + sprintf(temp, "$<%d.%d*>", delay / 10, delay % 10); + put_columns(temp, strlen(temp), 10); + } + r = r->next; + } + put_crlf(); + } +} + +/* +** dump_test_stats(test_list, status, ch) +** +** Dump the statistics about the last test +*/ +void +dump_test_stats( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + char tbuf[32]; + int x[32]; + + put_crlf(); + if (tx_source && tx_source->caps_done) { + cap_index(tx_source->caps_done, x); + if (x[0] >= 0) { + sprintf(temp, "Caps summary for (%s)", + tx_source->caps_done); + ptextln(temp); + for (i = 0; x[i] >= 0; i++) { + show_cap_results(x[i]); + } + put_crlf(); + } + } + sprintf(tbuf, "%011u", usec_run_time); + sprintf(temp, "Test time: %d.%s, characters per second %d, characters %d", + usec_run_time / 1000000, &tbuf[5], tx_cps, tx_characters); + ptextln(temp); + for (i = 0; i < txp; i++) { + if ((j = get_string_cap_byvalue(tx_cap[i])) >= 0) { + sprintf(tbuf, "(%s)", strnames[j]); + } else { + strcpy(tbuf, "(?)"); + } + sprintf(temp, "%8d %3d $<%3d> %8s %s", + tx_count[i], tx_affected[i], tx_delay[i], + tbuf, expand(tx_cap[i])); + putln(temp); + } + generic_done_message(t, state, ch); +} + +/* +** longer_test_time(test_list, status, ch) +** +** Extend the number of seconds for each test. +*/ +void +longer_test_time( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch) +{ + pad_test_duration += 1; + sprintf(txt_longer_test_time, "+) Change test time to %d seconds", + pad_test_duration + 1); + sprintf(txt_shorter_test_time, "-) Change test time to %d seconds", + pad_test_duration - 1); + sprintf(temp, "Tests will run for %d seconds", pad_test_duration); + ptext(temp); + *ch = REQUEST_PROMPT; +} + +/* +** shorter_test_time(test_list, status, ch) +** +** Shorten the number of seconds for each test. +*/ +void +shorter_test_time( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch) +{ + if (pad_test_duration > 1) { + pad_test_duration -= 1; + sprintf(txt_longer_test_time, "+) Change test time to %d seconds", + pad_test_duration + 1); + sprintf(txt_shorter_test_time, "-) Change test time to %d seconds", + pad_test_duration - 1); + } + sprintf(temp, "Tests will run for %d second%s", pad_test_duration, + pad_test_duration > 1 ? "s" : ""); + ptext(temp); + *ch = REQUEST_PROMPT; +} + +/* +** longer_augment(test_list, status, ch) +** +** Lengthen the number of lines/characters effected +*/ +void +longer_augment( + struct test_list *t, + int *state GCC_UNUSED, + int *ch) +{ + augment <<= 1; + set_augment_txt(); + if (augment_test) { + t = augment_test; + } + sprintf(temp, "The pad tests will effect %d %s.", augment, + ((t->flags & MENU_LC_MASK) == MENU_lines) ? + "lines" : "characters"); + ptextln(temp); + *ch = REQUEST_PROMPT; +} + +/* +** shorter_augment(test_list, status, ch) +** +** Shorten the number of lines/characters effected +*/ +void +shorter_augment( + struct test_list *t, + int *state GCC_UNUSED, + int *ch) +{ + if (augment > 1) { + /* don't let the augment go to zero */ + augment >>= 1; + } + set_augment_txt(); + if (augment_test) { + t = augment_test; + } + sprintf(temp, "The pad tests will effect %d %s.", augment, + ((t->flags & MENU_LC_MASK) == MENU_lines) ? + "lines" : "characters"); + ptextln(temp); + *ch = REQUEST_PROMPT; +} diff --git a/tack/crum.c b/tack/crum.c new file mode 100644 index 00000000..94183635 --- /dev/null +++ b/tack/crum.c @@ -0,0 +1,426 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include + +MODULE_ID("$Id: crum.c,v 1.2 1999/08/21 23:09:08 tom Exp $") + +/* + * Test cursor movement. + */ + +static void crum_clear(struct test_list *t, int *state, int *ch); +static void crum_home(struct test_list *t, int *state, int *ch); +static void crum_ll(struct test_list *t, int *state, int *ch); +static void crum_move(struct test_list *t, int *state, int *ch); +static void crum_os(struct test_list *t, int *state, int *ch); + +static char crum_text[5][80]; + +struct test_list crum_test_list[] = { + {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, + {MENU_NEXT, 0, "clear", 0, 0, crum_clear, 0}, + {MENU_NEXT, 0, "home", 0, 0, crum_home, 0}, + {MENU_NEXT, 0, "ll", 0, 0, crum_ll, 0}, + {MENU_NEXT, 0, crum_text[0], "home cuu1", 0, crum_move, 0}, + {MENU_NEXT + 1, 0, crum_text[1], "cub1 cud1 cuf1 cuu1", 0, crum_move, 0}, + {MENU_NEXT + 2, 0, crum_text[2], "cub cud cuf cuu", 0, crum_move, 0}, + {MENU_NEXT + 3, 0, crum_text[3], "vpa hpa", 0, crum_move, 0}, + {MENU_NEXT + 4, 0, crum_text[4], "cup", 0, crum_move, 0}, + {MENU_NEXT, 0, "cup", "os", 0, crum_os, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +/* +** move_to(from-row, from-column, to-row, to-column, selection) +** +** move the cursor from (rf, cf) to (rt, ct) using sel +*/ +static void +move_to( + int rf, + int cf, + int rt, + int ct, + int sel) +{ + char *s; + + if (sel & 16) { /* use (cup) */ + s = tparm(cursor_address, rt, ct); + tputs(s, lines, tc_putch); + return; + } + if (sel & 8) { /* use (hpa) (vpa) */ + if (column_address) { + s = tparm(column_address, ct); + tputs(s, 1, tc_putch); + cf = ct; + } + if (row_address) { + s = tparm(row_address, rt); + tputs(s, 1, tc_putch); + rf = rt; + } + } + if (sel & 4) { /* paramiterized relative cursor movement */ + if (parm_right_cursor) + if (cf < ct) { + s = tparm(parm_right_cursor, ct - cf); + tputs(s, ct - cf, tc_putch); + cf = ct; + } + if (parm_left_cursor) + if (cf > ct) { + s = tparm(parm_left_cursor, cf - ct); + tputs(s, cf - ct, tc_putch); + cf = ct; + } + if (parm_down_cursor) + if (rf < rt) { + s = tparm(parm_down_cursor, rt - rf); + tputs(s, rt - rf, tc_putch); + rf = rt; + } + if (parm_up_cursor) + if (rf > rt) { + s = tparm(parm_up_cursor, rf - rt); + tputs(s, rf - rt, tc_putch); + rf = rt; + } + } + if (sel & 2) { + if (cursor_left) + while (cf > ct) { + tc_putp(cursor_left); + cf--; + } + /* + do vertical motion next. Just in case cursor_down has a + side effect of changing the column. This could happen if + the tty handler translates NL to CRNL. + */ + if (cursor_down) + while (rf < rt) { + tc_putp(cursor_down); + rf++; + } + if (cursor_up) + while (rf > rt) { + tc_putp(cursor_up); + rf--; + } + if (cursor_right) + while (cf < ct) { + tc_putp(cursor_right); + cf++; + } + } + /* last chance */ + if (rf > rt) { + if (can_go_home) { /* a bit drastic but ... */ + go_home(); + cf = 0; + rf = 0; + } else if (cursor_up) { + while (rf > rt) { + tc_putp(cursor_up); + rf--; + } + } + } + if (ct == 0 && rt > rf) { + put_crlf(); + cf = 0; + rf++; + } + if (ct == 0 && cf != 0) { + put_cr(); + cf = 0; + } + while (rf < rt) { + put_lf(); + rf++; + } + while (cf > ct) { + put_str("\b"); + cf--; + } + if (cursor_right) { + while (cf < ct) { + tc_putp(cursor_right); + cf++; + } + } else { + /* go ahead and trash my display */ + while (cf < ct) { + putchp(' '); + cf++; + } + } +} + +/* +** display_it(selection, text) +** +** print the display using sel +*/ +static void +display_it( + int sel, + char *txt) +{ + int i, done_line; + + put_clear(); + go_home(); + put_newlines(2); + ptextln(" The top line should be alternating <'s and >'s"); + ptextln(" The left side should be alternating A's and V's"); + ptext(" Testing "); + ptext(txt); + put_cr(); + + /* horizontal */ + move_to(done_line = line_count, 0, 0, 2, sel); + for (i = 4; i < columns - 2; i += 2) { + putchp('>'); + move_to(0, i - 1, 0, i, sel); + } + putchp('>'); + i -= 2; + move_to(0, i + 1, 0, i - 1, sel); + for (; i > 2; i -= 2) { + putchp('<'); + move_to(0, i, 0, i - 3, sel); + } + putchp('<'); + + /* vertical */ + move_to(0, 2, 0, 0, sel); + for (i = 2; i < lines - 1; i += 2) { + putchp('V'); + move_to(i - 2, 1, i, 0, sel); + } + putchp('V'); + i -= 2; + move_to(i, 1, i + 1, 0, sel); + for (; i > 0; i -= 2) { + putchp('A'); + move_to(i + 1, 1, i - 1, 0, sel); + } + putchp('A'); + move_to(i + 1, 1, 0, 0, sel); /* go home first */ + move_to(0, 0, done_line + 1, 3, sel); + put_str(txt); + put_str(" Done. "); +} + +/* +** crum_clear(test_list, status, ch) +** +** (clear) test Clear screen +*/ +static void +crum_clear( + struct test_list *t, + int *state, + int *ch) +{ + int i; + + if (clear_screen) { + for (i = lines; i > 1; i--) { + putln("garbage"); + } + put_clear(); + ptextln("This line should start in the home position."); + ptext("The rest of the screen should be clear. "); + } else { + ptextln("(clear) Clear screen is not defined. "); + } + generic_done_message(t, state, ch); +} + +/* +** crum_home(test_list, status, ch) +** +** (home) test Home cursor +*/ +static void +crum_home( + struct test_list *t, + int *state, + int *ch) +{ + if (cursor_home) { + put_clear(); + put_newlines(lines / 2); + go_home(); + put_crlf(); + ptext("The bottom line should have text."); + go_home(); + put_newlines(lines - 1); + ptext("This line is on the bottom."); + go_home(); + ptextln("This line starts in the home position."); + put_crlf(); + } else { + ptextln("(home) Home cursor is not defined. "); + } + generic_done_message(t, state, ch); +} + +/* +** crum_ll(test_list, status, ch) +** +** (ll) test Last line +*/ +static void +crum_ll( + struct test_list *t, + int *state, + int *ch) +{ + /* + (ll) may be simulated with (cup). Don't complain if (cup) is present. + */ + if (cursor_to_ll) { + put_clear(); + put_str("This line could be anywhere."); + tc_putp(cursor_to_ll); + ptext("This line should be on the bottom"); + go_home(); + put_crlf(); + } else + if (cursor_address) { + return; + } else { + ptextln("(ll) Move to last line is not defined. "); + } + generic_done_message(t, state, ch); +} + +/* +** crum_move(test_list, status, ch) +** +** (*) test all cursor move commands +*/ +static void +crum_move( + struct test_list *t, + int *state, + int *ch) +{ + char buf[80]; + int n; + + switch (n = (t->flags & 15)) { + case 0: + sprintf(buf, " (cr) (nel) (cub1)%s", + cursor_home ? " (home)" : (cursor_up ? " (cuu1)" : "")); + break; + case 1: + sprintf(buf, "%s%s%s%s", cursor_left ? " (cub1)" : "", + cursor_down ? " (cud1)" : "", cursor_right ? " (cuf1)" : "", + cursor_up ? " (cuu1)" : ""); + if (buf[0] == '\0') { + ptext(" (cub1) (cud1) (cuf1) (cuu1) not defined."); + } + break; + case 2: + sprintf(buf, "%s%s%s%s", parm_left_cursor ? " (cub)" : "", + parm_down_cursor ? " (cud)" : "", + parm_right_cursor ? " (cuf)" : "", + parm_up_cursor ? " (cuu)" : ""); + if (buf[0] == '\0') { + ptext(" (cub) (cud) (cuf) (cuu) not defined."); + } + break; + case 3: + sprintf(buf, "%s%s", row_address ? " (vpa)" : "", + column_address ? " (hpa)" : ""); + if (buf[0] == '\0') { + ptext(" (vpa) (hpa) not defined."); + } + break; + case 4: + if (!cursor_address) { + ptext(" (cup) not defined. "); + generic_done_message(t, state, ch); + return; + } + strcpy(buf, " (cup)"); + break; + } + if (buf[0] == '\0') { + put_str(" Done. "); + } else { + can_test(buf, FLAG_TESTED); + strcpy(crum_text[n], &buf[2]); + crum_text[n][strlen(buf) - 3] = '\0'; + + display_it(1 << n, buf); + } + *ch = wait_here(); + if (*ch != 'r') { + put_clear(); + } +} + +/* +** crum_os(test_list, status, ch) +** +** (cup) test Cursor position on overstrike terminals +*/ +static void +crum_os( + struct test_list *t, + int *state, + int *ch) +{ + int i; + + if (cursor_address && over_strike) { + put_clear(); + for (i = 0; i < columns - 2; i++) { + tc_putch('|'); + } + for (i = 1; i < lines - 2; i++) { + put_crlf(); + tc_putch('_'); + } + for (i = 0; i < columns - 2; i++) { + tputs(tparm(cursor_address, 0, i), lines, tc_putch); + tc_putch('+'); + } + for (i = 0; i < lines - 2; i++) { + tputs(tparm(cursor_address, i, 0), lines, tc_putch); + tc_putch(']'); + tc_putch('_'); + } + go_home(); + put_newlines(3); + ptext(" All the characters should look the same. "); + generic_done_message(t, state, ch); + put_clear(); + } +} diff --git a/tack/edit.c b/tack/edit.c new file mode 100644 index 00000000..5685d925 --- /dev/null +++ b/tack/edit.c @@ -0,0 +1,977 @@ +/* +** Copyright (C) 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include + +MODULE_ID("$Id: edit.c,v 1.3 1999/06/16 00:43:43 tom Exp $") + +/* + * Terminfo edit features + */ +static void show_info(struct test_list *, int *, int *); +static void show_value(struct test_list *, int *, int *); +static void show_untested(struct test_list *, int *, int *); +static void show_changed(struct test_list *, int *, int *); + +#define SHOW_VALUE 1 +#define SHOW_EDIT 2 +#define SHOW_DELETE 3 + +struct test_list edit_test_list[] = { + {MENU_CLEAR, 0, 0, 0, "i) display current terminfo", show_info, 0}, + {0, 0, 0, 0, "w) write the current terminfo to a file", save_info, 0}, + {SHOW_VALUE, 3, 0, 0, "v) show value of a selected cap", show_value, 0}, + {SHOW_EDIT, 4, 0, 0, "e) edit value of a selected cap", show_value, 0}, + {SHOW_DELETE, 3, 0, 0, "d) delete string", show_value, 0}, + {0, 3, 0, 0, "m) show caps that have been modified", show_changed, 0}, + {MENU_CLEAR + FLAG_CAN_TEST, 0, 0, 0, "c) show caps that can be tested", show_report, 0}, + {MENU_CLEAR + FLAG_TESTED, 0, 0, 0, "t) show caps that have been tested", show_report, 0}, + {MENU_CLEAR + FLAG_FUNCTION_KEY, 0, 0, 0, "f) show a list of function keys", show_report, 0}, + {MENU_CLEAR, 0, 0, 0, "u) show caps defined that can not be tested", show_untested, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +static char change_pad_text[MAX_CHANGES][80]; +struct test_list change_pad_list[MAX_CHANGES] = { + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +static void build_change_menu(struct test_menu *); +static void change_one_entry(struct test_list *, int *, int *); + +struct test_menu change_pad_menu = { + 0, 'q', 0, + "Select cap name", "change", 0, + build_change_menu, change_pad_list, 0, 0, 0 +}; + +extern struct test_results *pads[STRCOUNT]; /* save pad results here */ + +static TERMTYPE original_term; /* terminal type description */ + +static char flag_boolean[BOOLCOUNT]; /* flags for booleans */ +static char flag_numerics[NUMCOUNT]; /* flags for numerics */ +static char flag_strings[STRCOUNT]; /* flags for strings */ +static int xon_index; /* Subscript for (xon) */ +int xon_shadow; + +static int start_display; /* the display has just started */ +static int display_lines; /* number of lines displayed */ + +/* +** send_info_string(str) +** +** Return the terminfo string prefixed by the correct seperator +*/ +static void +send_info_string( + const char *str, + int *ch) +{ + int len; + + if (display_lines == -1) { + return; + } + len = strlen(str); + if (len + char_count + 3 >= columns) { + if (start_display == 0) { + put_str(","); + } + put_crlf(); + if (++display_lines > lines) { + ptext("-- more -- "); + *ch = wait_here(); + if (*ch == 'q') { + display_lines = -1; + return; + } + display_lines = 0; + } + if (len >= columns) { + /* if the terminal does not (am) then this loses */ + if (columns) { + display_lines += ((strlen(str) + 3) / columns) + 1; + } + put_str(" "); + put_str(str); + start_display = 0; + return; + } + ptext(" "); + } else + if (start_display == 0) { + ptext(", "); + } else { + ptext(" "); + } + ptext(str); + start_display = 0; +} + +/* +** show_info(test_list, status, ch) +** +** Display the current terminfo +*/ +static void +show_info( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch) +{ + int i; + char buf[1024]; + + display_lines = 1; + start_display = 1; + for (i = 0; i < BOOLCOUNT; i++) { + if ((i == xon_index) ? xon_shadow : CUR Booleans[i]) { + send_info_string(boolnames[i], ch); + } + } + for (i = 0; i < NUMCOUNT; i++) { + if (CUR Numbers[i] >= 0) { + sprintf(buf, "%s#%d", numnames[i], CUR Numbers[i]); + send_info_string(buf, ch); + } + } + for (i = 0; i < STRCOUNT; i++) { + if (CUR Strings[i]) { + sprintf(buf, "%s=%s", strnames[i], + print_expand(CUR Strings[i])); + send_info_string(buf, ch); + } + } + put_newlines(2); + *ch = REQUEST_PROMPT; +} + +/* +** save_info_string(str, fp) +** +** Write the terminfo string prefixed by the correct seperator +*/ +static void +save_info_string( + const char *str, + FILE *fp) +{ + int len; + + len = strlen(str); + if (len + display_lines >= 77) { + if (display_lines > 0) { + (void) fprintf(fp, "\n\t"); + } + display_lines = 8; + } else + if (display_lines > 0) { + (void) fprintf(fp, " "); + display_lines++; + } else { + (void) fprintf(fp, "\t"); + display_lines = 8; + } + (void) fprintf(fp, "%s,", str); + display_lines += len + 1; +} + +/* +** save_info(test_list, status, ch) +** +** Write the current terminfo to a file +*/ +void +save_info( + struct test_list *t, + int *state, + int *ch) +{ + int i; + FILE *fp; + time_t now; + char buf[1024]; + + if ((fp = fopen(tty_basename, "w")) == (FILE *) NULL) { + (void) sprintf(temp, "can't open: %s", tty_basename); + ptextln(temp); + generic_done_message(t, state, ch); + return; + } + time(&now); + /* Note: ctime() returns a newline at the end of the string */ + (void) fprintf(fp, "# Terminfo created by TACK for TERM=%s on %s", + tty_basename, ctime(&now)); + (void) fprintf(fp, "%s|%s,\n", tty_basename, longname()); + + display_lines = 0; + for (i = 0; i < BOOLCOUNT; i++) { + if (i == xon_index ? xon_shadow : CUR Booleans[i]) { + save_info_string(boolnames[i], fp); + } + } + for (i = 0; i < NUMCOUNT; i++) { + if (CUR Numbers[i] >= 0) { + sprintf(buf, "%s#%d", numnames[i], CUR Numbers[i]); + save_info_string(buf, fp); + } + } + for (i = 0; i < STRCOUNT; i++) { + if (CUR Strings[i]) { + sprintf(buf, "%s=%s", strnames[i], + _nc_tic_expand(CUR Strings[i], TRUE, TRUE)); + save_info_string(buf, fp); + } + } + (void) fprintf(fp, "\n"); + (void) fclose(fp); + sprintf(temp, "Terminfo saved as file: %s", tty_basename); + ptextln(temp); +} + +/* +** show_value(test_list, status, ch) +** +** Display the value of a selected cap +*/ +static void +show_value( + struct test_list *t, + int *state GCC_UNUSED, + int *ch) +{ + struct name_table_entry const *nt; + char *s; + int n, op, b; + char buf[1024]; + char tmp[1024]; + + ptext("enter name: "); + read_string(buf, 80); + if (buf[0] == '\0' || buf[1] == '\0') { + *ch = buf[0]; + return; + } + if (line_count + 2 >= lines) { + put_clear(); + } + op = t->flags & 255; + if ((nt = _nc_find_entry(buf, _nc_info_hash_table))) { + switch (nt->nte_type) { + case BOOLEAN: + if (op == SHOW_DELETE) { + if (nt->nte_index == xon_index) { + xon_shadow = 0; + } else { + CUR Booleans[nt->nte_index] = 0; + } + return; + } + b = nt->nte_index == xon_index ? xon_shadow : + CUR Booleans[nt->nte_index]; + sprintf(temp, "boolean %s %s", buf, + b ? "True" : "False"); + break; + case STRING: + if (op == SHOW_DELETE) { + CUR Strings[nt->nte_index] = (char *) 0; + return; + } + if (CUR Strings[nt->nte_index]) { + sprintf(temp, "string %s %s", buf, + expand(CUR Strings[nt->nte_index])); + } else { + sprintf(temp, "undefined string %s", buf); + } + break; + case NUMBER: + if (op == SHOW_DELETE) { + CUR Numbers[nt->nte_index] = -1; + return; + } + sprintf(temp, "numeric %s %d", buf, + CUR Numbers[nt->nte_index]); + break; + default: + sprintf(temp, "unknown"); + break; + } + ptextln(temp); + } else { + sprintf(temp, "Cap not found: %s", buf); + ptextln(temp); + return; + } + if (op != SHOW_EDIT) { + return; + } + if (nt->nte_type == BOOLEAN) { + ptextln("Value flipped"); + if (nt->nte_index == xon_index) { + xon_shadow = !xon_shadow; + } else { + CUR Booleans[nt->nte_index] = !CUR Booleans[nt->nte_index]; + } + return; + } + ptextln("Enter new value"); + read_string(buf, sizeof(buf)); + + switch (nt->nte_type) { + case STRING: + _nc_reset_input((FILE *) 0, buf); + _nc_trans_string(tmp); + s = (char *)malloc(strlen(tmp) + 1); + strcpy(s, tmp); + CUR Strings[nt->nte_index] = s; + sprintf(temp, "new string value %s", nt->nte_name); + ptextln(temp); + ptextln(expand(CUR Strings[nt->nte_index])); + break; + case NUMBER: + if (sscanf(buf, "%d", &n) == 1) { + CUR Numbers[nt->nte_index] = n; + sprintf(temp, "new numeric value %s %d", + nt->nte_name, n); + ptextln(temp); + } else { + sprintf(temp, "Illegal number: %s", buf); + ptextln(temp); + } + break; + default: + break; + } +} + +/* +** get_string_cap_byname(name, long_name) +** +** Given a cap name, find the value +** Errors are quietly ignored. +*/ +char * +get_string_cap_byname( + const char *name, + const char **long_name) +{ + struct name_table_entry const *nt; + + if ((nt = _nc_find_entry(name, _nc_info_hash_table))) { + if (nt->nte_type == STRING) { + *long_name = strfnames[nt->nte_index]; + return (CUR Strings[nt->nte_index]); + } + } + *long_name = "??"; + return (char *) 0; +} + +/* +** get_string_cap_byvalue(value) +** +** Given a capability string, find its position in the data base. +** Return the index or -1 if not found. +*/ +int +get_string_cap_byvalue( + const char *value) +{ + int i; + + if (value) { + for (i = 0; i < STRCOUNT; i++) { + if (CUR Strings[i] == value) { + return i; + } + } + /* search for translated strings */ + for (i = 0; i < TM_last; i++) { + if (TM_string[i].value == value) { + return TM_string[i].index; + } + } + } + return -1; +} + +/* +** show_changed(test_list, status, ch) +** +** Display a list of caps that have been changed. +*/ +static void +show_changed( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch) +{ + int i, header = 1, v; + const char *a; + const char *b; + static char title[] = " old value cap new value"; + char abuf[1024]; + + for (i = 0; i < BOOLCOUNT; i++) { + v = (i == xon_index) ? xon_shadow : CUR Booleans[i]; + if (original_term.Booleans[i] != v) { + if (header) { + ptextln(title); + header = 0; + } + sprintf(temp, "%30d %6s %d", + original_term.Booleans[i], boolnames[i], v); + ptextln(temp); + } + } + for (i = 0; i < NUMCOUNT; i++) { + if (original_term.Numbers[i] != CUR Numbers[i]) { + if (header) { + ptextln(title); + header = 0; + } + sprintf(temp, "%30d %6s %d", + original_term.Numbers[i], numnames[i], + CUR Numbers[i]); + ptextln(temp); + } + } + for (i = 0; i < STRCOUNT; i++) { + a = original_term.Strings[i] ? original_term.Strings[i] : ""; + b = CUR Strings[i] ? CUR Strings[i] : ""; + if (strcmp(a, b)) { + if (header) { + ptextln(title); + header = 0; + } + strcpy(abuf, _nc_tic_expand(a, TRUE, TRUE)); + sprintf(temp, "%30s %6s %s", abuf, strnames[i], + _nc_tic_expand(b, TRUE, TRUE)); + putln(temp); + } + } + if (header) { + ptextln("No changes"); + } + put_crlf(); + *ch = REQUEST_PROMPT; +} + +/* +** user_modified() +** +** Return TRUE if the user has modified the terminfo +*/ +int +user_modified(void) +{ + const char *a, *b; + int i, v; + + for (i = 0; i < BOOLCOUNT; i++) { + v = (i == xon_index) ? xon_shadow : CUR Booleans[i]; + if (original_term.Booleans[i] != v) { + return TRUE; + } + } + for (i = 0; i < NUMCOUNT; i++) { + if (original_term.Numbers[i] != CUR Numbers[i]) { + return TRUE; + } + } + for (i = 0; i < STRCOUNT; i++) { + a = original_term.Strings[i] ? original_term.Strings[i] : ""; + b = CUR Strings[i] ? CUR Strings[i] : ""; + if (strcmp(a, b)) { + return TRUE; + } + } + return FALSE; +} + +/***************************************************************************** + * + * Maintain the list of capabilities that can be tested + * + *****************************************************************************/ + +/* +** mark_cap(name, flag) +** +** Mark the cap data base with the flag provided. +*/ +static void +mark_cap( + char *name, + int flag) +{ + struct name_table_entry const *nt; + + if ((nt = _nc_find_entry(name, _nc_info_hash_table))) { + switch (nt->nte_type) { + case BOOLEAN: + flag_boolean[nt->nte_index] |= flag; + break; + case STRING: + flag_strings[nt->nte_index] |= flag; + break; + case NUMBER: + flag_numerics[nt->nte_index] |= flag; + break; + default: + sprintf(temp, "unknown cap type (%s)", name); + ptextln(temp); + break; + } + } else { + sprintf(temp, "Cap not found: %s", name); + ptextln(temp); + (void) wait_here(); + } +} + +/* +** can_test(name-list, flags) +** +** Scan the name list and get the names. +** Enter each name into the can-test data base. +** ( and ) may be used as seperators. +*/ +void +can_test( + const char *s, + int flags) +{ + int ch, i, j; + char name[32]; + + if (s) { + for (i = j = 0; (name[j] = ch = *s); s++) { + if (ch == ' ' || ch == ')' || ch == '(') { + if (j) { + name[j] = '\0'; + mark_cap(name, flags); + } + j = 0; + } else { + j++; + } + } + if (j) { + mark_cap(name, flags); + } + } +} + +/* +** cap_index(name-list, index-list) +** +** Scan the name list and return a list of indexes. +** ( and ) may be used as seperators. +** This list is terminated with -1. +*/ +void +cap_index( + const char *s, + int *inx) +{ + struct name_table_entry const *nt; + int ch, i, j; + char name[32]; + + if (s) { + for (i = j = 0; ; s++) { + name[j] = ch = *s; + if (ch == ' ' || ch == ')' || ch == '(' || ch == 0) { + if (j) { + name[j] = '\0'; + if ((nt = _nc_find_entry(name, + _nc_info_hash_table)) && + (nt->nte_type == STRING)) { + *inx++ = nt->nte_index; + } + } + if (ch == 0) { + break; + } + j = 0; + } else { + j++; + } + } + } + *inx = -1; +} + +/* +** cap_match(name-list, cap) +** +** Scan the name list and see if the cap is in the list. +** Return TRUE if we find an exact match. +** ( and ) may be used as seperators. +*/ +int +cap_match( + const char *names, + const char *cap) +{ + char *s; + int c, l, t; + + if (names) { + l = strlen(cap); + while ((s = strstr(names, cap))) { + c = (names == s) ? 0 : *(s - 1); + t = s[l]; + if ((c == 0 || c == ' ' || c == '(') && + (t == 0 || t == ' ' || t == ')')) { + return TRUE; + } + if (t == 0) { + break; + } + names = s + l; + } + } + return FALSE; +} + +/* +** show_report(test_list, status, ch) +** +** Display a list of caps that can be tested +*/ +void +show_report( + struct test_list *t, + int *state GCC_UNUSED, + int *ch) +{ + int i, j, nc, flag; + const char *s; + const char *nx[BOOLCOUNT + NUMCOUNT + STRCOUNT]; + + flag = t->flags & 255; + nc = 0; + for (i = 0; i < BOOLCOUNT; i++) { + if (flag_boolean[i] & flag) { + nx[nc++] = boolnames[i]; + } + } + for (i = 0; i < NUMCOUNT; i++) { + if (flag_numerics[i] & flag) { + nx[nc++] = numnames[i]; + } + } + for (i = 0; i < STRCOUNT; i++) { + if (flag_strings[i] & flag) { + nx[nc++] = strnames[i]; + } + } + /* sort */ + for (i = 0; i < nc - 1; i++) { + for (j = i + 1; j < nc; j++) { + if (strcmp(nx[i], nx[j]) > 0) { + s = nx[i]; + nx[i] = nx[j]; + nx[j] = s; + } + } + } + if (flag & FLAG_FUNCTION_KEY) { + ptextln("The following function keys can be tested:"); + } else + if (flag & FLAG_CAN_TEST) { + ptextln("The following capabilities can be tested:"); + } else + if (flag & FLAG_TESTED) { + ptextln("The following capabilities have been tested:"); + } + put_crlf(); + for (i = 0; i < nc; i++) { + sprintf(temp, "%s ", nx[i]); + ptext(temp); + } + put_newlines(1); + *ch = REQUEST_PROMPT; +} + +/* +** show_untested(test_list, status, ch) +** +** Display a list of caps that are defined but cannot be tested. +** Don't bother to sort this list. +*/ +static void +show_untested( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch) +{ + int i; + + ptextln("Caps that are defined but cannot be tested:"); + for (i = 0; i < BOOLCOUNT; i++) { + if (flag_boolean[i] == 0 && CUR Booleans[i]) { + sprintf(temp, "%s ", boolnames[i]); + ptext(temp); + } + } + for (i = 0; i < NUMCOUNT; i++) { + if (flag_numerics[i] == 0 && CUR Numbers[i] >= 0) { + sprintf(temp, "%s ", numnames[i]); + ptext(temp); + } + } + for (i = 0; i < STRCOUNT; i++) { + if (flag_strings[i] == 0 && CUR Strings[i]) { + sprintf(temp, "%s ", strnames[i]); + ptext(temp); + } + } + put_newlines(1); + *ch = REQUEST_PROMPT; +} + +/* +** edit_init() +** +** Initialize the function key data base +*/ +void +edit_init(void) +{ + int i, j, lc; + char *lab; + struct name_table_entry const *nt; + int label_strings[STRCOUNT]; + + _nc_copy_termtype(&original_term, &cur_term->type); + for (i = 0; i < BOOLCOUNT; i++) { + original_term.Booleans[i] = CUR Booleans[i]; + } + for (i = 0; i < NUMCOUNT; i++) { + original_term.Numbers[i] = CUR Numbers[i]; + } + /* scan for labels */ + for (i = lc = 0; i < STRCOUNT; i++) { + original_term.Strings[i] = CUR Strings[i]; + if (strncmp(strnames[i], "lf", 2) == 0) { + flag_strings[i] |= FLAG_LABEL; + if (CUR Strings[i]) { + label_strings[lc++] = i; + } + } + } + /* scan for function keys */ + for (i = 0; i < STRCOUNT; i++) { + if ((strnames[i][0] == 'k') && strcmp(strnames[i], "kmous")) { + flag_strings[i] |= FLAG_FUNCTION_KEY; + lab = (char *) 0; + for (j = 0; j < lc; j++) { + if (!strcmp(&strnames[i][1], + &strnames[label_strings[j]][1])) { + lab = CUR Strings[label_strings[j]]; + break; + } + } + enter_key(strnames[i], CUR Strings[i], lab); + } + } + /* Lookup the translated strings */ + for (i = 0; i < TM_last; i++) { + if ((nt = _nc_find_entry(TM_string[i].name, + _nc_info_hash_table)) && (nt->nte_type == STRING)) { + TM_string[i].index = nt->nte_index; + } else { + sprintf(temp, "TM_string lookup failed for: %s", + TM_string[i].name); + ptextln(temp); + } + } + if ((nt = _nc_find_entry("xon", _nc_info_hash_table)) != 0) { + xon_index = nt->nte_index; + } + xon_shadow = xon_xoff; +} + +/* +** change_one_entry(test_list, status, ch) +** +** Change the padding on the selected cap +*/ +static void +change_one_entry( + struct test_list *test, + int *state, + int *chp) +{ + struct name_table_entry const *nt; + int i, j, x, star, slash, v, dot, ch; + const char *s; + char *t, *p; + const char *current_string; + char buf[1024]; + char pad[1024]; + + i = test->flags & 255; + if (i == 255) { + /* read the cap name from the user */ + ptext("enter name: "); + read_string(pad, 32); + if (pad[0] == '\0' || pad[1] == '\0') { + *chp = pad[0]; + return; + } + if ((nt = _nc_find_entry(pad, _nc_info_hash_table)) && + (nt->nte_type == STRING)) { + x = nt->nte_index; + current_string = CUR Strings[x]; + } else { + sprintf(temp, "%s is not a string capability", pad); + ptext(temp); + generic_done_message(test, state, chp); + return; + } + } else { + x = tx_index[i]; + current_string = tx_cap[i]; + strcpy(pad, strnames[x]); + } + if (!current_string) { + ptextln("That string is not currently defined. Please enter a new value, including the padding delay:"); + read_string(buf, sizeof(buf)); + _nc_reset_input((FILE *) 0, buf); + _nc_trans_string(pad); + t = (char *)malloc(strlen(pad) + 1); + strcpy(t, pad); + CUR Strings[x] = t; + sprintf(temp, "new string value %s", strnames[x]); + ptextln(temp); + ptextln(expand(t)); + return; + } + sprintf(buf, "Current value: (%s) %s", pad, _nc_tic_expand(current_string, TRUE, TRUE)); + putln(buf); + ptextln("Enter new pad. 0 for no pad. CR for no change."); + read_string(buf, 32); + if (buf[0] == '\0' || (buf[1] == '\0' && isalpha(buf[0]))) { + *chp = buf[0]; + return; + } + star = slash = FALSE; + for (j = v = dot = 0; (ch = buf[j]); j++) { + if (ch >= '0' && ch <= '9') { + v = ch - '0' + v * 10; + if (dot) { + dot++; + } + } else if (ch == '*') { + star = TRUE; + } else if (ch == '/') { + slash = TRUE; + } else if (ch == '.') { + dot = 1; + } else { + sprintf(temp, "Illegal character: %c", ch); + ptextln(temp); + ptext("General format: 99.9*/ "); + generic_done_message(test, state, chp); + return; + } + } + while (dot > 2) { + v /= 10; + dot--; + } + if (dot == 2) { + sprintf(pad, "%d.%d%s%s", v / 10, v % 10, + star ? "*" : "", slash ? "/" : ""); + } else { + sprintf(pad, "%d%s%s", + v, star ? "*" : "", slash ? "/" : ""); + } + s = current_string; + t = buf; + for (v = 0; (ch = *t = *s++); t++) { + if (v == '$' && ch == '<') { + while ((ch = *s++) && (ch != '>')); + for (p = pad; (*++t = *p++); ); + *t++ = '>'; + while ((*t++ = *s++)); + pad[0] = '\0'; + break; + } + v = ch; + } + if (pad[0]) { + sprintf(t, "$<%s>", pad); + } + if ((t = (char *)malloc(strlen(buf) + 1))) { + strcpy(t, buf); + CUR Strings[x] = t; + if (i != 255) { + tx_cap[i] = t; + } + } + generic_done_message(test, state, chp); +} + +/* +** build_change_menu(menu_list) +** +** Build the change pad menu list +*/ +static void +build_change_menu( + struct test_menu *m) +{ + int i, j, k; + char *s; + + for (i = j = 0; i < txp; i++) { + if ((k = tx_index[i]) >= 0) { + s = _nc_tic_expand(tx_cap[i], TRUE, TRUE); + s[40] = '\0'; + sprintf(change_pad_text[j], "%c) (%s) %s", + 'a' + j, strnames[k], s); + change_pad_list[j].flags = i; + change_pad_list[j].lines_needed = 4; + change_pad_list[j].menu_entry = change_pad_text[j]; + change_pad_list[j].test_procedure = change_one_entry; + j++; + } + } + strcpy(change_pad_text[j], "z) enter name"); + change_pad_list[j].flags = 255; + change_pad_list[j].lines_needed = 4; + change_pad_list[j].menu_entry = change_pad_text[j]; + change_pad_list[j].test_procedure = change_one_entry; + j++; + change_pad_list[j].flags = MENU_LAST; + if (m->menu_title) { + put_crlf(); + ptextln(m->menu_title); + } +} diff --git a/tack/fun.c b/tack/fun.c new file mode 100644 index 00000000..7ddfbbdf --- /dev/null +++ b/tack/fun.c @@ -0,0 +1,912 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include + +MODULE_ID("$Id: fun.c,v 1.2 1999/06/16 00:46:12 tom Exp $") + +/* + * Test the function keys on the terminal. The code for echo tests + * lives here too. + */ + +static void funkey_keys(struct test_list *, int *, int *); +static void funkey_meta(struct test_list *, int *, int *); +static void funkey_label(struct test_list *, int *, int *); +static void funkey_prog(struct test_list *, int *, int *); +static void funkey_local(struct test_list *, int *, int *); + +struct test_list funkey_test_list[] = { + {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, + {MENU_CLEAR + FLAG_FUNCTION_KEY, 0, 0, 0, "f) show a list of function keys", show_report, 0}, + {MENU_NEXT | MENU_CLEAR, 0, "smkx) (rmkx", 0, + "k) test function keys", funkey_keys, 0}, + {MENU_NEXT, 10, "km", "smm rmm", 0, funkey_meta, 0}, + {MENU_NEXT, 8, "nlab) (smln) (pln) (rmln", "lw lh", 0, funkey_label, 0}, + {MENU_NEXT, 2, "pfx", 0, 0, funkey_prog, 0}, + {MENU_NEXT, 2, "pfloc", 0, 0, funkey_local, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +static void printer_on(struct test_list *, int *, int *); +static void printer_mc0(struct test_list *, int *, int *); + +struct test_list printer_test_list[] = { + {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, + {MENU_NEXT | MENU_CLEAR, 0, "mc4) (mc5) (mc5i", 0, 0, printer_on, 0}, + {MENU_NEXT | MENU_CLEAR, 0, "mc0", 0, 0, printer_mc0, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +#define MAX_STRINGS STRCOUNT + +/* scan code externals */ +extern int scan_max; /* length of longest scan code */ +extern char **scan_up, **scan_down, **scan_name; +extern int *scan_tested, *scan_length; + +/* local definitions */ +static const char *fk_name[MAX_STRINGS]; +static char *fkval[MAX_STRINGS]; +static char *fk_label[MAX_STRINGS]; /* function key labels (if any) */ +static int fk_tested[MAX_STRINGS]; +static int fkmax = 1; /* length of longest key */ +static int got_labels = 0; /* true if we have some labels */ +static int key_count = 0; +static int end_state; + +/* unknown function keys */ +#define MAX_FK_UNK 50 +static char *fk_unknown[MAX_FK_UNK]; +static int fk_length[MAX_FK_UNK]; +static int funk; + +/* +** keys_tested(first-time, show-help, hex-output) +** +** Display a list of the keys not tested. +*/ +static void +keys_tested( + int first_time, + int show_help, + int hex_output) +{ + int i, l; + char outbuf[256]; + + put_clear(); + tty_set(); + flush_input(); + if (got_labels) { + putln("Function key labels:"); + for (i = 0; i < key_count; ++i) { + if (fk_label[i]) { + sprintf(outbuf, "%s %s", + fk_name[i] ? fk_name[i] : "??", fk_label[i]); + put_columns(outbuf, strlen(outbuf), 16); + } + } + put_newlines(2); + } + if (funk) { + putln("The following keys are not defined:"); + for (i = 0; i < funk; ++i) { + put_columns(fk_unknown[i], fk_length[i], 16); + } + put_mode(exit_attribute_mode); + put_newlines(2); + } + if (first_time) { + putln("The following keys are defined:"); + } else { + putln("The following keys have not been tested:"); + } + if (scan_mode) { + for (i = 0; scan_down[i]; i++) { + if (!scan_tested[i]) { + if (hex_output) { + strcpy(outbuf, hex_expand_to(scan_down[i], 3)); + } else { + strcpy(outbuf, expand(scan_down[i])); + } + l = expand_chars; + if (hex_output) { + strcat(outbuf, hex_expand_to(scan_up[i], 3)); + } else { + strcat(outbuf, expand(scan_up[i])); + } + expand_chars += l; + l = strlen(scan_name[i]); + if (((char_count + 16) & ~15) + + ((expand_chars + 7) & ~7) + l >= columns) { + put_crlf(); + } else + if (char_count + 24 > columns) { + put_crlf(); + } else if (char_count) { + putchp(' '); + } + put_columns(outbuf, expand_chars, 16); + put_columns(scan_name[i], l, 8); + } + } + } else { + for (i = 0; i < key_count; i++) { + if (!fk_tested[i]) { + if (hex_output) { + strcpy(outbuf, hex_expand_to(fkval[i], 3)); + } else { + strcpy(outbuf, expand(fkval[i])); + } + l = strlen(fk_name[i]); + if (((char_count + 16) & ~15) + + ((expand_chars + 7) & ~7) + l >= columns) { + put_crlf(); + } else + if (char_count + 24 > columns) { + put_crlf(); + } else + if (char_count) { + putchp(' '); + } + put_columns(outbuf, expand_chars, 16); + put_columns(fk_name[i], l, 8); + } + } + } + put_newlines(2); + if (show_help) { + ptextln("Hit any function key. Type 'end' to quit. Type ? to update the display."); + put_crlf(); + } +} + +/* +** enter_key(name, value, label) +** +** Enter a function key into the data base +*/ +void +enter_key( + const char *name, + char *value, + char *lab) +{ + int j; + + if (value) { + j = strlen(value); + fkmax = fkmax > j ? fkmax : j; + /* do not permit duplicates */ + for (j = 0; j < key_count; j++) { + if (!strcmp(fk_name[j], name)) { + return; + } + } + fkval[key_count] = value; + fk_tested[key_count] = 0; + fk_label[key_count] = lab; + fk_name[key_count++] = name; + if (lab) { + got_labels = TRUE; + } + } +} + + +static void +fresh_line(void) +{ /* clear the line for a new fumction key line */ + if (over_strike) { + put_crlf(); + } else { + put_cr(); + if (clr_eol) { + tc_putp(clr_eol); + } else { + put_str(" \r"); + } + } +} + + +static int +end_funky(int ch) +{ /* return true if this is the end */ + switch (ch) { + case 'e': + case 'E': + end_state = 'e'; + break; + case 'n': + case 'N': + if (end_state == 'e') { + end_state = 'n'; + } else { + end_state = 0; + } + break; + case 'd': + case 'D': + if (end_state == 'n') { + end_state = 'd'; + } else { + end_state = 0; + } + break; + case 'l': + case 'L': + if (end_state == 'l') { + end_state = '?'; + } else { + end_state = 'l'; + } + break; + default: + end_state = 0; + break; + } + return end_state == 'd'; +} + + +static int +found_match(char *s, int hx, int cc) +{ /* return true if this string is a match */ + int j, f; + char outbuf[256]; + + if (!*s) { + return 0; + } + if (scan_mode) { + for (j = f = 0; scan_down[j]; j++) { + if (scan_length[j] == 0) { + continue; + } + if (!strncmp(s, scan_down[j], scan_length[j])) { + if (!f) { /* first match */ + put_cr(); + if (hx) { + put_str(hex_expand_to(s, 10)); + } else { + put_str(expand_to(s, 10)); + } + f = 1; + } + (void) end_funky(scan_name[j][0]); + put_str(" "); + put_str(scan_name[j]); + scan_tested[j] = 1; + s += scan_length[j]; + if (strncmp(s, scan_up[j], scan_length[j])) { + put_str(" scan down"); + } else { + s += scan_length[j]; + } + if (!*s) { + break; + } + j = -1; + } + if (!strncmp(s, scan_up[j], scan_length[j])) { + if (!f) { /* first match */ + put_cr(); + if (hx) { + put_str(hex_expand_to(s, 10)); + } else { + put_str(expand_to(s, 10)); + } + f = 1; + } + put_str(" "); + put_str(scan_name[j]); + put_str(" scan up"); + s += scan_length[j]; + if (!*s) { + break; + } + j = -1; + } + } + } else { + for (j = f = 0; j < key_count; j++) { + if (!strcmp(s, fkval[j])) { + if (!f) { /* first match */ + put_cr(); + if (hx) { + put_str(hex_expand_to(s, 10)); + } else { + put_str(expand_to(s, 10)); + } + f = 1; + } + sprintf(outbuf, " (%s)", fk_name[j]); + put_str(outbuf); + if (fk_label[j]) { + sprintf(outbuf, " <%s>", fk_label[j]); + put_str(outbuf); + } + fk_tested[j] = 1; + } + } + } + if (end_state == '?') { + keys_tested(0, 1, hx); + tty_raw(cc, char_mask); + end_state = 0; + } + return f; +} + + +static int +found_exit(char *keybuf, int hx, int cc) +{ /* return true if the user wants to exit */ + int j, k; + char *s; + + + if (scan_mode) { + if (*keybuf == '\0') { + return TRUE; + } + } else { + /* break is a special case */ + if (*keybuf == '\0') { + fresh_line(); + tty_set(); + ptext("Hit X to exit: "); + if (wait_here() == 'X') { + return TRUE; + } + keys_tested(0, 1, hx); + tty_raw(cc, char_mask); + return FALSE; + } + /* is this the end? */ + for (k = 0; (j = (keybuf[k] & STRIP_PARITY)); k++) { + if (end_funky(j)) { + return TRUE; + } + } + + j = TRUE; /* does he need an updated list? */ + for (k = 0; keybuf[k]; k++) { + j &= (keybuf[k] & STRIP_PARITY) == '?'; + } + if (j || end_state == '?') { + keys_tested(0, 1, hx); + tty_raw(cc, char_mask); + end_state = 0; + return FALSE; + } + } + + put_cr(); + if (hx) { + s = hex_expand_to(keybuf, 10); + } else { + s = expand_to(keybuf, 10); + } + sprintf(temp, "%s Unknown", s); + put_str(temp); + for (j = 0; j < MAX_FK_UNK; j++) { + if (j == funk) { + fk_length[funk] = expand_chars; + if ((fk_unknown[funk] = (char *)malloc(strlen(s) + 1))) { + strcpy(fk_unknown[funk++], s); + } + break; + } + if (fk_length[j] == expand_chars) { + if (!strcmp(fk_unknown[j], s)) { + break; + } + } + } + return FALSE; +} + +/* +** funkey_keys(test_list, status, ch) +** +** Test function keys +*/ +static void +funkey_keys( + struct test_list *t, + int *state, + int *ch) +{ + char keybuf[256]; + + if (keypad_xmit) { + tc_putp(keypad_xmit); + } + keys_tested(1, 1, hex_out); /* also clears screen */ + keybuf[0] = '\0'; + end_state = 0; + if (scan_mode) { + fkmax = scan_max; + } + tty_raw(0, char_mask); + while (end_state != 'd') { + read_key(keybuf, sizeof(keybuf)); + fresh_line(); + if (found_match(keybuf, hex_out, 0)) { + continue; + } + if (found_exit(keybuf, hex_out, 0)) { + break; + } + } + if (keypad_local) { + tc_putp(keypad_local); + } + keys_tested(0, 0, hex_out); + ptext("Function key test "); + generic_done_message(t, state, ch); +} + +int +tty_meta_prep(void) +{ /* print a warning before the meta key test */ + if (not_a_tty) { + return 0; + } + if (initial_stty_query(TTY_8_BIT)) { + return 0; + } + ptext("The meta key test must be run with the"); + ptext(" terminal set for 8 data bits. Two stop bits"); + ptext(" may also be needed for correct display. I will"); + ptext(" transmit 8 bit data but if the terminal is set for"); + ptextln(" 7 bit data, garbage may appear on the screen."); + return 1; +} + +/* +** funkey_meta(test_list, status, ch) +** +** Test meta key (km) (smm) (rmm) +*/ +static void +funkey_meta( + struct test_list *t, + int *state, + int *ch) +{ + int i, j, k, len; + char outbuf[256]; + + if (has_meta_key) { + put_crlf(); + if (char_mask != ALLOW_PARITY) { + if (tty_meta_prep()) { + ptext("\nHit any key to continue > "); + (void) wait_here(); + put_crlf(); + } + } + ptext("Begin meta key test. (km) (smm) (rmm) Hit any key"); + ptext(" with the meta key. The character will be"); + ptext(" displayed in hex. If the meta key is working"); + ptext(" then the most significant bit will be set. Type"); + ptextln(" 'end' to exit."); + tty_raw(1, ALLOW_PARITY); + tc_putp(meta_on); + + for (i = j = k = len = 0; i != 'e' || j != 'n' || k != 'd';) { + i = j; + j = k; + k = getchp(ALLOW_PARITY); + if (k == EOF) { + break; + } + if ((len += 3) >= columns) { + put_crlf(); + len = 3; + } + sprintf(outbuf, "%02X ", k); + put_str(outbuf); + k &= STRIP_PARITY; + } + tc_putp(meta_off); + put_crlf(); + tty_set(); + put_crlf(); + } else { + ptext("(km) Has-meta-key is not set. "); + } + generic_done_message(t, state, ch); +} + +/* +** funkey_label(test_list, status, ch) +** +** Test labels (nlab) (smln) (pln) (rmln) (lw) (lh) +*/ +static void +funkey_label( + struct test_list *t, + int *state, + int *ch) +{ + int i; + char outbuf[256]; + + if (num_labels == -1) { + ptextln("Your terminal has no labels. (nlab)"); + } else { + sprintf(temp, "Your terminal has %d labels (nlab) that are %d characters wide (lw) and %d lines high (lh)", + num_labels, label_width, label_height); + ptext(temp); + ptextln(" Testing (smln) (pln) (rmln)"); + if (label_on) { + tc_putp(label_on); + } + if (label_width <= 0) { + label_width = sizeof(outbuf) - 1; + } + for (i = 1; i <= num_labels; i++) { + sprintf(outbuf, "L%d..............................", i); + outbuf[label_width] = '\0'; + tc_putp(tparm(plab_norm, i, outbuf)); + } + if (label_off) { + ptext("Hit any key to remove the labels: "); + (void) wait_here(); + tc_putp(label_off); + } + } + generic_done_message(t, state, ch); +} + +/* +** funkey_prog(test_list, status, ch) +** +** Test program function keys (pfx) +*/ +static void +funkey_prog( + struct test_list *t, + int *state, + int *ch) +{ + int i, fk; + char mm[256]; + + fk = 1; /* use function key 1 for now */ + if (pkey_xmit) { + /* test program function key */ + sprintf(temp, + "(pfx) Set function key %d to transmit abc\\n", fk); + ptextln(temp); + tc_putp(tparm(pkey_xmit, fk, "abc\n")); + sprintf(temp, "Hit function key %d\n", fk); + ptextln(temp); + for (i = 0; i < 4; ++i) + mm[i] = getchp(STRIP_PARITY); + mm[i] = '\0'; + put_crlf(); + if (mm[0] != 'a' || mm[1] != 'b' || mm[2] != 'c') { + sprintf(temp, "Error string recieved was: %s", expand(mm)); + ptextln(temp); + } else { + putln("Thank you\n"); + } + flush_input(); + if (key_f1) { + tc_putp(tparm(pkey_xmit, fk, key_f1)); + } + } else { + ptextln("Function key transmit (pfx), not present."); + } + generic_done_message(t, state, ch); +} + +/* +** funkey_local(test_list, status, ch) +** +** Test program local function keys (pfloc) +*/ +static void +funkey_local( + struct test_list *t, + int *state, + int *ch) +{ + int fk; + + fk = 1; + if (pkey_local) { + /* test local function key */ + sprintf(temp, + "(pfloc) Set function key %d to execute a clear and print \"Done!\"", fk); + ptextln(temp); + sprintf(temp, "%sDone!", liberated(clear_screen)); + tc_putp(tparm(pkey_local, fk, temp)); + sprintf(temp, "Hit function key %d. Then hit return.", fk); + ptextln(temp); + (void) wait_here(); + flush_input(); + if (key_f1 && pkey_xmit) { + tc_putp(tparm(pkey_xmit, fk, key_f1)); + } + } else { + ptextln("Function key execute local (pfloc), not present."); + } + + generic_done_message(t, state, ch); +} + +/* +** printer_on(test_list, status, ch) +** +** Test printer on/off (mc4) (mc5) (mc5i) +*/ +static void +printer_on( + struct test_list *t, + int *state, + int *ch) +{ + if (!prtr_on || !prtr_off) { + ptextln("Printer on/off missing. (mc5) (mc4)"); + } else if (prtr_silent) { + ptextln("Your printer is silent. (mc5i) is set."); + tc_putp(prtr_on); + ptextln("This line should be on the printer but not your screen. (mc5)"); + tc_putp(prtr_off); + ptextln("This line should be only on the screen. (mc4)"); + } else { + ptextln("Your printer is not silent. (mc5i) is reset."); + tc_putp(prtr_on); + ptextln("This line should be on the printer and the screen. (mc5)"); + tc_putp(prtr_off); + ptextln("This line should only be on the screen. (mc4)"); + } + generic_done_message(t, state, ch); +} + +/* +** printer_mc0(test_list, status, ch) +** +** Test screen print (mc0) +*/ +static void +printer_mc0( + struct test_list *t, + int *state, + int *ch) +{ + if (print_screen) { + ptext("I am going to send the contents of the screen to"); + ptext(" the printer, then wait for a keystroke from you."); + ptext(" All of the text that appears on the screen"); + ptextln(" should be printed. (mc0)"); + tc_putp(print_screen); + } else { + ptext("(mc0) Print-screen is not present. "); + } + generic_done_message(t, state, ch); +} + + +static void +line_pattern(void) +{ /* put up a pattern that will help count the + number of lines */ + int i, j; + + put_clear(); + if (over_strike) { + for (i = 0; i < 100; i++) { + if (i) { + put_crlf(); + } + for (j = i / 10; j; j--) { + put_this(' '); + } + put_this('0' + ((i + 1) % 10)); + } + } else /* I assume it will scroll */ { + for (i = 100; i; i--) { + sprintf(temp, "\r\n%d", i); + put_str(temp); + } + } +} + + +static void +column_pattern(void) +{ /* put up a pattern that will help count the + number of columns */ + int i, j; + + put_clear(); + for (i = 0; i < 20; i++) { + for (j = 1; j < 10; j++) { + put_this('0' + j); + } + put_this('.'); + } +} + +/* +** report_help() +** +** Print the help text for the echo tests +*/ +static void +report_help(int crx) +{ + ptextln("The following commands may also be entered:"); + ptextln(" clear clear screen."); + ptextln(" columns print a test patterm to help count screen width."); + ptextln(" lines print a test patterm to help count screen length."); + ptextln(" end exit."); + ptextln(" echo redisplay last report."); + if (crx) { + ptextln(" hex redisplay last report in hex."); + } else { + ptextln(" hex toggle hex display mode."); + } + ptextln(" help display this list."); + ptextln(" high toggle forced high bit (0x80)."); + ptextln(" scan toggle scan mode."); + ptextln(" one echo one character after or as is. (report mode)"); + ptextln(" two echo two characters after or as is."); + ptextln(" all echo all characters after or as is. (echo mode)"); +} + +/* +** tools_report(testlist, state, ch) +** +** Run the echo tool and report tool +*/ +void +tools_report( + struct test_list *t, + int *state GCC_UNUSED, + int *pch GCC_UNUSED) +{ + int i, j, ch, crp, crx, high_bit, save_scan_mode, hex_display; + char buf[1024]; + char txt[8]; + + hex_display = hex_out; + put_clear(); + if ((crx = (t->flags & 255)) == 1) { + ptext("Characters after a CR or LF will be echoed as"); + ptextln(" is. All other characters will be expanded."); + report_help(crx); + } else { /* echo test */ + ptextln("Begin echo test."); + report_help(crx); + } + txt[sizeof(txt) - 1] = '\0'; + save_scan_mode = scan_mode; + tty_raw(1, char_mask); + for (i = crp = high_bit = 0;;) { + ch = getchp(char_mask); + if (ch == EOF) { + break; + } + if (i >= (int) sizeof(buf) - 1) { + i = 0; + } + buf[i++] = ch; + buf[i] = '\0'; + for (j = 0; j < (int) sizeof(txt) - 1; j++) { + txt[j] = txt[j + 1]; + } + txt[sizeof(txt) - 1] = ch & STRIP_PARITY; + if (crx == 0) { /* echo test */ + if (hex_display) { + ptext(hex_expand_to(&buf[i - 1], 3)); + } else { + tc_putch(ch | high_bit); + } + } else /* status report test */ + if (ch == '\n' || ch == '\r') { + put_crlf(); + crp = 0; + } else if (crp++ < crx) { + tc_putch(ch | high_bit); + } else { + put_str(expand(&buf[i - 1])); + } + if (!strncmp(&txt[sizeof(txt) - 7], "columns", 7)) { + column_pattern(); + buf[i = 0] = '\0'; + crp = 0; + } + if (!strncmp(&txt[sizeof(txt) - 5], "lines", 5)) { + line_pattern(); + buf[i = 0] = '\0'; + crp = 0; + } + if (!strncmp(&txt[sizeof(txt) - 5], "clear", 5)) { + put_clear(); + buf[i = 0] = '\0'; + crp = 0; + } + if (!strncmp(&txt[sizeof(txt) - 4], "high", 4)) { + high_bit ^= 0x80; + if (high_bit) { + ptextln("\nParity bit set"); + } else { + ptextln("\nParity bit reset"); + } + } + if (!strncmp(&txt[sizeof(txt) - 4], "help", 4)) { + put_crlf(); + report_help(crx); + } + if (!strncmp(&txt[sizeof(txt) - 4], "echo", 4)) { + /* display the last status report */ + /* clear bypass condition on Tek terminals */ + put_crlf(); + if (i >= 4) { + buf[i -= 4] = '\0'; + } + put_str(expand(buf)); + } + if (save_scan_mode && + !strncmp(&txt[sizeof(txt) - 4], "scan", 4)) { + /* toggle scan mode */ + scan_mode = !scan_mode; + } + if (!strncmp(&txt[sizeof(txt) - 3], "end", 3)) + break; + if (!strncmp(&txt[sizeof(txt) - 3], "hex", 3)) { + if (crx) { + /* display the last status report in hex */ + /* clear bypass condition on Tek terminals */ + put_crlf(); + if (i >= 3) { + buf[i -= 3] = '\0'; + } + put_str(hex_expand_to(buf, 3)); + } else { + hex_display = !hex_display; + } + } + if (!strncmp(&txt[sizeof(txt) - 3], "two", 3)) + crx = 2; + if (!strncmp(&txt[sizeof(txt) - 3], "one", 3)) + crx = 1; + if (!strncmp(&txt[sizeof(txt) - 3], "all", 3)) + crx = 0; + } + scan_mode = save_scan_mode; + put_crlf(); + tty_set(); + if (crx) { + ptextln("End of status report test."); + } else { + ptextln("End of echo test."); + } +} diff --git a/tack/init.c b/tack/init.c new file mode 100644 index 00000000..e19493d6 --- /dev/null +++ b/tack/init.c @@ -0,0 +1,300 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ +/* initialization and wrapup code */ + +#include + +MODULE_ID("$Id: init.c,v 1.1 1999/04/18 01:05:23 tom Exp $") + +#if NCURSES_VERSION_MAJOR >= 5 || NCURSES_VERSION_PATCH >= 981219 +#define _nc_get_curterm(p) _nc_get_tty_mode(p) +#endif + +FILE *debug_fp; +char temp[1024]; +char tty_basename[64]; + +void +put_name(const char *cap, const char *name) +{ /* send the cap name followed by the cap */ + if (cap) { + ptext(name); + tc_putp(cap); + } +} + +static void +report_cap(const char *tag, const char *s) +{ /* expand the cap or print *** missing *** */ + int i; + + ptext(tag); + for (i = char_count; i < 13; i++) { + putchp(' '); + } + put_str(" = "); + if (s) { + putln(expand(s)); + } else { + putln("*** missing ***"); + } +} + + +void +reset_init(void) +{ /* send the reset and init strings */ + int i; + + ptext("Terminal reset"); + i = char_count; + put_name(reset_1string, " (rs1)"); + put_name(reset_2string, " (rs2)"); + /* run the reset file */ + if (reset_file && reset_file[0]) { + FILE *fp; + int ch; + + can_test("rf", FLAG_TESTED); + if ((fp = fopen(reset_file, "r"))) { /* send the reset file */ + sprintf(temp, " (rf) %s", reset_file); + ptextln(temp); + while (1) { + ch = getc(fp); + if (ch == EOF) + break; + put_this(ch); + } + fclose(fp); + } else { + sprintf(temp, "\nCannot open reset file (rf) %s", reset_file); + ptextln(temp); + } + } + put_name(reset_3string, " (rs3)"); + if (i != char_count) { + put_crlf(); + } + ptext(" init"); + put_name(init_1string, " (is1)"); + put_name(init_2string, " (is2)"); + if (set_tab && clear_all_tabs && init_tabs != 8) { + put_crlf(); + tc_putp(clear_all_tabs); + for (char_count = 0; char_count < columns; char_count++) { + put_this(' '); + if ((char_count & 7) == 7) { + tc_putp(set_tab); + } + } + put_cr(); + } + /* run the initialization file */ + if (init_file && init_file[0]) { + FILE *fp; + int ch; + + can_test("if", FLAG_TESTED); + if ((fp = fopen(init_file, "r"))) { /* send the init file */ + sprintf(temp, " (if) %s", init_file); + ptextln(temp); + while (1) { + ch = getc(fp); + if (ch == EOF) + break; + put_this(ch); + } + fclose(fp); + } else { + sprintf(temp, "\nCannot open init file (if) %s", init_file); + ptextln(temp); + } + } + if (init_prog) { + can_test("iprog", FLAG_TESTED); + (void) system(init_prog); + } + put_name(init_3string, " (is3)"); + + fflush(stdout); +} + +/* +** display_basic() +** +** display the basic terminal definitions +*/ +void +display_basic(void) +{ + put_str("Name: "); + putln(ttytype); + + report_cap("\\r ^M (cr)", carriage_return); + report_cap("\\n ^J (ind)", scroll_forward); + report_cap("\\b ^H (cub1)", cursor_left); + report_cap("\\t ^I (ht)", tab); +/* report_cap("\\f ^L (ff)", form_feed); */ + if (newline) { + /* OK if missing */ + report_cap(" (nel)", newline); + } + report_cap(" (clear)", clear_screen); + if (!cursor_home && cursor_address) { + report_cap("(cup) (home)", tparm(cursor_address, 0, 0)); + } else { + report_cap(" (home)", cursor_home); + } + report_cap("ENQ (u9)", user9); + report_cap("ACK (u8)", user8); + + sprintf(temp, "\nTerminal size: %d x %d. Baud rate: %ld. Frame size: %d.%d", columns, lines, tty_baud_rate, tty_frame_size >> 1, (tty_frame_size & 1) * 5); + putln(temp); +} + +/* +** curses_setup(exec_name) +** +** Startup ncurses +*/ +void +curses_setup( + char *exec_name) +{ + int status; + static TERMTYPE term; + char tty_filename[2048]; + + tty_init(); + + /** + See if the terminal is in the terminfo data base. This call has + two useful benefits, 1) it returns the filename of the terminfo entry, + and 2) it searches only terminfo's. This allows us to abort before + ncurses starts scanning the termcap file. + **/ + if ((status = _nc_read_entry(tty_basename, tty_filename, &term)) == 0) { + fprintf(stderr, "Terminal not found: TERM=%s\n", tty_basename); + show_usage(exec_name); + exit(1); + } + if (status == -1) { + fprintf(stderr, "Terminfo database is inaccessible\n"); + exit(1); + } + + /** + This call will load the terminfo data base and set the cur-term + variable. Only terminals that actually exist will get here so its + OK to ignore errors. This is a good thing since ncurses does not + permit (os) or (gn) to be set. + **/ + setupterm(tty_basename, 1, &status); + + /** + Get the current terminal definitions. This must be done before + getting the baudrate. + **/ + _nc_get_curterm(&cur_term->Nttyb); + tty_baud_rate = baudrate(); + tty_cps = (tty_baud_rate << 1) / tty_frame_size; + + /* set up the defaults */ + replace_mode = TRUE; + scan_mode = 0; + char_count = 0; + select_delay_type = debug_level = 0; + char_mask = (meta_on && meta_on[0] == '\0') ? ALLOW_PARITY : STRIP_PARITY; + /* Don't change the XON/XOFF modes yet. */ + select_xon_xoff = initial_stty_query(TTY_XON_XOFF) ? 1 : needs_xon_xoff; + + fflush(stdout); /* flush any output */ + tty_set(); + + go_home(); /* set can_go_home */ + put_clear(); /* set can_clear_screen */ + + if (send_reset_init) { + reset_init(); + } + + /* + I assume that the reset and init strings may not have the correct + pads. (Because that part of the test comes much later.) Because + of this, I allow the terminal some time to catch up. + */ + fflush(stdout); /* waste some time */ + sleep(1); /* waste more time */ + charset_can_test(); + can_test("lines cols cr nxon rf if iprog rmp", FLAG_CAN_TEST); + edit_init(); /* initialize the edit data base */ + + if (send_reset_init && enter_ca_mode) { + tc_putp(enter_ca_mode); + put_clear(); /* just in case we switched pages */ + } + put_crlf(); + ptext("Using terminfo from: "); + ptextln(tty_filename); + put_crlf(); + + if (tty_can_sync == SYNC_NEEDED) { + verify_time(); + } + + display_basic(); +} + +/* +** bye_kids(exit-condition) +** +** Shutdown the terminal, clear the signals, and exit +*/ +void +bye_kids(int n) +{ /* reset the tty and exit */ + ignoresig(); + if (send_reset_init) { + if (exit_ca_mode) { + tc_putp(exit_ca_mode); + } + if (initial_stty_query(TTY_XON_XOFF)) { + if (enter_xon_mode) { + tc_putp(enter_xon_mode); + } + } else if (exit_xon_mode) { + tc_putp(exit_xon_mode); + } + } + if (debug_fp) { + fclose(debug_fp); + } + if (log_fp) { + fclose(log_fp); + } + tty_reset(); + fclose(stdin); + fclose(stdout); + fclose(stderr); + if (not_a_tty) + sleep(1); + exit(n); +} diff --git a/tack/menu.c b/tack/menu.c new file mode 100644 index 00000000..a2bcc380 --- /dev/null +++ b/tack/menu.c @@ -0,0 +1,421 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include + +MODULE_ID("$Id: menu.c,v 1.1 1998/01/10 00:29:30 tom Exp $") + +/* + Menu control + */ + +static void test_byname(struct test_menu *, int *, int *); + +struct test_list *augment_test; +char prompt_string[80]; /* menu prompt storage */ + +/* +** menu_prompt() +** +** Print the menu prompt string. +*/ +void +menu_prompt(void) +{ + ptext(&prompt_string[1]); +} + +/* +** menu_test_loop(test-structure, state, control-character) +** +** This function implements the repeat test function. +*/ +static void +menu_test_loop( + struct test_list *test, + int *state, + int *ch) +{ + int nch, p; + + if ((test->flags & MENU_REP_MASK) && (augment_test != test)) { + /* set the augment variable (first time only) */ + p = (test->flags >> 8) & 15; + if ((test->flags & MENU_REP_MASK) == MENU_LM1) { + augment = lines - 1; + } else + if ((test->flags & MENU_ONE_MASK) == MENU_ONE) { + augment = 1; + } else + if ((test->flags & MENU_LC_MASK) == MENU_lines) { + augment = lines * p / 10; + } else + if ((test->flags & MENU_LC_MASK) == MENU_columns) { + augment = columns * p / 10; + } else { + augment = 1; + } + augment_test = test; + set_augment_txt(); + } + do { + if ((test->flags | *state) & MENU_CLEAR) { + put_clear(); + } else + if (line_count + test->lines_needed >= lines) { + put_clear(); + } + nch = 0; + if (test->test_procedure) { + /* The procedure takes precidence so I can pass + the menu entry as an argument. + */ + can_test(test->caps_done, FLAG_TESTED); + can_test(test->caps_tested, FLAG_TESTED); + test->test_procedure(test, state, &nch); + } else + if (test->sub_menu) { + /* nested menu's */ + menu_display(test->sub_menu, &nch); + *state = 0; + if (nch == 'q' || nch == 's') { + /* Quit and skip are killed here */ + nch = '?'; + } + } else { + break; /* cya */ + } + if (nch == '\r' || nch == '\n' || nch == 'n') { + nch = 0; + break; + } + } while (nch == 'r'); + *ch = nch; +} + +/* +** menu_display(menu-structure, flags) +** +** This function implements menu control. +*/ +void +menu_display( + struct test_menu *menu, + int *last_ch) +{ + int test_state = 0, run_standard_tests; + int hot_topic, ch = 0, nch = 0; + struct test_list *mt; + struct test_list *repeat_tests = 0; + int repeat_state = 0; + int prompt_length; + + prompt_length = strlen(prompt_string); + if (menu->ident) { + sprintf(&prompt_string[prompt_length], "/%s", menu->ident); + } + hot_topic = menu->default_action; + run_standard_tests = menu->standard_tests ? + menu->standard_tests[0] : -1; + if (!last_ch) { + last_ch = &ch; + } + while (1) { + if (ch == 0) { + /* Display the menu */ + put_crlf(); + if (menu->menu_function) { + /* + this function may be used to restrict menu + entries. If used it must print the title. + */ + menu->menu_function(menu); + } else + if (menu->menu_title) { + ptextln(menu->menu_title); + } + for (mt = menu->tests; (mt->flags & MENU_LAST) == 0; mt++) { + if (mt->menu_entry) { + ptext(" "); + ptextln(mt->menu_entry); + } + } + if (menu->standard_tests) { + ptext(" "); + ptextln(menu->standard_tests); + ptextln(" r) repeat test"); + ptextln(" s) skip to next test"); + } + ptextln(" q) quit"); + ptextln(" ?) help"); + } + if (ch == 0 || ch == REQUEST_PROMPT) { + put_crlf(); + ptext(&prompt_string[1]); + if (hot_topic) { + ptext(" ["); + putchp(hot_topic); + ptext("]"); + } + ptext(" > "); + /* read a character */ + ch = wait_here(); + } + if (ch == '\r' || ch == '\n') { + ch = hot_topic; + } + if (ch == 'q') { + break; + } + if (ch == '?') { + ch = 0; + continue; + } + nch = ch; + ch = 0; + /* Run one of the standard tests (by request) */ + for (mt = menu->tests; (mt->flags & MENU_LAST) == 0; mt++) { + if (mt->menu_entry && (nch == mt->menu_entry[0])) { + if (mt->flags & MENU_MENU) { + test_byname(menu, &test_state, &nch); + } else { + menu_test_loop(mt, &test_state, &nch); + } + ch = nch; + if ((mt->flags & MENU_COMPLETE) && ch == 0) { + /* top level */ + hot_topic = 'q'; + ch = '?'; + } + } + } + if (menu->standard_tests && nch == 'r') { + menu->resume_tests = repeat_tests; + test_state = repeat_state; + nch = run_standard_tests; + } + if (nch == run_standard_tests) { + if (!(mt = menu->resume_tests)) { + mt = menu->tests; + } + if (mt->flags & MENU_LAST) { + mt = menu->tests; + } + /* Run the standard test suite */ + for ( ; (mt->flags & MENU_LAST) == 0; ) { + if ((mt->flags & MENU_NEXT) == MENU_NEXT) { + repeat_tests = mt; + repeat_state = test_state; + nch = run_standard_tests; + menu_test_loop(mt, &test_state, &nch); + if (nch != 0 && nch != 'n') { + ch = nch; + break; + } + if (test_state & MENU_STOP) { + break; + } + } + mt++; + } + if (ch == 0) { + ch = hot_topic; + } + menu->resume_tests = mt; + menu->resume_state = test_state; + menu->resume_char = ch; + + if (ch == run_standard_tests) { + /* pop up a level */ + break; + } + } + } + *last_ch = ch; + prompt_string[prompt_length] = '\0'; +} + +/* +** generic_done_message(test_list) +** +** Print the Done message and request input. +*/ +void +generic_done_message( + struct test_list *test, + int *state, + int *ch) +{ + char done_message[128]; + + if (test->caps_done) { + sprintf(done_message, "(%s) Done ", test->caps_done); + ptext(done_message); + } else { + ptext("Done "); + } + *ch = wait_here(); + if (*ch == '\r' || *ch == '\n' || *ch == 'n') { + *ch = 0; + } + if (*ch == 's') { + *state |= MENU_STOP; + *ch = 0; + } +} + +/* +** menu_clear_screen(test, state, ch) +** +** Just clear the screen. +*/ +void +menu_clear_screen( + struct test_list *test GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + put_clear(); +} + +/* +** menu_reset_init(test, state, ch) +** +** Send the reset and init strings. +*/ +void +menu_reset_init( + struct test_list *test GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + reset_init(); + put_crlf(); +} + +/* +** subtest_menu(test, state, ch) +** +** Scan the menu looking for something to execute +** Return TRUE if we found anything. +*/ +int +subtest_menu( + struct test_list *test, + int *state, + int *ch) +{ + struct test_list *mt; + + if (*ch) { + for (mt = test; (mt->flags & MENU_LAST) == 0; mt++) { + if (mt->menu_entry && (*ch == mt->menu_entry[0])) { + *ch = 0; + menu_test_loop(mt, state, ch); + return TRUE; + } + } + } + return FALSE; +} + +/* +** menu_can_scan(menu-structure) +** +** Recursivly scan the menu tree and find which cap names can be tested. +*/ +void +menu_can_scan( + const struct test_menu *menu) +{ + struct test_list *mt; + + for (mt = menu->tests; (mt->flags & MENU_LAST) == 0; mt++) { + can_test(mt->caps_done, FLAG_CAN_TEST); + can_test(mt->caps_tested, FLAG_CAN_TEST); + if (!(mt->test_procedure)) { + if (mt->sub_menu) { + menu_can_scan(mt->sub_menu); + } + } + } +} + +/* +** menu_search(menu-structure, cap) +** +** Recursivly search the menu tree and execute any tests that use cap. +*/ +static void +menu_search( + struct test_menu *menu, + int *state, + int *ch, + char *cap) +{ + struct test_list *mt; + int nch; + + for (mt = menu->tests; (mt->flags & MENU_LAST) == 0; mt++) { + nch = 0; + if (cap_match(mt->caps_done, cap) + || cap_match(mt->caps_tested, cap)) { + menu_test_loop(mt, state, &nch); + } + if (!(mt->test_procedure)) { + if (mt->sub_menu) { + menu_search(mt->sub_menu, state, &nch, cap); + } + } + if (*state & MENU_STOP) { + break; + } + if (nch != 0 && nch != 'n') { + *ch = nch; + break; + } + } +} + +/* +** test_byname(menu, state, ch) +** +** Get a cap name then run all tests that use that cap. +*/ +static void +test_byname( + struct test_menu *menu, + int *state GCC_UNUSED, + int *ch) +{ + int test_state = 0; + char cap[32]; + + if (tty_can_sync == SYNC_NOT_TESTED) { + verify_time(); + } + ptext("enter name: "); + read_string(cap, sizeof(cap)); + if (cap[0]) { + menu_search(menu, &test_state, ch, cap); + } + *ch = '?'; +} diff --git a/tack/modes.c b/tack/modes.c new file mode 100644 index 00000000..f370ba89 --- /dev/null +++ b/tack/modes.c @@ -0,0 +1,913 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include + +MODULE_ID("$Id: modes.c,v 1.1 1998/01/10 00:29:53 tom Exp $") + +/* + * Tests boolean flags and terminal modes. + */ +static void subtest_os(struct test_list *, int *, int *); +static void subtest_rmam(struct test_list *, int *, int *); +static void subtest_smam(struct test_list *, int *, int *); +static void subtest_am(struct test_list *, int *, int *); +static void subtest_ul(struct test_list *, int *, int *); +static void subtest_uc(struct test_list *, int *, int *); +static void subtest_bw(struct test_list *, int *, int *); +static void subtest_xenl(struct test_list *, int *, int *); +static void subtest_eo(struct test_list *, int *, int *); +static void subtest_xmc(struct test_list *, int *, int *); +static void subtest_xhp(struct test_list *, int *, int *); +static void subtest_mir(struct test_list *, int *, int *); +static void subtest_msgr(struct test_list *, int *, int *); +static void subtest_tbc(struct test_list *, int *, int *); +static void subtest_xt(struct test_list *, int *, int *); +static void subtest_hts(struct test_list *, int *, int *); +static void subtest_cbt(struct test_list *, int *, int *); +static void subtest_in(struct test_list *, int *, int *); +static void subtest_dadb(struct test_list *, int *, int *); + +struct test_list mode_test_list[] = { + {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, + {MENU_NEXT, 3, "os", 0, 0, subtest_os, 0}, + {MENU_NEXT, 1, "rmam", 0, 0, subtest_rmam, 0}, + {MENU_NEXT, 1, "smam", 0, 0, subtest_smam, 0}, + {MENU_NEXT, 1, "am", 0, 0, subtest_am, 0}, + {MENU_NEXT, 3, "ul", 0, 0, subtest_ul, 0}, + {MENU_NEXT, 3, "uc", 0, 0, subtest_uc, 0}, + {MENU_NEXT, 3, "bw", 0, 0, subtest_bw, 0}, + {MENU_NEXT, 4, "xenl", 0, 0, subtest_xenl, 0}, + {MENU_NEXT, 3, "eo", 0, 0, subtest_eo, 0}, + {MENU_NEXT, 3, "xmc", 0, 0, subtest_xmc, 0}, + {MENU_NEXT, 3, "xhp", 0, 0, subtest_xhp, 0}, + {MENU_NEXT, 6, "mir", 0, 0, subtest_mir, 0}, + {MENU_NEXT, 6, "msgr", 0, 0, subtest_msgr, 0}, + {MENU_NEXT | MENU_CLEAR, 0, "tbc", "it", 0, subtest_tbc, 0}, + {MENU_NEXT | MENU_CLEAR, 0, "hts", "it", 0, subtest_hts, 0}, + {MENU_NEXT, 4, "xt", "it", 0, subtest_xt, 0}, + {MENU_NEXT, 1, "cbt", "it", 0, subtest_cbt, 0}, + {MENU_NEXT, 6, "in", 0, 0, subtest_in, 0}, + {MENU_NEXT, 1, "da) (db", 0, 0, subtest_dadb, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +/* +** subtest_os(test_list, status, ch) +** +** test over strike mode (os) +*/ +static void +subtest_os( + struct test_list *t, + int *state, + int *ch) +{ + ptext("(os) should be true, not false."); + put_cr(); + ptextln("(os) should be false."); + sprintf(temp, "(os) over-strike is %s in the data base. ", + over_strike ? "true" : "false"); + ptext(temp); + generic_done_message(t, state, ch); +} + +/* +** subtest_rmam(test_list, status, ch) +** +** test exit automatic margins mode (rmam) +*/ +static void +subtest_rmam( + struct test_list *t, + int *state, + int *ch) +{ + int j; + + if (!exit_am_mode) { + ptext("(rmam) not present. "); + } else + if (!can_go_home) { + ptext("(rmam) not tested, no way to home cursor. "); + } else + if (over_strike) { + put_clear(); + go_home(); + tc_putp(exit_am_mode); + ptext("\n(rmam) will reset (am)"); + go_home(); + for (j = 0; j < columns; j++) + put_this(' '); + ptext("(rmam) will not reset (am)"); + go_home(); + put_newlines(2); + } else { + put_clear(); + go_home(); + tc_putp(exit_am_mode); + ptext("\n(rmam) will reset (am)"); + go_home(); + for (j = 0; j < columns; j++) + put_this(' '); + ptext("(rmam) will not reset (am) "); + go_home(); + put_str(" "); + go_home(); + put_newlines(2); + } + ptext("Exit-automatic-margins "); + generic_done_message(t, state, ch); +} + +/* +** subtest_smam(test_list, status, ch) +** +** test enter automatic margins mode (smam) +*/ +static void +subtest_smam( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!enter_am_mode) { + ptext("(smam) not present. "); + } else + if (!can_go_home) { + ptext("(smam) not tested, no way to home cursor. "); + } else + if (over_strike) { + put_clear(); + go_home(); + tc_putp(enter_am_mode); + ptext("\n(smam) will "); + i = char_count; + ptext("not set (am)"); + go_home(); + for (j = -i; j < columns; j++) + put_this(' '); + put_str("@@@"); + put_newlines(2); + } else { + put_clear(); + go_home(); + tc_putp(enter_am_mode); + ptext("\n(smam) will not set (am)"); + go_home(); + for (j = 0; j < columns; j++) + put_this(' '); + ptext("(smam) will set (am) "); + go_home(); + put_str(" "); + put_newlines(2); + } + ptext("Enter-automatic-margins "); + generic_done_message(t, state, ch); +} + +/* +** subtest_am(test_list, status, ch) +** +** test automatic margins (am) +*/ +static void +subtest_am( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!can_go_home) { + ptextln("(am) not tested, no way to home cursor. "); + } else + if (over_strike) { + put_clear(); + go_home(); + ptext("\n(am) should "); + i = char_count; + ptext("not be set"); + go_home(); + for (j = -i; j < columns; j++) + put_this(' '); + put_str("@@@"); + go_home(); + put_newlines(2); + sprintf(temp, "(am) is %s in the data base", + auto_right_margin ? "true" : "false"); + ptextln(temp); + } else { + put_clear(); + go_home(); + ptext("\n(am) should not be set"); + go_home(); + for (j = 0; j < columns; j++) + put_this(' '); + ptext("(am) should be set "); + go_home(); + put_str(" \n\n"); + sprintf(temp, "(am) is %s in the data base", + auto_right_margin ? "true" : "false"); + ptextln(temp); + } + ptext("Automatic-right-margin "); + generic_done_message(t, state, ch); +} + +/* Note: uprint() sends underscore back-space character, and + ucprint() sends character back-space underscore. */ + +/* +** uprint(string) +** +** underline string for (ul) test +*/ +static void +uprint(const char *s) +{ + if (s) { + while (*s) { + put_str("_\b"); + putchp(*s++); + } + } +} + +/* +** ucprint(string) +** +** underline string for (uc) test +*/ +static void +ucprint(const char *s) +{ + if (s) { + while (*s) { + putchp(*s++); + putchp('\b'); + tc_putp(underline_char); + } + } +} + +/* +** subtest_ul(test_list, status, ch) +** +** test transparent underline (ul) +*/ +static void +subtest_ul( + struct test_list *t, + int *state, + int *ch) +{ + if (!over_strike) { + /* (ul) is used only if (os) is reset */ + put_crlf(); + sprintf(temp, "This text should %sbe underlined.", + transparent_underline ? "" : "not "); + uprint(temp); + put_crlf(); + ptextln("If the above line is not underlined the (ul) should be false."); + sprintf(temp, "(ul) Transparent-underline is %s in the data base", + transparent_underline ? "true" : "false"); + ptextln(temp); + generic_done_message(t, state, ch); + } +} + +/* +** subtest_uc(test_list, status, ch) +** +** test underline character (uc) +*/ +static void +subtest_uc( + struct test_list *t, + int *state, + int *ch) +{ + if (!over_strike) { + if (underline_char) { + ucprint("This text should be underlined."); + put_crlf(); + ptextln("If the above text is not underlined the (uc) has failed."); + ptext("Underline-character "); + } else { + ptext("(uc) underline-character is not defined. "); + } + generic_done_message(t, state, ch); + } +} + +/* +** subtest_bw(test_list, status, ch) +** +** test auto left margin (bw) +*/ +static void +subtest_bw( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (over_strike) { + /* test (bw) */ + ptext("\n(bw) should "); + i = char_count; + ptextln("not be set."); + for (j = i; j < columns; j++) + put_str("\b"); + put_str("@@@"); + put_crlf(); + sprintf(temp, "(bw) Auto-left-margin is %s in the data base", + auto_left_margin ? "true" : "false"); + ptextln(temp); + } else { + /* test (bw) */ + ptextln("(bw) should not be set."); + for (i = 12; i < columns; i++) + put_str("\b"); + if (delete_character) { + for (i = 0; i < 4; i++) + tc_putp(delete_character); + } else { + put_str(" "); + } + put_crlf(); + sprintf(temp, "(bw) Auto-left-margin is %s in the data base", + auto_left_margin ? "true" : "false"); + ptextln(temp); + } + generic_done_message(t, state, ch); +} + +/* +** subtest_tbc(test_list, status, ch) +** +** test clear tabs (tbc) +*/ +static void +subtest_tbc( + struct test_list *t, + int *state, + int *ch) +{ + int tabat; /* the tab spacing we end up with */ + int i; + + if (clear_all_tabs && !set_tab) { + ptext("(tbc) Clear-all-tabs is defined but (hts) set-tab is not. "); + ptext("Once the tabs are cleared there is no way to set them. "); + } else + if (clear_all_tabs) { + tabat = set_tab ? 8 : init_tabs; + tc_putp(clear_all_tabs); + ptext("Clear tabs (tbc)"); + go_home(); + put_crlf(); + putchp('\t'); + putchp('T'); + go_home(); + put_newlines(2); + for (i = 0; i < columns; i++) { + if (i == tabat) { + putchp('T'); + } else { + putchp('.'); + } + } + go_home(); + ptext("\n\n\nIf the above two lines have T's in the same column then (tbc) has failed. "); + } else { + ptext("(tbc) Clear-all-tabs is not defined. "); + } + generic_done_message(t, state, ch); +} + +/* +** subtest_hts(test_list, status, ch) +** +** (ht) and set tabs with (hts) +*/ +static void +subtest_hts( + struct test_list *t, + int *state, + int *ch) +{ + int tabat; /* the tab spacing we end up with */ + int i; + + tabat = init_tabs; + if (set_tab) { + ptext("Tabs set with (hts)"); + put_crlf(); + for (i = 1; i < columns; i++) { + if (i % 8 == 1) { + tc_putp(set_tab); + } + putchp(' '); + } + tabat = 8; + } else { + sprintf(temp, "(hts) Set-tabs not defined. (it) Initial-tabs at %d", init_tabs); + ptext(temp); + } + go_home(); + put_newlines(2); + if (tabat <= 0) { + tabat = 8; + } + for (i = tabat; i < columns; i += tabat) { + putchp('\t'); + putchp('T'); + } + go_home(); + put_newlines(3); + for (i = 1; i < columns; i++) { + putchp('.'); + } + go_home(); + put_newlines(3); + for (i = tabat; i < columns; i += tabat) { + putchp('\t'); + putchp('T'); + } + go_home(); + put_newlines(4); + putchp('.'); + for (i = 2; i < columns; i++) { + if (i % tabat == 1) { + putchp('T'); + } else { + putchp('.'); + } + } + go_home(); + put_newlines(5); + if (set_tab) { + ptextln("If the last two lines are not the same then (hts) has failed."); + } else + if (init_tabs > 0) { + ptextln("If the last two lines are not the same then (it) is wrong."); + } else { + ptextln("If the last two lines are the same then maybe you do have tabs and (it) should be changed."); + } + generic_done_message(t, state, ch); +} + +/* +** subtest_xt(test_list, status, ch) +** +** (xt) glitch +*/ +static void +subtest_xt( + struct test_list *t, + int *state, + int *ch) +{ + int tabat; /* the tab spacing we end up with */ + int cc; + + tabat = set_tab ? 8 : init_tabs; + if (!over_strike && (tabat > 0)) { + ptext("(xt) should not "); + put_cr(); + ptext("(xt) should"); + cc = char_count; + while (cc < 16) { + putchp('\t'); + cc = ((cc / tabat) + 1) * tabat; + } + putln("be set."); + sprintf(temp, "(xt) Destructive-tab is %s in the data base.", + dest_tabs_magic_smso ? "true" : "false"); + ptextln(temp); + generic_done_message(t, state, ch); + } +} + +/* +** subtest_cbt(test_list, status, ch) +** +** (cbt) back tab +*/ +static void +subtest_cbt( + struct test_list *t, + int *state, + int *ch) +{ + int i; + + if (back_tab) { + put_clear(); + ptext("Back-tab (cbt)"); + go_home(); + put_crlf(); + for (i = 1; i < columns; i++) { + putchp(' '); + } + for (i = 0; i < columns; i += 8) { + tc_putp(back_tab); + putchp('T'); + tc_putp(back_tab); + } + go_home(); + put_newlines(2); + for (i = 1; i < columns; i++) { + if (i % 8 == 1) { + putchp('T'); + } else { + putchp(' '); + } + } + go_home(); + put_newlines(3); + ptextln("The preceding two lines should be the same."); + } else { + ptextln("(cbt) Back-tab not present"); + } + generic_done_message(t, state, ch); +} + +/* +** subtest_xenl(test_list, status, ch) +** +** (xenl) eat newline glitch +*/ +static void +subtest_xenl( + struct test_list *t, + int *state, + int *ch) +{ + int i, j, k; + + if (over_strike) { + /* test (xenl) on overstrike terminals */ + if (!can_go_home || !can_clear_screen) { + ptextln("(xenl) Newline-glitch not tested, can't home cursor and clear."); + generic_done_message(t, state, ch); + return; + } + put_clear(); + /* + this test must be done in raw mode. Otherwise UNIX will + translate CR to CRLF. + */ + if (stty_query(TTY_OUT_TRANS)) + tty_raw(1, char_mask); + ptext("\nreset (xenl). Does "); + i = char_count; + put_str("not ignore CR, does "); + k = char_count; + put_str("not ignore LF"); + go_home(); + for (j = 0; j < columns; j++) + put_this(' '); + put_cr(); + for (j = 0; j < i; j++) + putchp(' '); + put_str("@@@\n@@"); + go_home(); + for (j = 0; j < columns; j++) + put_this(' '); + put_lf(); + for (j = 0; j < k; j++) + putchp(' '); + put_str("@@@\r@@"); + tty_set(); + go_home(); + put_newlines(4); + sprintf(temp, "(xenl) Newline-glitch is %s in the data base", + eat_newline_glitch ? "true" : "false"); + ptextln(temp); + } else { + /* test (xenl) when (os) is reset */ + if (!can_go_home) { + ptextln("(xenl) Newline-glitch not tested, can't home cursor"); + generic_done_message(t, state, ch); + return; + } + /* (xenl) test */ + put_clear(); + /* + this test must be done in raw mode. Otherwise + UNIX will translate CR to CRLF. + */ + if (stty_query(TTY_OUT_TRANS)) + tty_raw(1, char_mask); + for (j = 0; j < columns; j++) + put_this(' '); + put_cr(); + ptext("(xenl) should be set. Does not ignore CR"); + go_home(); + put_crlf(); + for (j = 0; j < columns; j++) + put_this(' '); + put_lf(); /* test (cud1) */ + ptext("(xenl) should be set. Ignores (cud1)"); + go_home(); + put_newlines(3); + if (scroll_forward && cursor_down && + strcmp(scroll_forward, cursor_down)) { + for (j = 0; j < columns; j++) + put_this(' '); + put_ind(); /* test (ind) */ + ptext("(xenl) should be set. Ignores (ind)"); + go_home(); + put_newlines(5); + } + tty_set(); + ptextln("If you don't see text above telling you to set it, (xenl) should be false"); + sprintf(temp, "(xenl) Newline-glitch is %s in the data base", + eat_newline_glitch ? "true" : "false"); + ptextln(temp); + } + generic_done_message(t, state, ch); +} + +/* +** subtest_eo(test_list, status, ch) +** +** (eo) erase overstrike +*/ +static void +subtest_eo( + struct test_list *t, + int *state, + int *ch) +{ + if (transparent_underline || over_strike || underline_char) { + ptext("(eo) should "); + if (underline_char) { + ucprint("not"); + } else { + uprint("not"); + } + put_cr(); + ptextln("(eo) should be set"); + sprintf(temp, "\n(eo) Erase-overstrike is %s in the data base", + erase_overstrike ? "true" : "false"); + ptextln(temp); + generic_done_message(t, state, ch); + } +} + +/* +** subtest_xmc(test_list, status, ch) +** +** (xmc) magic cookie glitch +*/ +static void +subtest_xmc( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (enter_standout_mode) { + sprintf(temp, "\n(xmc) Magic-cookie-glitch is %d in the data base", magic_cookie_glitch); + ptextln(temp); + j = magic_cookie_glitch * 8; + for (i = 0; i < j; i++) { + put_str(" "); + } + ptextln(" These two lines should line up."); + if (j > 0) { + char_count += j; + } + for (i = 0; i < 4; i++) { + put_mode(enter_standout_mode); + putchp(' '); + put_mode(exit_standout_mode); + putchp(' '); + } + ptextln("These two lines should line up."); + ptext("If they don't line up then (xmc) magic-cookie-glitch should be greater than zero. "); + generic_done_message(t, state, ch); + } +} + +/* +** subtest_xhp(test_list, status, ch) +** +** (xhp) erase does not clear standout mode +*/ +static void +subtest_xhp( + struct test_list *t, + int *state, + int *ch) +{ + if (enter_standout_mode) { + put_crlf(); + put_mode(enter_standout_mode); + put_str("Stand out"); + put_mode(exit_standout_mode); + put_cr(); + ptextln("If any part of this line is standout then (xhp) should be set."); + sprintf(temp, "(xhp) Erase-standout-glitch is %s in the data base", + ceol_standout_glitch ? "true" : "false"); + ptextln(temp); + generic_done_message(t, state, ch); + } +} + +/* +** subtest_mir(test_list, status, ch) +** +** (mir) move in insert mode +*/ +static void +subtest_mir( + struct test_list *t, + int *state, + int *ch) +{ + int i; + char *s; + + if (enter_insert_mode && exit_insert_mode && cursor_address) { + put_clear(); + i = line_count; + put_str("\nXXX\nXXX\nXXX\nXXX"); + tc_putp(enter_insert_mode); + s = tparm(cursor_address, i + 1, 0); + tputs(s, lines, tc_putch); + putchp('X'); + s = tparm(cursor_address, i + 2, 1); + tputs(s, lines, tc_putch); + putchp('X'); + s = tparm(cursor_address, i + 3, 2); + tputs(s, lines, tc_putch); + putchp('X'); + s = tparm(cursor_address, i + 4, 3); + tputs(s, lines, tc_putch); + putchp('X'); + tc_putp(exit_insert_mode); + put_newlines(2); + ptextln("If you see a 4 by 4 block of X's then (mir) should be true."); + sprintf(temp, "(mir) Move-in-insert-mode is %s in the data base", + move_insert_mode ? "true" : "false"); + ptextln(temp); + } else { + ptext("(mir) Move-in-insert-mode not tested, "); + if (!enter_insert_mode) { + ptext("(smir) "); + } + if (!exit_insert_mode) { + ptext("(rmir) "); + } + if (!cursor_address) { + ptext("(cup) "); + } + ptext("not present. "); + } + generic_done_message(t, state, ch); +} + +/* +** subtest_msgr(test_list, status, ch) +** +** (msgr) move in sgr mode +*/ +static void +subtest_msgr( + struct test_list *t, + int *state, + int *ch) +{ + int i; + + if (cursor_address && + ((enter_standout_mode && exit_standout_mode) || + (enter_alt_charset_mode && exit_alt_charset_mode))) { + put_crlf(); + i = line_count + 1; + tputs(tparm(cursor_address, i, 0), lines, tc_putch); + put_mode(enter_alt_charset_mode); + put_crlf(); + /* + some versions of the wy-120 can not clear lines or + screen when in alt charset mode. If (el) and (ed) + are defined then I can test them. If they are not + defined then they can not break (msgr) + */ + tc_putp(clr_eos); + tc_putp(clr_eol); + put_mode(exit_alt_charset_mode); + put_mode(enter_standout_mode); + putchp('X'); + tputs(tparm(cursor_address, i + 2, 1), lines, tc_putch); + putchp('X'); + tputs(tparm(cursor_address, i + 3, 2), lines, tc_putch); + putchp('X'); + tputs(tparm(cursor_address, i + 4, 3), lines, tc_putch); + putchp('X'); + put_mode(exit_standout_mode); + put_crlf(); + tc_putp(clr_eos); /* OK if missing */ + put_crlf(); + ptextln("If you see a diagonal line of standout X's then (msgr) should be true. If any of the blanks are standout then (msgr) should be false."); + sprintf(temp, "(msgr) Move-in-SGR-mode is %s in the data base", + move_standout_mode ? "true" : "false"); + ptextln(temp); + } else { + ptextln("(smso) (rmso) (smacs) (rmacs) missing; (msgr) Move-in-SGR-mode not tested."); + } + generic_done_message(t, state, ch); +} + +/* +** subtest_in(test_list, status, ch) +** +** (in) insert null glitch +*/ +static void +subtest_in( + struct test_list *t, + int *state, + int *ch) +{ + if (enter_insert_mode && exit_insert_mode) { + ptextln("\nTesting (in) with (smir) and (rmir)"); + putln("\tIf these two lines line up ..."); + put_str("\tIf these two lines line up ..."); + put_cr(); + tc_putp(enter_insert_mode); + putchp(' '); + tc_putp(exit_insert_mode); + ptext("\nthen (in) should be set. "); + sprintf(temp, + "(in) Insert-null-glitch is %s in the data base.", + insert_null_glitch ? "true" : "false"); + ptextln(temp); + generic_done_message(t, state, ch); + } +} + +/* +** subtest_dadb(test_list, status, ch) +** +** (da) (db) data above, (db) data below +*/ +static void +subtest_dadb( + struct test_list *t, + int *state, + int *ch) +{ + if (can_clear_screen && scroll_reverse && scroll_forward) { + put_clear(); + if (scroll_reverse) + ptext("(da) Data-above should be set\r"); + home_down(); + if (scroll_forward) + ptext("(db) Data-below should be set\r"); + tc_putp(scroll_forward); + go_home(); + tc_putp(scroll_reverse); + tc_putp(scroll_reverse); + home_down(); + tc_putp(scroll_forward); + go_home(); + ptextln("\n\n\n\n\nIf the top line is blank then (da) should be false."); + ptextln("If the bottom line is blank then (db) should be false."); + sprintf(temp, "\n(da) Data-above is %s, and (db) Data-below is %s, in the data base.", + memory_above ? "true" : "false", + memory_below ? "true" : "false"); + ptextln(temp); + line_count = lines; + } else { + ptextln("(da) Data-above, (db) Data-below not tested, scrolls or (clear) is missing."); + } + generic_done_message(t, state, ch); +} diff --git a/tack/modules b/tack/modules index 334d512c..79c2d226 100644 --- a/tack/modules +++ b/tack/modules @@ -1,47 +1,18 @@ -# $Id: modules,v 1.3 1998/02/11 12:14:03 tom Exp $ -############################################################################## -# 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 -# -ansi tack $(srcdir) -charset tack $(srcdir) -color tack $(srcdir) -control tack $(srcdir) -crum tack $(srcdir) -edit tack $(srcdir) -fun tack $(srcdir) -init tack $(srcdir) -menu tack $(srcdir) -modes tack $(srcdir) -output tack $(srcdir) -pad tack $(srcdir) -scan tack $(srcdir) -sync tack $(srcdir) -sysdep tack $(srcdir) -tack tack $(srcdir) +# $Id: modules,v 1.4 1999/04/18 01:43:32 tom Exp $ +@ base +ansi progs $(srcdir) $(srcdir)/tack.h ../include/term.h +charset progs $(srcdir) $(srcdir)/tack.h ../include/term.h +color progs $(srcdir) $(srcdir)/tack.h ../include/term.h +control progs $(srcdir) $(srcdir)/tack.h ../include/term.h +crum progs $(srcdir) $(srcdir)/tack.h ../include/term.h +edit progs $(srcdir) $(srcdir)/tack.h ../include/term.h $(INCDIR)/tic.h +fun progs $(srcdir) $(srcdir)/tack.h ../include/term.h +init progs $(srcdir) $(srcdir)/tack.h ../include/term.h +menu progs $(srcdir) $(srcdir)/tack.h ../include/term.h +modes progs $(srcdir) $(srcdir)/tack.h ../include/term.h +output progs $(srcdir) $(srcdir)/tack.h ../include/term.h +pad progs $(srcdir) $(srcdir)/tack.h ../include/term.h +scan progs $(srcdir) $(srcdir)/tack.h ../include/term.h +sync progs $(srcdir) $(srcdir)/tack.h ../include/term.h +sysdep progs $(srcdir) $(srcdir)/tack.h ../include/term.h +tack progs $(srcdir) $(srcdir)/tack.h ../include/term.h diff --git a/tack/output.c b/tack/output.c new file mode 100644 index 00000000..3c419a8b --- /dev/null +++ b/tack/output.c @@ -0,0 +1,818 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ +/* screen formatting and I/O utility functions */ + +#include +#include + +MODULE_ID("$Id: output.c,v 1.4 1999/06/16 00:46:53 tom Exp $") + +/* globals */ +long char_sent; /* number of characters sent */ +int char_count; /* counts characters */ +int line_count; /* counts line feeds */ +int expand_chars; /* length of expand() string */ +int replace_mode; /* used to output replace mode padding */ +int can_go_home; /* TRUE if we can fashion a home command */ +int can_clear_screen; /* TRUE if we can somehow clear the screen */ +int raw_characters_sent; /* Total output characters */ +int log_count; /* Number of characters on a log line */ + +/* translate mode default strings */ +#define TM_carriage_return TM_string[0].value +#define TM_cursor_down TM_string[1].value +#define TM_scroll_forward TM_string[2].value +#define TM_newline TM_string[3].value +#define TM_cursor_left TM_string[4].value +#define TM_bell TM_string[5].value +#define TM_form_feed TM_string[6].value +#define TM_tab TM_string[7].value + +struct default_string_list TM_string[TM_last] = { + {"cr", "\r", 0}, + {"cud1", "\n", 0}, + {"ind", "\n", 0}, + {"nel", "\r\n", 0}, + {"cub1", "\b", 0}, + {"bel", "\007", 0}, + {"ff", "\f", 0}, + {"ht", "\t", 0} +}; + +static const char *c0[32] = { + "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", + "BEL", "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", + "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", + "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US" +}; + +static const char *c1[32] = { + "", "", "", "", "IND", "NEL", "SSA", "ESA", + "HTS", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3", + "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA", + "", "", "", "CSI", "ST", "OSC", "PM", "APC" +}; + +int +getnext(int mask) +{ /* get the next character without scan mode + conversion */ + int ch; + unsigned char buf; + + tc_putp(req_for_input); + fflush(stdout); + if (nodelay_read) + while (1) { + ch = read(fileno(stdin), &buf, 1); + if (ch == -1) + return EOF; + if (ch == 1) + return buf; + } + ch = getchar(); + if (ch == EOF) + return EOF; + return ch & mask; +} + + +int +getchp(int mask) +{ /* read a character with scan mode conversion */ + if (scan_mode) { + tc_putp(req_for_input); + fflush(stdout); + return scan_key(); + } else + return getnext(mask); +} + +/* +** tc_putch(c) +** +** Output one character +*/ +int +tc_putch(int c) +{ + char_sent++; + raw_characters_sent++; + putchar(c); + if ((raw_characters_sent & 31) == 31) { + fflush(stdout); + } + if (log_fp) { + /* terminal output logging */ + c &= 0xff; + if (c < 32) { + fprintf(log_fp, "<%s>", c0[c]); + log_count += 5; + } else + if (c < 127) { + fprintf(log_fp, "%c", c); + log_count += 1; + } else { + fprintf(log_fp, "<%02x>", c); + log_count += 4; + } + if (c == '\n' || log_count >= 80) { + fprintf(log_fp, "\n"); + log_count = 0; + } + } + return (c); +} + +/* +** tt_tputs(string, reps) +** +** Output a string with tputs() translation. +** Use this function inside timing tests. +*/ +void +tt_tputs(const char *string, int reps) +{ + int i; + + if (string) { + for (i = 0; i < TT_MAX; i++) { + if (i >= ttp) { + tt_cap[i] = string; + tt_affected[i] = reps; + tt_count[i] = 1; + tt_delay[i] = msec_cost(string, reps); + ttp++; + break; + } + if (string == tt_cap[i] && reps == tt_affected[i]) { + tt_count[i]++; + tt_delay_used += tt_delay[i]; + break; + } + } + (void) tputs(string, reps, tc_putch); + } +} + +/* +** tt_putp(string) +** +** Output a string with tputs() translation. +** Use this function inside timing tests. +*/ +void +tt_putp(const char *string) +{ + tt_tputs(string, 1); +} + +/* +** tt_putparm(string, reps, arg1, arg2, ...) +** +** Send tt_tputs(tparm(string, args...), reps) +** Use this function inside timing tests. +*/ +void +tt_putparm( + NCURSES_CONST char *string, + int reps, + int arg1, + int arg2) +{ + int i; + + if (string) { + for (i = 0; i < TT_MAX; i++) { + if (i >= ttp) { + tt_cap[i] = string; + tt_affected[i] = reps; + tt_count[i] = 1; + tt_delay[i] = msec_cost(string, reps); + ttp++; + break; + } + if (string == tt_cap[i] && reps == tt_affected[i]) { + tt_count[i]++; + tt_delay_used += tt_delay[i]; + break; + } + } + (void) tputs(tparm((NCURSES_CONST char *)string, arg1, arg2), reps, tc_putch); + } +} + +/* +** tc_putp(string) +** +** Output a string with tputs() translation. +** Use this function instead of putp() so we can track +** the actual number of characters sent. +*/ +int +tc_putp(const char *string) +{ + return tputs(string, 1, tc_putch); +} + + +void +put_this(int c) +{ /* output one character (with padding) */ + tc_putch(c); + if (char_padding && replace_mode) + tt_putp(char_padding); +} + + +void +put_cr(void) +{ + if (translate_mode && carriage_return) { + tt_putp(carriage_return); + } else { + tt_putp(TM_carriage_return); + } + char_count = 0; +} + + +void +put_lf(void) +{ /* send a linefeed (only works in RAW or + CBREAK mode) */ + if (translate_mode && cursor_down) { + tt_putp(cursor_down); + } else { + tt_putp(TM_cursor_down); + } + line_count++; +} + + +void +put_ind(void) +{ /* scroll forward (only works in RAW or + CBREAK mode) */ + if (translate_mode && scroll_forward) { + tt_putp(scroll_forward); + } else { + tt_putp(TM_scroll_forward); + } + line_count++; +} + +/* +** put_crlf() +** +** Send (nel) or +*/ +void +put_crlf(void) +{ + if (translate_mode && newline) { + tt_putp(newline); + } else { + tt_putp(TM_newline); + } + char_count = 0; + line_count++; +} + +/* +** put_new_lines(count) +** +** Send a number of newlines. (nel) +*/ +void +put_newlines(int n) +{ + while (n-- > 0) { + put_crlf(); + } +} + +/* +** putchp(character) +** +** Send one character to the terminal. +** This function does translation of control characters. +*/ +void +putchp(int c) +{ + switch (c) { + case '\b': + if (translate_mode && cursor_left) { + tt_putp(cursor_left); + } else { + tt_putp(TM_cursor_left); + } + char_count--; + break; + case 7: + if (translate_mode && bell) { + tt_putp(bell); + } else { + tt_putp(TM_bell); + } + break; + case '\f': + if (translate_mode && form_feed) { + tt_putp(form_feed); + } else { + tt_putp(TM_form_feed); + } + char_count = 0; + line_count++; + break; + case '\n': + put_crlf(); + break; + case '\r': + put_cr(); + break; + case '\t': + if (translate_mode && tab) { + tt_putp(tab); + } else { + tt_putp(TM_tab); + } + char_count = ((char_count / 8) + 1) * 8; + break; + default: + put_this(c); + char_count++; + break; + } +} + + +void +put_str(const char *s) +{ /* send the string to the terminal */ + for (; *s; putchp(*s++)); +} + + +void +putln(const char *s) +{ /* output a string followed by a CR LF */ + for (; *s; putchp(*s++)); + put_crlf(); +} + + +void +put_columns(const char *s, int len, int w) +{ /* put out s in column format */ + int l; + + if (char_count + w > columns) { + put_crlf(); + } + l = char_count % w; + if (l) { + while (l < w) { + putchp(' '); + l++; + } + } + if (char_count && char_count + len >= columns) { + put_crlf(); + } + l = char_count; + put_str(s); + char_count = l + len; +} + + +/* +** ptext(string) +** +** Output a string but do not assume the terminal will wrap to a +** new line. Break the line at a word boundry then send a CR LF. +** This is more estetic on 40 column terminals. +*/ +void +ptext(const char *s) +{ + const char *t; + + while (*s) { + for (t = s + 1; *t > ' '; t++); + if ((char_count != 0) && ((t - s) + char_count >= columns)) { + put_crlf(); + while (*s == ' ') + s++; + } + while (s < t) { + putchp(*s++); + } + } +} + + +void +put_dec(char *f, int i) +{ /* print a line with a decimal number in it */ + char tm[128]; + + sprintf(tm, f, i / 10, i % 10); + ptext(tm); +} + + +void +three_digit(char *tx, int i) +{ /* convert the decimal number to a string of + at least 3 digits */ + if (i < 1000) + sprintf(tx, "%d.%d", i / 10, i % 10); + else + sprintf(tx, "%d", i / 10); +} + + +void +ptextln(const char *s) +{ /* print the text using ptext() then add a CR + LF */ + ptext(s); + put_crlf(); +} + + +static void +expand_one(int ch, char **v) +{ /* expand one character */ + char *t = *v; + + if (ch & 0x80) { /* dump it in octal (yuck) */ + *t++ = '\\'; + *t++ = '0' + ((ch >> 6) & 3); + *t++ = '0' + ((ch >> 3) & 7); + *t++ = '0' + (ch & 7); + expand_chars += 4; + } else if (ch == 127) { /* DEL */ + *t++ = '^'; + *t++ = '?'; + expand_chars += 2; + } else if (ch >= ' ') { + *t++ = ch; + expand_chars++; + } else { /* control characters */ + *t++ = '^'; + *t++ = ch + '@'; + expand_chars += 2; + } + *v = t; +} + + +char * +expand(const char *s) +{ /* convert the string to printable form */ + static char buf[4096]; + char *t, *v; + int ch; + + if (magic_cookie_glitch <= 0 && exit_attribute_mode) { + v = enter_reverse_mode; + } else { + v = NULL; + } + expand_chars = 0; + t = buf; + if (s) { + for (; (ch = *s); s++) { + if ((ch & 0x80) && v) { /* print it in reverse video + mode */ + strcpy(t, liberated(tparm(v))); + for (; *t; t++); + expand_one(ch & 0x7f, &t); + strcpy(t, liberated(tparm(exit_attribute_mode))); + for (; *t; t++); + } else { + expand_one(ch, &t); + } + } + } + *t = '\0'; + return buf; +} + + +char * +print_expand(char *s) +{ /* convert the string to 7-bit printable form */ + static char buf[4096]; + char *t; + int ch; + + expand_chars = 0; + t = buf; + if (s) { + for (; (ch = *s); s++) { + expand_one(ch, &t); + } + } + *t = '\0'; + return buf; +} + + +char * +expand_to(char *s, int l) +{ /* expand s to length l */ + char *t; + + for (s = t = expand(s); *t; t++); + for (; expand_chars < l; expand_chars++) { + *t++ = ' '; + } + *t = '\0'; + return s; +} + + +char * +hex_expand_to(char *s, int l) +{ /* expand s to length l in hex */ + static char buf[4096]; + char *t; + + for (t = buf; *s; s++) { + sprintf(t, "%02X ", *s & 0xff); + t += 3; + if (t - buf > (int) sizeof(buf) - 4) { + break; + } + } + for (; t - buf < l;) { + *t++ = ' '; + } + *t = '\0'; + expand_chars = t - buf; + return buf; +} + + +char * +expand_command(const char *c) +{ /* expand an ANSI escape sequence */ + static char buf[256]; + int i, j, ch; + char *s; + + s = buf; + for (i = FALSE; (ch = (*c & 0xff)); c++) { + if (i) { + *s++ = ' '; + } + i = TRUE; + if (ch < 32) { + j = c[1] & 0xff; + if (ch == '\033' && j >= '@' && j <= '_') { + ch = j - '@'; + c++; + for (j = 0; (*s = c1[ch][j++]); s++); + } else + for (j = 0; (*s = c0[ch][j++]); s++); + } else { + *s++ = ch; + j = c[1] & 0xff; + if (ch >= '0' && ch <= '9' && + j >= '0' && j <= '9') { + i = FALSE; + } + } + } + *s = '\0'; + return buf; +} + +/* +** go_home() +** +** Move the cursor to the home position +*/ +void +go_home(void) +{ + int i; + + if (cursor_home) + tt_putp(cursor_home); + else if (cursor_address) + tt_putparm(cursor_address, lines, 0, 0); + else if (row_address) { /* use (vpa) */ + put_cr(); + tt_putparm(row_address, 1, 0, 0); + } else if (cursor_up && cursor_to_ll) { + tt_putp(cursor_to_ll); + for (i = 1; i < lines; i++) { + tt_putp(cursor_up); + } + } else { + can_go_home = FALSE; + return; + } + char_count = line_count = 0; + can_go_home = TRUE; +} + + +void +home_down(void) +{ /* move the cursor to the lower left hand + corner */ + int i; + + if (cursor_to_ll) + tt_putp(cursor_to_ll); + else if (cursor_address) + tt_putparm(cursor_address, lines, lines - 1, 0); + else if (row_address) { /* use (vpa) */ + put_cr(); + tt_putparm(row_address, 1, lines - 1, 0); + } else if (cursor_down && cursor_home) { + tt_putp(cursor_home); + for (i = 1; i < lines; i++) + tt_putp(cursor_down); + } else + return; + char_count = 0; + line_count = lines - 1; +} + + +void +put_clear(void) +{ /* clear the screen */ + int i; + + if (clear_screen) + tt_tputs(clear_screen, lines); + else if (clr_eos && can_go_home) { + go_home(); + tt_tputs(clr_eos, lines); + } else if (scroll_forward && !over_strike && (can_go_home || cursor_up)) { + /* clear the screen by scrolling */ + put_cr(); + if (cursor_to_ll) { + tt_putp(cursor_to_ll); + } else if (cursor_address) { + tt_putparm(cursor_address, lines, lines - 1, 0); + } else if (row_address) { + tt_putparm(row_address, 1, lines - 1, 0); + } else { + for (i = 1; i < lines; i++) { + tt_putp(scroll_forward); + } + } + for (i = 1; i < lines; i++) { + tt_putp(scroll_forward); + } + if (can_go_home) { + go_home(); + } else { + for (i = 1; i < lines; i++) { + tt_putp(cursor_up); + } + } + } else { + can_clear_screen = FALSE; + return; + } + char_count = line_count = 0; + can_clear_screen = TRUE; +} + +/* +** wait_here() +** +** read one character from the input stream +** If the terminal is not in RAW mode then this function will +** wait for a or . +*/ +int +wait_here(void) +{ + char ch, cc[64]; + char message[16]; + int i, j; + + for (i = 0; i < (int) sizeof(cc); i++) { + cc[i] = ch = getchp(STRIP_PARITY); + if (ch == '\r' || ch == '\n') { + put_crlf(); + char_sent = 0; + return cc[i ? i - 1 : 0]; + } + if (ch >= ' ') { + if (stty_query(TTY_CHAR_MODE)) { + put_crlf(); + char_sent = 0; + return ch; + } + continue; + } + if (ch == 023) { /* Control S */ + /* ignore control S, but tell me about it */ + while (ch == 023 || ch == 021) { + ch = getchp(STRIP_PARITY); + if (i < (int) sizeof(cc)) + cc[++i] = ch; + } + put_str("\nThe terminal sent a ^S -"); + for (j = 0; j <= i; j++) { + sprintf(message, " %02X", cc[j] & 0xFF); + put_str(message); + } + put_crlf(); + i = -1; + } else if (ch != 021) { /* Not Control Q */ + /* could be abort character */ + spin_flush(); + if (tty_can_sync == SYNC_TESTED) { + (void) tty_sync_error(); + } else { + put_str("\n? "); + } + } + } + return '?'; +} + + +/* +** read_string(buffer, length) +** +** Read a string of characters from the input stream. +*/ +void +read_string( + char *buf, + int length) +{ + int ch, i; + + for (i = 0; i < length - 1; ) { + ch = getchp(STRIP_PARITY); + if (ch == '\r' || ch == '\n') { + break; + } + if (ch == '\b' || ch == 127) { + if (i) { + putchp('\b'); + putchp(' '); + putchp('\b'); + i--; + } + } else { + buf[i++] = ch; + putchp(ch); + } + } + buf[i] = '\0'; + put_crlf(); + char_sent = 0; +} + +/* +** maybe_wait(lines) +** +** wait if near the end of the screen, then clear screen +*/ +void +maybe_wait(int n) +{ + if (line_count + n >= lines) { + if (char_sent != 0) { + ptext("Go? "); + (void) wait_here(); + } + put_clear(); + } else { + put_crlf(); + } +} diff --git a/tack/pad.c b/tack/pad.c new file mode 100644 index 00000000..bc6c6933 --- /dev/null +++ b/tack/pad.c @@ -0,0 +1,1955 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include + +MODULE_ID("$Id: pad.c,v 1.1 1998/01/10 00:30:27 tom Exp $") + +/* test the pad counts on the terminal */ + +static void pad_standard(struct test_list *, int *, int *); +static void init_xon_xoff(struct test_list *, int *, int *); +static void init_cup(struct test_list *, int *, int *); +static void pad_rmxon(struct test_list *, int *, int *); +static void pad_home1(struct test_list *, int *, int *); +static void pad_home2(struct test_list *, int *, int *); +static void pad_clear(struct test_list *, int *, int *); +static void pad_ech(struct test_list *, int *, int *); +static void pad_el1(struct test_list *, int *, int *); +static void pad_el(struct test_list *, int *, int *); +static void pad_smdc(struct test_list *, int *, int *); +static void pad_dch(struct test_list *, int *, int *); +static void pad_dch1(struct test_list *, int *, int *); +static void pad_smir(struct test_list *, int *, int *); +static void pad_ich(struct test_list *, int *, int *); +static void pad_ich1(struct test_list *, int *, int *); +static void pad_xch1(struct test_list *, int *, int *); +static void pad_rep(struct test_list *, int *, int *); +static void pad_cup(struct test_list *, int *, int *); +static void pad_hd(struct test_list *, int *, int *); +static void pad_hu(struct test_list *, int *, int *); +static void pad_rin(struct test_list *, int *, int *); +static void pad_il(struct test_list *, int *, int *); +static void pad_indn(struct test_list *, int *, int *); +static void pad_dl(struct test_list *, int *, int *); +static void pad_xl(struct test_list *, int *, int *); +static void pad_scrc(struct test_list *, int *, int *); +static void pad_csrind(struct test_list *, int *, int *); +static void pad_sccsrrc(struct test_list *, int *, int *); +static void pad_csr_nel(struct test_list *, int *, int *); +static void pad_csr_cup(struct test_list *, int *, int *); +static void pad_ht(struct test_list *, int *, int *); +static void pad_smso(struct test_list *, int *, int *); +static void pad_smacs(struct test_list *, int *, int *); +static void pad_crash(struct test_list *, int *, int *); + +extern struct test_menu change_pad_menu; + +/* + Any command found in this list, executed from a "Done" prompt + will force the default action to repeat rather than next. +*/ +const char *pad_repeat_test = {"ep-+<>"}; + +struct test_list pad_test_list[] = { + {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, + {0, 0, 0, 0, "p) change padding", 0, &change_pad_menu}, + {0, 0, 0, 0, "@) display statistics about the last test", dump_test_stats, 0}, + {0, 0, 0, 0, "c) clear screen", menu_clear_screen, 0}, + {0, 0, 0, 0, "i) send reset and init", menu_reset_init, 0}, + {0, 0, 0, 0, txt_longer_test_time, longer_test_time, 0}, + {0, 0, 0, 0, txt_shorter_test_time, shorter_test_time, 0}, + {0, 0, 0, 0, txt_longer_augment, longer_augment, 0}, + {0, 0, 0, 0, txt_shorter_augment, shorter_augment, 0}, + /*** + Phase 1: Test initialization and reset strings. + + (rs1) (rs2) (rs3) (is1) (is2) (is3) are very difficult to test. + They have no defined output. To make matters worse, the cap + builder could partition (rs1) (rs2) (rs3) by length, leaving the + terminal in some unknown state between (rs1) and (rs2) or between + (r2) and (rs3). Some reset strings clear the screen when done. + + We have no control over this. The only thing we can do for + certain is to test the pad times by checking for overruns. + ***/ + {MENU_NEXT, 3, "rs1", 0, 0, pad_standard, 0}, + {MENU_NEXT, 3, "rs2", 0, 0, pad_standard, 0}, + {MENU_NEXT, 3, "rs3", 0, 0, pad_standard, 0}, + {MENU_NEXT | MENU_INIT, 0, 0, 0, 0, init_xon_xoff, 0}, + {MENU_NEXT, 3, "is1", 0, 0, pad_standard, 0}, + {MENU_NEXT, 3, "is2", 0, 0, pad_standard, 0}, + {MENU_NEXT, 3, "is3", 0, 0, pad_standard, 0}, + {MENU_NEXT, 3, "rmxon", "smxon", 0, pad_rmxon, 0}, + {MENU_NEXT | MENU_INIT, 0, 0, 0, 0, init_cup, 0}, + /* + Phase 2: Test home, screen clears and erases. + */ + {MENU_NEXT, 0, "home", 0, 0, pad_home1, 0}, + {MENU_NEXT, 0, "home) (nel", 0, 0, pad_home2, 0}, + {MENU_NEXT | 1, 0, "clear", 0, 0, pad_clear, 0}, + {MENU_NEXT | MENU_LM1, 0, "ed", 0, 0, pad_clear, 0}, + {MENU_NEXT | MENU_80c, 0, "ech", 0, 0, pad_ech, 0}, + {MENU_NEXT | MENU_80c, 0, "el1", "cub1 nel", 0, pad_el1, 0}, + {MENU_NEXT | MENU_10c, 0, "el", "nel", 0, pad_el, 0}, + /* + Phase 3: Character deletions and insertions + */ + {MENU_NEXT, 0, "smdc) (rmdc", 0, 0, pad_smdc, 0}, + {MENU_NEXT | MENU_80c, 0, "dch", "smdc rmdc", 0, pad_dch, 0}, + {MENU_NEXT | MENU_80c, 0, "dch1", "smdc rmdc", 0, pad_dch1, 0}, + {MENU_NEXT, 0, "smir) (rmir", 0, 0, pad_smir, 0}, + {MENU_NEXT | MENU_90c, 0, "ich) (ip", "smir rmir", 0, pad_ich, 0}, + {MENU_NEXT | MENU_90c, 0, "ich1) (ip", "smir rmir", 0, pad_ich1, 0}, + {MENU_NEXT, 4, "ich1) (dch1", "smir rmir", 0, pad_xch1, 0}, + {MENU_NEXT | MENU_90c, 0, "rep", 0, 0, pad_rep, 0}, + /* + Phase 4: Test cursor addressing pads. + */ + {MENU_NEXT, 0, "cup", 0, 0, pad_cup, 0}, + /* + Phase 5: Test scrolling and cursor save/restore. + */ + {MENU_NEXT, 0, "hd", 0, 0, pad_hd, 0}, + {MENU_NEXT, 0, "hu", 0, 0, pad_hu, 0}, + {MENU_NEXT | MENU_LM1 | 1, 0, "rin", 0, 0, pad_rin, 0}, + {MENU_NEXT, 0, "ri", 0, 0, pad_rin, 0}, + {MENU_NEXT | MENU_LM1 | 1, 0, "il", 0, 0, pad_il, 0}, + {MENU_NEXT, 0, "il1", 0, 0, pad_il, 0}, + {MENU_NEXT | MENU_LM1 | 1, 0, "indn", 0, 0, pad_indn, 0}, + {MENU_NEXT, 0, "ind", 0, 0, pad_indn, 0}, + {MENU_NEXT | MENU_LM1 | 1, 0, "dl", 0, 0, pad_dl, 0}, + {MENU_NEXT, 0, "dl1", 0, 0, pad_dl, 0}, + {MENU_NEXT, 0, "il1) (dl1", 0, 0, pad_xl, 0}, + {MENU_NEXT, 0, "sc) (rc", 0, 0, pad_scrc, 0}, + {MENU_NEXT | MENU_50l, 0, "csr) (ind", 0, 0, pad_csrind, 0}, + {MENU_NEXT, 0, "sc) (csr) (rc", 0, 0, pad_sccsrrc, 0}, + {MENU_NEXT, 0, "csr) (nel", "sc rc", 0, pad_csr_nel, 0}, + {MENU_NEXT, 0, "csr) (cup", 0, 0, pad_csr_cup, 0}, + /* + Phase 6: Test tabs. + */ + {MENU_NEXT, 0, "ht", 0, 0, pad_ht, 0}, + /* + Phase 7: Test character-set-switch pads. + */ + {MENU_NEXT, 0, "smso) (rmso", 0, 0, pad_smso, 0}, + {MENU_NEXT, 0, "smacs) (rmacs", 0, 0, pad_smacs, 0}, + /* + Phase 8: Tests for miscellaneous mode-switch pads. + */ + {MENU_NEXT, 3, "flash", 0, 0, pad_standard, 0}, + {MENU_NEXT, 3, "smkx", 0, 0, pad_standard, 0}, + {MENU_NEXT, 3, "rmkx", 0, 0, pad_standard, 0}, + {MENU_NEXT, 3, "smm", 0, 0, pad_standard, 0}, + {MENU_NEXT, 3, "rmm", 0, 0, pad_standard, 0}, + /* + Phase 9: Test crash-and-burn properties of unpadded (clear). + */ + {0, 0, "clear", "xon", "k) run clear test with no padding", pad_crash, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +extern int test_complete; /* counts number of tests completed */ + +/* globals */ +int hzcc; /* horizontal character count */ +char letter; /* current character being displayed */ +int letter_number; /* points into letters[] */ +int augment, repeats; /* number of characters (or lines) effected */ +char letters[] = "AbCdefghiJklmNopQrStuVwXyZ"; + +static char every_line[] = "This text should be on every line."; +static char all_lines[] = "Each char on any line should be the same. "; +static char above_line[] = "The above lines should be all Xs. "; +static char no_visual[] = "This loop test has no visual failure indicator. "; + +/* +** pad_standard(test_list, status, ch) +** +** Run a single cap pad test. +*/ +static void +pad_standard( + struct test_list *t, + int *state, + int *ch) +{ + const char *long_name; + char *cap; + int l = 2, i; + char tbuf[128]; + + if ((cap = get_string_cap_byname(t->caps_done, &long_name))) { + sprintf(tbuf, "(%s) %s, start testing", t->caps_done, + long_name); + if (skip_pad_test(t, state, ch, tbuf)) { + return; + } + i = 1; + pad_test_startup(1); + do { + if (i >= columns) { + page_loop(); + l++; + i = 1; + } + tt_putp(cap); + putchp(letter); + i++; + } while(still_testing()); + pad_test_shutdown(t, 0); + if (l >= lines) { + home_down(); + } else { + put_crlf(); + } + ptextln(no_visual); + } else { + CAP_NOT_FOUND; + /* Note: get_string_cap_byname() always sets long_name */ + sprintf(temp, "(%s) %s, not present. ", t->caps_done, + long_name); + ptext(temp); + } + pad_done_message(t, state, ch); +} + +/* +** init_xon_xoff(test_list, status, ch) +** +** Initialize the xon_xoff values +*/ +static void +init_xon_xoff( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + /* the reset strings may dink with the XON/XOFF modes */ + if (select_xon_xoff == 0 && exit_xon_mode) { + tc_putp(exit_xon_mode); + } + if (select_xon_xoff == 1 && enter_xon_mode) { + tc_putp(enter_xon_mode); + } +} + +/* +** pad_rmxon(test_list, status, ch) +** +** Test (rmxon) exit XON/XOFF mode +*/ +static void +pad_rmxon( + struct test_list *t, + int *state, + int *ch) +{ + if (select_xon_xoff == 0 && exit_xon_mode) { + pad_standard(t, state, ch); + } +} + +/* +** init_cup(test_list, status, ch) +** +** Send the initialization strings for XON/XOFF and (smcup) +** Stop pad testing if clear screen is missing. +*/ +static void +init_cup( + struct test_list *t, + int *state, + int *ch) +{ + init_xon_xoff(t, state, ch); + if (enter_ca_mode) { + tc_putp(enter_ca_mode); + } + if (!can_clear_screen) { + ptext("(clear) clear screen not present,"); + ptext(" pad processing terminated. "); + pad_done_message(t, state, ch); + if (*ch == 0 || *ch == 'n' || *ch == 's' || *ch == 'r') { + *ch = '?'; + } + return; + } +} + +/* +** pad_home1(test_list, status, ch) +** +** Test (home) when (am) is set. +*/ +static void +pad_home1( + struct test_list *t, + int *state, + int *ch) +{ + int j, k; + + if (can_go_home && auto_right_margin) { + /* + truly brain damaged terminals will fail this test because + they cannot accept data at full rate + */ + if (skip_pad_test(t, state, ch, "(home) Home start testing")) { + return; + } + pad_test_startup(1); + do { + go_home(); + for (j = 1; j < lines; j++) { + for (k = 0; k < columns; k++) { + if (k & 0xF) { + put_this(letter); + } else { + put_this('.'); + } + } + SLOW_TERMINAL_EXIT; + } + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + ptext("All the dots should line up. "); + pad_done_message(t, state, ch); + put_clear(); + } +} + +/* +** pad_home2(test_list, status, ch) +** +** Test (home) and (nel). (am) is reset. +*/ +static void +pad_home2( + struct test_list *t, + int *state, + int *ch) +{ + int j, k; + + if (can_go_home) { + if (skip_pad_test(t, state, ch, + "(home) Home, (nel) newline start testing")) { + return; + } + pad_test_startup(1); + do { + go_home(); + for (j = 1; j < lines; j++) { + for (k = 2; k < columns; k++) { + if (k & 0xF) { + put_this(letter); + } else { + put_this('.'); + } + } + put_crlf(); /* this does the (nel) */ + SLOW_TERMINAL_EXIT; + } + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + ptext("All the dots should line up. "); + pad_done_message(t, state, ch); + put_clear(); + } +} + +/* +** pad_clear(test_list, status, ch) +** +** Test (clear) and (ed) +** run the clear screen tests (also clear-to-end-of-screen) +** +** 0) full page +** 1) sparse page +** 2) short lines +** 3) one full line +** 4) one short line +*/ +static void +pad_clear( + struct test_list *t, + int *state, + int *ch) +{ + const char *end_message = 0; + const char *txt; + int j, k, is_clear; + int clear_select; /* select the test number */ + + is_clear = t->flags & 1; + clear_select = auto_right_margin ? 0 : 1; + if (is_clear) { + txt = "(clear) clear-screen start testing"; + } else { + if (!clr_eos) { + CAP_NOT_FOUND; + ptext("(ed) erase-to-end-of-display, not present. "); + pad_done_message(t, state, ch); + return; + } + txt = "(ed) erase-to-end-of-display start testing"; + } + if (skip_pad_test(t, state, ch, txt)) { + return; + } + if (enter_am_mode) { + tc_putp(enter_am_mode); + clear_select = 0; + } + for (; clear_select < 5; clear_select++) { + if (augment > lines || is_clear || !cursor_address) { + augment = lines; + } else { + if (augment <= 1) { + augment = 2; + } + if (augment < lines) { + put_clear(); + tt_putparm(cursor_address, 1, + lines - augment - 1, 0); + ptextln("This line should not be erased (ed)"); + } + } + repeats = augment; + switch (clear_select) { + case 0: + end_message = "Clear full screen. "; + break; + case 1: + end_message = "Clear sparse screen. "; + if (cursor_down) { + break; + } + clear_select++; + case 2: + end_message = "Clear one character per line. "; + if (newline) { + break; + } + clear_select++; + case 3: + end_message = "Clear one full line. "; + break; + case 4: + end_message = "Clear single short line. "; + break; + } + pad_test_startup(0); + do { + switch (clear_select) { + case 0: /* full screen test */ + for (j = 1; j < repeats; j++) { + for (k = 0; k < columns; k++) { + if (k & 0xF) { + put_this(letter); + } else { + put_this('.'); + } + } + SLOW_TERMINAL_EXIT; + } + break; + case 1: /* sparse screen test */ + for (j = columns - repeats; j > 2; j--) { + put_this(letter); + } + for (j = 2; j < repeats; j++) { + tt_putp(cursor_down); + put_this(letter); + } + break; + case 2: /* short lines */ + for (j = 2; j < repeats; j++) { + put_this(letter); + tt_putp(newline); + } + put_this(letter); + break; + case 3: /* one full line */ + for (j = columns - 5; j > 1; j--) { + put_this(letter); + } + break; + case 4: /* one short line */ + put_str("Erase this!"); + break; + } + if (is_clear) { + put_clear(); + } else { + if (augment == lines) { + go_home(); + } else { + tt_putparm(cursor_address, 1, + lines - repeats, 0); + } + tt_tputs(clr_eos, repeats); + } + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 1); + ptext(end_message); + + pad_done_message(t, state, ch); + + if (*ch != 0 && *ch != 'n') { + return; + } + } +} + +/* +** pad_ech(test_list, status, ch) +** +** Test (ech) erase characters +*/ +static void +pad_ech( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!erase_chars) { + CAP_NOT_FOUND; + ptext("(ech) Erase-characters, not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(ech) Erase-characters start testing")) { + return; + } + if (augment > columns - 2) { + augment = columns - 2; + } + pad_test_startup(1); + do { + go_home(); + for (i = 2; i < lines; i++) { + for (j = 0; j <= repeats; j++) { + putchp(letter); + } + put_cr(); + tt_putparm(erase_chars, repeats, repeats, 0); + put_crlf(); + SLOW_TERMINAL_EXIT; + } + for (i = 1; i <= repeats; i++) { + putchp(' '); + } + putchp(letter); + put_crlf(); + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + ptext(all_lines); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_el1(test_list, status, ch) +** +** Test (el1) erase to start of line also (cub1) and (nel) +*/ +static void +pad_el1( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!clr_bol) { + CAP_NOT_FOUND; + ptext("(el1) Erase-to-beginning-of-line, not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(el1) Erase-to-beginning-of-line start testing")) { + return; + } + if (augment > columns - 2) { + augment = columns - 2; + } + pad_test_startup(1); + do { + go_home(); + for (i = 2; i < lines; i++) { + for (j = 0; j <= repeats; j++) { + putchp(letter); + } + tt_putp(cursor_left); + tt_putp(cursor_left); + tt_tputs(clr_bol, repeats); + put_crlf(); + SLOW_TERMINAL_EXIT; + } + for (i = 1; i <= repeats; i++) { + putchp(' '); + } + putchp(letter); + put_crlf(); + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + ptext(all_lines); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_el(test_list, status, ch) +** +** Test (el) clear to end of line also (nel) +*/ +static void +pad_el( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!clr_eol) { + CAP_NOT_FOUND; + ptext("(el) Clear-to-end-of-line, not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(el) Clear-to-end-of-line start testing")) { + return; + } + hzcc = columns * 8 / 10; /* horizontal character count */ + if (augment > hzcc) { + augment = hzcc; + } + pad_test_startup(1); + do { + go_home(); + for (i = 2; i < lines; i++) { + for (j = -1; j < augment; j++) { + putchp(letter); + } + put_cr(); + putchp(letter); + tt_putp(clr_eol); + put_crlf(); + SLOW_TERMINAL_EXIT; + } + putchp(letter); + put_crlf(); + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + ptext(all_lines); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_smdc(test_list, status, ch) +** +** Test (smdc) (rmdc) Delete mode +*/ +static void +pad_smdc( + struct test_list *t, + int *state, + int *ch) +{ + int i; + + if (!enter_delete_mode) { + CAP_NOT_FOUND; + ptext("(smdc) Enter-delete-mode"); + if (!exit_delete_mode) { + ptext(", (rmdc) Exit-delete-mode"); + } + ptext(", not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(smdc) (rmdc) Enter/Exit-delete-mode start testing")) { + return; + } + pad_test_startup(1); + do { + page_loop(); + for (i = 1; i < columns; i++) { + tt_putp(enter_delete_mode); + tt_putp(exit_delete_mode); + putchp(letter); + } + } while(still_testing()); + pad_test_shutdown(t, 0); + home_down(); + ptext(no_visual); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_dch(test_list, status, ch) +** +** Test (smdc) (rmdc) Delete mode and (dch) +*/ +static void +pad_dch( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!parm_dch) { + CAP_NOT_FOUND; + ptext("(dch) Delete-characters, not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(dch) Delete-characters start testing")) { + return; + } + hzcc = columns * 8 / 10; /* horizontal character count */ + if (augment > hzcc) { + augment = hzcc; + } + pad_test_startup(1); + do { + go_home(); + for (i = 2; i < lines; i++) { + for (j = 0; j <= repeats; j++) { + putchp(letter); + } + put_cr(); + tt_putp(enter_delete_mode); + tt_putparm(parm_dch, repeats, repeats, 0); + tt_putp(exit_delete_mode); + put_crlf(); + SLOW_TERMINAL_EXIT; + } + putchp(letter); + put_crlf(); + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + home_down(); + ptext(all_lines); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_dch1(test_list, status, ch) +** +** Test (smdc) (rmdc) Delete mode and (dch1) +*/ +static void +pad_dch1( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!delete_character) { + if (parm_dch) { + /* if the other one is defined then its OK */ + return; + } + CAP_NOT_FOUND; + ptext("(dch1) Delete-character, not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(dch1) Delete-character start testing")) { + return; + } + hzcc = columns * 8 / 10; /* horizontal character count */ + if (augment > hzcc) { + augment = hzcc; + } + pad_test_startup(1); + do { + go_home(); + for (i = 2; i < lines; i++) { + for (j = -1; j < augment; j++) { + putchp(letter); + } + put_cr(); + tt_putp(enter_delete_mode); + for (j = 0; j < augment; j++) { + tt_putp(delete_character); + } + tt_putp(exit_delete_mode); + put_crlf(); + SLOW_TERMINAL_EXIT; + } + putchp(letter); + put_crlf(); + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + ptext(all_lines); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_smir(test_list, status, ch) +** +** Test (smir) (rmir) Insert mode +*/ +static void +pad_smir( + struct test_list *t, + int *state, + int *ch) +{ + int i; + + if (!enter_insert_mode) { + CAP_NOT_FOUND; + ptext("(smir) Enter-insert-mode"); + if (!exit_insert_mode) { + ptext(", (rmir) Exit-insert-mode"); + } + ptext(", not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(smir) (rmir) Enter/Exit-insert-mode start testing")) { + return; + } + pad_test_startup(1); + do { + page_loop(); + for (i = 1; i < columns; i++) { + tt_putp(enter_insert_mode); + tt_putp(exit_insert_mode); + putchp(letter); + } + } while(still_testing()); + pad_test_shutdown(t, 0); + home_down(); + ptext(no_visual); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_ich(test_list, status, ch) +** +** Test (smir) (rmir) Insert mode and (ich) and (ip) +*/ +static void +pad_ich( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!parm_ich) { + CAP_NOT_FOUND; + ptext("(ich) Insert-characters, not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(ich) Insert-characters, (ip) Insert-padding start testing")) { + return; + } + j = columns * 9 / 10; + if (augment > j) { + augment = j; + } + pad_test_startup(1); + do { + go_home(); + for (i = 2; i < lines; i++) { + putchp(letter); + put_cr(); + tt_putp(enter_insert_mode); + replace_mode = 0; + tt_putparm(parm_ich, repeats, repeats, 0); + tt_putp(exit_insert_mode); + replace_mode = 1; + put_crlf(); + SLOW_TERMINAL_EXIT; + } + for (i = 0; i < repeats; i++) { + putchp(' '); + } + putchp(letter); + NEXT_LETTER; + put_crlf(); + } while(still_testing()); + pad_test_shutdown(t, 0); + ptext(all_lines); + pad_done_message(t, state, ch); + tc_putp(exit_insert_mode); +} + +/* +** pad_ich1(test_list, status, ch) +** +** Test (smir) (rmir) Insert mode and (ich1) and (ip) +*/ +static void +pad_ich1( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!insert_character) { + CAP_NOT_FOUND; + ptext("(ich1) Insert-character, not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(ich1) Insert-character, (ip) Insert-padding start testing")) { + return; + } + if (augment > columns - 2) { + augment = columns - 2; + } + pad_test_startup(1); + do { + put_clear(); + for (i = 2; i < lines; i++) { + putchp(letter); + put_cr(); + tt_putp(enter_insert_mode); + replace_mode = 0; + if (!insert_padding && !insert_character) { + /* only enter/exit is needed */ + for (j = 0; j < augment; j++) { + putchp('.'); + } + } else { + for (j = 0; j < augment; j++) { + tt_putp(insert_character); + putchp('.'); + tt_putp(insert_padding); + } + } + tt_putp(exit_insert_mode); + replace_mode = 1; + put_crlf(); + SLOW_TERMINAL_EXIT; + } + for (j = 0; j < augment; j++) { + putchp('.'); + } + putchp(letter); + NEXT_LETTER; + put_crlf(); + } while(still_testing()); + pad_test_shutdown(t, 0); + ptext(all_lines); + pad_done_message(t, state, ch); + tc_putp(exit_insert_mode); +} + +/* +** pad_xch1(test_list, status, ch) +** +** Test (ich1) (ip) (dch1) +*/ +static void +pad_xch1( + struct test_list *t, + int *state, + int *ch) +{ + static char xch1[] = + "This line should not be garbled. It should be left justified."; + + if (enter_insert_mode || exit_insert_mode || + enter_delete_mode || exit_delete_mode || + !insert_character || !delete_character) { + /* this test is quitely ignored */ + return; + } + if (skip_pad_test(t, state, ch, + "(ich1) Insert-character, (dch1) Delete-character start testing")) { + return; + } + put_crlf(); + ptext(xch1); + put_cr(); + pad_test_startup(0); + do { + tt_putp(insert_character); + tt_putp(delete_character); + } while(still_testing()); + pad_test_shutdown(t, 1); + ptextln(xch1); + ptext("The preceeding two lines should be the same. "); + pad_done_message(t, state, ch); +} + +/* +** pad_rep(test_list, status, ch) +** +** Test (rep) repeat character +*/ +static void +pad_rep( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!repeat_char) { + CAP_NOT_FOUND; + ptext("(rep) Repeat-character, not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(rep) Repeat-character start testing")) { + return; + } + if (augment > columns - 2) { + augment = columns - 2; + } + if (augment < 2) { + augment = 2; + } + pad_test_startup(1); + do { + go_home(); + for (i = 2; i < lines; i++) { + tt_putparm(repeat_char, repeats, letter, repeats); + put_crlf(); + } + for (j = 0; j < repeats; j++) { + putchp(letter); + } + put_crlf(); + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + ptextln(all_lines); + pad_done_message(t, state, ch); +} + +/* +** pad_cup(test_list, status, ch) +** +** Test (cup) Cursor address +*/ +static void +pad_cup( + struct test_list *t, + int *state, + int *ch) +{ + int i, j, l, r, c; + + if (!cursor_address) { + CAP_NOT_FOUND; + ptext("(cup) Cursor-address not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(cup) Cursor-address start testing")) { + return; + } + put_clear(); + ptext("Each line should be filled with the same letter. There should"); + ptext(" be no gaps, or single letters scattered over the screen. "); + if (char_count + 15 > columns) { + put_crlf(); + } + if (((lines - line_count) & 1) == 0) { + /* this removes the gap in the middle of the test when the + number of lines is odd. */ + put_crlf(); + } + r = line_count; + c = char_count; + l = (columns - 4) >> 1; + pad_test_startup(0); + do { + for (i = 1; i + i + r < lines; i++) { + for (j = 0; j <= l; j++) { + tt_putparm(cursor_address, 1, r + i, j); + putchp(letter); + tt_putparm(cursor_address, 1, r + i, l + l + 1 - j); + putchp(letter); + tt_putparm(cursor_address, 1, lines - i, j); + putchp(letter); + tt_putparm(cursor_address, 1, lines - i, l + l + 1 - j); + putchp(letter); + } + SLOW_TERMINAL_EXIT; + } + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + tt_putparm(cursor_address, 1, line_count = r, char_count = c); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_hd(test_list, status, ch) +** +** Test (hd) Half down +*/ +static void +pad_hd( + struct test_list *t, + int *state, + int *ch) +{ + int i, j, k; + + if (!down_half_line) { + CAP_NOT_FOUND; + ptext("(hd) Half-line-down not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(hd) Half-line-down start testing")) { + return; + } + pad_test_startup(1); + do { + for (i = 1; i < columns; i += 2) { + for (j = 1; j < i; ++j) { + putchp(' '); + } + tt_putp(down_half_line); + for (k = lines + lines; k > 4; k--) { + if (j++ >= columns) { + break; + } + tt_putp(down_half_line); + putchp(letter); + } + go_home(); + SLOW_TERMINAL_EXIT; + } + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_hu(test_list, status, ch) +** +** Test (hu) Half line up +*/ +static void +pad_hu( + struct test_list *t, + int *state, + int *ch) +{ + int i, j, k; + + if (!up_half_line) { + CAP_NOT_FOUND; + ptext("(hu) Half-line-up not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(hu) Half-line-up start testing")) { + return; + } + pad_test_startup(1); + do { + for (i = 1; i < columns; i += 2) { + home_down(); + for (j = 1; j < i; ++j) { + putchp(' '); + } + tt_putp(up_half_line); + for (k = lines + lines; k > 4; k--) { + if (j++ >= columns) { + break; + } + tt_putp(up_half_line); + putchp(letter); + } + SLOW_TERMINAL_EXIT; + } + go_home(); + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, 0); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_rin(test_list, status, ch) +** +** Test (rin) and (ri) Reverse index +*/ +static void +pad_rin( + struct test_list *t, + int *state, + int *ch) +{ + int i; + const char *start_message; + + if (t->flags & 1) { + /* rin */ + if (!parm_rindex) { + CAP_NOT_FOUND; + ptext("(rin) Scroll-reverse-n-lines not present. "); + pad_done_message(t, state, ch); + return; + } + start_message = "(rin) Scroll-reverse-n-lines start testing"; + } else { + /* ri */ + if (!scroll_reverse) { + CAP_NOT_FOUND; + ptext("(ri) Scroll-reverse not present. "); + pad_done_message(t, state, ch); + return; + } + start_message = "(ri) Scroll-reverse start testing"; + augment = 1; + } + if (skip_pad_test(t, state, ch, start_message)) { + return; + } + pad_test_startup(1); + do { + sprintf(temp, "%d\r", test_complete); + put_str(temp); + if (scroll_reverse && augment == 1) { + tt_putp(scroll_reverse); + } else { + tt_putparm(parm_rindex, repeats, repeats, 0); + } + } while(still_testing()); + put_str("This line should be on the bottom.\r"); + if (scroll_reverse && augment == 1) { + for (i = 1; i < lines; i++) { + tt_putp(scroll_reverse); + } + } else { + tt_putparm(parm_rindex, lines - 1, lines - 1, 0); + } + putln("The screen should have text on the bottom line."); + sprintf(temp, "Scroll reverse %d line%s. ", augment, + augment == 1 ? "" : "s"); + put_str(temp); + pad_test_shutdown(t, 0); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_il(test_list, status, ch) +** +** Test (il) and (il1) Insert line +*/ +static void +pad_il( + struct test_list *t, + int *state, + int *ch) +{ + int i; + const char *start_message; + + if (t->flags & 1) { + /* il */ + if (!parm_insert_line) { + CAP_NOT_FOUND; + ptext("(il) Insert-lines not present. "); + pad_done_message(t, state, ch); + return; + } + start_message = "(il) Insert-lines start testing"; + } else { + /* il1 */ + if (!insert_line) { + CAP_NOT_FOUND; + ptext("(il1) Insert-line not present. "); + pad_done_message(t, state, ch); + return; + } + start_message = "(il1) Insert-line start testing"; + augment = 1; + } + if (skip_pad_test(t, state, ch, start_message)) { + return; + } + pad_test_startup(1); + do { + sprintf(temp, "%d\r", test_complete); + put_str(temp); + if (insert_line && repeats == 1) { + tt_putp(insert_line); + } else { + tt_putparm(parm_insert_line, repeats, repeats, 0); + } + } while(still_testing()); + put_str("This line should be on the bottom.\r"); + if (scroll_reverse && augment == 1) { + for (i = 1; i < lines; i++) { + tt_putp(insert_line); + } + } else { + tt_putparm(parm_insert_line, lines - 1, lines - 1, 0); + } + putln("The screen should have text on the bottom line."); + sprintf(temp, "Insert %d line%s. ", augment, + augment == 1 ? "" : "s"); + put_str(temp); + pad_test_shutdown(t, 0); + pad_done_message(t, state, ch); + put_clear(); +} + +/* +** pad_indn(test_list, status, ch) +** +** Test (indn) and (ind) Scroll forward +*/ +static void +pad_indn( + struct test_list *t, + int *state, + int *ch) +{ + int i; + const char *start_message; + + if (t->flags & 1) { + /* indn */ + if (!parm_index) { + CAP_NOT_FOUND; + ptext("(indn) Scroll-forward-n-lines not present. "); + pad_done_message(t, state, ch); + return; + } + start_message = "(indn) Scroll-forward-n-lines start testing"; + } else { + /* ind */ + if (!scroll_forward && over_strike) { + CAP_NOT_FOUND; + ptext("(ind) Scroll-forward not tested on overstrike terminals. "); + pad_done_message(t, state, ch); + return; + } + start_message = "(ind) Scroll-forward start testing"; + augment = 1; + } + if (skip_pad_test(t, state, ch, start_message)) { + return; + } + pad_test_startup(1); + /* go to the bottom of the screen */ + home_down(); + do { + sprintf(temp, "%d\r", test_complete); + put_str(temp); + if (augment > 1) { + tt_putparm(parm_index, repeats, repeats, 0); + } else { + put_ind(); + } + } while(still_testing()); + put_str("This line should be on the top.\r"); + if (augment == 1) { + for (i = 1; i < lines; i++) { + put_ind(); + } + } else { + tt_putparm(parm_index, lines - 1, lines - 1, 0); + } + go_home(); + sprintf(temp, "\nScroll forward %d line%s. ", augment, + augment == 1 ? "" : "s"); + put_str(temp); + pad_test_shutdown(t, 0); + pad_done_message(t, state, ch); +} + +/* +** pad_dl(test_list, status, ch) +** +** Test (dl) and (dl1) Delete lines +*/ +static void +pad_dl( + struct test_list *t, + int *state, + int *ch) +{ + int i = 0; + const char *start_message; + + if (t->flags & 1) { + /* dl */ + if (!parm_delete_line) { + CAP_NOT_FOUND; + ptext("(dl) Delete-lines not present. "); + pad_done_message(t, state, ch); + return; + } + start_message = "(dl) Delete-lines start testing"; + } else { + /* dl1 */ + if (!delete_line) { + CAP_NOT_FOUND; + ptext("(dl1) Delete-line not present. "); + pad_done_message(t, state, ch); + return; + } + start_message = "(dl1) Delete-line start testing"; + augment = 1; + } + if (skip_pad_test(t, state, ch, start_message)) { + return; + } + pad_test_startup(1); + do { + sprintf(temp, "%d\r", test_complete); + if ((i & 0x7f) == 0 && augment < lines - 1) { + go_home(); + putln(temp); + } + put_str(temp); + if (repeats || !delete_line) { + tt_putparm(parm_delete_line, repeats, repeats, 0); + } else { + tt_putp(delete_line); + } + } while(still_testing()); + home_down(); + put_str("This line should be on the top."); + go_home(); + if (repeats || !delete_line) { + tt_putparm(parm_delete_line, lines - 1, lines - 1, 0); + } else { + for (i = 1; i < lines; i++) { + tt_putp(delete_line); + } + } + sprintf(temp, "\nDelete %d line%s. ", augment, + augment == 1 ? "" : "s"); + put_str(temp); + pad_test_shutdown(t, 0); + pad_done_message(t, state, ch); +} + +/* +** pad_xl(test_list, status, ch) +** +** Test (il1) Insert and (dl1) Delete lines +*/ +static void +pad_xl( + struct test_list *t, + int *state, + int *ch) +{ + if (!insert_line && !delete_line) { + /* quietly skip this test */ + return; + } + if (skip_pad_test(t, state, ch, + "(il1) Insert-line, (dl1) Delete-line start testing")) { + return; + } + put_clear(); + putln("\rThis text is written on the first line."); + ptext("This sentence begins on the second line. As this"); + ptext(" test runs the bottom part of this paragraph will"); + ptext(" jump up and down. Don't worry, that's normal. When"); + ptext(" the jumping stops, the entire paragraph should"); + ptext(" still be on the screen and in the same place as when"); + ptext(" the test started. If this paragraph has scrolled"); + ptext(" off the top or bottom of the screen then the test"); + ptext(" has failed. Scrolling off the top of the screen"); + ptext(" usually means that the delete line capability is"); + ptext(" working better than the insert line capability. If"); + ptext(" the text scrolls off the bottom then delete line may"); + ptext(" be broken. If parts of the text are missing then"); + ptext(" you should get professional help."); + put_crlf(); + go_home(); + put_newlines(2); + pad_test_startup(0); + do { + tt_putp(insert_line); + put_cr(); + tt_putp(delete_line); + } while(still_testing()); + pad_test_shutdown(t, 0); + home_down(); + ptext("The top of the screen should have a paragraph of text. "); + pad_done_message(t, state, ch); +} + +/* +** pad_scrc(test_list, status, ch) +** +** Test (sc) (rc) Save/restore cursor +*/ +static void +pad_scrc( + struct test_list *t, + int *state, + int *ch) +{ + int i; + + if (!save_cursor || !restore_cursor) { + CAP_NOT_FOUND; + if (save_cursor) { + ptext("(rc) Restore-cursor"); + } else + if (restore_cursor) { + ptext("(sc) Save-cursor"); + } else { + ptext("(sc) Save-cursor, (rc) Restore-cursor"); + } + ptext(" not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(sc) (rc) Save/Restore-cursor start testing")) { + return; + } + pad_test_startup(1); + do { + page_loop(); + for (i = 1; i < columns; i++) { + tt_putp(save_cursor); + putchp(letter); + tt_putp(restore_cursor); + putchp('X'); + } + } while(still_testing()); + pad_test_shutdown(t, 0); + home_down(); + ptext(above_line); + pad_done_message(t, state, ch); +} + +/* +** pad_csrind(test_list, status, ch) +** +** Test (csr) and (ind) Change scroll region and index. +*/ +static void +pad_csrind( + struct test_list *t, + int *state, + int *ch) +{ + int i; + + if (!change_scroll_region) { + CAP_NOT_FOUND; + ptext("(csr) Change-scroll-region not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(csr) Save/Restore-cursor, (ind) index start testing")) { + return; + } + if (augment < 2) { + augment = 2; + } + if (augment > lines - 1) { + augment = lines - 1; + } + put_clear(); + ptext("This text is on the top line."); + tt_putparm(change_scroll_region, 1, lines - augment, lines - 1); + /* go to the bottom of the screen */ + home_down(); + pad_test_startup(0); + do { + sprintf(temp, "%d\r", test_complete); + put_str(temp); + put_ind(); + } while(still_testing()); + ptextln("(csr) is broken."); + for (i = augment; i > 1; i--) { + put_ind(); + } + pad_test_shutdown(t, 0); + ptext("All but top and bottom lines should be blank. "); + pad_done_message(t, state, ch); + tt_putparm(change_scroll_region, 1, 0, lines - 1); + put_clear(); +} + +/* +** pad_sccsrrc(test_list, status, ch) +** +** Test (sc) (csr) and (rc) Save/Change/Restore scroll region +*/ +static void +pad_sccsrrc( + struct test_list *t, + int *state, + int *ch) +{ + int i; + + if (!save_cursor || !change_scroll_region || !restore_cursor) { + /* quietly ignore this test */ + return; + } + if (skip_pad_test(t, state, ch, + "(sc) (csr) (rc) Save/Change/Restore-cursor, start testing")) { + return; + } + pad_test_startup(1); + do { + page_loop(); + for (i = 1; i < columns; i++) { + tt_putp(save_cursor); + putchp(letter); + tt_putparm(change_scroll_region, 1, 0, lines - 1); + tt_putp(restore_cursor); + putchp('X'); + } + } while(still_testing()); + pad_test_shutdown(t, 0); + home_down(); + ptext(above_line); + pad_done_message(t, state, ch); + tt_putparm(change_scroll_region, 1, 0, lines - 1); +} + +/* +** pad_csr_nel(test_list, status, ch) +** +** Test (sc) (csr) (nel) and (rc) Save/Change/Restore scroll region +*/ +static void +pad_csr_nel( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!save_cursor || !change_scroll_region || !restore_cursor) { + /* quietly ignore this test */ + return; + } + if (skip_pad_test(t, state, ch, + "(csr) Change-scroll-region, (nel) newline start testing")) { + return; + } + pad_test_startup(1); + do { + for (i = 0; i < lines; i++) { + for (j = lines - i; j > 0; j--) { + put_crlf(); + } + tt_putp(save_cursor); + tt_putparm(change_scroll_region, 1, i, lines - 1); + tt_putp(restore_cursor); + put_str(every_line); + } + tt_putp(save_cursor); + tt_putparm(change_scroll_region, 1, 0, lines - 1); + tt_putp(restore_cursor); + } while(still_testing()); + pad_test_shutdown(t, 0); + put_str(" "); + pad_done_message(t, state, ch); + tt_putparm(change_scroll_region, 1, 0, lines - 1); +} + +/* +** pad_csr_cup(test_list, status, ch) +** +** Test (csr) (cup) Change scroll region and cursor address +*/ +static void +pad_csr_cup( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!change_scroll_region || !cursor_address) { + /* quietly ignore this test */ + return; + } + if (skip_pad_test(t, state, ch, + "(csr) Change-scroll-region, (cup) cursor-address start testing")) { + return; + } + pad_test_startup(1); + do { + for (i = 0; i < lines; i++) { + for (j = lines - i; j > 0; j--) { + put_crlf(); + } + tt_putparm(change_scroll_region, 1, i, lines - 1); + tt_putparm(cursor_address, 1, lines - 1, 0); + put_str(every_line); + } + tt_putparm(change_scroll_region, 1, 0, lines - 1); + tt_putparm(cursor_address, 1, lines - 1, strlen(every_line)); + } while(still_testing()); + pad_test_shutdown(t, 0); + put_str(" "); + pad_done_message(t, state, ch); + tt_putparm(change_scroll_region, 1, 0, lines - 1); +} + +/* +** pad_ht(test_list, status, ch) +** +** Test (ht) Tabs +*/ +static void +pad_ht( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!set_tab && init_tabs <= 0) { + CAP_NOT_FOUND; + ptext("(ht) Tab not tested. (hts) Set-tabs and (it) initial-tabs not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, "(ht) Tab start testing")) { + return; + } + pad_test_startup(1); + do { + /* + it is not always possible to test tabs with caps + that do not already have padding. The following + test uses a mixed bag of tests in order to avoid + this problem. Note: I do not scroll + */ + if (auto_right_margin && can_go_home) + for (i = 1, go_home(); i < lines - 2; i++) { + for (j = 8; j < columns; j += 8) { + putchp('\t'); + } + put_str("A "); + } + if (cursor_down && can_go_home) + for (i = 1, go_home(); i < lines - 2; i++) { + for (j = 8; j < columns; j += 8) { + putchp('\t'); + } + put_str("D\r"); + tt_putp(cursor_down); + } + if (cursor_address) + for (i = 1; i < lines - 2; i++) { + tt_putparm(cursor_address, 1, i - 1, 0); + for (j = 8; j < columns; j += 8) { + putchp('\t'); + } + put_str("C"); + } + go_home(); + for (i = 1; i < lines - 2; i++) { + for (j = 8; j < columns; j += 8) { + putchp('\t'); + } + putln("N"); + } + } while(still_testing()); + pad_test_shutdown(t, 0); + ptextln("Letters on the screen other than Ns at the right margin indicate failure."); + ptext("A-(am) D-(cud1) C-(cup) N-(nel) "); + pad_done_message(t, state, ch); +} + +/* +** pad_smso(test_list, status, ch) +** +** Test (smso) (rmso) Enter/exit mode +*/ +static void +pad_smso( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + if (!enter_standout_mode || !exit_standout_mode) { + CAP_NOT_FOUND; + ptext("(smso) (rmso) Enter/Exit-standout-mode not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(smso) (rmso) Enter/Exit-standout-mode start testing")) { + return; + } + /* + In terminals that emulate non-hidden attributes with hidden + attributes, the amount of time that it takes to fill the screen + with an attribute is nontrivial. The following test is designed to + catch those delays + */ + pad_test_startup(1); + do { + page_loop(); + j = magic_cookie_glitch > 0 ? magic_cookie_glitch : 0; + for (i = 2 + j + j; i < columns;) { + put_mode(enter_standout_mode); + i += j + j + 2; + putchp('X'); + put_mode(exit_standout_mode); + putchp('X'); + } + } while(still_testing()); + pad_test_shutdown(t, 0); + home_down(); + ptext(above_line); + pad_done_message(t, state, ch); + put_mode(exit_standout_mode); +} + +/* +** pad_smacs(test_list, status, ch) +** +** Test (smacs) (rmacs) Enter/exit altcharset mode +*/ +static void +pad_smacs( + struct test_list *t, + int *state, + int *ch) +{ + int i, j; + + /* test enter even if exit is missing */ + if (!enter_alt_charset_mode) { + CAP_NOT_FOUND; + ptext("(smacs) Enter-altcharset-mode not present. "); + pad_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(smacs) (rmacs) Enter/Exit-altcharset-mode start testing")) { + return; + } + pad_test_startup(1); + do { + page_loop(); + j = magic_cookie_glitch > 0 ? magic_cookie_glitch : 0; + for (i = 2 + j + j; i < columns;) { + put_mode(enter_alt_charset_mode); + i += j + j + 2; + putchp(letter); + put_mode(exit_alt_charset_mode); + putchp(letter); + } + } while(still_testing()); + pad_test_shutdown(t, 0); + home_down(); + ptext("Every other character is from the alternate character set. "); + pad_done_message(t, state, ch); + put_mode(exit_alt_charset_mode); +} + +/* +** pad_crash(test_list, status, ch) +** +** Test (clear) without padding +*/ +static void +pad_crash( + struct test_list *t, + int *state, + int *ch) +{ + int save_xon_xoff; + + if (!clear_screen) { + ptext("(clear) Clear-screen not present. "); + pad_done_message(t, state, ch); + return; + } + ptext("If you would like to see if the terminal will really lock up."); + ptextln(" I will send the clear screen sequence without the pads."); + if (skip_pad_test(t, state, ch, + "(clear) Clear-screen start crash testing")) { + return; + } + save_xon_xoff = xon_xoff; + xon_xoff = 1; + pad_test_startup(0); + do { + put_str("Erase this!"); + tt_putp(clear_screen); + } while(still_testing()); + xon_xoff = save_xon_xoff; + pad_test_shutdown(t, 1); + pad_done_message(t, state, ch); +} diff --git a/tack/scan.c b/tack/scan.c new file mode 100644 index 00000000..d9429c96 --- /dev/null +++ b/tack/scan.c @@ -0,0 +1,261 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ +/* scan mode keyboard support */ + +#include + +MODULE_ID("$Id: scan.c,v 1.2 1999/08/21 23:09:35 tom Exp $") + +int scan_max; /* length of longest scan code */ +char **scan_up, **scan_down, **scan_name; +int *scan_tested, *scan_length, *scan_value; + +static int shift_state; +static char *str; +static int debug_char_count; + +#define SHIFT_KEY 0x100 +#define CONTROL_KEY 0x200 +#define META_KEY 0x400 +#define CAPS_LOCK 0x800 + +static const struct { + const char *name; + int type; +} scan_special[] = { + {"", SHIFT_KEY}, + {"", SHIFT_KEY}, + {"", SHIFT_KEY}, + {"", CONTROL_KEY}, + {"", CONTROL_KEY}, + {"", CONTROL_KEY}, + {"", META_KEY}, + {"", META_KEY}, + {"", META_KEY}, + {"", CAPS_LOCK}, + {"", '\t'}, + {"", ' '}, + {"", '\r'}, + {"", '\n'}, + {"", '\f'}, + {"", '\b'}, + {0, 0} +}; + +static void +scan_blanks(void) +{ /* scan past the white space */ + while (*str == ' ' || *str == '\t') + str++; +} + +static char * +smash(void) +{ /* convert a string to hex */ + char *s, *t; + int ch, i, j; + + t = s = str; + for (i = 0; (ch = *str); str++) { + if (ch >= '0' && ch <= '9') + j = ch - '0'; + else if (ch >= 'a' && ch <= 'f') + j = 10 - 'a' + ch; + else if (ch >= 'A' && ch <= 'F') + j = 10 - 'A' + ch; + else if (ch == ' ' || ch == '\t') + break; + else + continue; + if (i) { + *s |= j; + s++; + } else + *s = j << 4; + i ^= 1; + } + *s = '\0'; + return t; +} + +void +scan_init(char *fn) +{ /* read the scan mode key definitions */ + char *s, *sl; + FILE *fp; + int ch, i, j; + char home[512]; + + if ((str = getenv("HOME"))) + strcpy(home, str); + else + home[0] = '\0'; + fp = NULL; + if ((str = getenv("KEYBOARD"))) { + if (!(fp = fopen(str, "r")) && home[0]) { + sprintf(temp, "%s/.scan.%s", home, str); + fp = fopen(temp, "r"); + } + } + if (!fp) { + sprintf(temp, ".scan.%s", fn); + fp = fopen(temp, "r"); + } + if (!fp && home[0]) { + sprintf(temp, "%s/.scan.%s", home, fn); + fp = fopen(temp, "r"); + } + if (!fp) { + ptext("Unable to open scanfile: "); + ptextln(temp); + bye_kids(1); + return; + } + /* + scan file format: + + + + values are in hex. may be any string of characters + + */ + scan_up = (char **) malloc(sizeof(char *) * MAX_SCAN); + scan_down = (char **) malloc(sizeof(char *) * MAX_SCAN); + scan_name = (char **) malloc(sizeof(char *) * MAX_SCAN); + scan_tested = (int *) malloc(sizeof(int *) * MAX_SCAN); + scan_length = (int *) malloc(sizeof(int *) * MAX_SCAN); + scan_value = (int *) malloc(sizeof(int *) * MAX_SCAN); + scan_up[0] = scan_down[0] = scan_name[0] = (char *) 0; + str = (char *) malloc(4096); /* buffer space */ + sl = str + 4000; /* an upper limit */ + scan_max = 1; + for (i = 0;;) { + for (s = str; (ch = getc(fp)) != EOF;) { + if (ch == '\n' || ch == '\r') + break; + *s++ = ch; + } + *s++ = '\0'; + if (ch == EOF) + break; + if (*str == '#' || *str == '\0') + continue; + scan_down[i] = smash(); + scan_blanks(); + scan_up[i] = smash(); + scan_blanks(); + scan_name[i] = str; + + scan_length[i] = strlen(scan_down[i]); + ch = strlen(scan_up[i]) + scan_length[i]; + if (ch > scan_max) + scan_max = ch; + + scan_value[i] = scan_name[i][0]; + if (scan_name[i][1]) /* multi-character name */ + for (j = 0; scan_special[j].name; j++) { + if (!strcmp(scan_name[i], scan_special[j].name)) { + scan_value[i] = scan_special[j].type; + break; + } + } + + i++; + if (str > sl) { + str = (char *) malloc(4096); + sl = str + 4000; + } else + str = s; + } + fclose(fp); +#ifdef notdef + for (i = 0; scan_down[i]; i++) { + put_str(hex_expand_to(scan_down[i], 3)); + put_str(hex_expand_to(scan_up[i], 3)); + put_str(" "); + put_str(scan_name[i]); + put_crlf(); + } + (void) wait_here(); +#endif +} + +int +scan_key(void) +{ /* read a key and translate scan mode to + ASCII */ + int i, j, ch; + char buf[64]; + + for (i = 1;; i++) { + ch = getchar(); + if (ch == EOF) + return EOF; + if (debug_fp) { + fprintf(debug_fp, "%02X ", ch); + debug_char_count += 3; + if (debug_char_count > 72) { + fprintf(debug_fp, "\n"); + debug_char_count = 0; + } + } + buf[i - 1] = ch; + buf[i] = '\0'; + if (buf[0] & 0x80) { /* scan up */ + for (j = 0; scan_up[j]; j++) { + if (i == scan_length[j] && + !strcmp(buf, scan_up[j])) { + i = 0; + shift_state &= ~scan_value[j]; + break; + } + } + continue; + } + for (j = 0; scan_down[j]; j++) { + if (i == scan_length[j] && !strcmp(buf, scan_down[j])) { + i = 0; + shift_state |= scan_value[j]; + ch = scan_value[j]; + if (ch == CAPS_LOCK) + shift_state ^= SHIFT_KEY; + if (ch >= 256) + break; + if (shift_state & SHIFT_KEY) { + if (ch >= 0x60) + ch -= 0x20; + else if (ch >= 0x30 && ch <= 0x3f) + ch -= 0x10; + } + if (shift_state & CONTROL_KEY) { + if ((ch | 0x20) >= 0x60 && + (ch | 0x20) <= 0x7f) + ch = (ch | 0x20) - 0x60; + } + if (shift_state & META_KEY) + ch |= 0x80; + return ch; + } + } + if (i > scan_max) + i = 1; + } +} diff --git a/tack/sync.c b/tack/sync.c new file mode 100644 index 00000000..d8866a0e --- /dev/null +++ b/tack/sync.c @@ -0,0 +1,424 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include +#include + +MODULE_ID("$Id: sync.c,v 1.1 1998/01/10 00:31:07 tom Exp $") + +/* terminal-synchronization and performance tests */ + +static void sync_home(struct test_list *, int *, int *); +static void sync_lines(struct test_list *, int *, int *); +static void sync_clear(struct test_list *, int *, int *); +static void sync_summary(struct test_list *, int *, int *); + +struct test_list sync_test_list[] = { + {MENU_NEXT, 0, 0, 0, "b) baud rate test", sync_home, 0}, + {MENU_NEXT, 0, 0, 0, "l) scroll performance", sync_lines, 0}, + {MENU_NEXT, 0, 0, 0, "c) clear screen performance", sync_clear, 0}, + {MENU_NEXT, 0, 0, 0, "p) summary of results", sync_summary, 0}, + {0, 0, 0, 0, txt_longer_test_time, longer_test_time, 0}, + {0, 0, 0, 0, txt_shorter_test_time, shorter_test_time, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +struct test_menu sync_menu = { + 0, 'n', 0, + "Performance tests", "perf", "n) run standard tests", + sync_test, sync_test_list, 0, 0, 0 +}; + +int tty_can_sync; /* TRUE if tty_sync_error() returned FALSE */ +int tty_newline_rate; /* The number of newlines per second */ +int tty_clear_rate; /* The number of clear-screens per second */ +int tty_cps; /* The number of characters per second */ + +#define TTY_ACK_SIZE 64 + +int ACK_terminator; /* terminating ACK character */ +int ACK_length; /* length of ACK string */ +const char *tty_ENQ; /* enquire string */ +char tty_ACK[TTY_ACK_SIZE]; /* ACK response, set by tty_sync_error() */ + +/***************************************************************************** + * + * Terminal synchronization. + * + * These functions handle the messy business of enq-ack handshaking + * for timing purposes. + * + *****************************************************************************/ + +int +tty_sync_error(void) +{ + int ch, trouble, ack; + + trouble = FALSE; + for (;;) { + tt_putp(tty_ENQ); /* send ENQ */ + ch = getnext(STRIP_PARITY); + event_start(TIME_SYNC); /* start the timer */ + + /* + The timer doesn't start until we get the first character. + After that I expect to get the remaining characters of + the acknowledge string in a short period of time. If + that is not true then these characters are coming from + the user and we need to send the ENQ sequence out again. + */ + for (ack = 0; ; ) { + if (ack < TTY_ACK_SIZE - 2) { + tty_ACK[ack] = ch; + tty_ACK[ack + 1] = '\0'; + } + if (ch == ACK_terminator) { + return trouble; + } + if (++ack >= ACK_length) { + return trouble; + } + ch = getnext(STRIP_PARITY); + if (event_time(TIME_SYNC) > 400000) { + break; + } + } + + set_attr(0); /* just in case */ + put_crlf(); + if (trouble) { + /* The terminal won't sync. Life is not good. */ + return TRUE; + } + put_str(" -- sync -- "); + trouble = TRUE; + } +} + +/* +** flush_input() +** +** Throw away any output. +*/ +void +flush_input(void) +{ + if (tty_can_sync == SYNC_TESTED && ACK_terminator >= 0) { + (void) tty_sync_error(); + } else { + spin_flush(); + } +} + +/* +** probe_enq_ok() +** +** does the terminal do enq/ack handshaking? +*/ +static void +probe_enq_ok(void) +{ + int tc, len, ulen; + + put_str("Testing ENQ/ACK, standby..."); + fflush(stdout); + can_test("u8 u9", FLAG_TESTED); + + tty_ENQ = user9 ? user9 : "\005"; + tc_putp(tty_ENQ); + event_start(TIME_SYNC); /* start the timer */ + read_key(tty_ACK, TTY_ACK_SIZE - 1); + + if (event_time(TIME_SYNC) > 400000 || tty_ACK[0] == '\0') { + /* These characters came from the user. Sigh. */ + tty_can_sync = SYNC_FAILED; + ptext("\nThis program expects the ENQ sequence to be"); + ptext(" answered with the ACK character. This will help"); + ptext(" the program reestablish synchronization when"); + ptextln(" the terminal is overrun with data."); + ptext("\nENQ sequence from (u9): "); + putln(expand(tty_ENQ)); + ptext("ACK recieved: "); + putln(expand(tty_ACK)); + len = user8 ? strlen(user8) : 0; + sprintf(temp, "Length of ACK %d. Expected length of ACK %d.", + (int) strlen(tty_ACK), len); + ptextln(temp); + if (len) { + temp[0] = user8[len - 1]; + temp[1] = '\0'; + ptext("Terminating character found in (u8): "); + putln(expand(temp)); + } + return; + } + + tty_can_sync = SYNC_TESTED; + if ((len = strlen(tty_ACK)) == 1) { + /* single character acknowledge string */ + ACK_terminator = tty_ACK[0]; + ACK_length = 4096; + return; + } + tc = tty_ACK[len - 1]; + if (user8) { + ulen = strlen(user8); + if (tc == user8[ulen - 1]) { + /* ANSI style acknowledge string */ + ACK_terminator = tc; + ACK_length = 4096; + return; + } + } + /* fixed length acknowledge string */ + ACK_length = len; + ACK_terminator = -2; +} + +/* +** verify_time() +** +** verify that the time tests are ready to run. +** If the baud rate is not set then compute it. +*/ +void +verify_time(void) +{ + int status, ch; + + if (tty_can_sync == SYNC_FAILED) { + return; + } + probe_enq_ok(); + put_crlf(); + if (tty_can_sync == SYNC_TESTED) { + put_crlf(); + if (ACK_terminator >= 0) { + ptext("ACK terminating character: "); + temp[0] = ACK_terminator; + temp[1] = '\0'; + ptextln(expand(temp)); + } else { + sprintf(temp, "Fixed length ACK, %d characters", + ACK_length); + ptextln(temp); + } + } + if (tty_baud_rate == 0) { + sync_home(&sync_test_list[0], &status, &ch); + } +} + +/***************************************************************************** + * + * Terminal performance tests + * + * Find out how fast the terminal can: + * 1) accept characters + * 2) scroll the screen + * 3) clear the screen + * + *****************************************************************************/ + +/* +** sync_home(test_list, status, ch) +** +** Baudrate test +*/ +void +sync_home( + struct test_list *t, + int *state, + int *ch) +{ + int j, k; + unsigned long rate; + + if (!cursor_home && !cursor_address && !row_address) { + ptext("Terminal can not home cursor. "); + generic_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(home) Start baudrate search")) { + return; + } + pad_test_startup(1); + do { + go_home(); + for (j = 1; j < lines; j++) { + for (k = 0; k < columns; k++) { + if (k & 0xF) { + put_this(letter); + } else { + put_this('.'); + } + } + SLOW_TERMINAL_EXIT; + } + NEXT_LETTER; + } while(still_testing()); + pad_test_shutdown(t, auto_right_margin == 0); + /* note: tty_frame_size is the real framesize times two. + This takes care of half bits. */ + rate = (tx_cps * tty_frame_size) >> 1; + if (rate > tty_baud_rate) { + tty_baud_rate = rate; + } + if (tx_cps > tty_cps) { + tty_cps = tx_cps; + } + sprintf(temp, "%d characters per second. Baudrate %d ", tx_cps, j); + ptext(temp); + generic_done_message(t, state, ch); +} + +/* +** sync_lines(test_list, status, ch) +** +** How many newlines/second? +*/ +static void +sync_lines( + struct test_list *t, + int *state, + int *ch) +{ + int j; + + if (skip_pad_test(t, state, ch, + "(nel) Start scroll performance test")) { + return; + } + pad_test_startup(0); + repeats = 100; + do { + sprintf(temp, "%d", test_complete); + put_str(temp); + put_newlines(repeats); + } while(still_testing()); + pad_test_shutdown(t, 0); + j = sliding_scale(tx_count[0], 1000000, usec_run_time); + if (j > tty_newline_rate) { + tty_newline_rate = j; + } + sprintf(temp, "%d linefeeds per second. ", j); + ptext(temp); + generic_done_message(t, state, ch); +} + +/* +** sync_clear(test_list, status, ch) +** +** How many clear-screens/second? +*/ +static void +sync_clear( + struct test_list *t, + int *state, + int *ch) +{ + int j; + + if (!clear_screen) { + ptext("Terminal can not clear-screen. "); + generic_done_message(t, state, ch); + return; + } + if (skip_pad_test(t, state, ch, + "(clear) Start clear-screen performance test")) { + return; + } + pad_test_startup(0); + repeats = 20; + do { + sprintf(temp, "%d", test_complete); + put_str(temp); + for (j = 0; j < repeats; j++) { + put_clear(); + } + } while(still_testing()); + pad_test_shutdown(t, 0); + j = sliding_scale(tx_count[0], 1000000, usec_run_time); + if (j > tty_clear_rate) { + tty_clear_rate = j; + } + sprintf(temp, "%d clear-screens per second. ", j); + ptext(temp); + generic_done_message(t, state, ch); +} + +/* +** sync_symmary(test_list, status, ch) +** +** Print out the test results. +*/ +static void +sync_summary( + struct test_list *t, + int *state, + int *ch) +{ + char size[32]; + + put_crlf(); + ptextln("Terminal size characters/sec linefeeds/sec clears/sec"); + sprintf(size, "%dx%d", columns, lines); + sprintf(temp, "%-10s%-11s%11d %11d %11d", tty_basename, size, + tty_cps, tty_newline_rate, tty_clear_rate); + ptextln(temp); + generic_done_message(t, state, ch); +} + +/* +** sync_test(menu) +** +** Run at the beginning of the pad tests and function key tests +*/ +void +sync_test( + struct test_menu *menu) +{ + control_init(); + if (tty_can_sync == SYNC_NOT_TESTED) { + verify_time(); + } + if (menu->menu_title) { + put_crlf(); + ptextln(menu->menu_title); + } +} + +/* +** sync_handshake(test_list, status, ch) +** +** Test or retest the ENQ/ACK handshake +*/ +void +sync_handshake( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + tty_can_sync = SYNC_NOT_TESTED; + verify_time(); +} diff --git a/tack/sysdep.c b/tack/sysdep.c new file mode 100644 index 00000000..c07b4d9d --- /dev/null +++ b/tack/sysdep.c @@ -0,0 +1,469 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ +/* + * Operating system dependant functions. We assume the POSIX API. + * Note: on strict-POSIX systems (including BSD/OS) the select_delay_type + * global has no effect. + */ + +#if defined(__BEOS__) +#include +#endif + +#include + +#include +#include +#include + +#if HAVE_SELECT +#if HAVE_SYS_TIME_H && HAVE_SYS_TIME_SELECT +#include +#endif +#if HAVE_SYS_SELECT_H +#include +#endif +#endif + +MODULE_ID("$Id: sysdep.c,v 1.6 1999/09/04 13:45:00 tom Exp $") + +#if DECL_ERRNO +extern int errno; +#endif + +/* globals */ +int tty_frame_size; /* asynch frame size times 2 */ +unsigned long tty_baud_rate; /* baud rate - bits per second */ +int not_a_tty; /* TRUE if output is not a tty (i.e. pipe) */ +int nodelay_read; /* TRUE if NDELAY is set */ + +#define TTY_IS_NOECHO !(new_modes.c_lflag & ECHO) +#define TTY_IS_OUT_TRANS (new_modes.c_oflag & OPOST) +#define TTY_IS_CHAR_MODE !(new_modes.c_lflag & ICANON) +#define TTY_WAS_CS8 ((old_modes.c_cflag & CSIZE) == CS8) +#define TTY_WAS_XON_XOFF (old_modes.c_iflag & (IXON|IXOFF)) + +static TTY old_modes, new_modes; + +void catchsig(void); + +/* + * These are a sneaky way of conditionalizing bit unsets so strict-POSIX + * systems won't see them. + */ +#ifndef XCASE +#define XCASE 0 +#endif +#ifndef OLCUC +#define OLCUC 0 +#endif +#ifndef IUCLC +#define IUCLC 0 +#endif +#ifndef TABDLY +#define TABDLY 0 +#endif +#ifndef IXANY +#define IXANY 0 +#endif + +void +tty_raw(int minch GCC_UNUSED, int mask) +{ /* set tty to raw noecho */ + new_modes = old_modes; +#if HAVE_SELECT + new_modes.c_cc[VMIN] = 1; +#else + new_modes.c_cc[VMIN] = minch; +#endif + new_modes.c_cc[VTIME] = 2; + new_modes.c_lflag &= + ~(ISIG | ICANON | XCASE | ECHO | ECHOE | ECHOK | ECHONL); +#ifdef LOBLK + new_modes.c_lflag &= ~LOBLK; +#endif + new_modes.c_oflag &= ~(OPOST | OLCUC | TABDLY); + if (mask == ALLOW_PARITY) { + new_modes.c_cflag &= ~(CSIZE | PARENB | HUPCL); + new_modes.c_cflag |= CS8; + } + new_modes.c_iflag &= + ~(IGNBRK | BRKINT | IGNPAR | PARMRK | INPCK | ISTRIP | INLCR | IGNCR | ICRNL | + IUCLC | IXON | IXANY | IXOFF); + if (not_a_tty) + return; + tcsetattr(fileno(stdin), TCSAFLUSH, &new_modes); +} + +void +tty_set(void) +{ /* set tty to special modes */ + new_modes = old_modes; + new_modes.c_cc[VMIN] = 1; + new_modes.c_cc[VTIME] = 1; + new_modes.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL); +#if defined(ONLCR) && defined(OCRNL) && defined(ONLRET) && defined(OFILL) + new_modes.c_oflag &= ~(ONLCR | OCRNL | ONLRET | OFILL); +#else + new_modes.c_oflag &= ~(OPOST); +#endif + if (char_mask == ALLOW_PARITY) + new_modes.c_iflag &= ~ISTRIP; + switch (select_xon_xoff) { + case 0: + new_modes.c_iflag &= ~(IXON | IXOFF); + break; + case 1: +#if sequent + /* the sequent System V emulation is broken */ + new_modes = old_modes; + new_modes.c_cc[VEOL] = 6; /* control F (ACK) */ +#endif + new_modes.c_iflag |= IXON | IXOFF; + break; + } + switch (select_delay_type) { + case 0: +#ifdef NLDLY + new_modes.c_oflag &= + ~(NLDLY | CRDLY | TABDLY | BSDLY | VTDLY | FFDLY); +#endif /* NLDLY */ + break; + case 1: +#ifdef NLDLY + new_modes.c_oflag &= + ~(NLDLY | CRDLY | TABDLY | BSDLY | VTDLY | FFDLY); +#endif /* NLDLY */ +#ifdef NL1 + new_modes.c_oflag |= NL1 | CR2; +#endif /* NL1 */ + break; + } + if (!(new_modes.c_oflag & ~OPOST)) + new_modes.c_oflag &= ~OPOST; + if (not_a_tty) + return; + tcsetattr(fileno(stdin), TCSAFLUSH, &new_modes); +} + + +void +tty_reset(void) +{ /* reset the tty to the original modes */ + fflush(stdout); + if (not_a_tty) + return; + tcsetattr(fileno(stdin), TCSAFLUSH, &old_modes); +} + + +void +tty_init(void) +{ /* ATT terminal init */ +#if defined(F_GETFL) && defined(O_NDELAY) + int flags; + + flags = fcntl(fileno(stdin), F_GETFL, 0); + nodelay_read = flags & O_NDELAY; +#else + nodelay_read = FALSE; +#endif + not_a_tty = FALSE; + if (tcgetattr(fileno(stdin), &old_modes) == -1) { + if (errno == ENOTTY) { + tty_frame_size = 20; + not_a_tty = TRUE; + return; + } + printf("tcgetattr error: %d\n", errno); + exit(1); + } + /* if TAB3 is set then setterm() wipes out tabs (ht) */ + new_modes = old_modes; +#ifdef TABDLY + new_modes.c_oflag &= ~TABDLY; +#endif /* TABDLY */ + if (tcsetattr(fileno(stdin), TCSAFLUSH, &new_modes) == -1) { + printf("tcsetattr error: %d\n", errno); + exit(1); + } +#ifdef sequent + /* the sequent ATT emulation is broken soooo. */ + old_modes.c_cflag &= ~(CSIZE | CSTOPB); + old_modes.c_cflag |= CS7 | PARENB; +#endif + catchsig(); + switch (old_modes.c_cflag & CSIZE) { +#if defined(CS5) && (CS5 != 0) + case CS5: + tty_frame_size = 10; + break; +#endif +#if defined(CS6) && (CS6 != 0) + case CS6: + tty_frame_size = 12; + break; +#endif +#if defined(CS7) && (CS7 != 0) + case CS7: + tty_frame_size = 14; + break; +#endif +#if defined(CS8) && (CS8 != 0) + case CS8: + tty_frame_size = 16; + break; +#endif + } + tty_frame_size += 2 + + ((old_modes.c_cflag & PARENB) ? 2 : 0) + + ((old_modes.c_cflag & CSTOPB) ? 4 : 2); +} + +/* +** stty_query(question) +** +** Does the current driver settings have this property? +*/ +int +stty_query(int q) +{ + switch (q) { + case TTY_NOECHO: + return TTY_IS_NOECHO; + case TTY_OUT_TRANS: + return TTY_IS_OUT_TRANS; + case TTY_CHAR_MODE: + return TTY_IS_CHAR_MODE; + } + return (-1); +} + +/* +** initial_stty_query(question) +** +** Did the initial driver settings have this property? +*/ +int +initial_stty_query(int q) +{ + switch (q) { + case TTY_8_BIT: + return TTY_WAS_CS8; + case TTY_XON_XOFF: + return TTY_WAS_XON_XOFF; + } + return (-1); +} + +#if HAVE_SELECT && defined(FD_ZERO) +static int +char_ready(void) +{ + int n; + fd_set ifds; + struct timeval tv; + + FD_ZERO(&ifds); + FD_SET(fileno(stdin), &ifds); + tv.tv_sec = 0; + tv.tv_usec = 200000; + n = select(fileno(stdin)+1, &ifds, NULL, NULL, &tv); + return (n != 0); +} + +#else +#ifdef FIONREAD +int +char_ready(void) +{ + int i, j; + + /* the following loop has to be tuned for each computer */ + for (j = 0; j < 1000; j++) { + ioctl(fileno(stdin), FIONREAD, &i); + if (i) + return i; + } + return i; +} + +#else +#if defined(__BEOS__) +int +char_ready(void) +{ + int n = 0; + int howmany = ioctl(0, 'ichr', &n); + return (howmany >= 0 && n > 0); +} +#else +#define char_ready() 1 +#endif +#endif +#endif + +/* +** spin_flush() +** +** Wait for the input stream to stop. +** Throw away all input characters. +*/ +void +spin_flush(void) +{ + unsigned char buf[64]; + + fflush(stdout); + event_start(TIME_FLUSH); /* start the timer */ + do { + if (char_ready()) { + (void) read(fileno(stdin), &buf, sizeof(buf)); + } + } while (event_time(TIME_FLUSH) < 400000); +} + +/* +** read_key(input-buffer, length-of-buffer) +** +** read one function key from the input stream. +** A null character is converted to 0x80. +*/ +void +read_key(char *buf, int max) +{ + int got, ask, i, l; + char *s; + + *buf = '\0'; + s = buf; + fflush(stdout); + /* ATT unix may return 0 or 1, Berkeley Unix should be 1 */ + while (read(fileno(stdin), s, 1) == 0); + ++s; + --max; + while (max > 0 && (ask = char_ready())) { + if (ask > max) { + ask = max; + } + if ((got = read(fileno(stdin), s, ask))) { + s += got; + } else { + break; + } + max -= got; + } + *s = '\0'; + l = s - buf; + for (s = buf, i = 0; i < l; i++) { + if ((*s & 0x7f) == 0) { + /* convert nulls to 0x80 */ + *(unsigned char *)s = 128; + } else { + /* strip high order bits (if any) */ + *s &= char_mask; + } + } +} + + +void +ignoresig(void) +{ + /* ignore signals */ + signal(SIGINT, SIG_IGN); + signal(SIGHUP, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + signal(SIGTERM, SIG_IGN); + signal(SIGALRM, SIG_IGN); +} + + /* + onintr( ) + + is the interrupt handling routine onintr turns off interrupts while doing + clean-up + + onintr always exits fatally + */ + + +static RETSIGTYPE +onintr(int sig GCC_UNUSED) +{ + ignoresig(); + tty_reset(); + exit(1); +} + + + /* + catchsig( ) + + set up to field interrupts (via function onintr( )) so that if interrupted + we can restore the correct terminal modes + + catchsig simply returns + */ + + +void +catchsig(void) +{ + if ((signal(SIGINT, SIG_IGN)) == SIG_DFL) + signal(SIGINT, onintr); + + if ((signal(SIGHUP, SIG_IGN)) == SIG_DFL) + signal(SIGHUP, onintr); + + if ((signal(SIGQUIT, SIG_IGN)) == SIG_DFL) + signal(SIGQUIT, onintr); + + if ((signal(SIGTERM, SIG_IGN)) == SIG_DFL) + signal(SIGTERM, onintr); + +} + +/* +** alarm_event(sig) +** +** Come here for an alarm event +*/ +static void +alarm_event( + int sig GCC_UNUSED) +{ + no_alarm_event = 0; +} + +/* +** set_alarm_clock(seconds) +** +** Set the alarm clock to fire in +*/ +void +set_alarm_clock( + int seconds) +{ + signal(SIGALRM, alarm_event); + no_alarm_event = 1; + (void) alarm(seconds); +} diff --git a/tack/tack.1 b/tack/tack.1 new file mode 100644 index 00000000..be74e585 --- /dev/null +++ b/tack/tack.1 @@ -0,0 +1,311 @@ +.TH tack 1M "" +.ds n 5 +.ds d @TERMINFO@ +.SH NAME +\fBtack\fR - \fIterminfo\fR action checker +.SH SYNOPSIS +\fBtack\fR [-itV] [term] +.br +.SH DESCRIPTION +The \fBtack\fR program has three purposes: +(1) to help you build a new terminfo entry describing an unknown terminal, +(2) to test the correctness of an existing entry, and +(3) to develop the correct pad timings needed to ensure that screen updates +don't fall behind the incoming data stream. +.PP +\fBTack\fR presents a series of screen-painting and interactive +tests in ways which are intended to make any mismatches between the +terminfo entry and reality visually obvious. +\fBTack\fR also provides tools that can help in understanding how +the terminal operates. +.SS OPTIONS +.TP +.I "\-i" +Usually \fBtack\fR will send the reset and init strings to the terminal +when the program starts up. The \fI-i\fR option will inhibit the +terminal initialization. +.TP +.I "\-t" +Tell \fBtack\fR to override the terminfo settings for basic terminal +functions. When this option is set \fBtack\fR will translate +(cr) to \\r, (cud1) to \\n, (ind) to \\n, (nel) to \\r\\n, +(cub1) to \\b, (bel) to \\007, (ff) to \\f and (ht) to \\t. +.TP +.I "\-V" +Display the version information and exit. +.TP +.I "term" +Terminfo terminal name to be tested. If not present then the $TERM +environment variable will be used. +.SH OVERVIEW +Since \fBtack\fR is designed to test terminfo's it is not possible +to rely on the correctness of the terminfo data base. Because of this +the menuing system used with \fBtack\fR is vary primitive. When a +menu is printed it will scroll the entire screen. To compensate +for this verbose menu system \fBtack\fR permits menu selection +type ahead. +If you already know what action you would like \fBtack\fR to perform +then you can enter that value immediately and avoid the menu display. +When in doubt the question mark (?) is a good character to type. +A carriage return will execute the default action. These default +actions are designed to run all the standard tests. +.PP +When \fBtack\fR first comes up it will display some basic information +about the terminal. Take some time to verify this information. +If it is wrong many of the subsequent tests will fail. The most +important item is the screen size. If the screen size is wrong there +is no point in proceeding. (home) and (clear) are also critical +to the success of subsequent tests. The values of (cr) (ind) +(cub1) and (ht) may effect the tests if they are defined incorrectly. +If they are undefined \fBtack\fR will set them to reasonable defaults. +The last two entries on the display are the enquire and acknowledge strings. +These strings are taken from the user strings (u9) and (u8). +.PP +By now you must be wondering why the terminfo names are enclosed +in parenthesis. This has no profound meaning other than it makes +them stand out. The \fBtack\fR program uses this convention any time +it displays a terminfo name. Remember \fBtack\fR is designed to +rely on as little of the terminfo entry as possible. +.SH CREATING NEW ENTRIES +\fBTack\fR has a number of tools that are designed to help gather +information about the terminal. Although these functions are not +dependent on terminal type, you may wish to execute \fBtack\fR +with options \fI\-it\fR. This will turn off initialization +and default the standard entries. +.PP +These tools may be reached from the main menu by selecting +the 'tools' entry. +.PP +\fBEcho tool\fR: All data typed from the keyboard will be echoed back +to the terminal. Control characters are not translated to the up arrow format +but are sent as control characters. This allows you to test an escape +sequence and see what it actually does. You may also elect to +\fBenable hex output on echo tool\fR this will echo the characters in +hexadecimal. Once the test is running you may enter the 'lines' +or 'columns' keywords which will display a pattern that will help +you determine your screen size. A complete list of keywords will +be displayed when the test starts. Type 'help' to redisplay +the list of available commands. +.PP +\fBReply tool\fR: This tool acts much like the echo tool, but +control characters that are sent from the terminal more than one character +after a carriage return will be expanded to the up arrow format. For example +on a standard ANSI terminal you may type: + + CR ESC [ c + +and the response will be echoed as something like: + + ^[ [ ? 6 c +.PP +\fBANSI sgr display\fR: This test assumes you have an ANSI terminal. It +goes through attribute numbers 0 to 79, displaying each in turn and using that +SGR number to write the text. This shows you which of the SGR +modes are actually implemented by the terminal. Note: some terminals (such as +Tektronix color) use the private use characters to augment the functionality of +the SGR command. These private use characters may be interjected into the +escape sequence by typing the character ( <, =, >, ? ) after the original +display has been shown. +.PP +\fBANSI status reports\fR: This test queries the terminal in standard +ANSI/VT-100 fashion. The results of this test may help +determine what options are supported by your terminal. +.PP +\fBANSI character sets\fR: This test displays the character sets +available on a ANSI/VT-100 style terminal. +Character sets on a real VT-100 terminal are usually defined +with smacs=\\E(0 and rmacs=\\E(B. The first character after the +escape defines the font bank. The second character defines the +character set. This test allows you to view any of the possible +combinations. Private use character sets are defined by the digits. +Standard character sets are located in the alphabetic range. +.SH VERIFYING AN EXISTING ENTRY +.PP +You can verify the correctness of an entry with the `begin testing' +function. This entry is the default action and will be chosen +if you hit carriage return (or enter). This will bring up a +secondary menu that allows you to select more specific tests. +.PP +The general philosophy of the program is, for each capability, to send an +appropriate test pattern to the terminal then send a description of +what the user should expect. Occasionally (as when checking function-key +capabilities) the program will ask you to enter input for it to check. +.PP +If the test fails then you have the option of dynamically changing +the terminfo entry and re-running the test. This is done with +the 'edit terminfo' menu item. The edit submenu allows you to change +the offending terminfo entry and immediately retest the capability. +The edit menu lets you do other things with the terminfo, such as; +display the entire terminfo entry, +display which caps have been tested and display which caps cannot +be tested. This menu also allows you to write the newly modified +terminfo to disc. If you have made any modifications to the +terminfo \fBtack\fR will ask you if you want to save the file +to disc before it exits. The filename will be the same as the terminal name. +After the program exits you can run the tic(1M) compiler on the +new terminfo to install it in the terminfo data base. +.PP +.SH CORRECTING PAD TIMINGS +.SS Theory of Overruns and Padding +.PP +Some terminals require significant amounts of time (that is, more than one +transmitted-character interval) to do screen updates that change large +portions of the screen, such as screen clears, line insertions, +line deletions, and scrolls (including scrolls triggered by line feeds +or a write to the lowest, right-hand-most cell of the screen). +.PP +If the computer continues to send characters to the terminal while one +of these time-consuming operations is going on, the screen may be garbled. +Since the length of a character transmission time varies inversely with +transmission speed in cps, entries which function at lower speeds may +break at higher speeds. +.PP +Similar problems result if the host machine is simply sending characters at a +sustained rate faster than the terminal can buffer and process them. In either +case, when the terminal cannot process them and can't tell the host to stop +soon enough, it will just drop them. The dropped characters could be text, +escape sequences or the escape character itself, causing some really +strange-looking displays. This kind of glitch is called an \fIoverrun\fR. +.PP +In terminfo entries, you can attach a \fBpad time\fR to each string capability +that is a number of milliseconds to delay after sending it. This will give +the terminal time to catch up and avoid overruns. +.PP +If you are running a software terminal emulator, or you are on an X pseudo-tty, +or your terminal is on an RS-232C line which correctly handles RTS/CTS +hardware flow control, then pads are not strictly necessary. However, some +display packages (such as ncurses(3X)) use the pad counts to calculate +the fastest way to implement certain functions. +For example: scrolling the screen may be faster than deleting the top line. +.PP +One common way to avoid overruns is with XON/XOFF handshaking. +But even this handshake may have problems at high baud rates. +This is a result of the way XON/XOFF works. The terminal tells +the host to stop with an XOFF. When the host gets this character, it stops +sending. However, there is a small amount of time between the stop request and +the actual stop. During this window, the terminal must continue to accept +characters even though it has told the host to stop. If the terminal sends +the stop request too late, then its internal buffer will overflow. If it sends +the stop character too early, then the terminal is not getting the most +efficient use out of its internal buffers. In a real application at high baud +rates, a terminal could get a dozen or more characters before the host gets +around to suspending transmission. Connecting the terminal over a network +will make the problem much worse. +.PP +(RTS/CTS handshaking does not have this problem because the UARTs are +signal-connected and the "stop flow" is done at the lowest level, without +software intervention). +.PP +.SS Timing your terminal +.PP +In order to get accurate timings from your terminal \fBtack\fR +needs to know when the terminal has finished processing all the +characters that were sent. This requires a different type of handshaking +than the XON/XOFF that is supported by most terminals. \fBTack\fR +needs to send a request to the terminal and wait for its reply. +Many terminals will respond with an ACK when they receive an ENQ. +This is the preferred method since the sequence is short. +ANSI/VT-100 style terminals can mimic this handshake with the +escape sequence that requests 'primary device attributes'. + + ESC [ c + +The terminal will respond with a sequence like: + + ESC [ ? 1 ; 0 c + +\fBTack\fR assumes that (u9) is the enquire sequence and that (u8) is the +acknowledge string. A VT-100 style terminal could set u9=\\E[c +and u8=\\E[?1;0c. +Acknowledge strings fall into two categories. +1) Strings with a unique terminating character and, +2) strings of fixed length. +The acknowledge string for the VT-100 is of the first type since +it always ends with the letter 'c'. Some Tektronics terminals +have fixed length acknowledge strings. \fBTack\fR supports both +types of strings by scanning for the terminating character until +the length of the expected acknowledge string has arrived. +(u8) should be set to some typical acknowledge that will be +returned when (u9) is sent. +.PP +\fBTack\fR will test this sequence before running any of the pad +tests or the function key tests. \fBTack\fR will ask you the following: + + Hit lower case g to start testing... + +After it sends this message it will send the enquire string. +It will then read characters from the terminal until it sees the +letter g. +.PP +.SS Testing and Repairing Pad Timings +.PP +The pad timings in distributed terminfo entries are often incorrect. One +major motivation for this program is to make it relatively easy to tune these +timings. +.PP +You can verify and edit the pad timings for a terminal with +the `test string capabilities' +function (this is also part of the `normal test sequence' function). +.PP +The key to determining pad times is to find out the effective baud rate of +the terminal. The effective baud rate determines the number of characters +per second that the terminal can accept without either handshaking or +losing data. This rate is frequently less than the nominal cps rate on the +RS-232 line. +.PP +\fBTack\fR uses the effective baud rate to judge the duration of the test and +how much a particular escape sequence will perturb the terminal. +.PP +Each pad test has two associated variables that can be tweaked to help verify +the correctness of the pad timings. One is the pad test length. The other is +the pad multiplier, which is used if the pad prefix includes `*'. In curses +use, it is often the first parameter of the capability (if there is one). +For a capability like (dch) or (il) this will be the number of character +positions or lines affected, respectively. +.PP +\fBTack\fR will run the pad tests and display the results to the terminal. +On capabilities that have multipliers \fBtack\fR will not tell you +if the pad needs the multiplier or not. You must make this decision +yourself by rerunning the test with a different multiplier. +If the padding changes in proportion to the multiplier than the +multiplier is required. If the multiplier has little or no effect on +the suggested padding then the multiplier is not needed. +Some capabilities will take several runs to get a good feel for +the correct values. You may wish to make the test longer +to get more accurate results. System load will also effect the +results (a heavily loaded system will not stress the +terminal as much, possibly leading to pad timings that are too short). +.PP +.SH NOTE +The tests done at the beginning of the program are assumed to be correct later +in the code. In particular, \fBtack\fR displays the number of lines and +columns indicated in the terminfo entry as part of its initial output. +If these values are wrong a large number of tests will fail or give incorrect +results. +.SH FILES +.TP 12 +tack.log +If logging is enabled then all characters written to the terminal +will also be written to the log file. This gives you the ability +to see how the tests were performed. This feature is disabled by default. +.TP 12 +.I "term" +If you make changes to the terminfo entry \fBtack\fR will save +the new terminfo to a file. The file will have the same name +as the terminal name. +.SH SEE ALSO +\fBterminfo\fR(\*n), \fBncurses\fR(3X), \fBtic\fR(1m), \fBinfocmp\fR(1m). +You should also have the documentation supplied by the terminal +manufacturer. +.SH BUGS +If the screen size is incorrect, many of the tests will fail. +.SH AUTHOR +Concept, design, and original implementation by +Daniel Weaver . Portions of the code and +documentation are by Eric S. Raymond . +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/tack/tack.c b/tack/tack.c new file mode 100644 index 00000000..8ada023f --- /dev/null +++ b/tack/tack.c @@ -0,0 +1,620 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +#include + +MODULE_ID("$Id: tack.c,v 1.1 1998/01/10 01:34:45 tom Exp $") + +/* + This program is designed to test terminfo, not curses. Therefore + I have used as little of curses as possible. + + Pads associated with the following capabilities are used to set + delay times in the handler: (cr), (ind), (cub1), (ff), (tab). + + I use the (nxon) capability to set the tty handler with/without + xon/xoff. If (smxon)/(rmxon) is defined I will change the terminal + too. + + (xon) inhibits the sending of delay characters in putp(). + If the terminal is defined with no padding then the (xon) boolean + is a don't care. In this case I recommend that it be reset. + */ + +/***************************************************************************** + * + * Option processing + * + *****************************************************************************/ + +/* options and modes */ +int debug_level; /* debugging level */ +int translate_mode; /* translate tab, bs, cr, lf, ff */ +int scan_mode; /* use scan codes */ +int char_mask; /* either 0xFF else 0x7F, eight bit data mask */ +int select_delay_type; /* set handler delays for */ +int select_xon_xoff; /* TTY driver XON/XOFF mode select */ +int hex_out; /* Display output in hex */ +int send_reset_init; /* Send the reset and initialization strings */ +FILE *log_fp; /* Terminal logfile */ + +/***************************************************************************** + * + * Menu definitions + * + *****************************************************************************/ + +extern struct test_menu sync_menu; + +static void tools_hex_echo(struct test_list *, int *, int *); +static void tools_debug(struct test_list *, int *, int *); + +static char hex_echo_menu_entry[80]; + +struct test_list tools_test_list[] = { + {0, 0, 0, 0, "s) ANSI status reports", tools_status, 0}, + {0, 0, 0, 0, "g) ANSI SGR modes (bold, underline, reverse)", tools_sgr, 0}, + {0, 0, 0, 0, "c) ANSI character sets", tools_charset, 0}, + {0, 0, 0, 0, hex_echo_menu_entry, tools_hex_echo, 0}, + {0, 0, 0, 0, "e) echo tool", tools_report, 0}, + {1, 0, 0, 0, "r) reply tool", tools_report, 0}, + {0, 0, 0, 0, "p) performance testing", 0, &sync_menu}, + {0, 0, 0, 0, "i) send reset and init", menu_reset_init, 0}, + {0, 0, "u8) (u9", 0, "u) test ENQ/ACK handshake", sync_handshake, 0}, + {0, 0, 0, 0, "d) change debug level", tools_debug, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +struct test_menu tools_menu = { + 0, 'q', 0, "Tools Menu", "tools", + 0, 0, tools_test_list, 0, 0, 0 +}; + +static void tty_width(struct test_list *, int *, int *); +static void tty_delay(struct test_list *, int *, int *); +static void tty_xon(struct test_list *, int *, int *); +static void tty_trans(struct test_list *, int *, int *); +static void tty_show_state(struct test_menu *); + +static char tty_width_menu[80]; +static char tty_delay_menu[80]; +static char tty_xon_menu[80]; +static char tty_trans_menu[80]; +static char enable_xon_xoff[] = {"x) enable xon/xoff"}; +static char disable_xon_xoff[] = {"x) disable xon/xoff"}; + +static struct test_list tty_test_list[] = { + {0, 0, 0, 0, tty_width_menu, tty_width, 0}, + {0, 0, 0, 0, tty_delay_menu, tty_delay, 0}, + {0, 0, 0, 0, tty_xon_menu, tty_xon, 0}, + {0, 0, 0, 0, tty_trans_menu, tty_trans, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +static struct test_menu tty_menu = { + 0, 'q', 0, "Terminal and driver configuration", + "tty", 0, + tty_show_state, tty_test_list, 0, 0, 0 +}; + +extern struct test_list edit_test_list[]; + +struct test_menu edit_menu = { + 0, 'q', 0, "Edit terminfo menu", + "edit", 0, + 0, edit_test_list, 0, 0, 0 +}; + +extern struct test_list mode_test_list[]; + +struct test_menu mode_menu = { + 0, 'n', 0, "Mode test menu", + "mode", "n) run standard tests", + 0, mode_test_list, 0, 0, 0 +}; + +extern struct test_list acs_test_list[]; + +static struct test_menu acs_menu = { + 0, 'n', 0, + "Alternate character set and graphics rendition test menu", + "acs", "n) run standard tests", + 0, acs_test_list, 0, 0, 0 +}; + +extern struct test_list color_test_list[]; + +struct test_menu color_menu = { + 0, 'n', 0, + "Color test menu", + "color", "n) run standard tests", + 0, color_test_list, 0, 0, 0 +}; + +extern struct test_list crum_test_list[]; + +static struct test_menu crum_menu = { + 0, 'n', 0, + "Cursor movement test menu", + "move", "n) run standard tests", + 0, crum_test_list, 0, 0, 0 +}; + +extern struct test_list funkey_test_list[]; + +static struct test_menu funkey_menu = { + 0, 'n', 0, + "Function key test menu", + "fkey", "n) run standard tests", + sync_test, funkey_test_list, 0, 0, 0 +}; + +extern struct test_list printer_test_list[]; + +static struct test_menu printer_menu = { + 0, 'n', 0, + "Printer test menu", + "printer", "n) run standard tests", + 0, printer_test_list, 0, 0, 0 +}; + +static void pad_gen(struct test_list *, int *, int *); +extern struct test_list pad_test_list[]; + +static struct test_menu pad_menu = { + 0, 'n', 0, + "Pad test menu", + "pad", "n) run standard tests", + sync_test, pad_test_list, 0, 0, 0 +}; + +static struct test_list normal_test_list[] = { + {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, + {0, 0, 0, 0, "i) send reset and init", menu_reset_init, 0}, + {MENU_NEXT, 0, 0, 0, "x) test modes and glitches", 0, &mode_menu}, + {MENU_NEXT, 0, 0, 0, "a) test alternate character sets", 0, &acs_menu}, + {MENU_NEXT, 0, 0, 0, "c) test color", 0, &color_menu}, + {MENU_NEXT, 0, 0, 0, "m) test cursor movement", 0, &crum_menu}, + {MENU_NEXT, 0, 0, 0, "f) test function keys", 0, &funkey_menu}, + {MENU_NEXT, 0, 0, 0, "p) test string capabilities", 0, &pad_menu}, + {0, 0, 0, 0, "P) test printer", 0, &printer_menu}, + {MENU_MENU, 0, 0, 0, "/) test a specific capability", 0, 0}, + {0, 0, 0, 0, "t) auto generate pad delays", pad_gen, &pad_menu}, + {0, 0, "u8) (u9", 0, 0, sync_handshake, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + + +struct test_menu normal_menu = { + 0, 'n', 0, "Main test menu", + "test", "n) run standard tests", + 0, normal_test_list, 0, 0, 0 +}; + +static void start_tools(struct test_list *, int *, int *); +static void start_modes(struct test_list *, int *, int *); +static void start_basic(struct test_list *, int *, int *); +static void start_log(struct test_list *, int *, int *); + +static char logging_menu_entry[80] = "l) start logging"; + +struct test_list start_test_list[] = { + {0, 0, 0, 0, "b) display basic information", start_basic, 0}, + {0, 0, 0, 0, "m) change modes", start_modes, 0}, + {0, 0, 0, 0, "t) tools", start_tools, 0}, + {MENU_COMPLETE, 0, 0, 0, "n) begin testing", 0, &normal_menu}, + {0, 0, 0, 0, logging_menu_entry, start_log, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + + +struct test_menu start_menu = { + 0, 'n', 0, "Main Menu", "tack", 0, + 0, start_test_list, 0, 0, 0 +}; + +static struct test_list write_terminfo_list[] = { + {0, 0, 0, 0, "w) write the current terminfo to a file", save_info, 0}, + {MENU_LAST, 0, 0, 0, 0, 0, 0} +}; + +/***************************************************************************** + * + * Menu command interpretation. + * + *****************************************************************************/ + +/* +** tools_hex_echo(testlist, state, ch) +** +** Flip the hex echo flag. +*/ +static void +tools_hex_echo( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + if (hex_out) { + hex_out = FALSE; + strcpy(hex_echo_menu_entry, + "h) enable hex output on echo tool"); + } else { + hex_out = TRUE; + strcpy(hex_echo_menu_entry, + "h) disable hex output on echo tool"); + } +} + +/* +** tools_debug(testlist, state, ch) +** +** Change the debug level. +*/ +static void +tools_debug( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch) +{ + char buf[32]; + + ptext("Enter a new value: "); + read_string(buf, sizeof(buf)); + if (buf[0]) { + sscanf(buf, "%d", &debug_level); + } + sprintf(temp, "Debug level is now %d", debug_level); + ptext(temp); + *ch = REQUEST_PROMPT; +} + +/* +** start_tools(testlist, state, ch) +** +** Run the generic test tools +*/ +static void +start_tools( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + if (hex_out) { + strcpy(hex_echo_menu_entry, + "h) disable hex output on echo tool"); + } else { + strcpy(hex_echo_menu_entry, + "h) enable hex output on echo tool"); + } + menu_display(&tools_menu, 0); +} + +/* +** tty_show_state() +** +** Display the current state on the tty driver settings +*/ +static void +tty_show_state( + struct test_menu *menu GCC_UNUSED) +{ + put_crlf(); + (void) sprintf(temp, + "Accepting %d bits, UNIX delays %d, XON/XOFF %sabled, speed %ld, translate %s, scan-code mode %s.", + (char_mask == ALLOW_PARITY) ? 8 : 7, + select_delay_type, + select_xon_xoff ? "en" : "dis", + tty_baud_rate, + translate_mode ? "on" : "off", + scan_mode ? "on" : "off"); + ptextln(temp); + put_crlf(); +} + +/* +** tty_width(testlist, state, ch) +** +** Change the character width +*/ +static void +tty_width( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + if (char_mask == STRIP_PARITY) { + char_mask = ALLOW_PARITY; + strcpy(tty_width_menu, "7) treat terminal as 7-bit"); + } else { + char_mask = STRIP_PARITY; + strcpy(tty_width_menu, "8) treat terminal as 8-bit"); + } +} + +/* +** tty_delay(testlist, state, ch) +** +** Change the delay for in the TTY driver +*/ +static void +tty_delay( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + if (select_delay_type) { + select_delay_type = FALSE; + strcpy(tty_delay_menu, + "d) enable UNIX tty driver delays for "); + } else { + select_delay_type = TRUE; + strcpy(tty_delay_menu, + "d) disable UNIX tty driver delays for "); + } +} + +/* +** tty_xon(testlist, state, ch) +** +** Change the XON/XOFF flags in the TTY driver +*/ +static void +tty_xon( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + if (select_xon_xoff) { + if (needs_xon_xoff) { + ptextln("This terminal is marked as needing XON/XOFF protocol with (nxon)"); + } + if (exit_xon_mode) { + tc_putp(exit_xon_mode); + } + xon_xoff = select_xon_xoff = FALSE; + strcpy(tty_xon_menu, enable_xon_xoff); + } else { + if (enter_xon_mode) { + tc_putp(enter_xon_mode); + } + xon_xoff = select_xon_xoff = TRUE; + strcpy(tty_xon_menu, disable_xon_xoff); + } + tty_set(); +} + +/* +** tty_trans(testlist, state, ch) +** +** Change the translation mode for special characters +*/ +static void +tty_trans( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + if (translate_mode) { + translate_mode = FALSE; + strcpy(tty_trans_menu, + "t) use terminfo values for \\b\\f\\n\\r\\t"); + } else { + translate_mode = TRUE; + strcpy(tty_trans_menu, + "t) override terminfo values for \\b\\f\\n\\r\\t"); + } +} + +/* +** pad_gen(testlist, state, ch) +** +** Menu function for automatic pad generation +*/ +static void +pad_gen( + struct test_list *t, + int *state GCC_UNUSED, + int *ch) +{ + control_init(); + if (tty_can_sync == SYNC_NOT_TESTED) { + verify_time(); + } + auto_pad_mode = TRUE; + menu_display(t->sub_menu, ch); + auto_pad_mode = FALSE; +} + +/* +** start_modes(testlist, state, ch) +** +** Change the TTY modes +*/ +static void +start_modes( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + + if (select_delay_type) { + strcpy(tty_delay_menu, + "d) disable UNIX tty driver delays for "); + } else { + strcpy(tty_delay_menu, + "d) enable UNIX tty driver delays for "); + } + if (char_mask == ALLOW_PARITY) { + strcpy(tty_width_menu, + "7) treat terminal as 7-bit"); + } else { + strcpy(tty_width_menu, + "8) treat terminal as 8-bit"); + } + if (select_xon_xoff) { + strcpy(tty_xon_menu, disable_xon_xoff); + } else { + strcpy(tty_xon_menu, enable_xon_xoff); + } + if (translate_mode) { + strcpy(tty_trans_menu, + "t) override terminfo values for \\b\\f\\n\\r\\t"); + } else { + strcpy(tty_trans_menu, + "t) use terminfo values for \\b\\f\\n\\r\\t"); + } + menu_display(&tty_menu, 0); + tty_set(); +} + +/* +** start_basic(testlist, state, ch) +** +** Display basic terminal information +*/ +static void +start_basic( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch) +{ + display_basic(); + *ch = REQUEST_PROMPT; +} + +/* +** start_log(testlist, state, ch) +** +** Start/stop in logging function +*/ +static void +start_log( + struct test_list *t GCC_UNUSED, + int *state GCC_UNUSED, + int *ch GCC_UNUSED) +{ + if (logging_menu_entry[5] == 'a') { + ptextln("The log file will capture all characters sent to the terminal."); + if ((log_fp = fopen("tack.log", "w"))) { + ptextln("Start logging to file: tack.log"); + strcpy(logging_menu_entry, "l) stop logging"); + } else { + ptextln("File open error: tack.log"); + } + } else { + if (log_fp) { + fclose(log_fp); + log_fp = 0; + } + ptextln("Terminal output logging stopped."); + strcpy(logging_menu_entry, "l) start logging"); + } +} + +/* +** show_usage() +** +** Tell the user how its done. +*/ +void +show_usage( + char *name) +{ + (void) fprintf(stderr, "usage: %s [-itV] [term]\n", name); +} + +/* +** print_version() +** +** Print version and other useful information. +*/ +void +print_version(void) +{ + printf("tack version %d.%02d\n", MAJOR_VERSION, MINOR_VERSION); + printf("Copyright (C) 1997 Free Software Foundation, Inc.\n"); + printf("Tack comes with NO WARRANTY, to the extent permitted by law.\n"); + printf("You may redistribute copies of Tack under the terms of the\n"); + printf("GNU General Public License. For more information about\n"); + printf("these matters, see the file named COPYING.\n"); +} + + +/***************************************************************************** + * + * Main sequence + * + *****************************************************************************/ + +int +main(int argc, char *argv[]) +{ + int i, j; + char *term_variable; + + /* scan the option flags */ + send_reset_init = TRUE; + translate_mode = FALSE; + term_variable = getenv("TERM"); + tty_can_sync = SYNC_NOT_TESTED; + for (i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + for (j = 1; argv[i][j]; j++) { + switch (argv[i][j]) { + case 'V': + print_version(); + return (1); + case 'i': + send_reset_init = FALSE; + break; + case 't': + translate_mode = FALSE; + break; + default: + show_usage(argv[0]); + return (0); + } + } + } else { + term_variable = argv[i]; + } + } + (void) strcpy(tty_basename, term_variable); + + curses_setup(argv[0]); + + menu_can_scan(&normal_menu); /* extract which caps can be tested */ + menu_display(&start_menu, 0); + + if (user_modified()) { + sprintf(temp, "Hit y to save changes to file: %s ? ", + tty_basename); + ptext(temp); + if (wait_here() == 'y') { + save_info(write_terminfo_list, &i, &j); + } + } + + put_str("\nTerminal test complete\n"); + bye_kids(0); + return (0); +} diff --git a/tack/tack.h b/tack/tack.h new file mode 100644 index 00000000..22e15af5 --- /dev/null +++ b/tack/tack.h @@ -0,0 +1,403 @@ +/* +** Copyright (C) 1991, 1997 Free Software Foundation, Inc. +** +** This file is part of TACK. +** +** TACK 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, or (at your option) +** any later version. +** +** TACK 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 TACK; see the file COPYING. If not, write to +** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +*/ + +/* $Id: tack.h,v 1.5 1999/06/26 22:14:07 tom Exp $ */ + +#ifndef _TACK_H +#define _TACK_H 1 + +/* terminfo action checker include file */ + +#define MAJOR_VERSION 1 +#define MINOR_VERSION 0 + +#ifdef HAVE_CONFIG_H +#include +#else +#define RETSIGTYPE void +#define GCC_UNUSED /*nothing*/ +#define HAVE_GETTIMEOFDAY 1 +#define HAVE_SELECT 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TIME_SELECT 1 +#endif + +#include +#include +#include +#include +#include + +#include +#include + +#if USE_RCS_IDS +#define MODULE_ID(id) static const char Ident[] = id; +#else +#define MODULE_ID(id) /*nothing*/ +#endif + +#if !HAVE_STRSTR +extern char *_nc_strstr(const char *, const char *); +#define strstr(h,n) _nc_strstr(h,n) +#endif + +extern FILE *log_fp; +extern FILE *debug_fp; +extern int debug_level; +extern char temp[]; +extern char tty_basename[]; +extern char tty_shortname[]; + +#define SYNC_FAILED 0 +#define SYNC_TESTED 1 +#define SYNC_NOT_TESTED 2 +#define SYNC_NEEDED 3 + +extern int tty_can_sync; +extern int total_pads_sent; /* count pad characters sent */ +extern int total_caps_sent; /* count caps sent */ +extern int total_printing_characters; /* count printing characters sent */ +extern int no_alarm_event; /* TRUE if the alarm has not gone off yet */ +extern int usec_run_time; /* length of last test in microseconds */ +extern int raw_characters_sent; /* Total output characters */ + +/* Stopwatch event timers */ +#define TIME_TEST 0 +#define TIME_SYNC 1 +#define TIME_FLUSH 2 +#define MAX_TIMERS 3 + +/* definitions for pad.c */ + +#define EXIT_CONDITION (no_alarm_event && (tt_delay_used < tt_delay_max)) +#define SLOW_TERMINAL_EXIT if (!test_complete && !EXIT_CONDITION) { break; } +#define CAP_NOT_FOUND if (auto_pad_mode) return + +extern char letters[26+1]; +#define NEXT_LETTER letter = letters[letter_number =\ + letters[letter_number + 1] ? letter_number + 1 : 0] + +extern int test_complete; /* counts number of tests completed */ +extern char letter; +extern int letter_number; +extern int augment, repeats; +extern long char_sent; +extern const char *pad_repeat_test; /* commands that force repeat */ + +extern int replace_mode; +extern int char_count, line_count, expand_chars; +extern int can_go_home, can_clear_screen; + +extern int translate_mode, scan_mode; +extern int auto_pad_mode; /* TRUE for auto time tests */ +extern int char_mask; +extern int hex_out; /* Display output in hex */ + +/* Parity bit macros */ +#define STRIP_PARITY 0x7f +#define ALLOW_PARITY 0xff + +/* select_delay_type: 0 -> reset all delays + 1 -> force long delays + 2 -> do not change the delays */ +extern int select_delay_type; + +/* select_xon_xoff: 0 -> reset xon/xoff + 1 -> set xon/xoff + 2 -> do not change xon/xoff */ +extern int select_xon_xoff; + +extern int tty_frame_size; +extern unsigned long tty_baud_rate; +extern int tty_cps; /* The number of characters per second */ +extern int not_a_tty, nodelay_read; +extern int send_reset_init; + +/* definitions for stty_query() and initial_stty_query() */ +#define TTY_CHAR_MODE 0 +#define TTY_NOECHO 1 +#define TTY_OUT_TRANS 2 +#define TTY_8_BIT 3 +#define TTY_XON_XOFF 4 + +/* scan code definitions */ +#define MAX_SCAN 256 + +/* translate mode default strings */ +struct default_string_list { + const char *name; /* terminfo name */ + const char *value; /* value of default string */ + int index; /* index into the strfname[] array */ +}; + +#define TM_last 8 +extern struct default_string_list TM_string[TM_last]; + +/* attribute structure definition */ +struct mode_list { + const char *name; + const char *begin_mode; + const char *end_mode; + int number; +}; + +extern const struct mode_list alt_modes[]; +extern const int mode_map[]; + +/* Test data base */ + +#define FLAG_CAN_TEST 1 +#define FLAG_TESTED 2 +#define FLAG_LABEL 4 +#define FLAG_FUNCTION_KEY 8 + +/* caps under test data base */ + +#define TT_MAX 8 +#define MAX_CHANGES (TT_MAX+2) + +extern int tt_delay_max; /* max number of milliseconds we can delay */ +extern int tt_delay_used; /* number of milliseconds consumed in delay */ +extern const char *tt_cap[TT_MAX]; /* value of string */ +extern int tt_affected[TT_MAX]; /* lines or columns effected (repitition + factor) */ +extern int tt_count[TT_MAX]; /* Number of times sent */ +extern int tt_delay[TT_MAX]; /* Number of milliseconds delay */ +extern int ttp; /* number of entries used */ + +extern const char *tx_cap[TT_MAX]; /* value of string */ +extern int tx_affected[TT_MAX]; /* lines or columns effected (repitition + factor) */ +extern int tx_count[TT_MAX]; /* Number of times sent */ +extern int tx_delay[TT_MAX]; /* Number of milliseconds delay */ +extern int tx_index[TT_MAX]; /* String index */ +extern int txp; /* number of entries used */ +extern int tx_characters; /* printing characters sent by test */ +extern int tx_cps; /* characters per second */ + +/* + Menu control for tack. +*/ + +struct test_results { + struct test_results *next; /* point to next entry */ + struct test_list *test; /* Test which got these results */ + int reps; /* repeat count */ + int delay; /* delay times 10 */ +}; + +struct test_list { + int flags; /* Test description flags */ + int lines_needed; /* Lines needed for test (0->no action) */ + const char *caps_done; /* Caps shown in Done message */ + const char *caps_tested; /* Other caps also being tested */ + const char *menu_entry; /* Menu entry text (optional) */ + /* Function that does testing */ + void (*test_procedure)(struct test_list *, int *, int *); + struct test_menu *sub_menu; /* Nested sub-menu */ +}; + +struct test_menu { + int flags; /* Menu feature flag */ + int default_action; /* Default command if entered */ + const char *menu_text; /* Describe this test_menu */ + const char *menu_title; /* Title for the menu */ + const char *ident; /* short menu name */ + const char *standard_tests; /* Standard test text */ + /* print current settings (optional) */ + void (*menu_function)(struct test_menu *); + struct test_list *tests; /* Pointer to the menu/function pairs */ + struct test_list *resume_tests; /* Standard test resume point */ + int resume_state; /* resume state of test group */ + int resume_char; /* resume ch of test group */ +}; + + +/* menu flags */ +#define MENU_100c 0x00001a00 /* Augment 100% of columns */ +#define MENU_90c 0x00001900 /* Augment 90% of columns */ +#define MENU_80c 0x00001800 /* Augment 80% of columns */ +#define MENU_70c 0x00001700 /* Augment 70% of columns */ +#define MENU_60c 0x00001600 /* Augment 60% of columns */ +#define MENU_50c 0x00001500 /* Augment 50% of columns */ +#define MENU_40c 0x00001400 /* Augment 40% of columns */ +#define MENU_30c 0x00001300 /* Augment 30% of columns */ +#define MENU_20c 0x00001200 /* Augment 20% of columns */ +#define MENU_10c 0x00001100 /* Augment 10% of columns */ +#define MENU_LM1 0x00002e00 /* Augment lines - 1 */ +#define MENU_100l 0x00002a00 /* Augment 100% of lines */ +#define MENU_90l 0x00002900 /* Augment 90% of lines */ +#define MENU_50l 0x00002500 /* Augment 50% of lines */ +#define MENU_lines 0x00002000 /* Augment of lines */ +#define MENU_columns 0x00001000 /* Augment of columns */ +#define MENU_LC_MASK 0x00003000 /* Augment mask for lines and columns */ +#define MENU_1L 0x00002f00 /* Augment == one */ +#define MENU_1C 0x00001f00 /* Augment == one */ +#define MENU_ONE 0x00000f00 /* Augment == one */ +#define MENU_ONE_MASK 0x00000f00 /* Augment == one mask */ +#define MENU_REP_MASK 0x00003f00 /* Augment mask */ + +#define MENU_CLEAR 0x00010000 /* clear screen */ +#define MENU_INIT 0x00020000 /* Initialization function */ +#define MENU_NEXT 0x00040000 /* Next test in sequence */ +#define MENU_LAST 0x00080000 /* End of menu list */ +#define MENU_STOP 0x00100000 /* Stop testing next-in-sequence */ +#define MENU_COMPLETE 0x00200000 /* Test complete after this */ +#define MENU_MENU 0x00400000 /* Pass the menu name not test name */ + +#define REQUEST_PROMPT 256 + +extern char prompt_string[80]; /* menu prompt storage */ +extern struct test_menu edit_menu; +extern struct test_list *augment_test; + +/* tack.c */ +extern void show_usage(char *); +extern void print_version(void); + +/* output.c */ +extern void tt_tputs(const char *, int); +extern void tt_putp(const char *); +extern void tt_putparm(NCURSES_CONST char *, int, int, int); +extern int tc_putp(const char *); +extern int tc_putch(int); +extern void putchp(int); +extern void put_cr(void); +extern void put_crlf(void); +extern void put_clear(void); +extern void put_dec(char *, int); +extern void put_str(const char *); +extern void put_lf(void); +extern void put_ind(void); +extern void put_newlines(int); +extern void put_columns(const char *, int, int); +extern void put_this(int); +extern void putln(const char *); +extern void ptext(const char *); +extern void ptextln(const char *); +extern void home_down(void); +extern void go_home(void); +extern void three_digit(char *, int); +extern int getchp(int); +extern char *expand(const char *); +extern char *expand_to(char *, int); +extern char *expand_command(const char *); +extern char *hex_expand_to(char *, int); +extern char *print_expand(char *); +extern void maybe_wait(int); +extern int wait_here(void); +extern void read_string(char *, int); +extern int getnext(int); + +/* control.c */ +extern void event_start(int); +extern long event_time(int); +extern char *liberated(char *); +extern void page_loop(void); +extern void control_init(void); +extern int msec_cost(const char *const, int); +extern int skip_pad_test(struct test_list *, int *, int *, const char *); +extern void pad_test_startup(int); +extern int still_testing(void); +extern void pad_test_shutdown(struct test_list *, int); +extern void dump_test_stats(struct test_list *, int *, int *); +extern void longer_test_time(struct test_list *, int *, int *); +extern void shorter_test_time(struct test_list *, int *, int *); +extern char txt_longer_test_time[80]; +extern char txt_shorter_test_time[80]; +extern void set_augment_txt(void); +extern void longer_augment(struct test_list *, int *, int *); +extern void shorter_augment(struct test_list *, int *, int *); +extern char txt_longer_augment[80]; +extern char txt_shorter_augment[80]; +extern int sliding_scale(int, int, int); + +/* sync.c */ +extern void verify_time(void); +extern int tty_sync_error(void); +extern void flush_input(void); +extern void sync_test(struct test_menu *); +extern void sync_handshake(struct test_list *, int *, int *); + +/* charset.c */ +extern void set_attr(int); +extern void eat_cookie(void); +extern void put_mode(char *); + +/* init.c */ +extern void reset_init(void); +extern void display_basic(void); +extern void put_name(const char *, const char *); +extern void charset_can_test(void); +extern void curses_setup(char *); +extern void bye_kids(int); + +/* scan.c */ +extern int scan_key(void); +extern void scan_init(char *fn); + +/* ansi.c */ +extern void tools_status(struct test_list *, int *, int *); +extern void tools_charset(struct test_list *, int *, int *); +extern void tools_sgr(struct test_list *, int *, int *); + +/* pad.c */ + +/* fun.c */ +extern void enter_key(const char *, char *, char *); +extern int tty_meta_prep(void); +extern void tools_report(struct test_list *, int *, int *); + +/* sysdep.c */ +extern void tty_set(void); +extern void tty_raw(int, int); +extern void tty_init(void); +extern void tty_reset(void); +extern void spin_flush(void); +extern void read_key(char *, int); +extern void set_alarm_clock(int); +extern void ignoresig(void); +extern int stty_query(int); +extern int initial_stty_query(int); + +/* edit.c */ +extern int user_modified(void); +extern void save_info(struct test_list *, int *, int *); +extern void can_test(const char *, int); +extern void cap_index(const char *, int *); +extern int cap_match(const char *names, const char *cap); +extern void edit_init(void); +extern char *get_string_cap_byname(const char *, const char **); +extern int get_string_cap_byvalue(const char *); +extern void show_report(struct test_list *, int *, int *); + +/* menu.c */ +extern void menu_prompt(void); +extern void menu_can_scan(const struct test_menu *); +extern void menu_display(struct test_menu *, int *); +extern void generic_done_message(struct test_list *, int *, int *); +extern void pad_done_message(struct test_list *, int *, int *); +extern void menu_clear_screen(struct test_list *, int *, int *); +extern void menu_reset_init(struct test_list *, int *, int *); +extern int subtest_menu(struct test_list *, int *, int *); + +#endif /* _TACK_H */ diff --git a/test/Makefile.in b/test/Makefile.in index d189ada7..b0b9de03 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.45 1998/02/11 12:14:05 tom Exp $ +# $Id: Makefile.in,v 1.54 1999/10/23 20:01:19 tom Exp $ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -55,7 +55,7 @@ CCFLAGS = $(CPPFLAGS) $(CFLAGS) CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) # @CC_SHARED_OPTS@ +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) @@ -65,14 +65,14 @@ LOCAL_LIBS = @TEST_DEPS@ MATH_LIB = @MATH_LIB@ LD = @LD@ -LINK = $(CC) +LINK = @LINK_TESTS@ $(CC) LDFLAGS = @LD_MODEL@ @TEST_ARGS@ @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@ LDFLAGS_NORMAL = $(LDFLAGS) LDFLAGS_DEBUG = $(LDFLAGS) @CC_G_OPT@ LDFLAGS_PROFILE = $(LDFLAGS) -pg -LDFLAGS_SHARED = $(LDFLAGS) @CC_SHARED_OPTS@ # @LD_SHARED_OPTS@ +LDFLAGS_SHARED = $(LDFLAGS) @LD_SHARED_OPTS@ LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) @@ -83,11 +83,16 @@ LINT_LIBS = -lform -lmenu -lpanel -lncurses @LIBS@ TESTS = \ blue$x \ bs$x \ + cardfile$x \ + ditto$x \ + dots$x \ + filter$x \ firework$x \ firstlast$x \ gdc$x \ hanoi$x \ hashtest$x \ + keynames$x \ knight$x \ lrtest$x \ ncurses$x \ @@ -111,6 +116,18 @@ blue$x: $(MODEL)/blue.o $(LOCAL_LIBS) bs$x: $(MODEL)/bs.o $(LOCAL_LIBS) @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/bs.o $(LDFLAGS_DEFAULT) +cardfile$x: $(MODEL)/cardfile.o $(LOCAL_LIBS) + @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/cardfile.o $(LDFLAGS_DEFAULT) + +ditto$x: $(MODEL)/ditto.o $(LOCAL_LIBS) + @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/ditto.o $(LDFLAGS_DEFAULT) + +dots$x: $(MODEL)/dots.o $(LOCAL_LIBS) + @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/dots.o $(LDFLAGS_DEFAULT) + +filter$x: $(MODEL)/filter.o $(LOCAL_LIBS) + @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/filter.o $(LDFLAGS_DEFAULT) + firework$x: $(MODEL)/firework.o $(LOCAL_LIBS) @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/firework.o $(LDFLAGS_DEFAULT) @@ -126,6 +143,9 @@ hanoi$x: $(MODEL)/hanoi.o $(LOCAL_LIBS) hashtest$x: $(MODEL)/hashtest.o $(LOCAL_LIBS) @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/hashtest.o $(LDFLAGS_DEFAULT) +keynames$x: $(MODEL)/keynames.o $(LOCAL_LIBS) + @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/keynames.o $(LDFLAGS_DEFAULT) + knight$x: $(MODEL)/knight.o $(LOCAL_LIBS) @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/knight.o $(LDFLAGS_DEFAULT) diff --git a/test/blue.c b/test/blue.c index a97cdafb..4f733513 100644 --- a/test/blue.c +++ b/test/blue.c @@ -9,11 +9,11 @@ *****************************************************************************/ /* - * Compile this with the command `cc -O blue.c -lcurses -o blue'. For best - * results, use the portable freeware ncurses(3) library. On non-Intel - * machines, SVr4 curses is just as good. + * Compile this with the command `cc -O blue.c -lcurses -o blue'. For best + * results, use the ncurses(3) library. On non-Intel machines, SVr4 curses is + * just as good. * - * $Id: blue.c,v 1.15 1997/03/09 00:47:41 tom Exp $ + * $Id: blue.c,v 1.18 1999/01/17 00:11:56 tom Exp $ */ #include @@ -78,25 +78,29 @@ static chtype ranks[SUIT_LENGTH][2] = Color values should not be or'ed in. This only works, because the characters used here are plain and have no color attribute themselves. */ -static chtype letters[4] = -{ #ifdef COLOR_PAIR - 'h' | COLOR_PAIR(RED_ON_WHITE), /* hearts */ - 's' | COLOR_PAIR(BLACK_ON_WHITE), /* spades */ - 'd' | COLOR_PAIR(RED_ON_WHITE), /* diamonds */ - 'c' | COLOR_PAIR(BLACK_ON_WHITE), /* clubs */ +#define OR_COLORS(value,pair) ((value) | COLOR_PAIR(pair)) +#else +#define OR_COLORS(value,pair) (value) #endif + +#define PC_COLORS(value,pair) (OR_COLORS(value,pair) | A_ALTCHARSET) + +static chtype letters[4] = +{ + OR_COLORS('h', RED_ON_WHITE), /* hearts */ + OR_COLORS('s', BLACK_ON_WHITE), /* spades */ + OR_COLORS('d', RED_ON_WHITE), /* diamonds */ + OR_COLORS('c', BLACK_ON_WHITE), /* clubs */ }; #if defined(__i386__) static chtype glyphs[] = { -#ifdef COLOR_PAIR - '\003' | A_ALTCHARSET | COLOR_PAIR(RED_ON_WHITE), /* hearts */ - '\006' | A_ALTCHARSET | COLOR_PAIR(BLACK_ON_WHITE), /* spades */ - '\004' | A_ALTCHARSET | COLOR_PAIR(RED_ON_WHITE), /* diamonds */ - '\005' | A_ALTCHARSET | COLOR_PAIR(BLACK_ON_WHITE), /* clubs */ -#endif + PC_COLORS('\003', RED_ON_WHITE), /* hearts */ + PC_COLORS('\006', BLACK_ON_WHITE), /* spades */ + PC_COLORS('\004', RED_ON_WHITE), /* diamonds */ + PC_COLORS('\005', BLACK_ON_WHITE), /* clubs */ }; #endif /* __i386__ */ @@ -391,15 +395,15 @@ int main(int argc, char *argv[]) init_pair(BLACK_ON_WHITE, COLOR_BLACK, COLOR_WHITE); #ifndef COLOR_PAIR - letters[0] = 'h' | COLOR_PAIR(RED_ON_WHITE); /* hearts */ - letters[1] = 's' | COLOR_PAIR(BLACK_ON_WHITE); /* spades */ - letters[2] = 'd' | COLOR_PAIR(RED_ON_WHITE); /* diamonds */ - letters[3] = 'c' | COLOR_PAIR(BLACK_ON_WHITE); /* clubs */ + letters[0] = OR_COLORS('h', RED_ON_WHITE); /* hearts */ + letters[1] = OR_COLORS('s', BLACK_ON_WHITE); /* spades */ + letters[2] = OR_COLORS('d', RED_ON_WHITE); /* diamonds */ + letters[3] = OR_COLORS('c', BLACK_ON_WHITE); /* clubs */ #if defined(__i386__) && defined(A_ALTCHARSET) - glyphs[0] = '\003' | A_ALTCHARSET | COLOR_PAIR(RED_ON_WHITE); /* hearts */ - glyphs[1] = '\006' | A_ALTCHARSET | COLOR_PAIR(BLACK_ON_WHITE); /* spades */ - glyphs[2] = '\004' | A_ALTCHARSET | COLOR_PAIR(RED_ON_WHITE); /* diamonds */ - glyphs[3] = '\005' | A_ALTCHARSET | COLOR_PAIR(BLACK_ON_WHITE); /* clubs */ + glyphs[0] = PC_COLORS('\003', RED_ON_WHITE); /* hearts */ + glyphs[1] = PC_COLORS('\006', BLACK_ON_WHITE); /* spades */ + glyphs[2] = PC_COLORS('\004', RED_ON_WHITE); /* diamonds */ + glyphs[3] = PC_COLORS('\005', BLACK_ON_WHITE); /* clubs */ #endif #endif diff --git a/test/bs.c b/test/bs.c index eaa6f1ae..368abcd8 100644 --- a/test/bs.c +++ b/test/bs.c @@ -7,7 +7,7 @@ * v2.0 featuring strict ANSI/POSIX conformance, November 1993. * v2.1 with ncurses mouse support, September 1995 * - * $Id: bs.c,v 1.22 1997/12/20 15:11:53 tom Exp $ + * $Id: bs.c,v 1.24 1999/08/21 23:14:38 tom Exp $ */ #include @@ -129,22 +129,24 @@ ship_t; static bool checkplace(int b, ship_t *ss, int vis); +#define SHIPIT(name, symbol, length) { name, 0, symbol, length, 0,0, 0, FALSE } + static ship_t plyship[SHIPTYPES] = { - { carrier, 0, 'A', 5}, - { battle, 0, 'B', 4}, - { destroy, 0, 'D', 3}, - { sub, 0, 'S', 3}, - { ptboat, 0, 'P', 2}, + SHIPIT(carrier, 'A', 5), + SHIPIT(battle, 'B', 4), + SHIPIT(destroy, 'D', 3), + SHIPIT(sub, 'S', 3), + SHIPIT(ptboat, 'P', 2), }; static ship_t cpuship[SHIPTYPES] = { - { carrier, 0, 'A', 5}, - { battle, 0, 'B', 4}, - { destroy, 0, 'D', 3}, - { sub, 0, 'S', 3}, - { ptboat, 0, 'P', 2}, + SHIPIT(carrier, 'A', 5), + SHIPIT(battle, 'B', 4), + SHIPIT(destroy, 'D', 3), + SHIPIT(sub, 'S', 3), + SHIPIT(ptboat, 'P', 2), }; /* "Hits" board, and main board. */ @@ -827,11 +829,12 @@ static int plyturn(void) hits[PLAYER][curx][cury] = (hit ? MARK_HIT : MARK_MISS); cgoto(cury, curx); #ifdef A_COLOR - if (has_colors()) + if (has_colors()) { if (hit) attron(COLOR_PAIR(COLOR_RED)); else attron(COLOR_PAIR(COLOR_GREEN)); + } #endif /* A_COLOR */ (void) addch((chtype)hits[PLAYER][curx][cury]); #ifdef A_COLOR @@ -965,11 +968,12 @@ static int cpufire(int x, int y) pgoto(y, x); #ifdef A_COLOR - if (has_colors()) + if (has_colors()) { if (hit) attron(COLOR_PAIR(COLOR_RED)); else attron(COLOR_PAIR(COLOR_GREEN)); + } #endif /* A_COLOR */ (void)addch((chtype)(hit ? SHOWHIT : SHOWSPLASH)); #ifdef A_COLOR diff --git a/test/cardfile.c b/test/cardfile.c new file mode 100644 index 00000000..bc2e1adb --- /dev/null +++ b/test/cardfile.c @@ -0,0 +1,420 @@ +/**************************************************************************** + * Copyright (c) 1999 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/* + * Author: Thomas E. Dickey 1999 + * + * $Id: cardfile.c,v 1.2 1999/06/16 00:41:57 tom Exp $ + * + * File format: text beginning in column 1 is a title; other text forms the content. + */ + +#include + +#include +#include + +#include +#include + +#define VISIBLE_CARDS 10 +#define OFFSET_CARD 2 + +#ifndef CTRL +#define CTRL(x) ((x) & 0x1f) +#endif + +typedef struct _card { + struct _card *link; + PANEL *panel; + FORM *form; + char *title; + char *content; +} CARD; + +static CARD *all_cards; +static char default_name[] = "cardfile.dat"; + +#if !HAVE_STRDUP +#define strdup my_strdup +static char *strdup (char *s) +{ + char *p = (char *)malloc(strlen(s)+1); + if (p) + strcpy(p, s); + return(p); +} +#endif /* not HAVE_STRDUP */ + +static char *skip(char *buffer) +{ + while (isspace(*buffer)) + buffer++; + return buffer; +} + +static void trim(char *buffer) +{ + unsigned n = strlen(buffer); + while (n-- && isspace(buffer[n])) + buffer[n] = 0; +} + +/*******************************************************************************/ + +static CARD *add_title(const char *title) +{ + CARD *card, *p, *q; + + for (p = all_cards, q = 0; p != 0; q = p, p = p->link) + { + int cmp = strcmp(p->title, title); + if (cmp == 0) + return p; + if (cmp > 0) + break; + } + + card = (CARD *)calloc(1, sizeof(CARD)); + card->title = strdup(title); + card->content = strdup(""); + + if (q == 0) + { + card->link = all_cards; + all_cards = card; + } + else + { + card->link = q->link; + q->link = card; + } + + return card; +} + +static void add_content(CARD *card, char *content) +{ + unsigned total, offset; + + content = skip(content); + if ((total = strlen(content)) != 0) + { + if ((offset = strlen(card->content)) != 0) + { + total += 1 + offset; + card->content = (char *)realloc(card->content, total + 1); + strcpy(card->content + offset++, " "); + } + else + { + card->content = (char *)malloc(total + 1); + } + strcpy(card->content + offset, content); + } +} + +static CARD *find_card(char *title) +{ + CARD *card; + + for (card = all_cards; card != 0; card = card->link) + if (!strcmp(card->title, title)) + break; + + return card; +} + +static void read_data(char *fname) +{ + FILE *fp; + CARD *card = 0; + char buffer[BUFSIZ]; + + if ((fp = fopen(fname, "r")) != 0) + { + while (fgets(buffer, sizeof(buffer), fp)) + { + trim(buffer); + if (isspace(*buffer)) + { + if (card == 0) + card = add_title(""); + add_content(card, buffer); + } + else if ((card = find_card(buffer)) == 0) + { + card = add_title(buffer); + } + } + fclose(fp); + } +} + +/*******************************************************************************/ + +static void write_data(const char *fname) +{ + FILE *fp; + CARD *p = 0; + int n; + + if (!strcmp(fname, default_name)) + fname = "cardfile.out"; + + if ((fp = fopen(fname, "w")) != 0) + { + for (p = all_cards; p != 0; p = p->link) + { + FIELD **f = form_fields(p->form); + for (n = 0; f[n] != 0; n++) + { + char *s = field_buffer(f[n], 0); + if (s != 0 + && (s = strdup(s)) != 0) + { + trim(s); + fprintf(fp, "%s%s\n", n ? "\t" : "", s); + free(s); + } + } + } + fclose(fp); + } +} + +/*******************************************************************************/ + +/* + * Count the cards + */ +static int count_cards(void) +{ + CARD *p; + int count = 0; + + for (p = all_cards; p != 0; p = p->link) + count++; + + return count; +} + +/* + * Shuffle the panels to keep them in a natural hierarchy. + */ +static void order_cards(CARD *first, int depth) +{ + if (first) + { + if (depth && first->link) + order_cards(first->link, depth-1); + top_panel(first->panel); + } +} + +/* + * Return the next card in the list + */ +static CARD *next_card(CARD *now) +{ + if (now->link) + now = now->link; + return now; +} + +/* + * Return the previous card in the list + */ +static CARD *prev_card(CARD *now) +{ + CARD *p; + for (p = all_cards; p != 0; p = p->link) + if (p->link == now) + return p; + return now; +} + + +/*******************************************************************************/ + +static int form_virtualize(WINDOW *w) +{ + int c = wgetch(w); + + switch(c) + { + case CTRL('W'): + return(MAX_FORM_COMMAND + 4); + case CTRL('N'): + return(MAX_FORM_COMMAND + 3); + case CTRL('P'): + return(MAX_FORM_COMMAND + 2); + case CTRL('Q'): + case 033: + return(MAX_FORM_COMMAND + 1); + + case KEY_BACKSPACE: + return(REQ_DEL_PREV); + case KEY_DC: + return(REQ_DEL_CHAR); + case KEY_LEFT: + return(REQ_LEFT_CHAR); + case KEY_RIGHT: + return(REQ_RIGHT_CHAR); + + case KEY_DOWN: + case KEY_NEXT: + return(REQ_NEXT_FIELD); + case KEY_UP: + case KEY_PREVIOUS: + return(REQ_PREV_FIELD); + + default: + return(c); + } +} + +/*******************************************************************************/ + +static void cardfile(char *fname) +{ + WINDOW *win; + CARD *p; + CARD *top_card; + int visible_cards = count_cards(); + int panel_wide = COLS - (visible_cards * OFFSET_CARD); + int panel_high = LINES - (visible_cards * OFFSET_CARD) - 5; + int form_wide = panel_wide - 2; + int form_high = panel_high - 2; + int x = (visible_cards - 1) * OFFSET_CARD; + int y = 0; + int ch; + int finished = FALSE; + + move(LINES - 3, 0); + addstr("^Q/ESC -- exit form ^W -- writes data to file\n"); + addstr("^N -- go to next card ^P -- go to previous card\n"); + addstr("Arrow keys move left/right within a field, up/down between fields"); + + /* make a panel for each CARD */ + for (p = all_cards; p != 0; p = p->link) + { + FIELD **f = (FIELD **)calloc(3, sizeof(FIELD *)); + + win = newwin(panel_high, panel_wide, x, y); + keypad(win, TRUE); + p->panel = new_panel(win); + box(win, 0, 0); + + /* ...and a form in each panel */ + f[0] = new_field(1, form_wide, 0, 0, 0, 0); + set_field_back(f[0], A_REVERSE); + set_field_buffer(f[0], 0, p->title); + + f[1] = new_field(form_high-1, form_wide, 1, 0, 0, 0); + set_field_buffer(f[1], 0, p->content); + set_field_just(f[1], JUSTIFY_LEFT); + + f[2] = 0; + + p->form = new_form(f); + set_form_win(p->form, win); + set_form_sub(p->form, derwin(win, form_high, form_wide, 1, 1)); + post_form(p->form); + + x -= OFFSET_CARD; + y += OFFSET_CARD; + } + + order_cards(top_card = all_cards, visible_cards); + + update_panels(); + + while (!finished) + { + update_panels(); + doupdate(); + + switch(form_driver(top_card->form, ch = form_virtualize(panel_window(top_card->panel)))) + { + case E_OK: + break; + case E_UNKNOWN_COMMAND: + switch (ch) { + case MAX_FORM_COMMAND+1: + finished = TRUE; + break; + case MAX_FORM_COMMAND+2: + top_card = prev_card(top_card); + order_cards(top_card, visible_cards); + break; + case MAX_FORM_COMMAND+3: + top_card = next_card(top_card); + order_cards(top_card, visible_cards); + break; + case MAX_FORM_COMMAND+4: + write_data(fname); + break; + default: + beep(); + break; + } + break; + default: + flash(); + break; + } + } +} + +/*******************************************************************************/ + +int main(int argc, char *argv[]) +{ + int n; + + initscr(); + cbreak(); + noecho(); + + if (argc > 1) + { + for (n = 1; n < argc; n++) + read_data(argv[n]); + cardfile(argv[1]); + } + else + { + read_data(default_name); + cardfile(default_name); + } + + endwin(); + + return EXIT_SUCCESS; +} diff --git a/test/cardfile.dat b/test/cardfile.dat new file mode 100644 index 00000000..deb4b76a --- /dev/null +++ b/test/cardfile.dat @@ -0,0 +1,13 @@ +title 1 + Some text for title1 + and some more text +title 2 + The quicker brown fox ran all over the lazy dog. +put a card before the first two + This is an example of a simple cardfile. +show a fourth card + The fourth card + has a large amount of data, + more than the other cards. + At least, that is what I thought it should do, since I want to see how well + the forms package handles justification. diff --git a/test/configure b/test/configure new file mode 100755 index 00000000..649dffe9 --- /dev/null +++ b/test/configure @@ -0,0 +1,1949 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13.19990117 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +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' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +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 + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # 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 ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$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" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) 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) + # 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 << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF +cat <&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + 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 "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# 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 + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=ncurses.c + +# 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 "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# 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 "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:532: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:562: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +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 $# -gt 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" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:613: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:645: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 656 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:687: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:692: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:720: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 + + +CC_G_OPT="-g" +CC_SHARED_OPTS=unknown +CPPFLAGS="$CPPFLAGS" +DFT_DEP_SUFFIX="" +DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` +DFT_UPR_MODEL="NORMAL" +ECHO_LINK='@ echo linking $@ ... ;' +EXTRA_LIBS="" +LD="ld" +LDFLAGS_SHARED="" +LD_MODEL="" +LD_SHARED_OPTS="" +LIB_NAME=curses +LIB_PREFIX="-l" +LINK_TESTS="" +LINT=lint +LINT_OPTS="" +LOCAL_LDFLAGS="" +MATH_LIB="-lm" +PROG_EXT="" +TEST_ARGS="" +TEST_DEPS="" +cf_cv_abi_version="" +cf_cv_rel_version="" + + +# Check whether --with-5lib or --without-5lib was given. +if test "${with_5lib+set}" = set; then + withval="$with_5lib" + LIBS="-L/usr/5lib $LIBS" + CPPFLAGS="$CPPFLAGS -I/usr/5include" +fi + + + +# Check whether --with-ncurses or --without-ncurses was given. +if test "${with_ncurses+set}" = set; then + withval="$with_ncurses" + echo $ac_n "checking for initscr""... $ac_c" 1>&6 +echo "configure:791: checking for initscr" >&5 +if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char initscr(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_initscr) || defined (__stub___initscr) +choke me +#else +initscr(); +#endif + +; return 0; } +EOF +if { (eval echo configure:819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_initscr=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_initscr=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 +echo "configure:838: checking for Gpm_Open in -lgpm" >&5 +ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lgpm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo gpm | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + LIB_NAME=ncurses + for p in $HOME /usr/local /usr + do + if test -f $p/include/ncurses/curses.h + then + CPPFLAGS="$CPPFLAGS -I$p/include/ncurses" + test $p != /usr && LIBS="-L$p/lib $LIBS" + break + elif test $p != /usr + then + if test -f $p/include/curses.h + then + CPPFLAGS="$CPPFLAGS -I$p/include" + LIBS="-L$p/lib $LIBS" + break + fi + fi + done + +fi + +fi + + + + +echo $ac_n "checking for initscr""... $ac_c" 1>&6 +echo "configure:911: checking for initscr" >&5 +if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char initscr(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_initscr) || defined (__stub___initscr) +choke me +#else +initscr(); +#endif + +; return 0; } +EOF +if { (eval echo configure:939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_initscr=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_initscr=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 + +echo $ac_n "checking for initscr in -l$LIB_NAME""... $ac_c" 1>&6 +echo "configure:958: checking for initscr in -l$LIB_NAME" >&5 +ac_lib_var=`echo $LIB_NAME'_'initscr | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l$LIB_NAME $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo $LIB_NAME | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +fi + +echo $ac_n "checking for form_driver in -lform""... $ac_c" 1>&6 +echo "configure:1007: checking for form_driver in -lform" >&5 +ac_lib_var=`echo form'_'form_driver | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lform $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo form | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +echo $ac_n "checking for menu_driver in -lmenu""... $ac_c" 1>&6 +echo "configure:1054: checking for menu_driver in -lmenu" >&5 +ac_lib_var=`echo menu'_'menu_driver | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lmenu $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo menu | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +echo $ac_n "checking for new_panel in -lpanel""... $ac_c" 1>&6 +echo "configure:1101: checking for new_panel in -lpanel" >&5 +ac_lib_var=`echo panel'_'new_panel | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpanel $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo panel | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1149: checking return type of signal handlers" >&5 +if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#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; } +EOF +if { (eval echo configure:1171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <&6 +echo "configure:1191: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1271: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + 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 < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + 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 < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#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); } + +EOF +if { (eval echo configure:1351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:1375: checking whether time.h and sys/time.h may both be included" >&5 +if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +int main() { +struct tm *tp; +; return 0; } +EOF +if { (eval echo configure:1389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_time" 1>&6 +if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + +for ac_hdr in \ +form.h \ +getopt.h \ +menu.h \ +nc_alloc.h \ +panel.h \ +sys/ioctl.h \ +sys/select.h \ +sys/time.h \ +termios.h \ +unistd.h \ + +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1424: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + +for ac_func in \ +curses_version \ +gettimeofday \ +napms \ +resizeterm \ +strdup \ +vsscanf \ + +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1471: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +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 +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +echo $ac_n "checking if sys/time.h conflicts with sys/select.h""... $ac_c" 1>&6 +echo "configure:1525: checking if sys/time.h conflicts with sys/select.h" >&5 +if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +#endif +#if HAVE_SYS_SELECT_H +#include +#endif + +int main() { + +; return 0; } +EOF +if { (eval echo configure:1545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_sys_time_select=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_sys_time_select=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$cf_cv_sys_time_select" 1>&6 +test $cf_cv_sys_time_select = yes && cat >> confdefs.h <<\EOF +#define HAVE_SYS_TIME_SELECT 1 +EOF + + +trap '' 1 2 15 +cat > confcache <<\EOF +# 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. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# 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 \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13.19990117" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir + +trap 'rm -fr `echo "Makefile ncurses_cfg.h:ncurses_tst.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@CC@%$CC%g +s%@CC_G_OPT@%$CC_G_OPT%g +s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g +s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g +s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g +s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g +s%@ECHO_LINK@%$ECHO_LINK%g +s%@EXTRA_LIBS@%$EXTRA_LIBS%g +s%@LD@%$LD%g +s%@LDFLAGS_SHARED@%$LDFLAGS_SHARED%g +s%@LD_MODEL@%$LD_MODEL%g +s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g +s%@LIB_NAME@%$LIB_NAME%g +s%@LIB_PREFIX@%$LIB_PREFIX%g +s%@LINK_TESTS@%$LINK_TESTS%g +s%@LINT@%$LINT%g +s%@LINT_OPTS@%$LINT_OPTS%g +s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g +s%@MATH_LIB@%$MATH_LIB%g +s%@PROG_EXT@%$PROG_EXT%g +s%@TEST_ARGS@%$TEST_ARGS%g +s%@TEST_DEPS@%$TEST_DEPS%g +s%@cf_cv_abi_version@%$cf_cv_abi_version%g +s%@cf_cv_rel_version@%$cf_cv_rel_version%g +s%@CPP@%$CPP%g + +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_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # 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" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + 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 "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# 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='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.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'. +sort confdefs.h >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 : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # 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 conftest.in at the +# marker @DEFS@. +echo ' cat >> conftest.edit < conftest.out +rm -f conftest.in +mv conftest.out conftest.in +rm -f conftest.edit conftest.frag +' >> $CONFIG_STATUS + + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +# Extra commands, if any + + cat >>Makefile <>Makefile < 1996,1997,1998 dnl -dnl $Id: configure.in,v 1.23 1998/02/11 12:14:05 tom Exp $ +dnl $Id: configure.in,v 1.27 1999/10/23 20:01:42 tom Exp $ dnl This is a simple configuration-script for the ncurses test programs that dnl allows the test-directory to be separately configured against a reference dnl system (i.e., sysvr4 curses) @@ -53,10 +53,12 @@ DFT_UPR_MODEL="NORMAL" AC_SUBST(DFT_UPR_MODEL) ECHO_LINK='@ echo linking $@ ... ;' AC_SUBST(ECHO_LINK) EXTRA_LIBS="" AC_SUBST(EXTRA_LIBS) LD="ld" AC_SUBST(LD) -LD_MODEL="" AC_SUBST(LD_MODEL) LDFLAGS_SHARED="" AC_SUBST(LDFLAGS_SHARED) +LD_MODEL="" AC_SUBST(LD_MODEL) +LD_SHARED_OPTS="" AC_SUBST(LD_SHARED_OPTS) LIB_NAME=curses AC_SUBST(LIB_NAME) LIB_PREFIX="-l" AC_SUBST(LIB_PREFIX) +LINK_TESTS="" AC_SUBST(LINK_TESTS) LINT=lint AC_SUBST(LINT) LINT_OPTS="" AC_SUBST(LINT_OPTS) LOCAL_LDFLAGS="" AC_SUBST(LOCAL_LDFLAGS) @@ -127,6 +129,7 @@ unistd.h \ ) AC_CHECK_FUNCS( \ +curses_version \ gettimeofday \ napms \ resizeterm \ diff --git a/form/frm_adabind.c b/test/ditto.c similarity index 50% rename from form/frm_adabind.c rename to test/ditto.c index 53d1ca2a..8ceafe5d 100644 --- a/form/frm_adabind.c +++ b/test/ditto.c @@ -26,56 +26,123 @@ * authorization. * ****************************************************************************/ -/**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * - ****************************************************************************/ - -/*************************************************************************** -* Module frm_adabind.c * -* Helper routines to ease the implementation of an Ada95 binding to * -* ncurses. For details and copyright of the binding see the ../Ada95 * -* subdirectory. * -***************************************************************************/ -#include "form.priv.h" - -MODULE_ID("$Id: frm_adabind.c,v 1.5 1998/02/11 12:13:43 tom Exp $") +/* + * Author: Thomas E. Dickey 1998 + * + * $Id: ditto.c,v 1.3 1998/08/15 23:39:34 tom Exp $ + * + * The program illustrates how to set up multiple screens from a single + * program. Invoke the program by specifying another terminal on the same + * machine by specifying its device, e.g., + * ditto /dev/ttyp1 + */ +#include +#include +#include -/* Prototypes for the functions in this module */ -void _nc_ada_normalize_field_opts (int *opt); -void _nc_ada_normalize_form_opts (int *opt); -void* _nc_ada_getvarg(va_list *); -FIELD* _nc_get_field(const FORM*, int); +typedef struct { + FILE *input; + FILE *output; + SCREEN *screen; +} DITTO; - -void _nc_ada_normalize_field_opts (int *opt) +static void +failed(const char *s) { - *opt = ALL_FIELD_OPTS & (*opt); + perror(s); + exit(EXIT_FAILURE); } -void _nc_ada_normalize_form_opts (int *opt) +static void +usage(void) { - *opt = ALL_FORM_OPTS & (*opt); + fprintf(stderr, "usage: ditto [terminal1 ...]\n"); + exit(EXIT_FAILURE); } - -/* This tiny stub helps us to get a void pointer from an argument list. -// The mechanism for libform to handle arguments to field types uses -// unfortunately functions with variable argument lists. In the Ada95 -// binding we replace this by a mechanism that only uses one argument -// that is a pointer to a record describing all the specifics of an -// user defined field type. So we need only this simple generic -// procedure to get the pointer from the arglist. -*/ -void *_nc_ada_getvarg(va_list *ap) +static FILE * +open_tty(char *path) { - return va_arg(*ap,void*); + FILE *fp; + struct stat sb; + + if (stat(path, &sb) < 0) + failed(path); + if ((sb.st_mode & S_IFMT) != S_IFCHR) { + errno = ENOTTY; + failed(path); + } + fp = fopen(path, "a+"); + if (fp == 0) + failed(path); + printf("opened %s\n", path); + return fp; } -FIELD* _nc_get_field(const FORM* frm, int idx) { - if (frm && frm->field && idx>=0 && (idxmaxfield)) - { - return frm->field[idx]; - } - else - return (FIELD*)0; +int +main( + int argc GCC_UNUSED, + char *argv[] GCC_UNUSED) +{ + int j; + int active_tty = 0; + DITTO *data; + + if (argc <= 1) + usage(); + + if ((data = (DITTO *)calloc(argc, sizeof(DITTO))) == 0) + failed("calloc data"); + + data[0].input = stdin; + data[0].output = stdout; + for (j = 1; j < argc; j++) { + data[j].input = + data[j].output = open_tty(argv[j]); + } + + /* + * If we got this far, we have open connection(s) to the terminal(s). + * Set up the screens. + */ + for (j = 0; j < argc; j++) { + active_tty++; + data[j].screen = newterm( + (char *)0, /* assume $TERM is the same */ + data[j].output, + data[j].input); + if (data[j].screen == 0) + failed("newterm"); + cbreak(); + noecho(); + scrollok(stdscr, TRUE); + } + + /* + * Loop, reading characters from any of the inputs and writing to all + * of the screens. + */ + for(;;) { + int ch; + set_term(data[0].screen); + ch = getch(); + if (ch == ERR) + continue; + if (ch == 4) + break; + for (j = 0; j < argc; j++) { + set_term(data[j].screen); + addch(ch); + refresh(); + } + } + + /* + * Cleanup and exit + */ + for (j = argc-1; j >= 0; j--) { + set_term(data[j].screen); + endwin(); + } + return EXIT_SUCCESS; } diff --git a/test/dots.c b/test/dots.c new file mode 100644 index 00000000..13ec66a5 --- /dev/null +++ b/test/dots.c @@ -0,0 +1,143 @@ +/**************************************************************************** + * Copyright (c) 1999 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/* + * Author: Thomas E. Dickey 1999 + * + * $Id: dots.c,v 1.2 1999/10/23 13:24:32 tom Exp $ + * + * A simple demo of the terminfo interface. + */ +#include + +#include /* for tparm() */ + +#include +#include + +#define valid(s) ((s != 0) && s != (char *)-1) + +static bool interrupted = FALSE; + +static int +outc(int c) +{ + if (interrupted) { + char tmp = c; + write(STDOUT_FILENO, &tmp, 1); + } else { + putc(c, stdout); + } + return 0; +} + +static bool +outs(char *s) +{ + if (valid(s)) { + tputs(s, 1, outc); + return TRUE; + } + return FALSE; +} + +static void +cleanup(void) +{ + outs(exit_attribute_mode); + if (!outs(orig_colors)) + outs(orig_pair); + outs(clear_screen); + outs(cursor_normal); +} + +static void +onsig(int n GCC_UNUSED) +{ + interrupted = TRUE; + cleanup(); + exit(EXIT_FAILURE); +} + +static float +ranf(void) +{ + long r = (rand() & 077777); + return ((float) r / 32768.); +} + +int +main( + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + int x, y, z, j, p; + float r; + float c; + + for (j = SIGHUP; j <= SIGTERM; j++) + if (signal(j, SIG_IGN) != SIG_IGN) + signal(j, onsig); + + srand(time(0)); + setupterm((char *) 0, 1, (int *) 0); + outs(clear_screen); + outs(cursor_invisible); + if (max_colors > 1) { + if (!valid(set_a_foreground) + || !valid(set_a_background) + || (!valid(orig_colors) && !valid(orig_pair))) + max_colors = -1; + } + + r = (float) (lines - 4); + c = (float) (columns - 4); + + for (;;) { + x = (int) (c * ranf()) + 2; + y = (int) (r * ranf()) + 2; + p = (ranf() > 0.9) ? '*' : ' '; + + tputs(tparm(cursor_address, y, x), 1, outc); + if (max_colors > 0) { + z = ranf() * max_colors; + if (ranf() > 0.01) { + tputs(tparm(set_a_foreground, z), 1, outc); + } else { + tputs(tparm(set_a_background, z), 1, outc); + } + } else if (valid(exit_attribute_mode) + && valid(enter_reverse_mode)) { + if (ranf() <= 0.01) + outs((ranf() > 0.6) ? enter_reverse_mode : + exit_attribute_mode); + } + outc(p); + fflush(stdout); + } +} diff --git a/test/filter.c b/test/filter.c new file mode 100644 index 00000000..6057396a --- /dev/null +++ b/test/filter.c @@ -0,0 +1,109 @@ +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/* + * Author: Thomas E. Dickey 1998 + * + * $Id: filter.c,v 1.2 1998/05/10 00:39:27 tom Exp $ + */ +#include + +/* + * An example of the 'filter()' function in ncurses, this program prompts + * for commands and executes them (like a command shell). It illustrates + * how ncurses can be used to implement programs that are not full-screen. + * + * Ncurses differs slightly from SVr4 curses. The latter does not flush its + * state when exiting program mode, so the attributes on the command lines of + * this program 'bleed' onto the executed commands. Rather than use the + * reset_shell_mode() and reset_prog_mode() functions, we could invoke endwin() + * and refresh(), but that does not work any better. + */ + +#ifndef NCURSES_VERSION +#define attr_t long +#define getnstr(s,n) getstr(s) +#endif + +static int new_command(char *buffer, int length, attr_t underline) +{ + int code; + + attron(A_BOLD); + printw("Command: "); + attron(underline); + code = getnstr(buffer, length); + attroff(underline); + attroff(A_BOLD); + printw("\n"); + + return code; +} + +int main( + int argc GCC_UNUSED, + char *argv[] GCC_UNUSED) +{ + SCREEN *sp; + char buffer[80]; + attr_t underline; + + filter(); + sp = newterm((char *)0, stdout, stdin); + cbreak(); + keypad(stdscr, TRUE); + + if (has_colors()) { + int background = COLOR_BLACK; + start_color(); +#ifdef NCURSES_VERSION + if (use_default_colors () != ERR) + background = -1; +#endif + init_pair(1, COLOR_CYAN, background); + underline = COLOR_PAIR(1); + } else { + underline = A_UNDERLINE; + } + + while (new_command(buffer, sizeof(buffer)-1, underline) != ERR + && strlen(buffer) != 0) { + reset_shell_mode(); + printf("\n"); + fflush(stdout); + system(buffer); + reset_prog_mode(); + touchwin(stdscr); + erase(); + refresh(); + } + printw("done"); + refresh(); + endwin(); + return 0; +} diff --git a/test/firework.c b/test/firework.c index 1a37e049..557a7bf2 100644 --- a/test/firework.c +++ b/test/firework.c @@ -1,154 +1,174 @@ /* - * $Id: firework.c,v 1.11 1997/11/01 19:36:25 tom Exp $ + * $Id: firework.c,v 1.15 1999/10/16 21:33:39 tom Exp $ */ #include -#include /* for tparm() */ - #include -#include #include -static int get_colour(chtype *); -static void explode(int row, int col); -static void showit(void); -static RETSIGTYPE onsig(int sig); - static int my_bg = COLOR_BLACK; -int main( - int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) +static void +cleanup(void) { -int j; -int start,end,row,diff,flag = 0,direction; -unsigned seed; - - for (j=SIGHUP;j<=SIGTERM;j++) - if (signal(j,SIG_IGN)!=SIG_IGN) - signal(j,onsig); - - initscr(); - if (has_colors()) { - start_color(); -#ifdef NCURSES_VERSION - if (use_default_colors() == OK) - my_bg = -1; -#endif - } - curs_set(0); - - seed = time((time_t *)0); - srand(seed); - cbreak(); - for (;;) { - do { - start = rand() % (COLS -3); - end = rand() % (COLS - 3); - start = (start < 2) ? 2 : start; - end = (end < 2) ? 2 : end; - direction = (start > end) ? -1 : 1; - diff = abs(start-end); - } while (diff<2 || diff>=LINES-2); - attrset(A_NORMAL); - for (row=0;row 8) { + *bold = A_BOLD; + attr &= 7; + } + return (attr); +} - *bold = A_NORMAL; - if (attr > 8) { - *bold = A_BOLD; - attr &= 7; - } - return(attr); +static +void +explode(int row, int col) +{ + chtype bold; + erase(); + mvprintw(row, col, "-"); + showit(); + + init_pair(1, get_colour(&bold), my_bg); + attrset(COLOR_PAIR(1) | bold); + mvprintw(row - 1, col - 1, " - "); + mvprintw(row + 0, col - 1, "-+-"); + mvprintw(row + 1, col - 1, " - "); + showit(); + + init_pair(1, get_colour(&bold), my_bg); + attrset(COLOR_PAIR(1) | bold); + mvprintw(row - 2, col - 2, " --- "); + mvprintw(row - 1, col - 2, "-+++-"); + mvprintw(row + 0, col - 2, "-+#+-"); + mvprintw(row + 1, col - 2, "-+++-"); + mvprintw(row + 2, col - 2, " --- "); + showit(); + + init_pair(1, get_colour(&bold), my_bg); + attrset(COLOR_PAIR(1) | bold); + mvprintw(row - 2, col - 2, " +++ "); + mvprintw(row - 1, col - 2, "++#++"); + mvprintw(row + 0, col - 2, "+# #+"); + mvprintw(row + 1, col - 2, "++#++"); + mvprintw(row + 2, col - 2, " +++ "); + showit(); + + init_pair(1, get_colour(&bold), my_bg); + attrset(COLOR_PAIR(1) | bold); + mvprintw(row - 2, col - 2, " # "); + mvprintw(row - 1, col - 2, "## ##"); + mvprintw(row + 0, col - 2, "# #"); + mvprintw(row + 1, col - 2, "## ##"); + mvprintw(row + 2, col - 2, " # "); + showit(); + + init_pair(1, get_colour(&bold), my_bg); + attrset(COLOR_PAIR(1) | bold); + mvprintw(row - 2, col - 2, " # # "); + mvprintw(row - 1, col - 2, "# #"); + mvprintw(row + 0, col - 2, " "); + mvprintw(row + 1, col - 2, "# #"); + mvprintw(row + 2, col - 2, " # # "); + showit(); } -static void -showit(void) +int +main( + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { - refresh(); - napms(120); + int j; + int start, end, row, diff, flag = 0, direction; + unsigned seed; + + for (j = SIGHUP; j <= SIGTERM; j++) + if (signal(j, SIG_IGN) != SIG_IGN) + signal(j, onsig); + + initscr(); + noecho(); + cbreak(); + keypad(stdscr, TRUE); + nodelay(stdscr, TRUE); + + if (has_colors()) { + start_color(); +#ifdef NCURSES_VERSION + if (use_default_colors() == OK) + my_bg = -1; +#endif + } + curs_set(0); + + seed = time((time_t *) 0); + srand(seed); + for (;;) { + do { + start = rand() % (COLS - 3); + end = rand() % (COLS - 3); + start = (start < 2) ? 2 : start; + end = (end < 2) ? 2 : end; + direction = (start > end) ? -1 : 1; + diff = abs(start - end); + } while (diff < 2 || diff >= LINES - 2); + attrset(A_NORMAL); + for (row = 0; row < diff; row++) { + mvprintw(LINES - row, start + (row * direction), + (direction < 0) ? "\\" : "/"); + if (flag++) { + showit(); + erase(); + flag = 0; + } + } + if (flag++) { + showit(); + flag = 0; + } + seed = time((time_t *) 0); + srand(seed); + explode(LINES - row, start + (diff * direction)); + erase(); + showit(); + } } diff --git a/test/hanoi.c b/test/hanoi.c index 25d906ea..3ee64b0a 100644 --- a/test/hanoi.c +++ b/test/hanoi.c @@ -14,7 +14,7 @@ * * Date: 05.Nov.90 * - * $Id: hanoi.c,v 1.15 1997/10/18 20:11:20 tom Exp $ + * $Id: hanoi.c,v 1.16 1999/10/23 15:01:01 tom Exp $ */ #include @@ -118,8 +118,10 @@ unsigned char AutoFlag = 0; fprintf(stderr, "Min screen length 24 lines\n"); return EXIT_FAILURE; } - if(AutoFlag) + if(AutoFlag) { + curs_set(0); leaveok(stdscr, TRUE); /* Attempt to remove cursor */ + } InitTiles(NTiles); DisplayTiles(); if(AutoFlag) { @@ -148,7 +150,6 @@ unsigned char AutoFlag = 0; } } } - curs_set(1); endwin(); return EXIT_SUCCESS; } diff --git a/test/hashtest.c b/test/hashtest.c index 6cf7b753..514ac896 100644 --- a/test/hashtest.c +++ b/test/hashtest.c @@ -3,17 +3,14 @@ * * Generate timing statistics for vertical-motion optimization. * - * $Id: hashtest.c,v 1.12 1997/08/09 14:25:18 tom Exp $ + * $Id: hashtest.c,v 1.14 1998/06/13 22:45:39 tom Exp $ */ -#define NCURSES_TRACE - #ifdef TRACE #define Trace(p) _tracef p #define USE_TRACE 1 #else #define Trace(p) /* nothing */ -#define TRACE 0 #endif #include @@ -106,7 +103,12 @@ static void run_test(bool optimized) int lo = continuous ? LO_CHAR : 'a' - LINES; int hi = continuous ? HI_CHAR : 'a' + LINES; -#ifdef NCURSES_VERSION + if (lo < LO_CHAR) + lo = LO_CHAR; + if (hi > HI_CHAR) + hi = HI_CHAR; + +#if defined(TRACE) || defined(NCURSES_TEST) if (optimized) { Trace(("With hash mapping")); _nc_optimize_enable |= OPTIMIZE_HASHMAP; diff --git a/test/keynames.c b/test/keynames.c index 827709c4..88cadd2f 100644 --- a/test/keynames.c +++ b/test/keynames.c @@ -1,10 +1,10 @@ /* - * $Id: keynames.c,v 1.1 1997/10/25 18:41:04 tom Exp $ + * $Id: keynames.c,v 1.2 1998/06/06 22:45:13 tom Exp $ */ #include -int main(int argc, char *argv[]) +int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { int n; for (n = -1; n < 512; n++) { diff --git a/test/lrtest.c b/test/lrtest.c index 893e1cde..fb996411 100644 --- a/test/lrtest.c +++ b/test/lrtest.c @@ -6,42 +6,125 @@ * This can't be part of the ncurses test-program, because ncurses rips off the * bottom line to do labels. * - * $Id: lrtest.c,v 0.7 1998/02/12 23:49:11 tom Exp $ + * $Id: lrtest.c,v 0.14 1999/10/23 19:44:35 tom Exp $ */ #include +#include + +typedef struct { + int y, x, mode, dir, inc; + chtype value; +} MARK; + +/* + * Make a couple of markers go 'round the border to demonstrate that we can + * really write to all positions properly. + */ +static void +show(MARK * m) +{ + mvaddch(m->y, m->x, m->value); + if (m->mode == 0) { /* along the x-direction */ + m->x += m->inc; + if (m->x >= COLS) { + m->x = COLS - 1; + m->inc = -m->dir * m->inc; + m->y += m->inc; + m->mode = 1; + } else if (m->x < 0) { + m->x = 0; + m->inc = -m->dir * m->inc; + m->y += m->inc; + m->mode = 1; + } + } else { /* along the y-direction */ + m->y += m->inc; + if (m->y >= LINES) { + m->y = LINES - 1; + m->inc = m->dir * m->inc; + m->x += m->inc; + m->mode = 0; + } else if (m->y < 0) { + m->y = 0; + m->inc = m->dir * m->inc; + m->x += m->inc; + m->mode = 0; + } + } +} int main( - int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { + static MARK marks[] = + { + {0, 0, 0, -1, 1, '+' | A_BOLD}, + {0, 0, 1, 1, 2, 'X'}, + {0, 0, 1, -1, 3, 'Y'}, + {0, 8, 0, -1, 1, '+' | A_BOLD}, + {0, 9, 0, -1, 1, '+' | A_BOLD}, + {1, 0, 1, 1, 1, '*' | A_REVERSE}, + {2, 0, 1, 1, 1, '*' | A_REVERSE} + }; + initscr(); + noecho(); + cbreak(); + nodelay(stdscr, TRUE); + curs_set(0); - move(LINES/2-1, 4); - if (!has_ic()) - { +#ifdef KEY_RESIZE + keypad(stdscr, TRUE); + restart: +#endif + move(LINES / 2 - 1, 4); + if (!(has_ic() + /* see PutCharLR() */ + || auto_right_margin + || (enter_am_mode && exit_am_mode))) { addstr("Your terminal lacks the capabilities needed to address the\n"); - move(LINES/2, 4); + move(LINES / 2, 4); addstr("lower-right-hand corner of the screen.\n"); - } - else - { + } else { addstr("This is a test of access to the lower right corner.\n"); - move(LINES/2, 4); + move(LINES / 2, 4); addstr("If the top of the box is missing, the test failed.\n"); - move(LINES/2+1, 4); + move(LINES / 2 + 1, 4); addstr("Please report this (with a copy of your terminfo entry).\n"); - move(LINES/2+2, 4); + move(LINES / 2 + 2, 4); addstr("to the ncurses maintainers, at bug-ncurses@gnu.org.\n"); } - box(stdscr, 0, 0); - move(LINES-1, COLS-1); + for (;;) { + int ch; + unsigned n; + + box(stdscr, 0, 0); + for (n = 0; n < sizeof(marks) / sizeof(marks[0]); n++) { + show(&marks[n]); + } - refresh(); + if ((ch = getch()) > 0) { + if (ch == 'q') + break; + else if (ch == 's') + nodelay(stdscr, FALSE); + else if (ch == ' ') + nodelay(stdscr, TRUE); +#ifdef KEY_RESIZE + else if (ch == KEY_RESIZE) { + erase(); + goto restart; + } +#endif + } + napms(50); + } - getch(); + curs_set(1); endwin(); return 0; } diff --git a/test/modules b/test/modules index a265cfb0..3c69bbd4 100644 --- a/test/modules +++ b/test/modules @@ -1,7 +1,7 @@ # Test-Program modules -# $Id: modules,v 1.6 1998/02/11 12:14:04 tom Exp $ +# $Id: modules,v 1.11 1999/10/23 00:41:02 tom Exp $ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1999 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -34,11 +34,16 @@ @ base blue progs $(srcdir) ../include/term.h bs progs $(srcdir) +cardfile progs $(srcdir) ../include/panel.h ../include/menu.h ../include/form.h +ditto progs $(srcdir) +dots progs $(srcdir) ../include/term.h +filter progs $(srcdir) firework progs $(srcdir) ../include/term.h firstlast progs $(srcdir) gdc progs $(srcdir) hanoi progs $(srcdir) hashtest progs $(srcdir) +keynames progs $(srcdir) knight progs $(srcdir) lrtest progs $(srcdir) ncurses progs $(srcdir) ../include/panel.h ../include/menu.h ../include/form.h diff --git a/test/ncurses.c b/test/ncurses.c index c1d94086..aa24a426 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ DESCRIPTION AUTHOR Author: Eric S. Raymond 1993 -$Id: ncurses.c,v 1.108 1998/02/28 01:11:47 tom Exp $ +$Id: ncurses.c,v 1.120 1999/10/23 20:01:30 tom Exp $ ***************************************************************************/ @@ -185,6 +185,53 @@ static void ShellOut(bool message) refresh(); } +#ifdef NCURSES_MOUSE_VERSION +static const char *mouse_decode(MEVENT const *ep) +{ + static char buf[80]; + + (void) sprintf(buf, "id %2d at (%2d, %2d, %2d) state %4lx = {", + ep->id, ep->x, ep->y, ep->z, ep->bstate); + +#define SHOW(m, s) if ((ep->bstate & m)==m) {strcat(buf,s); strcat(buf, ", ");} + SHOW(BUTTON1_RELEASED, "release-1") + SHOW(BUTTON1_PRESSED, "press-1") + SHOW(BUTTON1_CLICKED, "click-1") + SHOW(BUTTON1_DOUBLE_CLICKED, "doubleclick-1") + SHOW(BUTTON1_TRIPLE_CLICKED, "tripleclick-1") + SHOW(BUTTON1_RESERVED_EVENT, "reserved-1") + SHOW(BUTTON2_RELEASED, "release-2") + SHOW(BUTTON2_PRESSED, "press-2") + SHOW(BUTTON2_CLICKED, "click-2") + SHOW(BUTTON2_DOUBLE_CLICKED, "doubleclick-2") + SHOW(BUTTON2_TRIPLE_CLICKED, "tripleclick-2") + SHOW(BUTTON2_RESERVED_EVENT, "reserved-2") + SHOW(BUTTON3_RELEASED, "release-3") + SHOW(BUTTON3_PRESSED, "press-3") + SHOW(BUTTON3_CLICKED, "click-3") + SHOW(BUTTON3_DOUBLE_CLICKED, "doubleclick-3") + SHOW(BUTTON3_TRIPLE_CLICKED, "tripleclick-3") + SHOW(BUTTON3_RESERVED_EVENT, "reserved-3") + SHOW(BUTTON4_RELEASED, "release-4") + SHOW(BUTTON4_PRESSED, "press-4") + SHOW(BUTTON4_CLICKED, "click-4") + SHOW(BUTTON4_DOUBLE_CLICKED, "doubleclick-4") + SHOW(BUTTON4_TRIPLE_CLICKED, "tripleclick-4") + SHOW(BUTTON4_RESERVED_EVENT, "reserved-4") + SHOW(BUTTON_CTRL, "ctrl") + SHOW(BUTTON_SHIFT, "shift") + SHOW(BUTTON_ALT, "alt") + SHOW(ALL_MOUSE_EVENTS, "all-events") + SHOW(REPORT_MOUSE_POSITION, "position") +#undef SHOW + + if (buf[strlen(buf)-1] == ' ') + buf[strlen(buf)-2] = '\0'; + (void) strcat(buf, "}"); + return(buf); +} +#endif /* NCURSES_MOUSE_VERSION */ + /**************************************************************************** * * Character input test @@ -231,7 +278,7 @@ int y, x; MEVENT event; getmouse(&event); - printw("KEY_MOUSE, %s\n", _tracemouse(&event)); + printw("KEY_MOUSE, %s\n", mouse_decode(&event)); } else #endif /* NCURSES_MOUSE_VERSION */ @@ -304,6 +351,8 @@ int y, x; static int show_attr(int row, int skip, chtype attr, const char *name, bool once) { + int ncv = tigetnum("ncv"); + mvprintw(row, 8, "%s mode:", name); mvprintw(row, 24, "|"); if (skip) printw("%*s", skip, " "); @@ -316,8 +365,34 @@ static int show_attr(int row, int skip, chtype attr, const char *name, bool once attroff(attr); if (skip) printw("%*s", skip, " "); printw("|"); - if (attr != A_NORMAL && !(termattrs() & attr)) - printw(" (N/A)"); + if (attr != A_NORMAL) { + if (!(termattrs() & attr)) { + printw(" (N/A)"); + } else if (ncv > 0 && (getbkgd(stdscr) & A_COLOR)) { + static const attr_t table[] = { + A_STANDOUT, + A_UNDERLINE, + A_REVERSE, + A_BLINK, + A_DIM, + A_BOLD, + A_INVIS, + A_PROTECT, + A_ALTCHARSET + }; + unsigned n; + bool found = FALSE; + for (n = 0; n < sizeof(table)/sizeof(table[0]); n++) { + if ((table[n] & attr) != 0 + && ((1 << n) & ncv) != 0) { + found = TRUE; + break; + } + } + if (found) + printw(" (NCV)"); + } + } return row + 2; } @@ -355,7 +430,7 @@ static void attr_test(void) { int n; int skip = tigetnum("xmc"); - int fg = COLOR_WHITE; + int fg = COLOR_BLACK; /* color pair 0 is special */ int bg = COLOR_BLACK; bool *pairs = (bool *)calloc(COLOR_PAIRS, sizeof(bool)); pairs[0] = TRUE; @@ -405,6 +480,7 @@ static void attr_test(void) refresh(); } while (attr_getc(&n, &fg, &bg)); + free((char *)pairs); bkgdset(A_NORMAL | BLANK); erase(); endwin(); @@ -1440,17 +1516,6 @@ static void acs_and_scroll(void) ****************************************************************************/ #if USE_LIBPANEL -static PANEL *p1; -static PANEL *p2; -static PANEL *p3; -static PANEL *p4; -static PANEL *p5; -static WINDOW *w1; -static WINDOW *w2; -static WINDOW *w3; -static WINDOW *w4; -static WINDOW *w5; - static unsigned long nap_msec = 1; static NCURSES_CONST char *mod[] = @@ -1499,17 +1564,24 @@ saywhat(NCURSES_CONST char *text) mkpanel(rows,cols,tly,tlx) - alloc a win and panel and associate them --------------------------------------------------------------------------*/ static PANEL * -mkpanel(int rows, int cols, int tly, int tlx) -{ -WINDOW *win = newwin(rows,cols,tly,tlx); -PANEL *pan; - - if(!win) - return((PANEL *)0); - if((pan = new_panel(win))) - return(pan); - delwin(win); - return((PANEL *)0); +mkpanel(int color, int rows, int cols, int tly, int tlx) +{ +WINDOW *win; +PANEL *pan = 0; + + if ((win = newwin(rows, cols, tly, tlx)) != 0) { + if ((pan = new_panel(win)) == 0) { + delwin(win); + } else if (has_colors()) { + int fg = (color == COLOR_BLUE) ? COLOR_WHITE : COLOR_BLACK; + int bg = color; + init_pair(color, fg, bg); + wbkgdset(win, COLOR_PAIR(color) | ' '); + } else { + wbkgdset(win, A_BOLD | ' '); + } + } + return pan; } /* end of mkpanel */ /*+------------------------------------------------------------------------- @@ -1543,9 +1615,10 @@ WINDOW *win = panel_window(pan); int num = ((const char *)panel_userptr(pan))[1]; int y,x; - box(win, 0, 0); wmove(win,1,1); wprintw(win,"-pan%c-", num); + wclrtoeol(win); + box(win, 0, 0); for(y = 2; y < getmaxy(win) - 1; y++) { for(x = 1; x < getmaxx(win) - 1; x++) @@ -1559,7 +1632,7 @@ int y,x; static void demo_panels(void) { int itmp; -register y,x; +register int y,x; refresh(); @@ -1570,24 +1643,25 @@ register y,x; } for(y = 0; y < 5; y++) { - p1 = mkpanel(LINES/2 - 2, COLS/8 + 1, 0, 0); - w1 = panel_window(p1); + PANEL *p1; + PANEL *p2; + PANEL *p3; + PANEL *p4; + PANEL *p5; + + p1 = mkpanel(COLOR_RED, LINES/2 - 2, COLS/8 + 1, 0, 0); set_panel_userptr(p1,"p1"); - p2 = mkpanel(LINES/2 + 1, COLS/7, LINES/4, COLS/10); - w2 = panel_window(p2); + p2 = mkpanel(COLOR_GREEN, LINES/2 + 1, COLS/7, LINES/4, COLS/10); set_panel_userptr(p2,"p2"); - p3 = mkpanel(LINES/4, COLS/10, LINES/2, COLS/9); - w3 = panel_window(p3); + p3 = mkpanel(COLOR_YELLOW, LINES/4, COLS/10, LINES/2, COLS/9); set_panel_userptr(p3,"p3"); - p4 = mkpanel(LINES/2 - 2, COLS/8, LINES/2 - 2, COLS/3); - w4 = panel_window(p4); + p4 = mkpanel(COLOR_BLUE, LINES/2 - 2, COLS/8, LINES/2 - 2, COLS/3); set_panel_userptr(p4,"p4"); - p5 = mkpanel(LINES/2 - 2, COLS/8, LINES/2, COLS/2 - 2); - w5 = panel_window(p5); + p5 = mkpanel(COLOR_MAGENTA, LINES/2 - 2, COLS/8, LINES/2, COLS/2 - 2); set_panel_userptr(p5,"p5"); fill_panel(p1); @@ -1678,6 +1752,9 @@ register y,x; for(itmp = 0; itmp < 6; itmp++) { + WINDOW *w4 = panel_window(p4); + WINDOW *w5 = panel_window(p5); + saywhat("m4; press any key to continue"); wmove(w4, LINES/8, 1); waddstr(w4,mod[itmp]); @@ -1686,6 +1763,7 @@ register y,x; waddstr(w5,mod[itmp]); pflush(); wait_a_while(nap_msec); + saywhat("m5; press any key to continue"); wmove(w4, LINES/6, 1); waddstr(w4,mod[itmp]); @@ -2219,14 +2297,25 @@ static int menu_virtualize(int c) { if (c == '\n' || c == KEY_EXIT) return(MAX_COMMAND + 1); + else if (c == 'u') + return(REQ_SCR_ULINE); + else if (c == 'd') + return(REQ_SCR_DLINE); + else if (c == 'b' || c == KEY_NPAGE) + return(REQ_SCR_UPAGE); + else if (c == 'f' || c == KEY_PPAGE) + return(REQ_SCR_DPAGE); else if (c == 'n' || c == KEY_DOWN) return(REQ_NEXT_ITEM); else if (c == 'p' || c == KEY_UP) return(REQ_PREV_ITEM); else if (c == ' ') return(REQ_TOGGLE_ITEM); - else + else { + if (c != KEY_MOUSE) + beep(); return(c); + } } static const char *animals[] = @@ -2241,13 +2330,17 @@ static void menu_test(void) ITEM *items[SIZEOF(animals)]; ITEM **ip = items; const char **ap; - int mrows, mcols; + int mrows, mcols, c; WINDOW *menuwin; +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *)0); +#endif mvaddstr(0, 0, "This is the menu test:"); mvaddstr(2, 0, " Use up and down arrow to move the select bar."); mvaddstr(3, 0, " 'n' and 'p' act like arrows."); - mvaddstr(4, 0, " Press return to exit."); + mvaddstr(4, 0, " 'b' and 'f' scroll up/down (page), 'u' and 'd' (line)."); + mvaddstr(5, 0, " Press return to exit."); refresh(); for (ap = animals; *ap; ap++) @@ -2256,6 +2349,7 @@ static void menu_test(void) m = new_menu(items); + set_menu_format(m, (SIZEOF(animals)+1)/2, 1); scale_menu(m, &mrows, &mcols); menuwin = newwin(mrows + 2, mcols + 2, MENU_Y, MENU_X); @@ -2267,8 +2361,11 @@ static void menu_test(void) post_menu(m); - while (menu_driver(m, menu_virtualize(wGetchar(menuwin))) != E_UNKNOWN_COMMAND) + while ((c = menu_driver(m, menu_virtualize(wGetchar(menuwin)))) != E_UNKNOWN_COMMAND) { + if (c == E_REQUEST_DENIED) + beep(); continue; + } (void) mvprintw(LINES - 2, 0, "You chose: %s\n", item_name(current_item(m))); @@ -2281,6 +2378,9 @@ static void menu_test(void) free_menu(m); for (ip = items; *ip; ip++) free_item(*ip); +#ifdef NCURSES_MOUSE_VERSION + mousemask(0, (mmask_t *)0); +#endif } #ifdef TRACE @@ -2459,12 +2559,14 @@ static FIELD *make_label(int frow, int fcol, NCURSES_CONST char *label) return(f); } -static FIELD *make_field(int frow, int fcol, int rows, int cols) +static FIELD *make_field(int frow, int fcol, int rows, int cols, bool secure) { - FIELD *f = new_field(rows, cols, frow, fcol, 0, 0); + FIELD *f = new_field(rows, cols, frow, fcol, 0, secure ? 1 : 0); - if (f) + if (f) { set_field_back(f, A_UNDERLINE); + set_field_userptr(f, (void *)0); + } return(f); } @@ -2499,101 +2601,142 @@ static void erase_form(FORM *f) delwin(w); } -static int form_virtualize(WINDOW *w) +static int edit_secure(FIELD *me, int c) { + int rows, cols, frow, fcol, nbuf; + + if (field_info(me, &rows, &cols, &frow, &fcol, (int *)0, &nbuf) == E_OK + && nbuf > 0) { + char temp[80]; + long len; + + strcpy(temp, field_buffer(me, 1)); + len = (long)(char *) field_userptr(me); + if (c <= KEY_MAX) { + if (isgraph(c)) { + temp[len++] = c; + temp[len] = 0; + set_field_buffer(me, 1, temp); + c = '*'; + } else { + c = 0; + } + } else { + switch (c) { + case REQ_BEG_FIELD: + case REQ_CLR_EOF: + case REQ_CLR_EOL: + case REQ_DEL_LINE: + case REQ_DEL_WORD: + case REQ_DOWN_CHAR: + case REQ_END_FIELD: + case REQ_INS_CHAR: + case REQ_INS_LINE: + case REQ_LEFT_CHAR: + case REQ_NEW_LINE: + case REQ_NEXT_WORD: + case REQ_PREV_WORD: + case REQ_RIGHT_CHAR: + case REQ_UP_CHAR: + c = 0; /* we don't want to do inline editing */ + break; + case REQ_CLR_FIELD: + if (len) { + temp[0] = 0; + set_field_buffer(me, 1, temp); + } + break; + case REQ_DEL_CHAR: + case REQ_DEL_PREV: + if (len) { + temp[--len] = 0; + set_field_buffer(me, 1, temp); + } + break; + } + } + set_field_userptr(me, (void *)len); + } + return c; +} + +static int form_virtualize(FORM *f, WINDOW *w) +{ + static const struct { + int code; + int result; + } lookup[] = { + { CTRL('A'), REQ_NEXT_CHOICE }, + { CTRL('B'), REQ_PREV_WORD }, + { CTRL('C'), REQ_CLR_EOL }, + { CTRL('D'), REQ_DOWN_FIELD }, + { CTRL('E'), REQ_END_FIELD }, + { CTRL('F'), REQ_NEXT_PAGE }, + { CTRL('G'), REQ_DEL_WORD }, + { CTRL('H'), REQ_DEL_PREV }, + { CTRL('I'), REQ_INS_CHAR }, + { CTRL('K'), REQ_CLR_EOF }, + { CTRL('L'), REQ_LEFT_FIELD }, + { CTRL('M'), REQ_NEW_LINE }, + { CTRL('N'), REQ_NEXT_FIELD }, + { CTRL('O'), REQ_INS_LINE }, + { CTRL('P'), REQ_PREV_FIELD }, + { CTRL('R'), REQ_RIGHT_FIELD }, + { CTRL('S'), REQ_BEG_FIELD }, + { CTRL('U'), REQ_UP_FIELD }, + { CTRL('V'), REQ_DEL_CHAR }, + { CTRL('W'), REQ_NEXT_WORD }, + { CTRL('X'), REQ_CLR_FIELD }, + { CTRL('Y'), REQ_DEL_LINE }, + { CTRL('Z'), REQ_PREV_CHOICE }, + { ESCAPE, MAX_FORM_COMMAND + 1 }, + { KEY_BACKSPACE, REQ_DEL_PREV }, + { KEY_DOWN, REQ_DOWN_CHAR }, + { KEY_END, REQ_LAST_FIELD }, + { KEY_HOME, REQ_FIRST_FIELD }, + { KEY_LEFT, REQ_LEFT_CHAR }, + { KEY_LL, REQ_LAST_FIELD }, + { KEY_NEXT, REQ_NEXT_FIELD }, + { KEY_NPAGE, REQ_NEXT_PAGE }, + { KEY_PPAGE, REQ_PREV_PAGE }, + { KEY_PREVIOUS, REQ_PREV_FIELD }, + { KEY_RIGHT, REQ_RIGHT_CHAR }, + { KEY_UP, REQ_UP_CHAR }, + { QUIT, MAX_FORM_COMMAND + 1 } + }; + static int mode = REQ_INS_MODE; int c = wGetchar(w); + unsigned n; + FIELD *me = current_field(f); - switch(c) - { - case QUIT: - case ESCAPE: - return(MAX_FORM_COMMAND + 1); - - /* demo doesn't use these three, leave them in anyway as sample code */ - case KEY_NPAGE: - case CTRL('F'): - return(REQ_NEXT_PAGE); - case KEY_PPAGE: - return(REQ_PREV_PAGE); - - case KEY_NEXT: - case CTRL('N'): - return(REQ_NEXT_FIELD); - case KEY_PREVIOUS: - case CTRL('P'): - return(REQ_PREV_FIELD); - - case KEY_HOME: - return(REQ_FIRST_FIELD); - case KEY_END: - case KEY_LL: - return(REQ_LAST_FIELD); - - case CTRL('L'): - return(REQ_LEFT_FIELD); - case CTRL('R'): - return(REQ_RIGHT_FIELD); - case CTRL('U'): - return(REQ_UP_FIELD); - case CTRL('D'): - return(REQ_DOWN_FIELD); - - case CTRL('W'): - return(REQ_NEXT_WORD); - case CTRL('B'): - return(REQ_PREV_WORD); - case CTRL('S'): - return(REQ_BEG_FIELD); - case CTRL('E'): - return(REQ_END_FIELD); - - case KEY_LEFT: - return(REQ_LEFT_CHAR); - case KEY_RIGHT: - return(REQ_RIGHT_CHAR); - case KEY_UP: - return(REQ_UP_CHAR); - case KEY_DOWN: - return(REQ_DOWN_CHAR); - - case CTRL('M'): - return(REQ_NEW_LINE); - case CTRL('I'): - return(REQ_INS_CHAR); - case CTRL('O'): - return(REQ_INS_LINE); - case CTRL('V'): - return(REQ_DEL_CHAR); - - case CTRL('H'): - case KEY_BACKSPACE: - return(REQ_DEL_PREV); - case CTRL('Y'): - return(REQ_DEL_LINE); - case CTRL('G'): - return(REQ_DEL_WORD); - - case CTRL('C'): - return(REQ_CLR_EOL); - case CTRL('K'): - return(REQ_CLR_EOF); - case CTRL('X'): - return(REQ_CLR_FIELD); - case CTRL('A'): - return(REQ_NEXT_CHOICE); - case CTRL('Z'): - return(REQ_PREV_CHOICE); - - case CTRL(']'): + if (c == CTRL(']')) { if (mode == REQ_INS_MODE) - return(mode = REQ_OVL_MODE); + mode = REQ_OVL_MODE; else - return(mode = REQ_INS_MODE); + mode = REQ_INS_MODE; + c = mode; + } else { + for (n = 0; n < sizeof(lookup)/sizeof(lookup[0]); n++) { + if (lookup[n].code == c) { + c = lookup[n].result; + break; + } + } + } - default: - return(c); + /* + * 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) { + c = edit_secure(me, c); + set_field_back(me, A_REVERSE); + } else if (c <= MAX_FORM_COMMAND) { + c = edit_secure(me, c); + set_field_back(me, A_UNDERLINE); } + return c; } static int my_form_driver(FORM *form, int c) @@ -2612,10 +2755,9 @@ static void demo_forms(void) { WINDOW *w; FORM *form; - FIELD *f[10]; + FIELD *f[12], *secure; int finished = 0, c; - - mvaddstr(10, 57, "Forms Entry Test"); + unsigned n = 0; move(18, 0); addstr("Defined form-traversal keys: ^Q/ESC- exit form\n"); @@ -2629,19 +2771,25 @@ static void demo_forms(void) addstr("^G -- delete current word ^C -- clear to end of line\n"); addstr("^K -- clear to end of field ^X -- clear field\n"); addstr("Arrow keys move within a field as you would expect."); + + mvaddstr(4, 57, "Forms Entry Test"); + refresh(); /* describe the form */ - f[0] = make_label(0, 15, "Sample Form"); - f[1] = make_label(2, 0, "Last Name"); - f[2] = make_field(3, 0, 1, 18); - f[3] = make_label(2, 20, "First Name"); - f[4] = make_field(3, 20, 1, 12); - f[5] = make_label(2, 34, "Middle Name"); - f[6] = make_field(3, 34, 1, 12); - f[7] = make_label(5, 0, "Comments"); - f[8] = make_field(6, 0, 4, 46); - f[9] = (FIELD *)0; + f[n++] = make_label(0, 15, "Sample Form"); + f[n++] = make_label(2, 0, "Last Name"); + f[n++] = make_field(3, 0, 1, 18, FALSE); + f[n++] = make_label(2, 20, "First Name"); + f[n++] = make_field(3, 20, 1, 12, FALSE); + f[n++] = make_label(2, 34, "Middle Name"); + f[n++] = make_field(3, 34, 1, 12, FALSE); + f[n++] = make_label(5, 0, "Comments"); + f[n++] = make_field(6, 0, 4, 46, FALSE); + f[n++] = make_label(5, 20, "Password:"); + secure = + f[n++] = make_field(5, 30, 1, 9, TRUE); + f[n++] = (FIELD *)0; form = new_form(f); @@ -2651,9 +2799,12 @@ static void demo_forms(void) raw(); while (!finished) { - switch(form_driver(form, c = form_virtualize(w))) + switch(form_driver(form, c = form_virtualize(form, w))) { case E_OK: + mvaddstr(5, 57, field_buffer(secure, 1)); + clrtoeol(); + refresh(); break; case E_UNKNOWN_COMMAND: finished = my_form_driver(form, c); @@ -3035,7 +3186,16 @@ main(int argc, char *argv[]) */ endwin(); +#if HAVE_CURSES_VERSION + (void) printf("Welcome to %s. Press ? for help.\n", curses_version()); +#elif defined(NCURSES_VERSION_MAJOR) && defined(NCURSES_VERSION_MINOR) && defined(NCURSES_VERSION_PATCH) + (void) printf("Welcome to ncurses %d.%d.%d. Press ? for help.\n", + NCURSES_VERSION_MAJOR, + NCURSES_VERSION_MINOR, + NCURSES_VERSION_PATCH); +#else (void) puts("Welcome to ncurses. Press ? for help."); +#endif do { (void) puts("This is the ncurses main menu"); diff --git a/test/rain.c b/test/rain.c index 4132a438..646ab96e 100644 --- a/test/rain.c +++ b/test/rain.c @@ -1,5 +1,5 @@ /* - * $Id: rain.c,v 1.11 1997/09/18 18:36:46 tom Exp $ + * $Id: rain.c,v 1.13 1999/10/23 01:31:26 tom Exp $ */ #include @@ -100,6 +100,12 @@ float c; curs_set(1); endwin(); return(EXIT_SUCCESS); + case 's': + nodelay(stdscr, FALSE); + break; + case ' ': + nodelay(stdscr, TRUE); + break; #ifdef KEY_RESIZE case(KEY_RESIZE): r = (float)(LINES - 4); @@ -122,10 +128,6 @@ onsig(int n GCC_UNUSED) static float ranf(void) { - float rv; - long r = rand(); - - r &= 077777; - rv =((float)r/32767.); - return rv; + long r = (rand() & 077777); + return ((float) r / 32768.); } diff --git a/test/tclock.c b/test/tclock.c index bccce31d..0c795684 100644 --- a/test/tclock.c +++ b/test/tclock.c @@ -1,6 +1,5 @@ #include "test.priv.h" -#include #include #include @@ -19,9 +18,9 @@ would be a precalc table for the 60 hand positions, so that the floating point stuff can be ditched. As I said, it was a 20 hackup minute job.] - + COMING SOON: tfishtank. Be the envy of your mac-owning - colleagues. + colleagues. */ /* To compile: cc -o tclock tclock.c -lcurses -lm */ @@ -40,145 +39,188 @@ /* Plot a point */ static void -plot(int x,int y,char col) +plot(int x, int y, char col) { - mvaddch(y,x,(chtype)col); + mvaddch(y, x, (chtype) col); } - /* Draw a diagonal(arbitrary) line using Bresenham's alogrithm. */ static void -dline(int from_x, int from_y, int x2, int y2, char ch) +dline(int pair, int from_x, int from_y, int x2, int y2, char ch) { - int dx,dy; - int ax,ay; - int sx,sy; - int x,y; - int d; - - dx=x2-from_x; - dy=y2-from_y; - - ax=abs(dx*2); - ay=abs(dy*2); - - sx=sign(dx); - sy=sign(dy); - - x=from_x; - y=from_y; - - if(ax>ay) - { - d=ay-(ax/2); - - while(1) - { - plot(x,y,ch); - if(x==x2) return; - - if(d>=0) - { - y+=sy; - d-=ax; - } - x+=sx; - d+=ay; - } + int dx, dy; + int ax, ay; + int sx, sy; + int x, y; + int d; + + if (has_colors()) + attrset(COLOR_PAIR(pair)); + + dx = x2 - from_x; + dy = y2 - from_y; + + ax = abs(dx * 2); + ay = abs(dy * 2); + + sx = sign(dx); + sy = sign(dy); + + x = from_x; + y = from_y; + + if (ax > ay) { + d = ay - (ax / 2); + + while (1) { + plot(x, y, ch); + if (x == x2) + return; + + if (d >= 0) { + y += sy; + d -= ax; + } + x += sx; + d += ay; } - else - { - d=ax-(ay/2); - - while(1) - { - plot(x,y,ch); - if(y==y2) return; - - if(d>=0) - { - x+=sx; - d-=ay; - } - y+=sy; - d+=ax; - } + } else { + d = ax - (ay / 2); + + while (1) { + plot(x, y, ch); + if (y == y2) + return; + + if (d >= 0) { + x += sx; + d -= ay; + } + y += sy; + d += ax; } + } } int main( - int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { - int i,cx,cy; - double mradius, hradius, mangle, hangle; - double sangle, sradius, hours; - int hdx, hdy; - int mdx, mdy; - int sdx, sdy; - time_t tim; - struct tm *t; - char szChar[10]; - - initscr(); - noecho(); - - cx=39; - cy=12; - mradius=9; - hradius=6; - sradius=8; - - for(i=0;i<12;i++) - { - sangle=(i+1)*(2.0*PI)/12.0; - sradius=10; - sdx = A2X(sangle, sradius); - sdy = A2Y(sangle, sradius); - sprintf(szChar,"%d",i+1); - - mvaddstr((int)(cy-sdy),(int)(cx+sdx),szChar); - } - - mvaddstr(0,0,"ASCII Clock by Howard Jones (ha.jones@ic.ac.uk),1994"); - - sradius=8; - for(;;) - { - napms(1000); - - tim = time(0); - t = localtime(&tim); - - hours = (t->tm_hour + (t->tm_min/60.0)); - if(hours>12.0) hours -= 12.0; - - mangle = ((t->tm_min) * (2 * PI)/60.0); - mdx = A2X(mangle, mradius); - mdy = A2Y(mangle, mradius); - - hangle = ((hours) * (2.0 * PI)/12.0); - hdx = A2X(hangle, hradius); - hdy = A2Y(hangle, hradius); - - sangle = ((t->tm_sec) * (2.0 * PI)/60.0); - sdx = A2X(sangle, sradius); - sdy = A2Y(sangle, sradius); - - plot(cx+sdx,cy-sdy,'O'); - dline(cx,cy,cx+hdx,cy-hdy,'.'); - dline(cx,cy,cx+mdx,cy-mdy,'#'); - - mvaddstr(23,0,ctime(&tim)); - refresh(); - if ((t->tm_sec % 5) == 0) beep(); - - plot(cx+sdx,cy-sdy,' '); - dline(cx,cy,cx+hdx,cy-hdy,' '); - dline(cx,cy,cx+mdx,cy-mdy,' '); - - } - - return 0; + int i, cx, cy; + double mradius, hradius, mangle, hangle; + double sangle, sradius, hours; + int hdx, hdy; + int mdx, mdy; + int sdx, sdy; + int ch; + int lastbeep = -1; + time_t tim; + struct tm *t; + char szChar[10]; + int my_bg = COLOR_BLACK; + + initscr(); + noecho(); + cbreak(); + nodelay(stdscr, TRUE); + curs_set(0); + + if (has_colors()) { + start_color(); +#ifdef NCURSES_VERSION + if (use_default_colors() == OK) + my_bg = -1; +#endif + init_pair(1, COLOR_RED, my_bg); + init_pair(2, COLOR_MAGENTA, my_bg); + init_pair(3, COLOR_GREEN, my_bg); + } +#ifdef KEY_RESIZE + keypad(stdscr, TRUE); + restart: +#endif + cx = (COLS - 1) / 2; /* 39 */ + cy = LINES / 2; /* 12 */ + ch = (cx > cy) ? cy : cx; /* usually cy */ + mradius = (3 * cy) / 4; /* 9 */ + hradius = cy / 2; /* 6 */ + sradius = (2 * cy) / 3; /* 8 */ + + for (i = 0; i < 12; i++) { + sangle = (i + 1) * (2.0 * PI) / 12.0; + sradius = (5 * cy) / 6; /* 10 */ + sdx = A2X(sangle, sradius); + sdy = A2Y(sangle, sradius); + sprintf(szChar, "%d", i + 1); + + mvaddstr(cy - sdy, cx + sdx, szChar); + } + + mvaddstr(0, 0, "ASCII Clock by Howard Jones (ha.jones@ic.ac.uk),1994"); + + sradius = 8; + for (;;) { + napms(1000); + + tim = time(0); + t = localtime(&tim); + + hours = (t->tm_hour + (t->tm_min / 60.0)); + if (hours > 12.0) + hours -= 12.0; + + mangle = ((t->tm_min) * (2 * PI) / 60.0); + mdx = A2X(mangle, mradius); + mdy = A2Y(mangle, mradius); + + hangle = ((hours) * (2.0 * PI) / 12.0); + hdx = A2X(hangle, hradius); + hdy = A2Y(hangle, hradius); + + sangle = ((t->tm_sec) * (2.0 * PI) / 60.0); + sdx = A2X(sangle, sradius); + sdy = A2Y(sangle, sradius); + + dline(3, cx, cy, cx + mdx, cy - mdy, '#'); + + attrset(A_REVERSE); + dline(2, cx, cy, cx + hdx, cy - hdy, '.'); + attroff(A_REVERSE); + + if (has_colors()) + attrset(COLOR_PAIR(1)); + + plot(cx + sdx, cy - sdy, 'O'); + + if (has_colors()) + attrset(COLOR_PAIR(0)); + + mvaddstr(LINES - 2, 0, ctime(&tim)); + refresh(); + if ((t->tm_sec % 5) == 0 + && t->tm_sec != lastbeep) { + lastbeep = t->tm_sec; + beep(); + } + + if ((ch = getch()) != ERR) { +#ifdef KEY_RESIZE + if (ch == KEY_RESIZE) { + erase(); + goto restart; + } +#endif + break; + } + + plot(cx + sdx, cy - sdy, ' '); + dline(0, cx, cy, cx + hdx, cy - hdy, ' '); + dline(0, cx, cy, cx + mdx, cy - mdy, ' '); + + } + + curs_set(1); + endwin(); + return 0; } diff --git a/test/testcurs.c b/test/testcurs.c index 7f40fffa..ff776570 100644 --- a/test/testcurs.c +++ b/test/testcurs.c @@ -7,7 +7,7 @@ * wrs(5/28/93) -- modified to be consistent (perform identically) with either * PDCurses or under Unix System V, R4 * - * $Id: testcurs.c,v 1.17 1997/09/20 17:45:04 tom Exp $ + * $Id: testcurs.c,v 1.19 1999/02/14 00:42:28 tom Exp $ */ #include @@ -187,7 +187,7 @@ scrollTest (WINDOW *win) { int i; int OldX, OldY; - const char *Message = "The window will now scroll slowly"; + NCURSES_CONST char *Message = "The window will now scroll slowly"; wclear(win); mvwprintw (win, height - 2, 1, Message); @@ -359,6 +359,8 @@ inputTest (WINDOW *win) wrefresh(win); echo(); noraw(); + num = 0; + *buffer = 0; mvwscanw(win, 7, 6, "%d %s", &num,buffer); mvwprintw(win, 8, 6, "String: %s Number: %d", buffer,num); Continue(win); @@ -476,10 +478,12 @@ outputTest (WINDOW *win) wrefresh(win); noraw(); echo(); + *Buffer = 0; wscanw (win, "%s", Buffer); printw("This is a formatted string in stdscr: %d %s\n", 42, "is it"); mvaddstr(10, 1, "Enter a string: "); + *Buffer = 0; scanw ("%s", Buffer); if (tigetstr("cvvis") != 0) { diff --git a/test/view.c b/test/view.c index ad6bb2e1..8381dc88 100644 --- a/test/view.c +++ b/test/view.c @@ -22,7 +22,7 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.26 1997/11/15 22:36:41 tom Exp $ + * $Id: view.c,v 1.27 1998/08/22 18:33:41 tom Exp $ */ #include @@ -348,9 +348,9 @@ static void show_all(void) for (i = 1; i < LINES; i++) { move(i, 0); if ((s = lptr[i-1]) != 0 && (int)strlen(s) > shift) - printw("%3d:%.*s", lptr+i-lines, COLS-4, s + shift); + printw("%3ld:%.*s", (long) (lptr+i-lines), COLS-4, s + shift); else - printw("%3d:", lptr+i-lines); + printw("%3ld:", (long) (lptr+i-lines)); clrtoeol(); } setscrreg(1, LINES-1); diff --git a/test/worm.c b/test/worm.c index ceb4f980..5f0ab5dc 100644 --- a/test/worm.c +++ b/test/worm.c @@ -34,26 +34,27 @@ Options: traces will be dumped. The program stops and waits for one character of input at the beginning and end of the interval. - $Id: worm.c,v 1.21 1998/01/30 10:17:59 tom Exp $ + $Id: worm.c,v 1.26 1999/10/23 01:31:40 tom Exp $ */ #include -#include /* for tparm() */ - #include -#define cursor(col,row) move(row,col) +#define typeAlloc(type,n) (type *) malloc(n * sizeof(type)) +#define typeRealloc(type,n,p) (type *) realloc(p, n * sizeof(type)) -short *ref[128]; -static chtype flavor[]={ - 'O' , '*', '#', '$', '%', '0', '@', +static chtype flavor[] = +{ + 'O', '*', '#', '$', '%', '0', '@', }; #define MAXWORMS (sizeof(flavor)/sizeof(chtype)) -static const short xinc[]={ - 1, 1, 1, 0, -1, -1, -1, 0 -}, yinc[]={ - -1, 0, 1, 1, 1, 0, -1, -1 +static const short xinc[] = +{ + 1, 1, 1, 0, -1, -1, -1, 0 +}, yinc[] = +{ + -1, 0, 1, 1, 1, 0, -1, -1 }; static struct worm { int orientation, head; @@ -61,12 +62,13 @@ static struct worm { } worm[40]; static const char *field; -static int length=16, number=3; -static chtype trail=' '; +static int length = 16, number = 3; +static chtype trail = ' '; #ifdef TRACE int generation, trace_start, trace_end, singlestep; #endif /* TRACE */ +/* *INDENT-OFF* */ static const struct options { int nopts; int opts[3]; @@ -152,64 +154,90 @@ static const struct options { { 0, { 0, 0, 0 } }, { 0, { 0, 0, 0 } } }; +/* *INDENT-ON* */ + +static void +cleanup(void) +{ + standend(); + refresh(); + curs_set(1); + endwin(); +} + +static RETSIGTYPE +onsig(int sig GCC_UNUSED) +{ + cleanup(); + exit(EXIT_FAILURE); +} -static RETSIGTYPE onsig(int sig); -static float ranf(void); +static float +ranf(void) +{ + long r = (rand() & 077777); + return ((float) r / 32768.); +} int main(int argc, char *argv[]) { -int x, y; -int n; -struct worm *w; -const struct options *op; -int h; -short *ip; -int last, bottom; - - for (x=1;x1024) { - fprintf(stderr,"%s: Invalid length\n",*argv); - return EXIT_FAILURE; - } - break; - case 'n': - if (++x==argc) goto usage; - if ((number=atoi(argv[x]))<1||number>40) { - fprintf(stderr,"%s: Invalid number of worms\n",*argv); - return EXIT_FAILURE; - } - break; - case 't': - trail='.'; - break; + short **ref; + int x, y; + int n; + int ch; + struct worm *w; + const struct options *op; + int h; + short *ip; + int last, bottom; + + for (x = 1; x < argc; x++) { + char *p; + p = argv[x]; + if (*p == '-') + p++; + switch (*p) { + case 'f': + field = "WORM"; + break; + case 'l': + if (++x == argc) + goto usage; + if ((length = atoi(argv[x])) < 2 || length > 1024) { + fprintf(stderr, "%s: Invalid length\n", *argv); + return EXIT_FAILURE; + } + break; + case 'n': + if (++x == argc) + goto usage; + if ((number = atoi(argv[x])) < 1 || number > 40) { + fprintf(stderr, "%s: Invalid number of worms\n", *argv); + return EXIT_FAILURE; + } + break; + case 't': + trail = '.'; + break; #ifdef TRACE - case 'S': - singlestep = TRUE; - break; - case 'T': - trace_start = atoi(argv[++x]); - trace_end = atoi(argv[++x]); - break; - case 'N': - _nc_optimize_enable ^= OPTIMIZE_ALL; /* declared by ncurses */ - break; + case 'S': + singlestep = TRUE; + break; + case 'T': + trace_start = atoi(argv[++x]); + trace_end = atoi(argv[++x]); + break; + case 'N': + _nc_optimize_enable ^= OPTIMIZE_ALL; /* declared by ncurses */ + break; #endif /* TRACE */ - default: - usage: - fprintf(stderr, "usage: %s [-field] [-length #] [-number #] [-trail]\n",*argv); - return EXIT_FAILURE; - break; - } + default: + usage: + fprintf(stderr, + "usage: %s [-field] [-length #] [-number #] [-trail]\n", *argv); + return EXIT_FAILURE; + } } signal(SIGINT, onsig); @@ -220,152 +248,183 @@ int last, bottom; curs_set(0); - bottom = LINES-1; - last = COLS-1; + bottom = LINES - 1; + last = COLS - 1; #ifdef A_COLOR - if (has_colors()) - { + if (has_colors()) { int bg = COLOR_BLACK; start_color(); #ifdef NCURSES_VERSION if (use_default_colors() == OK) bg = -1; #endif - - init_pair(COLOR_GREEN, COLOR_GREEN, bg); - init_pair(COLOR_RED, COLOR_RED, bg); - init_pair(COLOR_CYAN, COLOR_CYAN, bg); - init_pair(COLOR_WHITE, COLOR_WHITE, bg); - init_pair(COLOR_MAGENTA, COLOR_MAGENTA, bg); - init_pair(COLOR_BLUE, COLOR_BLUE, bg); - init_pair(COLOR_YELLOW, COLOR_YELLOW, bg); - - flavor[0] |= COLOR_PAIR(COLOR_GREEN) | A_BOLD; - flavor[1] |= COLOR_PAIR(COLOR_RED) | A_BOLD; - flavor[2] |= COLOR_PAIR(COLOR_CYAN) | A_BOLD; - flavor[3] |= COLOR_PAIR(COLOR_WHITE) | A_BOLD; - flavor[4] |= COLOR_PAIR(COLOR_MAGENTA) | A_BOLD; - flavor[5] |= COLOR_PAIR(COLOR_BLUE) | A_BOLD; - flavor[6] |= COLOR_PAIR(COLOR_YELLOW) | A_BOLD; + +#define SET_COLOR(num, fg) \ + init_pair(num+1, fg, bg); \ + flavor[num] |= COLOR_PAIR(num+1) | A_BOLD + + SET_COLOR(0, COLOR_GREEN); + SET_COLOR(1, COLOR_RED); + SET_COLOR(2, COLOR_CYAN); + SET_COLOR(3, COLOR_WHITE); + SET_COLOR(4, COLOR_MAGENTA); + SET_COLOR(5, COLOR_BLUE); + SET_COLOR(6, COLOR_YELLOW); } #endif /* A_COLOR */ - ip=(short *)malloc(LINES*COLS*sizeof (short)); - - for (n=0;n=0;) *ip++=0; #ifdef BADCORNER /* if addressing the lower right corner doesn't work in your curses */ - ref[bottom][last]=1; + ref[bottom][last] = 1; #endif /* BADCORNER */ - for (n=number, w= &worm[0];--n>=0;w++) { - w->orientation=w->head=0; - if (!(ip=(short *)malloc((length+1)*sizeof (short)))) { - fprintf(stderr,"%s: out of memory\n",*argv); - return EXIT_FAILURE; - } - w->xpos=ip; - for (x=length;--x>=0;) *ip++ = -1; - if (!(ip=(short *)malloc((length+1)*sizeof (short)))) { - fprintf(stderr,"%s: out of memory\n",*argv); - return EXIT_FAILURE; - } - w->ypos=ip; - for (y=length;--y>=0;) *ip++ = -1; + for (n = number, w = &worm[0]; --n >= 0; w++) { + w->orientation = w->head = 0; + if (!(ip = typeAlloc(short, (length + 1)))) { + fprintf(stderr, "%s: out of memory\n", *argv); + return EXIT_FAILURE; + } + w->xpos = ip; + for (x = length; --x >= 0;) + *ip++ = -1; + if (!(ip = typeAlloc(short, (length + 1)))) { + fprintf(stderr, "%s: out of memory\n", *argv); + return EXIT_FAILURE; + } + w->ypos = ip; + for (y = length; --y >= 0;) + *ip++ = -1; } if (field) { - register const char *p; - p=field; - for (y=bottom;--y>=0;) { - for (x=COLS;--x>=0;) { - addch((chtype)(*p++)); - if (!*p) p=field; - } - addch('\n'); - } + const char *p; + p = field; + for (y = bottom; --y >= 0;) { + for (x = COLS; --x >= 0;) { + addch((chtype) (*p++)); + if (!*p) + p = field; + } + } } + napms(10); refresh(); +#ifndef TRACE + nodelay(stdscr, TRUE); +#endif for (;;) { #ifdef TRACE - if (trace_start || trace_end) { - if (generation == trace_start) { - trace(TRACE_CALLS); - getch(); - } else if (generation == trace_end) { - trace(0); - getch(); + if (trace_start || trace_end) { + if (generation == trace_start) { + trace(TRACE_CALLS); + getch(); + } else if (generation == trace_end) { + trace(0); + getch(); + } + + if (singlestep && generation > trace_start && generation < trace_end) + getch(); + + generation++; + } +#else + if ((ch = getch()) > 0) { +#ifdef KEY_RESIZE + if (ch == KEY_RESIZE) { + if (last != COLS - 1) { + for (y = 0; y <= bottom; y++) { + ref[y] = typeRealloc(short, COLS, ref[y]); + for (x = last + 1; x < COLS; x++) + ref[y][x] = 0; } - - if (singlestep && generation > trace_start && generation < trace_end) - getch(); - - generation++; + last = COLS - 1; } -#endif /* TRACE */ - - for (n=0,w= &worm[0];nxpos[h=w->head])<0) { - cursor(x=w->xpos[h]=0,y=w->ypos[h]=bottom); - addch(flavor[n % MAXWORMS]); - ref[y][x]++; + if (bottom != LINES - 1) { + ref = typeRealloc(short *, LINES, ref); + for (y = COLS; y <= bottom; y++) + free(ref[y]); + for (y = bottom + 1; y < LINES; y++) { + ref[y] = typeAlloc(short, COLS); + for (x = 0; x < COLS; x++) + ref[y][x] = 0; } - else y=w->ypos[h]; - if (++h==length) h=0; - if (w->xpos[w->head=h]>=0) { - register int x1, y1; - x1=w->xpos[h]; y1=w->ypos[h]; - if (--ref[y1][x1]==0) { - cursor(x1,y1); addch(trail); - } - } - op= &(x==0 ? (y==0 ? upleft : (y==bottom ? lowleft : left)) : - (x==last ? (y==0 ? upright : (y==bottom ? lowright : right)) : - (y==0 ? upper : (y==bottom ? lower : normal))))[w->orientation]; - switch (op->nopts) { - case 0: - refresh(); - curs_set(1); - endwin(); - return EXIT_SUCCESS; - case 1: - w->orientation=op->opts[0]; - break; - default: - w->orientation=op->opts[(int)(ranf()*(float)op->nopts)]; - } - cursor(x+=xinc[w->orientation], y+=yinc[w->orientation]); - - if (y < 0 ) y = 0; - addch(flavor[n % MAXWORMS]); - ref[w->ypos[h]=y][w->xpos[h]=x]++; + bottom = LINES - 1; } - refresh(); - } -} + } +#endif + /* + * Make it simple to put this into single-step mode, or resume + * normal operation -TD + */ + if (ch == 'q') { + cleanup(); + return (EXIT_SUCCESS); + } else if (ch == 's') { + nodelay(stdscr, FALSE); + } else if (ch == ' ') { + nodelay(stdscr, TRUE); + } + } +#endif /* TRACE */ -static RETSIGTYPE -onsig(int sig GCC_UNUSED) -{ - standend(); + for (n = 0, w = &worm[0]; n < number; n++, w++) { + if ((x = w->xpos[h = w->head]) < 0) { + move(y = w->ypos[h] = bottom, x = w->xpos[h] = 0); + addch(flavor[n % MAXWORMS]); + ref[y][x]++; + } else { + y = w->ypos[h]; + } + if (x > last) + x = last; + if (y > bottom) + y = bottom; + if (++h == length) + h = 0; + if (w->xpos[w->head = h] >= 0) { + int x1, y1; + x1 = w->xpos[h]; + y1 = w->ypos[h]; + if (y1 < LINES + && x1 < COLS + && --ref[y1][x1] == 0) { + move(y1, x1); + addch(trail); + } + } + op = &(x == 0 ? (y == 0 ? upleft : (y == bottom ? lowleft : + left)) : + (x == last ? (y == 0 ? upright : (y == bottom ? lowright : + right)) : + (y == 0 ? upper : (y == bottom ? lower : normal))))[w->orientation]; + switch (op->nopts) { + case 0: + cleanup(); + return EXIT_SUCCESS; + case 1: + w->orientation = op->opts[0]; + break; + default: + w->orientation = op->opts[(int) (ranf() * (float) op->nopts)]; + } + move(y += yinc[w->orientation], x += xinc[w->orientation]); + + if (y < 0) + y = 0; + addch(flavor[n % MAXWORMS]); + ref[w->ypos[h] = y][w->xpos[h] = x]++; + } + napms(10); refresh(); - curs_set(1); - endwin(); - exit(EXIT_FAILURE); -} - -static float -ranf(void) -{ -float rv; -long r = rand(); - - r &= 077777; - rv =((float)r/32767.); - return rv; + } } -- 2.44.0