]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.5 v5.5
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 9 Oct 2005 18:41:57 +0000 (14:41 -0400)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 9 Oct 2005 18:41:57 +0000 (14:41 -0400)
647 files changed:
ANNOUNCE
Ada95/gen/Makefile.in
Ada95/gen/gen.c
Ada95/gen/terminal_interface-curses-mouse.ads.m4
Ada95/gen/terminal_interface-curses.ads.m4
Ada95/samples/Makefile.in
Ada95/samples/ncurses2-acs_and_scroll.adb
Ada95/samples/ncurses2-acs_display.adb
Ada95/samples/ncurses2-attr_test.adb
Ada95/samples/ncurses2-color_edit.adb
Ada95/samples/ncurses2-demo_forms.adb
Ada95/samples/ncurses2-demo_pad.adb
Ada95/samples/ncurses2-demo_panels.adb
Ada95/samples/ncurses2-getch_test.adb
Ada95/samples/ncurses2-getopt.adb
Ada95/samples/ncurses2-m.adb
Ada95/samples/ncurses2-menu_test.adb
Ada95/samples/ncurses2-overlap_test.adb
Ada95/samples/ncurses2-slk_test.adb
Ada95/samples/ncurses2-util.adb
Ada95/samples/sample-curses_demo.adb
Ada95/samples/sample-explanation.adb
Ada95/samples/sample-form_demo-aux.adb
Ada95/samples/sample-form_demo-handler.adb
Ada95/samples/sample-form_demo.adb
Ada95/samples/sample-function_key_setting.adb
Ada95/samples/sample-header_handler.adb
Ada95/samples/sample-keyboard_handler.adb
Ada95/samples/sample-menu_demo-handler.adb
Ada95/samples/sample-menu_demo.adb
Ada95/samples/sample-my_field_type.adb
Ada95/samples/sample-text_io_demo.adb
Ada95/src/Makefile.in
Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb
Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb
Ada95/src/terminal_interface-curses-forms-field_types-user.adb
Ada95/src/terminal_interface-curses-forms-field_types.adb
Ada95/src/terminal_interface-curses-forms.adb
Ada95/src/terminal_interface-curses-menus.adb
Ada95/src/terminal_interface-curses-mouse.adb
Ada95/src/terminal_interface-curses-panels.adb
Ada95/src/terminal_interface-curses-termcap.adb
Ada95/src/terminal_interface-curses-text_io.adb
Ada95/src/terminal_interface-curses-trace.adb_p
Ada95/src/terminal_interface-curses.adb
INSTALL
MANIFEST
Makefile.in
NEWS
README
README.emx
TO-DO
aclocal.m4
announce.html.in
c++/Makefile.in
c++/cursesapp.cc
c++/cursesapp.h
c++/cursesf.cc
c++/cursesf.h
c++/cursesm.cc
c++/cursesm.h
c++/cursesp.cc
c++/cursesp.h
c++/cursespad.cc
c++/cursesw.cc
c++/cursesw.h
c++/cursslk.cc
c++/cursslk.h
c++/demo.cc
c++/edit_cfg.sh
c++/etip.h.in
c++/internal.h
config.guess
config.sub
configure
configure.in
dist.mk
doc/hackguide.doc
doc/html/NCURSES-Programming-HOWTO.html [new file with mode: 0644]
doc/html/ada/files.htm
doc/html/ada/files/T.htm
doc/html/ada/funcs.htm
doc/html/ada/funcs/A.htm
doc/html/ada/funcs/B.htm
doc/html/ada/funcs/C.htm
doc/html/ada/funcs/D.htm
doc/html/ada/funcs/E.htm
doc/html/ada/funcs/F.htm
doc/html/ada/funcs/G.htm
doc/html/ada/funcs/H.htm
doc/html/ada/funcs/I.htm
doc/html/ada/funcs/K.htm
doc/html/ada/funcs/L.htm
doc/html/ada/funcs/M.htm
doc/html/ada/funcs/N.htm
doc/html/ada/funcs/O.htm
doc/html/ada/funcs/P.htm
doc/html/ada/funcs/Q.htm
doc/html/ada/funcs/R.htm
doc/html/ada/funcs/S.htm
doc/html/ada/funcs/T.htm
doc/html/ada/funcs/U.htm
doc/html/ada/funcs/V.htm
doc/html/ada/funcs/W.htm
doc/html/ada/index.htm
doc/html/ada/main.htm
doc/html/ada/terminal_interface-curses-aux__adb.htm
doc/html/ada/terminal_interface-curses-aux__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm
doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm
doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm
doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm
doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm
doc/html/ada/terminal_interface-curses-forms__adb.htm
doc/html/ada/terminal_interface-curses-forms__ads.htm
doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm
doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm
doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm
doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm
doc/html/ada/terminal_interface-curses-menus__adb.htm
doc/html/ada/terminal_interface-curses-menus__ads.htm
doc/html/ada/terminal_interface-curses-mouse__adb.htm
doc/html/ada/terminal_interface-curses-mouse__ads.htm
doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm
doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm
doc/html/ada/terminal_interface-curses-panels__adb.htm
doc/html/ada/terminal_interface-curses-panels__ads.htm
doc/html/ada/terminal_interface-curses-putwin__adb.htm
doc/html/ada/terminal_interface-curses-putwin__ads.htm
doc/html/ada/terminal_interface-curses-termcap__adb.htm
doc/html/ada/terminal_interface-curses-termcap__ads.htm
doc/html/ada/terminal_interface-curses-terminfo__adb.htm
doc/html/ada/terminal_interface-curses-terminfo__ads.htm
doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm
doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm
doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm
doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm
doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm
doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm
doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm
doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm
doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm
doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm
doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm
doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm
doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm
doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm
doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm
doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm
doc/html/ada/terminal_interface-curses-text_io__adb.htm
doc/html/ada/terminal_interface-curses-text_io__ads.htm
doc/html/ada/terminal_interface-curses-trace__adb.htm
doc/html/ada/terminal_interface-curses-trace__ads.htm
doc/html/ada/terminal_interface-curses__adb.htm
doc/html/ada/terminal_interface-curses__ads.htm
doc/html/ada/terminal_interface__ads.htm
doc/html/announce.html
doc/html/man/captoinfo.1m.html
doc/html/man/clear.1.html
doc/html/man/curs_add_wch.3x.html
doc/html/man/curs_add_wchstr.3x.html
doc/html/man/curs_addch.3x.html
doc/html/man/curs_addchstr.3x.html
doc/html/man/curs_addstr.3x.html
doc/html/man/curs_addwstr.3x.html
doc/html/man/curs_attr.3x.html
doc/html/man/curs_beep.3x.html
doc/html/man/curs_bkgd.3x.html
doc/html/man/curs_bkgrnd.3x.html
doc/html/man/curs_border.3x.html
doc/html/man/curs_border_set.3x.html
doc/html/man/curs_clear.3x.html
doc/html/man/curs_color.3x.html
doc/html/man/curs_delch.3x.html
doc/html/man/curs_deleteln.3x.html
doc/html/man/curs_extend.3x.html
doc/html/man/curs_get_wch.3x.html
doc/html/man/curs_get_wstr.3x.html
doc/html/man/curs_getcchar.3x.html
doc/html/man/curs_getch.3x.html
doc/html/man/curs_getstr.3x.html
doc/html/man/curs_getyx.3x.html
doc/html/man/curs_in_wch.3x.html
doc/html/man/curs_in_wchstr.3x.html
doc/html/man/curs_inch.3x.html
doc/html/man/curs_inchstr.3x.html
doc/html/man/curs_initscr.3x.html
doc/html/man/curs_inopts.3x.html
doc/html/man/curs_ins_wch.3x.html
doc/html/man/curs_ins_wstr.3x.html
doc/html/man/curs_insch.3x.html
doc/html/man/curs_insstr.3x.html
doc/html/man/curs_instr.3x.html
doc/html/man/curs_inwstr.3x.html
doc/html/man/curs_kernel.3x.html
doc/html/man/curs_mouse.3x.html
doc/html/man/curs_move.3x.html
doc/html/man/curs_outopts.3x.html
doc/html/man/curs_overlay.3x.html
doc/html/man/curs_pad.3x.html
doc/html/man/curs_print.3x.html
doc/html/man/curs_printw.3x.html
doc/html/man/curs_refresh.3x.html
doc/html/man/curs_scanw.3x.html
doc/html/man/curs_scr_dump.3x.html
doc/html/man/curs_scroll.3x.html
doc/html/man/curs_slk.3x.html
doc/html/man/curs_termattrs.3x.html
doc/html/man/curs_termcap.3x.html
doc/html/man/curs_terminfo.3x.html
doc/html/man/curs_touch.3x.html
doc/html/man/curs_trace.3x.html
doc/html/man/curs_util.3x.html
doc/html/man/curs_window.3x.html
doc/html/man/default_colors.3x.html
doc/html/man/define_key.3x.html
doc/html/man/form.3x.html
doc/html/man/form_cursor.3x.html
doc/html/man/form_data.3x.html
doc/html/man/form_driver.3x.html
doc/html/man/form_field.3x.html
doc/html/man/form_field_attributes.3x.html
doc/html/man/form_field_buffer.3x.html
doc/html/man/form_field_info.3x.html
doc/html/man/form_field_just.3x.html
doc/html/man/form_field_new.3x.html
doc/html/man/form_field_opts.3x.html
doc/html/man/form_field_userptr.3x.html
doc/html/man/form_field_validation.3x.html
doc/html/man/form_fieldtype.3x.html
doc/html/man/form_hook.3x.html
doc/html/man/form_new.3x.html
doc/html/man/form_new_page.3x.html
doc/html/man/form_opts.3x.html
doc/html/man/form_page.3x.html
doc/html/man/form_post.3x.html
doc/html/man/form_requestname.3x.html
doc/html/man/form_userptr.3x.html
doc/html/man/form_win.3x.html
doc/html/man/index.html [new file with mode: 0644]
doc/html/man/infocmp.1m.html
doc/html/man/infotocap.1m.html
doc/html/man/key_defined.3x.html
doc/html/man/keybound.3x.html
doc/html/man/keyok.3x.html
doc/html/man/menu.3x.html
doc/html/man/menu_attributes.3x.html
doc/html/man/menu_cursor.3x.html
doc/html/man/menu_driver.3x.html
doc/html/man/menu_format.3x.html
doc/html/man/menu_hook.3x.html
doc/html/man/menu_items.3x.html
doc/html/man/menu_mark.3x.html
doc/html/man/menu_new.3x.html
doc/html/man/menu_opts.3x.html
doc/html/man/menu_pattern.3x.html
doc/html/man/menu_post.3x.html
doc/html/man/menu_requestname.3x.html
doc/html/man/menu_spacing.3x.html
doc/html/man/menu_userptr.3x.html
doc/html/man/menu_win.3x.html
doc/html/man/mitem_current.3x.html
doc/html/man/mitem_name.3x.html
doc/html/man/mitem_new.3x.html
doc/html/man/mitem_opts.3x.html
doc/html/man/mitem_userptr.3x.html
doc/html/man/mitem_value.3x.html
doc/html/man/mitem_visible.3x.html
doc/html/man/ncurses.3x.html
doc/html/man/panel.3x.html
doc/html/man/resizeterm.3x.html
doc/html/man/term.5.html
doc/html/man/term.7.html
doc/html/man/terminfo.5.html
doc/html/man/tic.1m.html
doc/html/man/toe.1m.html
doc/html/man/tput.1.html
doc/html/man/tset.1.html
doc/html/man/wresize.3x.html
doc/html/ncurses-intro.html
doc/ncurses-intro.doc
form/Makefile.in
form/f_trace.c [new file with mode: 0644]
form/fld_arg.c
form/fld_attr.c
form/fld_current.c
form/fld_def.c
form/fld_dup.c
form/fld_ftchoice.c
form/fld_ftlink.c
form/fld_info.c
form/fld_just.c
form/fld_link.c
form/fld_max.c
form/fld_move.c
form/fld_newftyp.c
form/fld_opts.c
form/fld_pad.c
form/fld_page.c
form/fld_stat.c
form/fld_type.c
form/fld_user.c
form/form.h
form/form.priv.h
form/frm_cursor.c
form/frm_data.c
form/frm_def.c
form/frm_driver.c
form/frm_hook.c
form/frm_opts.c
form/frm_page.c
form/frm_post.c
form/frm_req_name.c
form/frm_scale.c
form/frm_sub.c
form/frm_user.c
form/frm_win.c
form/fty_alnum.c
form/fty_alpha.c
form/fty_enum.c
form/fty_int.c
form/fty_ipv4.c
form/fty_num.c
form/fty_regex.c
form/llib-lform
form/llib-lformw
form/modules
include/curses.h.in
include/curses.tail
include/curses.wide
include/nc_alloc.h
include/ncurses_cfg.hin
include/ncurses_defs
include/term_entry.h
include/tic.h
install-sh
man/Makefile.in
man/captoinfo.1m
man/curs_add_wchstr.3x
man/curs_addchstr.3x
man/curs_addstr.3x
man/curs_addwstr.3x
man/curs_attr.3x
man/curs_beep.3x
man/curs_bkgrnd.3x
man/curs_border.3x
man/curs_border_set.3x
man/curs_clear.3x
man/curs_color.3x
man/curs_deleteln.3x
man/curs_extend.3x
man/curs_get_wstr.3x
man/curs_getch.3x
man/curs_getstr.3x
man/curs_in_wchstr.3x
man/curs_inchstr.3x
man/curs_initscr.3x
man/curs_inopts.3x
man/curs_ins_wstr.3x
man/curs_insstr.3x
man/curs_instr.3x
man/curs_inwstr.3x
man/curs_kernel.3x
man/curs_mouse.3x
man/curs_move.3x
man/curs_outopts.3x
man/curs_overlay.3x
man/curs_pad.3x
man/curs_print.3x
man/curs_printw.3x
man/curs_refresh.3x
man/curs_scr_dump.3x
man/curs_scroll.3x
man/curs_slk.3x
man/curs_terminfo.3x
man/curs_touch.3x
man/curs_trace.3x
man/curs_util.3x
man/curs_window.3x
man/default_colors.3x
man/define_key.3x
man/form_field_buffer.3x
man/form_field_info.3x
man/form_field_opts.3x
man/infocmp.1m
man/infotocap.1m
man/key_defined.3x
man/make_sed.sh
man/man_db.renames
man/menu_spacing.3x
man/ncurses.3x
man/resizeterm.3x
man/term.5
man/terminfo.head
man/terminfo.tail
man/tic.1m
man/toe.1m
man/tput.1
man/tset.1
menu/Makefile.in
menu/llib-lmenu
menu/llib-lmenuw
menu/m_attribs.c
menu/m_cursor.c
menu/m_driver.c
menu/m_format.c
menu/m_global.c
menu/m_hook.c
menu/m_item_cur.c
menu/m_item_nam.c
menu/m_item_new.c
menu/m_item_opt.c
menu/m_item_top.c
menu/m_item_use.c
menu/m_item_val.c
menu/m_item_vis.c
menu/m_items.c
menu/m_new.c
menu/m_opts.c
menu/m_pad.c
menu/m_pattern.c
menu/m_post.c
menu/m_req_name.c
menu/m_scale.c
menu/m_spacing.c
menu/m_sub.c
menu/m_trace.c [new file with mode: 0644]
menu/m_userptr.c
menu/m_win.c
menu/menu.priv.h
menu/mf_common.h
menu/modules
misc/Makefile.in
misc/gen_edit.sh [new file with mode: 0755]
misc/indent.pro [deleted file]
misc/jpf-indent [new file with mode: 0755]
misc/ncu-indent [new file with mode: 0755]
misc/run_tic.in
misc/shlib
misc/terminfo.src
mk-0th.awk
mk-1st.awk
mk-2nd.awk
ncurses/Makefile.in
ncurses/SigAction.h
ncurses/base/MKkeyname.awk
ncurses/base/MKlib_gen.sh
ncurses/base/MKunctrl.awk
ncurses/base/define_key.c
ncurses/base/keybound.c
ncurses/base/lib_addch.c
ncurses/base/lib_addstr.c
ncurses/base/lib_beep.c
ncurses/base/lib_bkgd.c
ncurses/base/lib_chgat.c
ncurses/base/lib_color.c
ncurses/base/lib_colorset.c
ncurses/base/lib_dft_fgbg.c
ncurses/base/lib_freeall.c
ncurses/base/lib_getch.c
ncurses/base/lib_insch.c
ncurses/base/lib_insnstr.c [new file with mode: 0644]
ncurses/base/lib_instr.c
ncurses/base/lib_mouse.c
ncurses/base/lib_move.c
ncurses/base/lib_newterm.c
ncurses/base/lib_newwin.c
ncurses/base/lib_pad.c
ncurses/base/lib_printw.c
ncurses/base/lib_refresh.c
ncurses/base/lib_scroll.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_slkcolor.c
ncurses/base/lib_slkrefr.c
ncurses/base/lib_slkset.c
ncurses/base/lib_wattroff.c
ncurses/base/lib_wattron.c
ncurses/base/resizeterm.c
ncurses/base/tries.c
ncurses/base/version.c
ncurses/base/vsscanf.c
ncurses/curses.priv.h
ncurses/llib-lncurses
ncurses/llib-lncursesw
ncurses/modules
ncurses/tinfo/alloc_entry.c
ncurses/tinfo/captoinfo.c
ncurses/tinfo/comp_error.c
ncurses/tinfo/comp_hash.c
ncurses/tinfo/comp_parse.c
ncurses/tinfo/comp_scan.c
ncurses/tinfo/free_ttype.c
ncurses/tinfo/home_terminfo.c
ncurses/tinfo/init_keytry.c
ncurses/tinfo/lib_acs.c
ncurses/tinfo/lib_data.c
ncurses/tinfo/lib_kernel.c
ncurses/tinfo/lib_napms.c
ncurses/tinfo/lib_options.c
ncurses/tinfo/lib_setup.c
ncurses/tinfo/lib_termcap.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/trim_sgr0.c [new file with mode: 0644]
ncurses/trace/lib_trace.c
ncurses/trace/lib_traceatr.c
ncurses/trace/lib_tracechr.c
ncurses/trace/lib_tracedmp.c
ncurses/trace/lib_tracemse.c
ncurses/trace/visbuf.c
ncurses/tty/MKexpanded.sh
ncurses/tty/hashmap.c
ncurses/tty/lib_mvcur.c
ncurses/tty/lib_twait.c
ncurses/tty/lib_vidattr.c
ncurses/tty/tty_display.h
ncurses/tty/tty_update.c
ncurses/widechar/charable.c
ncurses/widechar/lib_add_wch.c
ncurses/widechar/lib_cchar.c
ncurses/widechar/lib_get_wch.c
ncurses/widechar/lib_get_wstr.c
ncurses/widechar/lib_in_wch.c
ncurses/widechar/lib_in_wchnstr.c
ncurses/widechar/lib_ins_wch.c
ncurses/widechar/lib_inwstr.c
ncurses/widechar/lib_slk_wset.c
ncurses/widechar/lib_unget_wch.c
ncurses/widechar/lib_vid_attr.c
ncurses/widechar/lib_wunctrl.c
panel/llib-lpanel
panel/llib-lpanelw
panel/p_above.c
panel/p_below.c
panel/p_bottom.c
panel/p_delete.c
panel/p_hidden.c
panel/p_hide.c
panel/p_move.c
panel/p_new.c
panel/p_replace.c
panel/p_show.c
panel/p_top.c
panel/p_update.c
panel/p_user.c
panel/p_win.c
panel/panel.c
panel/panel.priv.h
progs/Makefile.in
progs/clear.c
progs/dump_entry.c
progs/dump_entry.h
progs/infocmp.c
progs/modules
progs/progs.priv.h
progs/tic.c
progs/toe.c
progs/tput.c
progs/tset.c
tack/COPYING
tack/Makefile.in
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/output.c
tack/pad.c
tack/scan.c
tack/sync.c
tack/sysdep.c
tack/tack.1
tack/tack.c
tack/tack.h
test/Makefile.in
test/README
test/aclocal.m4
test/blue.c
test/bs.c
test/cardfile.c
test/color_set.c
test/configure
test/configure.in
test/demo_forms.c
test/demo_menus.c
test/demo_termcap.c [new file with mode: 0644]
test/ditto.c
test/dots.c
test/edit_field.c
test/edit_field.h
test/filter.c
test/firework.c
test/firstlast.c
test/gdc.c
test/hashtest.c
test/ins_wide.c
test/inserts.c
test/keynames.c
test/linux-color.dat [new file with mode: 0644]
test/lrtest.c
test/modules
test/ncurses.c
test/newdemo.c
test/tclock.c
test/test.priv.h
test/testcurs.c
test/tracemunch
test/view.c
test/worm.c
test/xmas.c
test/xterm-16color.dat [new file with mode: 0644]
test/xterm-88color.dat [new file with mode: 0644]

index 513234e33caa431aec05182c38be2c74dd34ffb6..5a2a139850d892ffa8efa3b34501cbf10710a5f0 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,4 @@
-
-                            Announcing ncurses 5.4
+                            Announcing ncurses 5.5
 
    The  ncurses  (new  curses)  library  is  a free software emulation of
    curses  in  System  V  Release 4.0, and more. It uses terminfo format,
@@ -8,9 +7,8 @@
    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.
+   considered  4.4BSD curses obsolete, and encouraged the keepers of Unix
+   releases such as BSD/OS, FreeBSD and NetBSD to switch over to ncurses.
 
    The ncurses code was developed under GNU/Linux. It has been in use for
    some  time  with  OpenBSD as the system curses library, and on FreeBSD
 
                                  Release Notes
 
-   This  release is designed to be upward compatible from ncurses 5.0 and
-   5.3;  very  few  applications will require recompilation, depending on
-   the  platform.  These  are  the  highlights  from the change-log since
-   ncurses 5.3 release.
+   This  release  is  designed  to  be upward compatible from ncurses 5.0
+   through   5.4;  very  few  applications  will  require  recompilation,
+   depending   on  the  platform.  These  are  the  highlights  from  the
+   change-log since ncurses 5.4 release.
 
    Interface changes:
-     * add  the  remaining  functions  for  X/Open  curses wide-character
-       support.
-          + pecho_wchar()
-          + slk_wset()
-       These  are  only  available if the library is configured using the
-       --enable-widec option.
-     * write  getyx()  and related 2-return macros in terms of getcury(),
-       getcurx(), etc.
-     * simplify ifdef for bool declaration in curses.h
-     * modify  ifdef's  in  curses.h that disabled use of __attribute__()
-       for  g++,  since recent versions implement the cases which ncurses
-       uses.
-     * add  key_defined()  function,  to  tell  which keycode a string is
-       bound to.
+     * terminfo   installs  "xterm-new"  as  "xterm"  entry  rather  than
+       "xterm-old" (aka xterm-r6).
+     * terminfo  data  is  installed using the tic -x option (few systems
+       still use ncurses 4.2).
+     * modify  C++  binding to work with newer C++ compilers by providing
+       initializers  and  using  modern casts. Old-style header names are
+       still  used  in  this  release  to allow compiling with not-so-old
+       compilers.
+     * modify parameter type in c++ binding for insch() and mvwinsch() to
+       be  consistent  with  underlying  ncurses  library  (was  char, is
+       chtype).
+     * change NCursesWindow::err_handler() to a virtual function.
+     * form  and  menu  libraries  now  work  with  wide-character  data.
+       Applications  which  bypassed the form library and manipulated the
+       FIELD.buf  data  directly  will  not  work properly with libformw,
+       since   that   no   longer   points  to  an  array  of  char.  The
+       set_field_buffer()  and field_buffer() functions translate to/from
+       the actual field data.
+     * add  symbol  to  curses.h which can be used to suppress include of
+       stdbool.h, e.g.,
+                #define NCURSES_ENABLE_STDBOOL_H 0
+                #include <curses.h>
+
+     * change  SP->_current_attr  to  a pointer, adjust ifdef's to ensure
+       that  libtinfo.so  and  libtinfow.so have the same ABI. The reason
+       for  this  is  that  the  corresponding  data which belongs to the
+       upper-level ncurses library has a different size in each model.
+     * winnstr()   now   returns  multibyte  character  strings  for  the
+       wide-character configuration.
+     * assume_default_colors()      no      longer      requires     that
+       use_default_colors() be called first.
+     * data_ahead() now works with wide-characters.
+     * slk_set()  and  slk_wset()  now  accept  and  store  multibyte  or
+       multicolumn characters.
+     * start_color()  now returns OK if colors have already been started.
+       start_color() also returns ERR if it cannot allocate memory.
+     * pair_content()  now returns -1 for consistency with init_pair() if
+       it corresponds to the default-color.
+     * unctrl()  now returns null if its parameter does not correspond to
+       an unsigned char.
 
    New features and improvements:
      * library
-          + implement  logic  in  lib_mouse.c  to handle position reports
-            which  are  generated  when XFree86 xterm is initialized with
-            private  modes  1002  or  1003.  These  are  returned  to the
-            application  as the REPORT_MOUSE_POSITION mask, which was not
-            implemented.
-          + modify soft-key initialization to use A_REVERSE if A_STANDOUT
-            would  not  be  shown when colors are used, i.e., if ncv#1 is
-            set in the terminfo as is done in "screen".
-          + add  configure  option for FreeBSD sysmouse, --with-sysmouse,
-            and implement library support for that.
+          + environment     variable     NCURSES_NO_UTF8_ACS     supports
+            miscellaneous   terminal  emulators  which  ignore  alternate
+            character set escape sequences when in UTF-8 mode.
+          + modify  initialization  of  key  lookup  table  so that if an
+            extended  capability (tic -x) string is defined, and its name
+            begins  with  'k',  ncurses  will automatically treat it as a
+            key.
+          + change  GPM  initialization,  using  dl  library  to  load it
+            dynamically at runtime.
+          + form, menu and panel libraries support debug-tracing.
+     * add   NCURSES-Programming-HOWTO.html   by   Pradeep   Padala  (see
+       http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/).
      * programs:
-          + tack:
-               o allow it to run from fallback terminfo data.
-               o reset  colors  after  each  color  test, correct a place
-                 where    exit_standout_mode    was   used   instead   of
-                 exit_attribute_mode.
-               o improve  bce  test  by  making  it set colors other than
-                 black on white.
-          + tic:
-               o handle  a  case  where  an entry has no description, and
-                 capabilities begin on the same line as the entry name.
-               o allow a terminfo entry with a leading 2-character name.
-               o improved  warnings  when  suppressing  items  to  fit in
-                 termcap's 1023-byte limit.
-               o add check for multiple "tc=" clauses in a termcap.
-               o correct logic for resolving "use=" clauses allow infocmp
-                 and tic to show cancelled capabilities.
-               o check for incomplete line-drawing character mapping.
-               o check for missing/empty/illegal terminfo name.
-          + tput:
-               o modify  tput  to  use  the  same  parameter  analysis as
-                 tparm() does, to provide for user-defined strings, e.g.,
-                 for  xterm  title,  a  corresponding capability might be
-                 title=\E]2;%p1%s^G,
-          + tset:
-               o use  the  system's  default  values  for CKILL and other
-                 default control characters.
-               o correct  interchanged  defaults  for  kill and interrupt
-                 characters, which caused it to report unnecessarily.
+     * infocmp:
+          + The  -i  option  now matches 8-bit controls against its table
+            entries, e.g., so it can analyze the xterm-8bit entry.
+          + add  "-x"  option to infocmp like tic's "-x", for use in "-F"
+            comparisons.  This  modifies  infocmp to only report extended
+            capabilities  if  the  -x  option  is given, making this more
+            consistent  with  tic.  Some scripts may break, since infocmp
+            previous gave this information without an option.
+     * tic:
+          + modify  termcap-parsing  to retain 2-character aliases at the
+            beginning of an entry if the "-x" option is used in tic.
+          + filter  out  long  extended names when translating to termcap
+            format.  Only  two  characters  are  permissible  for termcap
+            capability names.
+          + correct  translation  of  "%%" in terminfo format to termcap,
+            e.g., using "tic -C".
+          + modify  the  "-c  -v" options to ignore delays when comparing
+            strings.  Also  modify  it  to  ignore a canceled sgr string,
+            e.g.,  for terminals which cannot properly combine attributes
+            in one control sequence.
+          + add  a  check  for  improperly  ended  strings, i.e., where a
+            following line begins in column 1.
+          + add a check in tic for terminfo entries having an sgr0 but no
+            sgr string. This confuses Tru64 and HPUX curses when combined
+            with  color,  e.g., making them leave line-drawing characters
+            in odd places.
+          + add  check (with debug configuration) that provides about the
+            runtime  changes  that  would  be  made  to  sgr0 for termcap
+            applications.
+     * tset:
+          + add  -c  and  -w  options  to allow user to suppress ncurses'
+            resizing  of the terminal emulator window in the special case
+            where it is not able to detect the true size.
 
    Major bug fixes:
-     * prevent  recursion  in  wgetch()  via wgetnstr() if the connection
-       cannot  be  switched  between cooked/raw modes because it is not a
-       TTY.
-     * correct  a  case  in _nc_remove_string(), used by define_key(), to
-       avoid  infinite loop if the given string happens to be a substring
-       of other strings which are assigned to keys.
-     * modify  logic  of acsc to use the original character if no mapping
-       is defined, rather than a null.
-     * several  improvements  for  handling  multi-cell  display  of wide
-       characters.
-          + modify  setcchar()  to allow converting control characters to
-            complex characters.
-          + correct  handling of multibyte characters in waddch_literal()
-            which force wrapping because they are started too late on the
-            line.
-          + modify  setcchar()  to  allow  for wchar_t input strings that
-            have more than one spacing character.
-     * other fixes for wide-character support:
-          + rewrote  lib_acs.c  to  allow  PutAttrChar() to decide how to
-            render alternate-characters, i.e., to work with Linux console
-            and UTF-8 locale.
-          + implement  a  workaround  so  that  line-drawing  works  with
-            screen's  crippled  UTF-8  support (tested with 3.9.13). This
-            only  works with the wide-character support (--enable-widec);
-            the  normal  library  will  simply suppress line-drawing when
-            running in a UTF-8 locale in screen.
-          + corrections to lib_get_wstr.c:
-               o null-terminate   buffer   passed  to  setcchar(),  which
-                 occasionally failed.
-               o map    special    characters    such   as   erase-   and
-                 kill-characters  into  key-codes  so  those will work as
-                 expected even if they are not mentioned in the terminfo.
-     * modify  setupterm()  to  check  if the terminfo and terminal-modes
-       have  already  been  read.  This ensures that it does not reinvoke
-       def_prog_mode()  when an application calls more than one function,
-       such as tgetent() and initscr().
-     * fix    form_driver()    cases    for   REQ_CLR_EOF,   REQ_CLR_EOL,
-       REQ_DEL_CHAR,  REQ_DEL_PREV and REQ_NEW_LINE, which did not ensure
-       the   cursor   was   at   the   editing   position  before  making
-       modifications.
-     * correct keybound(), which reported definitions in the wrong table,
-       i.e., the list of definitions which are disabled by keyok().
-     * fixes related to safe_sprintf.c:
-          + correct  an  allocation  size  in  safe_sprintf.c for the "*"
-            format code.
-          + correct  safe_sprintf.c  to  not return a null pointer if the
-            format happens to be an empty string.
-          + make   return   value  from  _nc_printf_string()  consistent.
-            Before,  depending on whether --enable-safe-sprintf was used,
-            it might not be cached for reallocating.
-     * other low-level improvements to the optimization code include:
-          + if  the  output  is  a  socket or other non-tty device, use 1
-            millisecond  for  the  cost  in  mvcur;  previously  it was 9
-            milliseconds because the baudrate was not known.
-          + modify lib_getch.c to avoid recursion via wgetnstr() when the
-            input is not a tty and consequently mode-changes do not work.
-          + fix  several  places  in tack/pad.c which tested and used the
-            parameter- and parameterless strings inconsistently.
-          + change several tputs() calls in scrolling code to use putp(),
-            to enable padding which may be needed for some terminals.
-          + improve  mvcur() by checking if it is safe to move when video
-            attributes   are   set  (msgr),  and  if  not,  reset/restore
-            attributes   within   that  function  rather  than  doing  it
-            separately in the GoTo() function in tty_update.c.
-          + use tputs() rather than putp() in a few cases in tty_update.c
-            since the corresponding delays are proportional to the number
-            of       lines      affected:      repeat_char,      clr_eos,
-            change_scroll_region.
-     * correct  line/column  reference in adjust_window(), needed to make
-       special windows such as curscr track properly when resizing.
-     * fix a potential recursion between napms() and _nc_timed_wait()
-     * rewrote lib_insch.c, combining it with lib_insstr.c so both handle
-       tab and other control characters consistently.
-     * do  not  try  to open gpm mouse driver if standard output is not a
-       tty; the gpm library does not make this check.
+     * improve  logic  in tgetent() which adjusts the termcap "me" string
+       to  work with ISO-2022 string used in xterm-new. This is a feature
+       that was incompletely implemented in ncurses 5.3. ncurses attempts
+       to  provide  termcap clients with the portion of the sgr0 (termcap
+       "me") string that does not reset line-drawing.
+     * cells  in  the  WINDOW  which  are  continuations of a multicolumn
+       character   are   encoded   differently,  making  repainting  more
+       reliable.
+     * amend  change to setupterm() in ncurses 5.4 (20030405) which would
+       reuse  the value of cur_term if the same output was selected. This
+       now  reuses  it  only  when  setupterm() is called from tgetent(),
+       which  has no notion of separate SCREENs. Note that tgetent() must
+       be called after initscr() or newterm() to use this feature.
+     * make  setcchar() now works when its wchar_t* parameter is pointing
+       to a string which contains more data than can be converted.
+     * win_wchnstr() now works for more than one cell.
+     * resizeterm() now processes all levels of window hierarchy.
+     * disable  GPM  mouse support when $TERM happens to be prefixed with
+       "xterm".  Gpm_Open()  would otherwise assert that it can deal with
+       mouse events in this case.
+     * add  SP->_screen_acs_map[], used to ensure that mapping of missing
+       line-drawing   characters   is   handled  properly.  For  example,
+       ACS_DARROW  is  absent  from  xterm-new, and it was coincidentally
+       displayed the same as ACS_BTEE.
 
    Portability:
      * configure script:
           + new options:
 
-              --with-abi-version option.
-                      addresses  platforms  where packagers have diverged
-                      from ncurses ABI numbering.
-
-              --with-manpage-format=catonly
-                      addresses   behavior  of  BSDI,  allow  install  of
-                      man+cat   files   on  NetBSD,  whose  behavior  has
-                      diverged by requiring both to be present.
-
-              --with-manpage-aliases
-                      extends  "--with-manpage-aliases"  to  provide  the
-                      option   of  generating  ".so"  files  rather  than
-                      symbolic links for manpage aliases.
-
-              --with-rel-version
-                      workaround  to force libtool on Darwin generate the
-                      "same"  library  names  as with the "--with-shared"
-                      option.  The  Darwin  ld program does not work well
-                      with a zero as the minor-version value.
-
-              --with-trace
-                      simplifies defining TRACE to incorporate trace() in
-                      libraries.
-
+              --enable-largefile
+                      set  compiler  and  linker  flags  to use largefile
+                      support.
+
+              --enable-ext-colors
+                      Allow  encoding  of  256  foreground and background
+                      colors,    e.g.,   with   the   xterm-256color   or
+                      xterm-88color terminfo entries. This requires ABI 6
+                      because it changes the size of cchar_t.
+
+              --enable-ext-mouse
+                      This  defines NCURSES_MOUSE_VERSION 2, and modifies
+                      the encoding of mouse events to support wheel mice,
+                      which may transmit buttons 4 and 5. This works with
+                      xterm and similar terminal emulators. This requires
+                      ABI  6  because  it  changes  the encoding of mouse
+                      events.
+
+              --with-chtype
+                      overriding of the non-LP64 model's use of chtype
+
+              --with-mmask-t
+                      overriding of the non-LP64 model's use of mmask_t
+
+              --without-xterm-new
+                      Installs  "xterm-old"  as  the "xterm" entry of the
+                      terminfo database.
+
+          + The  --with-termlib option now accepts a value which sets the
+            name  of the terminfo library. This would allow a packager to
+            build libtinfow.so renamed to coincide with libtinfo.so
           + fixes/improvements for cross-compiling:
-               o allow BUILD_CC and related configure script variables to
-                 be overridden from the environment.
-               o use AC_CHECK_TOOL to get proper values for AR and LD for
-                 cross compiling.
-               o use $cross_compiling variable in configure script rather
-                 than  comparing  $host_alias  and  $target  alias, since
-                 "host"  is traditionally misused in autoconf to refer to
-                 the target platform.
-               o modify  run_tic.in to avoid using wrong shared libraries
-                 when cross-compiling.
-          + fixes for Mac OS X:
-               o fix  a  redefinition  of $RANLIB in the configure script
-                 when libtool is used.
-               o modify  MKlib_gen.sh to avoid passing "#" tokens through
-                 the  C  preprocessor.  This  works  around  Mac  OS  X's
-                 preprocessor,  which  insists  on adding a blank on each
-                 side of the token.
-          + workarounds for broken tools:
-               o add configure check for wchar_t and wint_t types, rather
-                 than  rely on preprocessor definitions. Also work around
-                 for  gcc  fixinclude  bug which creates a shadow copy of
-                 curses.h if it sees these symbols apparently typedef'd.
-               o modify  configure  script  to omit -Winline for gcc 3.3,
-                 since that feature is broken.
-               o several script fixes to work around the ironically named
-                 POSIXLY_CORRECT feature of GNU sed 4.0.
-               o modify  configure script to avoid using "head -1", which
-                 does not work if POSIXLY_CORRECT (sic) is set.
-               o update    configure    script   to   reflect   fix   for
-                 AC_PROG_GCC_TRADITIONAL,  which  is  broken  in autoconf
-                 2.5x for Mac OS X 10.2.3.
-               o repair  check  for missing C++ compiler, which is broken
-                 in autoconf 2.5x by hardcoding it to g++.
-          + corrected  ifdef's  relating  to configure check for wchar_t,
-            etc.
-          + remove configure script check to allow -Wconversion for older
-            versions of gcc
-          + modify  configure  script to accommodate libtool 1.5, as well
-            as  add an parameter to the "--with-libtool" option which can
-            specify the pathname of libtool.
-          + change  several  sed  scripts to avoid using "\+" since it is
-            not  a  BRE  (basic  regular expression). One instance caused
-            terminfo.5 to be misformatted on FreeBSD.
-          + use  '%'  as  sed  substitute  delimiter in run_tic script to
-            avoid problems with pathname delimiters such as ':' and '@'.
-          + add  -D_XOPEN_SOURCE=500  if  needed  when  configuring  with
-            "--enable-widec", to get mbstate_t declaration on HPUX 11.11.
+               o suppress     $suffix     in     misc/run_tic.sh     when
+                 cross-compiling.  This  allows cross-compiles to use the
+                 host's  tic  program  to  handle the "make install.data"
+                 step.
+               o correct       BUILD_CPPFLAGS       substitution       in
+                 ncurses/Makefile.in,  to  allow  cross-compiling  from a
+                 separate directory tree.
      * library:
-          + adjust  include-options  in  CF_ETIP_DEFINES to avoid missing
-            ncurses_dll.h,  fixing special definitions that may be needed
-            for etip.h.
-          + modify CF_LIB_SUFFIX for Itanium releases of HP-UX, which use
-            a ".so" suffix.
-          + improve  ifdef's to guard against redefinition of wchar_t and
-            wint_t in curses.h.
-          + remove  an  #undef for KEY_EVENT from curses.tail used in the
-            experimental   NCURSES_WGETCH_EVENTS   feature.   The  #undef
-            confuses Debian dpkg's build script.
+          + add  ifdef's  for  _LP64  in curses.h to avoid using wasteful
+            64-bits  for  chtype  and  mmask_t,  but add configure option
+            --disable-lp64 in case anyone used that configuration.
+          + modify  C++  binding to use some C internal functions to make
+            it compile properly on Solaris (and other platforms).
+          + remove  check  in  newwin()  that prevents allocating windows
+            that extend beyond the screen (Solaris does this).
+          + check  for  nl_langinfo(CODESET),  use  it if available. This
+            replaces  ad  hoc  tests of environment variables to check if
+            the  terminal is setup for UTF-8 encoding. Applications which
+            do  not  call  setlocale()  should be corrected, to make them
+            work properly with UTF-8 encoding.
+            In  particular,  applications  which  assume (and do not call
+            setlocale())  that Latin-1 codes are printable will no longer
+            work  in a UTF-8 locale since the ad hoc check of environment
+            variables  to  see  if  the locale was UTF-8 is not used when
+            nl_langinfo(CODESET) is available.
+          + use  setlocale() to query the program's current locale rather
+            than  using  getenv().  This supports applications which rely
+            upon  legacy treatment of 8-bit characters when the locale is
+            not initialized.
 
                               Features of Ncurses
 
index aea7fdd7238e200d6236dea5cbfc8c2cb103028a..fd79d8babd218fb74c017b122d36ea2ee87a91ef 100644 (file)
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998-2002,2003 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -28,8 +28,7 @@
 #
 #  Author:  Juergen Pfeifer, 1996
 #
-#  Version Control
-#  $Revision: 1.44 $
+#  $Id: Makefile.in,v 1.49 2005/05/14 13:57:14 tom Exp $
 #
 .SUFFIXES:
 
@@ -68,12 +67,10 @@ CFLAGS_SHARED       = $(CCFLAGS) @CC_SHARED_OPTS@
 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
 
 LINK           = $(HOST_CC)
-LD_FLAGS       = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS)
+LD_FLAGS       = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_ARGS2@
 
 RANLIB         = @RANLIB@
 
-LIB_CURSES      = -L../../lib -lncurses@LIB_SUFFIX@
-
 M4             = m4
 M4FLAGS                =
 
@@ -152,7 +149,7 @@ GEN_SRC             = $(srcdir)/$(ABASE).ads.m4                             \
 
 all \
 libs : $(GEN_TARGETS)
-       @
+       @echo made $@
 
 sources:
 
@@ -184,7 +181,7 @@ uninstall.libs ::
        -@cd $(ADA_OBJECTS) && rm -f $(ALIB)[-.]*
 
 gen$x: gen.o
-       @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@ $(LIB_CURSES)
+       @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@
 
 gen.o: $(srcdir)/gen.c
        $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
@@ -400,7 +397,7 @@ $(HTML_DIR)/table.html : instab.tmp
        @rm -f instab.tmp
 
 adahtml:
-       @rm -rf $(HTML_DIR)/
+       @find $(HTML_DIR) -type f -exec rm -f {} \;
        @mkdir -p $(HTML_DIR)
        cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb]
        ln -sf ../src/*.ali .
@@ -431,7 +428,7 @@ adahtml:
        @rm -rf html
 
 html : adahtml $(HTML_DIR)/table.html
-       @
+       @echo made $@
 
 ###############################################################################
 # The remainder of this file is automatically generated during configuration
index 7a5bbedf6324229bd2cfa4298b3164c2e7eb18a3..b7842a64a862d45e193f299070a5304f26f2c385 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998,2004,2005 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 /*
     Version Control
-    $Revision: 1.36 $
+    $Id: gen.c,v 1.40 2005/01/22 17:03:48 tom Exp $
   --------------------------------------------------------------------------*/
 /*
   This program generates various record structures and constants from the
 static const char *model = "";
 static int little_endian = 0;
 
-typedef struct {
-  const char *name;
-  unsigned long attr;
-} name_attribute_pair;
+typedef struct
+  {
+    const char *name;
+    unsigned long attr;
+  }
+name_attribute_pair;
 
-static int find_pos (char *s, unsigned len, int *low, int *high)
+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;
-  *low  = 8*len;
+  *low = 8 * len;
 
-  for(i=0; i < len; i++,s++)
+  for (i = 0; i < len; i++, s++)
     {
       if (*s)
        {
-         for(j=0;j<8*sizeof(char);j++)
+         for (j = 0; j < 8 * sizeof(char); j++)
+
            {
-             if ((( little_endian && ((*s)&0x01)) ||
-                  (!little_endian && ((*s)&0x80))) )
+             if (((little_endian && ((*s) & 0x01)) ||
+                  (!little_endian && ((*s) & 0x80))))
                {
                  if (l > *high)
                    *high = l;
@@ -102,212 +106,229 @@ static int find_pos (char *s, unsigned len, int *low, int *high)
  * bit size, i.e. they fit into an (u)int or a (u)short.
  */
 static void
-gen_reps
-(const name_attribute_pair *nap, /* array of name_attribute_pair records */
const char *name,               /* name of the represented record type  */
int len,                        /* size of the record in bytes          */
- int bias)
+  gen_reps
+  (const name_attribute_pair * nap,    /* array of name_attribute_pair records */
  const char *name,           /* name of the represented record type  */
  int len,                    /* size of the record in bytes          */
  int bias)
 {
-  int i,n,l,cnt = 0,low,high;
+  int i, n, l, cnt = 0, low, high;
   int width = strlen(RES_NAME) + 3;
   unsigned long a;
   unsigned long mask = 0;
 
-  assert (nap!=NULL);
+  assert(nap != NULL);
 
-  for (i=0; nap[i].name != (char *)0; i++)
+  for (i = 0; nap[i].name != (char *)0; i++)
     {
       cnt++;
       l = strlen(nap[i].name);
-      if (l>width)
+      if (l > width)
        width = l;
     }
-  assert (width > 0);
+  assert(width > 0);
 
-  printf("   type %s is\n",name);
+  printf("   type %s is\n", name);
   printf("      record\n");
-  for (i=0; nap[i].name != (char *)0; i++)
+  for (i = 0; nap[i].name != (char *)0; i++)
     {
-      printf("         %-*s : Boolean;\n",width,nap[i].name);
+      printf("         %-*s : Boolean;\n", width, nap[i].name);
     }
   printf("      end record;\n");
-  printf("   pragma Pack (%s);\n",name);
-  printf("   pragma Convention (C, %s);\n\n",name);
+  printf("   pragma Convention (C, %s);\n\n", name);
 
-  printf("   for %s use\n",name);
+  printf("   for %s use\n", name);
   printf("      record\n");
 
-  for (i=0; nap[i].name != (char *)0; i++)
+  for (i = 0; nap[i].name != (char *)0; i++)
     {
       a = nap[i].attr;
       mask |= a;
-      l = find_pos( (char *)&a,sizeof(a),&low,&high );
-      if (l>=0)
-       printf("         %-*s at 0 range %2d .. %2d;\n",width,nap[i].name,
-              low-bias,high-bias);
+      l = find_pos((char *)&a, sizeof(a), &low, &high);
+      if (l >= 0)
+       printf("         %-*s at 0 range %2d .. %2d;\n", width, nap[i].name,
+              low - bias, high - bias);
     }
-  i = 1; n = cnt;
+  i = 1;
+  n = cnt;
   printf("      end record;\n");
-  printf("   for %s'Size use %d;\n", name, 8*len);
+  printf("   for %s'Size use %d;\n", name, 8 * len);
   printf("   --  Please note: this rep. clause is generated and may be\n");
   printf("   --               different on your system.");
 }
 
-
-static void chtype_rep (const char *name, attr_t mask)
+static void
+chtype_rep(const char *name, attr_t mask)
 {
   attr_t x = -1;
   attr_t t = x & mask;
   int low, high;
-  int l = find_pos ((char *)&t, sizeof(t), &low, &high);
-  if (l>=0)
-    printf("         %-5s at 0 range %2d .. %2d;\n",name,low,high);
+  int l = find_pos((char *)&t, sizeof(t), &low, &high);
+
+  if (l >= 0)
+    printf("         %-5s at 0 range %2d .. %2d;\n", name, low, high);
 }
 
-static void gen_chtype_rep(const char *name)
+static void
+gen_chtype_rep(const char *name)
 {
-  printf("   for %s use\n      record\n",name);
-  chtype_rep("Ch",A_CHARTEXT);
-  chtype_rep("Color",A_COLOR);
-  chtype_rep("Attr",(A_ATTRIBUTES&~A_COLOR));
-  printf("      end record;\n   for %s'Size use %ld;\n", name, (long)(8*sizeof(chtype)));
+  printf("   for %s use\n      record\n", name);
+  chtype_rep("Ch", A_CHARTEXT);
+  chtype_rep("Color", A_COLOR);
+  chtype_rep("Attr", (A_ATTRIBUTES & ~A_COLOR));
+  printf("      end record;\n   for %s'Size use %ld;\n",
+        name, (long)(8 * sizeof(chtype)));
+
   printf("      --  Please note: this rep. clause is generated and may be\n");
   printf("      --               different on your system.\n");
 }
 
-
-static void mrep_rep (const char *name, void *rec)
+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);
-}
 
+  if (l >= 0)
+    printf("         %-7s at 0 range %3d .. %3d;\n", name, low, high);
+}
 
-static void gen_mrep_rep(const char *name)
+static void
+gen_mrep_rep(const char *name)
 {
   MEVENT x;
 
-  printf("   for %s use\n      record\n",name);
+  printf("   for %s use\n      record\n", name);
 
-  memset(&x,0,sizeof(x));
+  memset(&x, 0, sizeof(x));
   x.id = -1;
-  mrep_rep("Id",&x);
+  mrep_rep("Id", &x);
 
-  memset(&x,0,sizeof(x));
+  memset(&x, 0, sizeof(x));
   x.x = -1;
-  mrep_rep("X",&x);
+  mrep_rep("X", &x);
 
-  memset(&x,0,sizeof(x));
+  memset(&x, 0, sizeof(x));
   x.y = -1;
-  mrep_rep("Y",&x);
+  mrep_rep("Y", &x);
 
-  memset(&x,0,sizeof(x));
+  memset(&x, 0, sizeof(x));
   x.z = -1;
-  mrep_rep("Z",&x);
+  mrep_rep("Z", &x);
 
-  memset(&x,0,sizeof(x));
+  memset(&x, 0, sizeof(x));
   x.bstate = -1;
-  mrep_rep("Bstate",&x);
+  mrep_rep("Bstate", &x);
 
   printf("      end record;\n");
   printf("      --  Please note: this rep. clause is generated and may be\n");
   printf("      --               different on your system.\n");
 }
 
-static void gen_attr_set( const char *name )
+static void
+gen_attr_set(const char *name)
 {
   /* All of the A_xxx symbols are defined in ncurses, but not all are nonzero
    * if "configure --enable-widec" is specified.
    */
-  static const name_attribute_pair nap[] = {
+  static const name_attribute_pair nap[] =
+  {
 #if A_STANDOUT
-    {"Stand_Out",               A_STANDOUT},
+    {"Stand_Out", A_STANDOUT},
 #endif
 #if A_UNDERLINE
-    {"Under_Line",              A_UNDERLINE},
+    {"Under_Line", A_UNDERLINE},
 #endif
 #if A_REVERSE
-    {"Reverse_Video",           A_REVERSE},
+    {"Reverse_Video", A_REVERSE},
 #endif
 #if A_BLINK
-    {"Blink",                   A_BLINK},
+    {"Blink", A_BLINK},
 #endif
 #if A_DIM
-    {"Dim_Character",           A_DIM},
+    {"Dim_Character", A_DIM},
 #endif
 #if A_BOLD
-    {"Bold_Character",          A_BOLD},
+    {"Bold_Character", A_BOLD},
 #endif
 #if A_ALTCHARSET
     {"Alternate_Character_Set", A_ALTCHARSET},
 #endif
 #if A_INVIS
-    {"Invisible_Character",     A_INVIS},
+    {"Invisible_Character", A_INVIS},
 #endif
 #if A_PROTECT
-    {"Protected_Character",     A_PROTECT},
+    {"Protected_Character", A_PROTECT},
 #endif
 #if A_HORIZONTAL
-    {"Horizontal",              A_HORIZONTAL},
+    {"Horizontal", A_HORIZONTAL},
 #endif
 #if A_LEFT
-    {"Left",                    A_LEFT},
+    {"Left", A_LEFT},
 #endif
 #if A_LOW
-    {"Low",                     A_LOW},
+    {"Low", A_LOW},
 #endif
 #if A_RIGHT
-    {"Right",                   A_RIGHT},
+    {"Right", A_RIGHT},
 #endif
 #if A_TOP
-    {"Top",                     A_TOP},
+    {"Top", A_TOP},
 #endif
 #if A_VERTICAL
-    {"Vertical",                A_VERTICAL},
+    {"Vertical", A_VERTICAL},
 #endif
-    {(char *)0,                 0}
+    {(char *)0, 0}
   };
   chtype attr = A_ATTRIBUTES & ~A_COLOR;
-  int start=-1, len=0, i, set;
-  for(i=0;i<(int)(8*sizeof(chtype));i++) {
-    set = attr&1;
-    if (set) {
-      if (start<0)
-       start = i;
-      if (start>=0) {
-       len++;
-      }
+  int start = -1;
+  int len = 0;
+  int 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;
     }
-    attr = attr >> 1;
-  }
-  gen_reps (nap, name, (len+7)/8, little_endian?start:0);
+  gen_reps(nap, name, (len + 7) / 8, little_endian ? start : 0);
 }
 
-static void gen_trace(const char *name)
-{  
-  static const name_attribute_pair nap[] = {
-    {"Times",               TRACE_TIMES},
-    {"Tputs",               TRACE_TPUTS},
-    {"Update",              TRACE_UPDATE},
-    {"Cursor_Move",         TRACE_MOVE},
-    {"Character_Output",    TRACE_CHARPUT},
-    {"Calls",               TRACE_CALLS},
-    {"Virtual_Puts",        TRACE_VIRTPUT},
-    {"Input_Events",        TRACE_IEVENT},
-    {"TTY_State",           TRACE_BITS},
-    {"Internal_Calls",      TRACE_ICALLS},
-    {"Character_Calls",     TRACE_CCALLS},
-    {"Termcap_TermInfo",    TRACE_DATABASE},
-    {(char *)0,                0}
+static void
+gen_trace(const char *name)
+{
+  static const name_attribute_pair nap[] =
+  {
+    {"Times", TRACE_TIMES},
+    {"Tputs", TRACE_TPUTS},
+    {"Update", TRACE_UPDATE},
+    {"Cursor_Move", TRACE_MOVE},
+    {"Character_Output", TRACE_CHARPUT},
+    {"Calls", TRACE_CALLS},
+    {"Virtual_Puts", TRACE_VIRTPUT},
+    {"Input_Events", TRACE_IEVENT},
+    {"TTY_State", TRACE_BITS},
+    {"Internal_Calls", TRACE_ICALLS},
+    {"Character_Calls", TRACE_CCALLS},
+    {"Termcap_TermInfo", TRACE_DATABASE},
+    {(char *)0, 0}
   };
-  gen_reps(nap,name,sizeof(int),0);
+  gen_reps(nap, name, sizeof(int), 0);
 }
 
-static void gen_menu_opt_rep(const char *name)
+static void
+gen_menu_opt_rep(const char *name)
 {
-  static const name_attribute_pair nap[] = {
+  static const name_attribute_pair nap[] =
+  {
 #ifdef O_ONEVALUE
     {"One_Valued", O_ONEVALUE},
 #endif
@@ -328,90 +349,99 @@ static void gen_menu_opt_rep(const char *name)
 #endif
     {(char *)0, 0}
   };
-  gen_reps (nap, name, sizeof(int),0);
+  gen_reps(nap, name, sizeof(int), 0);
 }
 
-static void gen_item_opt_rep(const char *name)
+static void
+gen_item_opt_rep(const char *name)
 {
-  static const name_attribute_pair nap[] = {
+  static const name_attribute_pair nap[] =
+  {
 #ifdef O_SELECTABLE
     {"Selectable", O_SELECTABLE},
 #endif
-    {(char *)0   , 0}
+    {(char *)0, 0}
   };
-  gen_reps (nap, name, sizeof(int),0);
+  gen_reps(nap, name, sizeof(int), 0);
 }
 
-static void gen_form_opt_rep(const char *name)
+static void
+gen_form_opt_rep(const char *name)
 {
-  static const name_attribute_pair nap[] = {
+  static const name_attribute_pair nap[] =
+  {
 #ifdef O_NL_OVERLOAD
     {"NL_Overload", O_NL_OVERLOAD},
 #endif
 #ifdef O_BS_OVERLOAD
     {"BS_Overload", O_BS_OVERLOAD},
 #endif
-    {(char *)0    , 0}
+    {(char *)0, 0}
   };
-  gen_reps (nap, name, sizeof(int),0);
+  gen_reps(nap, name, sizeof(int), 0);
 }
 
 /*
  * Generate the representation clause for the Field_Option_Set record
  */
-static void gen_field_opt_rep(const char *name)
+static void
+gen_field_opt_rep(const char *name)
 {
-  static const name_attribute_pair nap[] = {
+  static const name_attribute_pair nap[] =
+  {
 #ifdef O_VISIBLE
-    {"Visible",O_VISIBLE},
+    {"Visible", O_VISIBLE},
 #endif
 #ifdef O_ACTIVE
-    {"Active",O_ACTIVE},
+    {"Active", O_ACTIVE},
 #endif
 #ifdef O_PUBLIC
-    {"Public",O_PUBLIC},
+    {"Public", O_PUBLIC},
 #endif
 #ifdef O_EDIT
-    {"Edit",O_EDIT},
+    {"Edit", O_EDIT},
 #endif
 #ifdef O_WRAP
-    {"Wrap",O_WRAP},
+    {"Wrap", O_WRAP},
 #endif
 #ifdef O_BLANK
-    {"Blank",O_BLANK},
+    {"Blank", O_BLANK},
 #endif
 #ifdef O_AUTOSKIP
-    {"Auto_Skip",O_AUTOSKIP},
+    {"Auto_Skip", O_AUTOSKIP},
 #endif
 #ifdef O_NULLOK
-    {"Null_Ok",O_NULLOK},
+    {"Null_Ok", O_NULLOK},
 #endif
 #ifdef O_PASSOK
-    {"Pass_Ok",O_PASSOK},
+    {"Pass_Ok", O_PASSOK},
 #endif
 #ifdef O_STATIC
-    {"Static",O_STATIC},
+    {"Static", O_STATIC},
 #endif
     {(char *)0, 0}
   };
-  gen_reps (nap, name, sizeof(int),0);
+  gen_reps(nap, name, sizeof(int), 0);
 }
 
 /*
  * Generate a single key code constant definition.
  */
-static void keydef(const char *name, const char *old_name, int value, int mode)
+static void
+keydef(const char *name, const char *old_name, int value, int mode)
 {
-  if (mode==0) /* Generate the new name */
-    printf("   %-30s : constant Special_Key_Code := 8#%3o#;\n",name,value);
+  if (mode == 0)               /* Generate the new name */
+    printf("   %-30s : constant Special_Key_Code := 8#%3o#;\n", name, value);
   else
-    { /* generate the old name, but only if it doesn't conflict with the old
-       * name (Ada95 isn't case sensitive!)
-       */
-      const char *s = old_name; const char *t = name;
-      while ( *s && *t && (toupper(*s++) == toupper(*t++)));
+    {                          /* generate the old name, but only if it doesn't conflict with the old
+                                * name (Ada95 isn't case sensitive!)
+                                */
+      const char *s = old_name;
+      const char *t = name;
+
+      while (*s && *t && (toupper(*s++) == toupper(*t++)));
       if (*s || *t)
-       printf("   %-16s : Special_Key_Code renames %s;\n",old_name,name);
+       printf("   %-16s : Special_Key_Code renames %s;\n", old_name, name);
     }
 }
 
@@ -422,298 +452,299 @@ static void keydef(const char *name, const char *old_name, int value, int mode)
  * generated, given that the name wasn't already defined in the "nice"
  * list.
  */
-static void gen_keydefs (int mode)
+static void
+gen_keydefs(int mode)
 {
   char buf[16];
   char obuf[16];
   int i;
 
 #ifdef KEY_CODE_YES
-  keydef("Key_Code_Yes","KEY_CODE_YES",KEY_CODE_YES,mode);
+  keydef("Key_Code_Yes", "KEY_CODE_YES", KEY_CODE_YES, mode);
 #endif
 #ifdef KEY_MIN
-  keydef("Key_Min","KEY_MIN",KEY_MIN,mode);
+  keydef("Key_Min", "KEY_MIN", KEY_MIN, mode);
 #endif
 #ifdef KEY_BREAK
-  keydef("Key_Break","KEY_BREAK",KEY_BREAK,mode);
+  keydef("Key_Break", "KEY_BREAK", KEY_BREAK, mode);
 #endif
 #ifdef KEY_DOWN
-  keydef("Key_Cursor_Down","KEY_DOWN",KEY_DOWN,mode);
+  keydef("Key_Cursor_Down", "KEY_DOWN", KEY_DOWN, mode);
 #endif
 #ifdef KEY_UP
-  keydef("Key_Cursor_Up","KEY_UP",KEY_UP,mode);
+  keydef("Key_Cursor_Up", "KEY_UP", KEY_UP, mode);
 #endif
 #ifdef KEY_LEFT
-  keydef("Key_Cursor_Left","KEY_LEFT",KEY_LEFT,mode);
+  keydef("Key_Cursor_Left", "KEY_LEFT", KEY_LEFT, mode);
 #endif
 #ifdef KEY_RIGHT
-  keydef("Key_Cursor_Right","KEY_RIGHT",KEY_RIGHT,mode);
+  keydef("Key_Cursor_Right", "KEY_RIGHT", KEY_RIGHT, mode);
 #endif
 #ifdef KEY_HOME
-  keydef("Key_Home","KEY_HOME",KEY_HOME,mode);
+  keydef("Key_Home", "KEY_HOME", KEY_HOME, mode);
 #endif
 #ifdef KEY_BACKSPACE
-  keydef("Key_Backspace","KEY_BACKSPACE",KEY_BACKSPACE,mode);
+  keydef("Key_Backspace", "KEY_BACKSPACE", KEY_BACKSPACE, mode);
 #endif
 #ifdef KEY_F0
-  keydef("Key_F0","KEY_F0",KEY_F0,mode);
+  keydef("Key_F0", "KEY_F0", KEY_F0, mode);
 #endif
 #ifdef KEY_F
-  for(i=1;i<=24;i++)
+  for (i = 1; i <= 24; i++)
     {
-      sprintf(buf ,"Key_F%d",i);
-      sprintf(obuf,"KEY_F%d",i);
-      keydef(buf,obuf,KEY_F(i),mode);
+      sprintf(buf, "Key_F%d", i);
+      sprintf(obuf, "KEY_F%d", i);
+      keydef(buf, obuf, KEY_F(i), mode);
     }
 #endif
 #ifdef KEY_DL
-  keydef("Key_Delete_Line","KEY_DL",KEY_DL,mode);
+  keydef("Key_Delete_Line", "KEY_DL", KEY_DL, mode);
 #endif
 #ifdef KEY_IL
-  keydef("Key_Insert_Line","KEY_IL",KEY_IL,mode);
+  keydef("Key_Insert_Line", "KEY_IL", KEY_IL, mode);
 #endif
 #ifdef KEY_DC
-  keydef("Key_Delete_Char","KEY_DC",KEY_DC,mode);
+  keydef("Key_Delete_Char", "KEY_DC", KEY_DC, mode);
 #endif
 #ifdef KEY_IC
-  keydef("Key_Insert_Char","KEY_IC",KEY_IC,mode);
+  keydef("Key_Insert_Char", "KEY_IC", KEY_IC, mode);
 #endif
 #ifdef KEY_EIC
-  keydef("Key_Exit_Insert_Mode","KEY_EIC",KEY_EIC,mode);
+  keydef("Key_Exit_Insert_Mode", "KEY_EIC", KEY_EIC, mode);
 #endif
 #ifdef KEY_CLEAR
-  keydef("Key_Clear_Screen","KEY_CLEAR",KEY_CLEAR,mode);
+  keydef("Key_Clear_Screen", "KEY_CLEAR", KEY_CLEAR, mode);
 #endif
 #ifdef KEY_EOS
-  keydef("Key_Clear_End_Of_Screen","KEY_EOS",KEY_EOS,mode);
+  keydef("Key_Clear_End_Of_Screen", "KEY_EOS", KEY_EOS, mode);
 #endif
 #ifdef KEY_EOL
-  keydef("Key_Clear_End_Of_Line","KEY_EOL",KEY_EOL,mode);
+  keydef("Key_Clear_End_Of_Line", "KEY_EOL", KEY_EOL, mode);
 #endif
 #ifdef KEY_SF
-  keydef("Key_Scroll_1_Forward","KEY_SF",KEY_SF,mode);
+  keydef("Key_Scroll_1_Forward", "KEY_SF", KEY_SF, mode);
 #endif
 #ifdef KEY_SR
-  keydef("Key_Scroll_1_Backward","KEY_SR",KEY_SR,mode);
+  keydef("Key_Scroll_1_Backward", "KEY_SR", KEY_SR, mode);
 #endif
 #ifdef KEY_NPAGE
-  keydef("Key_Next_Page","KEY_NPAGE",KEY_NPAGE,mode);
+  keydef("Key_Next_Page", "KEY_NPAGE", KEY_NPAGE, mode);
 #endif
 #ifdef KEY_PPAGE
-  keydef("Key_Previous_Page","KEY_PPAGE",KEY_PPAGE,mode);
+  keydef("Key_Previous_Page", "KEY_PPAGE", KEY_PPAGE, mode);
 #endif
 #ifdef KEY_STAB
-  keydef("Key_Set_Tab","KEY_STAB",KEY_STAB,mode);
+  keydef("Key_Set_Tab", "KEY_STAB", KEY_STAB, mode);
 #endif
 #ifdef KEY_CTAB
-  keydef("Key_Clear_Tab","KEY_CTAB",KEY_CTAB,mode);
+  keydef("Key_Clear_Tab", "KEY_CTAB", KEY_CTAB, mode);
 #endif
 #ifdef KEY_CATAB
-  keydef("Key_Clear_All_Tabs","KEY_CATAB",KEY_CATAB,mode);
+  keydef("Key_Clear_All_Tabs", "KEY_CATAB", KEY_CATAB, mode);
 #endif
 #ifdef KEY_ENTER
-  keydef("Key_Enter_Or_Send","KEY_ENTER",KEY_ENTER,mode);
+  keydef("Key_Enter_Or_Send", "KEY_ENTER", KEY_ENTER, mode);
 #endif
 #ifdef KEY_SRESET
-  keydef("Key_Soft_Reset","KEY_SRESET",KEY_SRESET,mode);
+  keydef("Key_Soft_Reset", "KEY_SRESET", KEY_SRESET, mode);
 #endif
 #ifdef KEY_RESET
-  keydef("Key_Reset","KEY_RESET",KEY_RESET,mode);
+  keydef("Key_Reset", "KEY_RESET", KEY_RESET, mode);
 #endif
 #ifdef KEY_PRINT
-  keydef("Key_Print","KEY_PRINT",KEY_PRINT,mode);
+  keydef("Key_Print", "KEY_PRINT", KEY_PRINT, mode);
 #endif
 #ifdef KEY_LL
-  keydef("Key_Bottom","KEY_LL",KEY_LL,mode);
+  keydef("Key_Bottom", "KEY_LL", KEY_LL, mode);
 #endif
 #ifdef KEY_A1
-  keydef("Key_Upper_Left_Of_Keypad","KEY_A1",KEY_A1,mode);
+  keydef("Key_Upper_Left_Of_Keypad", "KEY_A1", KEY_A1, mode);
 #endif
 #ifdef KEY_A3
-  keydef("Key_Upper_Right_Of_Keypad","KEY_A3",KEY_A3,mode);
+  keydef("Key_Upper_Right_Of_Keypad", "KEY_A3", KEY_A3, mode);
 #endif
 #ifdef KEY_B2
-  keydef("Key_Center_Of_Keypad","KEY_B2",KEY_B2,mode);
+  keydef("Key_Center_Of_Keypad", "KEY_B2", KEY_B2, mode);
 #endif
 #ifdef KEY_C1
-  keydef("Key_Lower_Left_Of_Keypad","KEY_C1",KEY_C1,mode);
+  keydef("Key_Lower_Left_Of_Keypad", "KEY_C1", KEY_C1, mode);
 #endif
 #ifdef KEY_C3
-  keydef("Key_Lower_Right_Of_Keypad","KEY_C3",KEY_C3,mode);
+  keydef("Key_Lower_Right_Of_Keypad", "KEY_C3", KEY_C3, mode);
 #endif
 #ifdef KEY_BTAB
-  keydef("Key_Back_Tab","KEY_BTAB",KEY_BTAB,mode);
+  keydef("Key_Back_Tab", "KEY_BTAB", KEY_BTAB, mode);
 #endif
 #ifdef KEY_BEG
-  keydef("Key_Beginning","KEY_BEG",KEY_BEG,mode);
+  keydef("Key_Beginning", "KEY_BEG", KEY_BEG, mode);
 #endif
 #ifdef KEY_CANCEL
-  keydef("Key_Cancel","KEY_CANCEL",KEY_CANCEL,mode);
+  keydef("Key_Cancel", "KEY_CANCEL", KEY_CANCEL, mode);
 #endif
 #ifdef KEY_CLOSE
-  keydef("Key_Close","KEY_CLOSE",KEY_CLOSE,mode);
+  keydef("Key_Close", "KEY_CLOSE", KEY_CLOSE, mode);
 #endif
 #ifdef KEY_COMMAND
-  keydef("Key_Command","KEY_COMMAND",KEY_COMMAND,mode);
+  keydef("Key_Command", "KEY_COMMAND", KEY_COMMAND, mode);
 #endif
 #ifdef KEY_COPY
-  keydef("Key_Copy","KEY_COPY",KEY_COPY,mode);
+  keydef("Key_Copy", "KEY_COPY", KEY_COPY, mode);
 #endif
 #ifdef KEY_CREATE
-  keydef("Key_Create","KEY_CREATE",KEY_CREATE,mode);
+  keydef("Key_Create", "KEY_CREATE", KEY_CREATE, mode);
 #endif
 #ifdef KEY_END
-  keydef("Key_End","KEY_END",KEY_END,mode);
+  keydef("Key_End", "KEY_END", KEY_END, mode);
 #endif
 #ifdef KEY_EXIT
-  keydef("Key_Exit","KEY_EXIT",KEY_EXIT,mode);
+  keydef("Key_Exit", "KEY_EXIT", KEY_EXIT, mode);
 #endif
 #ifdef KEY_FIND
-  keydef("Key_Find","KEY_FIND",KEY_FIND,mode);
+  keydef("Key_Find", "KEY_FIND", KEY_FIND, mode);
 #endif
 #ifdef KEY_HELP
-  keydef("Key_Help","KEY_HELP",KEY_HELP,mode);
+  keydef("Key_Help", "KEY_HELP", KEY_HELP, mode);
 #endif
 #ifdef KEY_MARK
-  keydef("Key_Mark","KEY_MARK",KEY_MARK,mode);
+  keydef("Key_Mark", "KEY_MARK", KEY_MARK, mode);
 #endif
 #ifdef KEY_MESSAGE
-  keydef("Key_Message","KEY_MESSAGE",KEY_MESSAGE,mode);
+  keydef("Key_Message", "KEY_MESSAGE", KEY_MESSAGE, mode);
 #endif
 #ifdef KEY_MOVE
-  keydef("Key_Move","KEY_MOVE",KEY_MOVE,mode);
+  keydef("Key_Move", "KEY_MOVE", KEY_MOVE, mode);
 #endif
 #ifdef KEY_NEXT
-  keydef("Key_Next","KEY_NEXT",KEY_NEXT,mode);
+  keydef("Key_Next", "KEY_NEXT", KEY_NEXT, mode);
 #endif
 #ifdef KEY_OPEN
-  keydef("Key_Open","KEY_OPEN",KEY_OPEN,mode);
+  keydef("Key_Open", "KEY_OPEN", KEY_OPEN, mode);
 #endif
 #ifdef KEY_OPTIONS
-  keydef("Key_Options","KEY_OPTIONS",KEY_OPTIONS,mode);
+  keydef("Key_Options", "KEY_OPTIONS", KEY_OPTIONS, mode);
 #endif
 #ifdef KEY_PREVIOUS
-  keydef("Key_Previous","KEY_PREVIOUS",KEY_PREVIOUS,mode);
+  keydef("Key_Previous", "KEY_PREVIOUS", KEY_PREVIOUS, mode);
 #endif
 #ifdef KEY_REDO
-  keydef("Key_Redo","KEY_REDO",KEY_REDO,mode);
+  keydef("Key_Redo", "KEY_REDO", KEY_REDO, mode);
 #endif
 #ifdef KEY_REFERENCE
-  keydef("Key_Reference","KEY_REFERENCE",KEY_REFERENCE,mode);
+  keydef("Key_Reference", "KEY_REFERENCE", KEY_REFERENCE, mode);
 #endif
 #ifdef KEY_REFRESH
-  keydef("Key_Refresh","KEY_REFRESH",KEY_REFRESH,mode);
+  keydef("Key_Refresh", "KEY_REFRESH", KEY_REFRESH, mode);
 #endif
 #ifdef KEY_REPLACE
-  keydef("Key_Replace","KEY_REPLACE",KEY_REPLACE,mode);
+  keydef("Key_Replace", "KEY_REPLACE", KEY_REPLACE, mode);
 #endif
 #ifdef KEY_RESTART
-  keydef("Key_Restart","KEY_RESTART",KEY_RESTART,mode);
+  keydef("Key_Restart", "KEY_RESTART", KEY_RESTART, mode);
 #endif
 #ifdef KEY_RESUME
-  keydef("Key_Resume","KEY_RESUME",KEY_RESUME,mode);
+  keydef("Key_Resume", "KEY_RESUME", KEY_RESUME, mode);
 #endif
 #ifdef KEY_SAVE
-  keydef("Key_Save","KEY_SAVE",KEY_SAVE,mode);
+  keydef("Key_Save", "KEY_SAVE", KEY_SAVE, mode);
 #endif
 #ifdef KEY_SBEG
-  keydef("Key_Shift_Begin","KEY_SBEG",KEY_SBEG,mode);
+  keydef("Key_Shift_Begin", "KEY_SBEG", KEY_SBEG, mode);
 #endif
 #ifdef KEY_SCANCEL
-  keydef("Key_Shift_Cancel","KEY_SCANCEL",KEY_SCANCEL,mode);
+  keydef("Key_Shift_Cancel", "KEY_SCANCEL", KEY_SCANCEL, mode);
 #endif
 #ifdef KEY_SCOMMAND
-  keydef("Key_Shift_Command","KEY_SCOMMAND",KEY_SCOMMAND,mode);
+  keydef("Key_Shift_Command", "KEY_SCOMMAND", KEY_SCOMMAND, mode);
 #endif
 #ifdef KEY_SCOPY
-  keydef("Key_Shift_Copy","KEY_SCOPY",KEY_SCOPY,mode);
+  keydef("Key_Shift_Copy", "KEY_SCOPY", KEY_SCOPY, mode);
 #endif
 #ifdef KEY_SCREATE
-  keydef("Key_Shift_Create","KEY_SCREATE",KEY_SCREATE,mode);
+  keydef("Key_Shift_Create", "KEY_SCREATE", KEY_SCREATE, mode);
 #endif
 #ifdef KEY_SDC
-  keydef("Key_Shift_Delete_Char","KEY_SDC",KEY_SDC,mode);
+  keydef("Key_Shift_Delete_Char", "KEY_SDC", KEY_SDC, mode);
 #endif
 #ifdef KEY_SDL
-  keydef("Key_Shift_Delete_Line","KEY_SDL",KEY_SDL,mode);
+  keydef("Key_Shift_Delete_Line", "KEY_SDL", KEY_SDL, mode);
 #endif
 #ifdef KEY_SELECT
-  keydef("Key_Select","KEY_SELECT",KEY_SELECT,mode);
+  keydef("Key_Select", "KEY_SELECT", KEY_SELECT, mode);
 #endif
 #ifdef KEY_SEND
-  keydef("Key_Shift_End","KEY_SEND",KEY_SEND,mode);
+  keydef("Key_Shift_End", "KEY_SEND", KEY_SEND, mode);
 #endif
 #ifdef KEY_SEOL
-  keydef("Key_Shift_Clear_End_Of_Line","KEY_SEOL",KEY_SEOL,mode);
+  keydef("Key_Shift_Clear_End_Of_Line", "KEY_SEOL", KEY_SEOL, mode);
 #endif
 #ifdef KEY_SEXIT
-  keydef("Key_Shift_Exit","KEY_SEXIT",KEY_SEXIT,mode);
+  keydef("Key_Shift_Exit", "KEY_SEXIT", KEY_SEXIT, mode);
 #endif
 #ifdef KEY_SFIND
-  keydef("Key_Shift_Find","KEY_SFIND",KEY_SFIND,mode);
+  keydef("Key_Shift_Find", "KEY_SFIND", KEY_SFIND, mode);
 #endif
 #ifdef KEY_SHELP
-  keydef("Key_Shift_Help","KEY_SHELP",KEY_SHELP,mode);
+  keydef("Key_Shift_Help", "KEY_SHELP", KEY_SHELP, mode);
 #endif
 #ifdef KEY_SHOME
-  keydef("Key_Shift_Home","KEY_SHOME",KEY_SHOME,mode);
+  keydef("Key_Shift_Home", "KEY_SHOME", KEY_SHOME, mode);
 #endif
 #ifdef KEY_SIC
-  keydef("Key_Shift_Insert_Char","KEY_SIC",KEY_SIC,mode);
+  keydef("Key_Shift_Insert_Char", "KEY_SIC", KEY_SIC, mode);
 #endif
 #ifdef KEY_SLEFT
-  keydef("Key_Shift_Cursor_Left","KEY_SLEFT",KEY_SLEFT,mode);
+  keydef("Key_Shift_Cursor_Left", "KEY_SLEFT", KEY_SLEFT, mode);
 #endif
 #ifdef KEY_SMESSAGE
-  keydef("Key_Shift_Message","KEY_SMESSAGE",KEY_SMESSAGE,mode);
+  keydef("Key_Shift_Message", "KEY_SMESSAGE", KEY_SMESSAGE, mode);
 #endif
 #ifdef KEY_SMOVE
-  keydef("Key_Shift_Move","KEY_SMOVE",KEY_SMOVE,mode);
+  keydef("Key_Shift_Move", "KEY_SMOVE", KEY_SMOVE, mode);
 #endif
 #ifdef KEY_SNEXT
-  keydef("Key_Shift_Next_Page","KEY_SNEXT",KEY_SNEXT,mode);
+  keydef("Key_Shift_Next_Page", "KEY_SNEXT", KEY_SNEXT, mode);
 #endif
 #ifdef KEY_SOPTIONS
-  keydef("Key_Shift_Options","KEY_SOPTIONS",KEY_SOPTIONS,mode);
+  keydef("Key_Shift_Options", "KEY_SOPTIONS", KEY_SOPTIONS, mode);
 #endif
 #ifdef KEY_SPREVIOUS
-  keydef("Key_Shift_Previous_Page","KEY_SPREVIOUS",KEY_SPREVIOUS,mode);
+  keydef("Key_Shift_Previous_Page", "KEY_SPREVIOUS", KEY_SPREVIOUS, mode);
 #endif
 #ifdef KEY_SPRINT
-  keydef("Key_Shift_Print","KEY_SPRINT",KEY_SPRINT,mode);
+  keydef("Key_Shift_Print", "KEY_SPRINT", KEY_SPRINT, mode);
 #endif
 #ifdef KEY_SREDO
-  keydef("Key_Shift_Redo","KEY_SREDO",KEY_SREDO,mode);
+  keydef("Key_Shift_Redo", "KEY_SREDO", KEY_SREDO, mode);
 #endif
 #ifdef KEY_SREPLACE
-  keydef("Key_Shift_Replace","KEY_SREPLACE",KEY_SREPLACE,mode);
+  keydef("Key_Shift_Replace", "KEY_SREPLACE", KEY_SREPLACE, mode);
 #endif
 #ifdef KEY_SRIGHT
-  keydef("Key_Shift_Cursor_Right","KEY_SRIGHT",KEY_SRIGHT,mode);
+  keydef("Key_Shift_Cursor_Right", "KEY_SRIGHT", KEY_SRIGHT, mode);
 #endif
 #ifdef KEY_SRSUME
-  keydef("Key_Shift_Resume","KEY_SRSUME",KEY_SRSUME,mode);
+  keydef("Key_Shift_Resume", "KEY_SRSUME", KEY_SRSUME, mode);
 #endif
 #ifdef KEY_SSAVE
-  keydef("Key_Shift_Save","KEY_SSAVE",KEY_SSAVE,mode);
+  keydef("Key_Shift_Save", "KEY_SSAVE", KEY_SSAVE, mode);
 #endif
 #ifdef KEY_SSUSPEND
-  keydef("Key_Shift_Suspend","KEY_SSUSPEND",KEY_SSUSPEND,mode);
+  keydef("Key_Shift_Suspend", "KEY_SSUSPEND", KEY_SSUSPEND, mode);
 #endif
 #ifdef KEY_SUNDO
-  keydef("Key_Shift_Undo","KEY_SUNDO",KEY_SUNDO,mode);
+  keydef("Key_Shift_Undo", "KEY_SUNDO", KEY_SUNDO, mode);
 #endif
 #ifdef KEY_SUSPEND
-  keydef("Key_Suspend","KEY_SUSPEND",KEY_SUSPEND,mode);
+  keydef("Key_Suspend", "KEY_SUSPEND", KEY_SUSPEND, mode);
 #endif
 #ifdef KEY_UNDO
-  keydef("Key_Undo","KEY_UNDO",KEY_UNDO,mode);
+  keydef("Key_Undo", "KEY_UNDO", KEY_UNDO, mode);
 #endif
 #ifdef KEY_MOUSE
-  keydef("Key_Mouse","KEY_MOUSE",KEY_MOUSE,mode);
+  keydef("Key_Mouse", "KEY_MOUSE", KEY_MOUSE, mode);
 #endif
 #ifdef KEY_RESIZE
-  keydef("Key_Resize","KEY_RESIZE",KEY_RESIZE,mode);
+  keydef("Key_Resize", "KEY_RESIZE", KEY_RESIZE, mode);
 #endif
 }
 
@@ -722,120 +753,122 @@ static void gen_keydefs (int mode)
  * is a reference to the ACS character in the acs_map[] array and
  * will be translated into an index.
  */
-static void acs_def (const char *name, chtype *a)
+static void
+acs_def(const char *name, chtype *a)
 {
   int c = a - &acs_map[0];
-  printf("   %-24s : constant Character := ",name);
-  if (isprint(c) && (c!='`'))
-    printf("'%c';\n",c);
+
+  printf("   %-24s : constant Character := ", name);
+  if (isprint(c) && (c != '`'))
+    printf("'%c';\n", c);
   else
-    printf("Character'Val (%d);\n",c);
+    printf("Character'Val (%d);\n", c);
 }
 
 /*
  * Generate the constants for the ACS characters
  */
-static void gen_acs (void)
+static void
+gen_acs(void)
 {
 #ifdef ACS_ULCORNER
-  acs_def("ACS_Upper_Left_Corner",&ACS_ULCORNER);
+  acs_def("ACS_Upper_Left_Corner", &ACS_ULCORNER);
 #endif
 #ifdef ACS_LLCORNER
-  acs_def("ACS_Lower_Left_Corner",&ACS_LLCORNER);
+  acs_def("ACS_Lower_Left_Corner", &ACS_LLCORNER);
 #endif
 #ifdef ACS_URCORNER
-  acs_def("ACS_Upper_Right_Corner",&ACS_URCORNER);
+  acs_def("ACS_Upper_Right_Corner", &ACS_URCORNER);
 #endif
 #ifdef ACS_LRCORNER
-  acs_def("ACS_Lower_Right_Corner",&ACS_LRCORNER);
+  acs_def("ACS_Lower_Right_Corner", &ACS_LRCORNER);
 #endif
 #ifdef ACS_LTEE
-  acs_def("ACS_Left_Tee",&ACS_LTEE);
+  acs_def("ACS_Left_Tee", &ACS_LTEE);
 #endif
 #ifdef ACS_RTEE
-  acs_def("ACS_Right_Tee",&ACS_RTEE);
+  acs_def("ACS_Right_Tee", &ACS_RTEE);
 #endif
 #ifdef ACS_BTEE
-  acs_def("ACS_Bottom_Tee",&ACS_BTEE);
+  acs_def("ACS_Bottom_Tee", &ACS_BTEE);
 #endif
 #ifdef ACS_TTEE
-  acs_def("ACS_Top_Tee",&ACS_TTEE);
+  acs_def("ACS_Top_Tee", &ACS_TTEE);
 #endif
 #ifdef ACS_HLINE
-  acs_def("ACS_Horizontal_Line",&ACS_HLINE);
+  acs_def("ACS_Horizontal_Line", &ACS_HLINE);
 #endif
 #ifdef ACS_VLINE
-  acs_def("ACS_Vertical_Line",&ACS_VLINE);
+  acs_def("ACS_Vertical_Line", &ACS_VLINE);
 #endif
 #ifdef ACS_PLUS
-  acs_def("ACS_Plus_Symbol",&ACS_PLUS);
+  acs_def("ACS_Plus_Symbol", &ACS_PLUS);
 #endif
 #ifdef ACS_S1
-  acs_def("ACS_Scan_Line_1",&ACS_S1);
+  acs_def("ACS_Scan_Line_1", &ACS_S1);
 #endif
 #ifdef ACS_S9
-  acs_def("ACS_Scan_Line_9",&ACS_S9);
+  acs_def("ACS_Scan_Line_9", &ACS_S9);
 #endif
 #ifdef ACS_DIAMOND
-  acs_def("ACS_Diamond",&ACS_DIAMOND);
+  acs_def("ACS_Diamond", &ACS_DIAMOND);
 #endif
 #ifdef ACS_CKBOARD
-  acs_def("ACS_Checker_Board",&ACS_CKBOARD);
+  acs_def("ACS_Checker_Board", &ACS_CKBOARD);
 #endif
 #ifdef ACS_DEGREE
-  acs_def("ACS_Degree",&ACS_DEGREE);
+  acs_def("ACS_Degree", &ACS_DEGREE);
 #endif
 #ifdef ACS_PLMINUS
-  acs_def("ACS_Plus_Minus",&ACS_PLMINUS);
+  acs_def("ACS_Plus_Minus", &ACS_PLMINUS);
 #endif
 #ifdef ACS_BULLET
-  acs_def("ACS_Bullet",&ACS_BULLET);
+  acs_def("ACS_Bullet", &ACS_BULLET);
 #endif
 #ifdef ACS_LARROW
-  acs_def("ACS_Left_Arrow",&ACS_LARROW);
+  acs_def("ACS_Left_Arrow", &ACS_LARROW);
 #endif
 #ifdef ACS_RARROW
-  acs_def("ACS_Right_Arrow",&ACS_RARROW);
+  acs_def("ACS_Right_Arrow", &ACS_RARROW);
 #endif
 #ifdef ACS_DARROW
-  acs_def("ACS_Down_Arrow",&ACS_DARROW);
+  acs_def("ACS_Down_Arrow", &ACS_DARROW);
 #endif
 #ifdef ACS_UARROW
-  acs_def("ACS_Up_Arrow",&ACS_UARROW);
+  acs_def("ACS_Up_Arrow", &ACS_UARROW);
 #endif
 #ifdef ACS_BOARD
-  acs_def("ACS_Board_Of_Squares",&ACS_BOARD);
+  acs_def("ACS_Board_Of_Squares", &ACS_BOARD);
 #endif
 #ifdef ACS_LANTERN
-  acs_def("ACS_Lantern",&ACS_LANTERN);
+  acs_def("ACS_Lantern", &ACS_LANTERN);
 #endif
 #ifdef ACS_BLOCK
-  acs_def("ACS_Solid_Block",&ACS_BLOCK);
+  acs_def("ACS_Solid_Block", &ACS_BLOCK);
 #endif
 #ifdef ACS_S3
-  acs_def("ACS_Scan_Line_3",&ACS_S3);
+  acs_def("ACS_Scan_Line_3", &ACS_S3);
 #endif
 #ifdef ACS_S7
-  acs_def("ACS_Scan_Line_7",&ACS_S7);
+  acs_def("ACS_Scan_Line_7", &ACS_S7);
 #endif
 #ifdef ACS_LEQUAL
-  acs_def("ACS_Less_Or_Equal",&ACS_LEQUAL);
+  acs_def("ACS_Less_Or_Equal", &ACS_LEQUAL);
 #endif
 #ifdef ACS_GEQUAL
-  acs_def("ACS_Greater_Or_Equal",&ACS_GEQUAL);
+  acs_def("ACS_Greater_Or_Equal", &ACS_GEQUAL);
 #endif
 #ifdef ACS_PI
-  acs_def("ACS_PI",&ACS_PI);
+  acs_def("ACS_PI", &ACS_PI);
 #endif
 #ifdef ACS_NEQUAL
-  acs_def("ACS_Not_Equal",&ACS_NEQUAL);
+  acs_def("ACS_Not_Equal", &ACS_NEQUAL);
 #endif
 #ifdef ACS_STERLING
-  acs_def("ACS_Sterling",&ACS_STERLING);
+  acs_def("ACS_Sterling", &ACS_STERLING);
 #endif
 }
 
-
 #define GEN_EVENT(name,value) \
    printf("   %-25s : constant Event_Mask := 8#%011lo#;\n", \
           #name, value)
@@ -845,7 +878,8 @@ static void gen_acs (void)
           #name, name)
 
 static
-void gen_mouse_events(void)
+void
+gen_mouse_events(void)
 {
   mmask_t all1 = 0;
   mmask_t all2 = 0;
@@ -959,15 +993,15 @@ void gen_mouse_events(void)
 #endif
 #ifdef REPORT_MOUSE_POSITION
   GEN_MEVENT(REPORT_MOUSE_POSITION);
-#endif   
+#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);
+  GEN_EVENT(BUTTON1_EVENTS, all1);
+  GEN_EVENT(BUTTON2_EVENTS, all2);
+  GEN_EVENT(BUTTON3_EVENTS, all3);
+  GEN_EVENT(BUTTON4_EVENTS, all4);
 }
 
 /*
@@ -975,41 +1009,45 @@ GEN_EVENT(BUTTON4_EVENTS,all4);
  * The name parameter is the name of the facility to be used in
  * the comment.
  */
-static void prologue(const char *name)
+static void
+prologue(const char *name)
 {
-  printf("--  %s binding.\n",name);
+  printf("--  %s binding.\n", name);
   printf("--  This module is generated. Please don't change it manually!\n");
   printf("--  Run the generator instead.\n--  |");
 
   printf("define(`M4_BIT_ORDER',`%s_Order_First')",
-        little_endian ? "Low":"High");
+        little_endian ? "Low" : "High");
 }
 
 /*
  * Write the prologue for the curses facility and make sure that
  * KEY_MIN and KEY_MAX are defined for the rest of this source.
  */
-static void basedefs (void)
+static void
+basedefs(void)
 {
   prologue("curses");
 #ifndef KEY_MAX
 #  define KEY_MAX 0777
 #endif
-  printf("define(`M4_KEY_MAX',`8#%o#')",KEY_MAX);
+  printf("define(`M4_KEY_MAX',`8#%o#')", KEY_MAX);
 #ifndef KEY_MIN
 #  define KEY_MIN 0401
 #endif
-  if (KEY_MIN == 256) {
-    fprintf(stderr,"Unexpected value for KEY_MIN: %d\n",KEY_MIN);
-    exit(1);
-  }
-  printf("define(`M4_SPECIAL_FIRST',`8#%o#')",KEY_MIN - 1);
+  if (KEY_MIN == 256)
+    {
+      fprintf(stderr, "Unexpected value for KEY_MIN: %d\n", KEY_MIN);
+      exit(1);
+    }
+  printf("define(`M4_SPECIAL_FIRST',`8#%o#')", KEY_MIN - 1);
 }
 
 /*
  * Write out the comment lines for the menu facility
  */
-static void menu_basedefs (void)
+static void
+menu_basedefs(void)
 {
   prologue("menu");
 }
@@ -1017,7 +1055,8 @@ static void menu_basedefs (void)
 /*
  * Write out the comment lines for the form facility
  */
-static void form_basedefs (void)
+static void
+form_basedefs(void)
 {
   prologue("form");
 }
@@ -1025,7 +1064,8 @@ static void form_basedefs (void)
 /*
  * Write out the comment lines for the mouse facility
  */
-static void mouse_basedefs(void)
+static void
+mouse_basedefs(void)
 {
   prologue("mouse");
 }
@@ -1033,9 +1073,10 @@ static void mouse_basedefs(void)
 /*
  * Write the definition of a single color
  */
-static void color_def (const char *name, int value)
+static void
+color_def(const char *name, int value)
 {
-  printf("   %-16s : constant Color_Number := %d;\n",name,value);
+  printf("   %-16s : constant Color_Number := %d;\n", name, value);
 }
 
 #define HAVE_USE_DEFAULT_COLORS 1
@@ -1043,87 +1084,93 @@ static void color_def (const char *name, int value)
 /*
  * Generate all color definitions
  */
-static void gen_color (void)
+static void
+gen_color(void)
 {
 #ifdef HAVE_USE_DEFAULT_COLORS
-  color_def ("Default_Color",-1);
+  color_def("Default_Color", -1);
 #endif
 #ifdef COLOR_BLACK
-  color_def ("Black",COLOR_BLACK);
+  color_def("Black", COLOR_BLACK);
 #endif
 #ifdef COLOR_RED
-  color_def ("Red",COLOR_RED);
+  color_def("Red", COLOR_RED);
 #endif
 #ifdef COLOR_GREEN
-  color_def ("Green",COLOR_GREEN);
+  color_def("Green", COLOR_GREEN);
 #endif
 #ifdef COLOR_YELLOW
-  color_def ("Yellow",COLOR_YELLOW);
+  color_def("Yellow", COLOR_YELLOW);
 #endif
 #ifdef COLOR_BLUE
-  color_def ("Blue",COLOR_BLUE);
+  color_def("Blue", COLOR_BLUE);
 #endif
 #ifdef COLOR_MAGENTA
-  color_def ("Magenta",COLOR_MAGENTA);
+  color_def("Magenta", COLOR_MAGENTA);
 #endif
 #ifdef COLOR_CYAN
-  color_def ("Cyan",COLOR_CYAN);
+  color_def("Cyan", COLOR_CYAN);
 #endif
 #ifdef COLOR_WHITE
-  color_def ("White",COLOR_WHITE);
+  color_def("White", COLOR_WHITE);
 #endif
 }
 
 /*
  * Generate the linker options for the base facility
  */
-static void gen_linkopts (void)
+static void
+gen_linkopts(void)
 {
-   printf("   pragma Linker_Options (\"-lncurses%s\");\n", model);
+  printf("   pragma Linker_Options (\"-lncurses%s\");\n", model);
 }
 
 /*
  * Generate the linker options for the menu facility
  */
-static void gen_menu_linkopts (void)
+static void
+gen_menu_linkopts(void)
 {
-   printf("   pragma Linker_Options (\"-lmenu%s\");\n", model);
+  printf("   pragma Linker_Options (\"-lmenu%s\");\n", model);
 }
 
 /*
  * Generate the linker options for the form facility
  */
-static void gen_form_linkopts (void)
+static void
+gen_form_linkopts(void)
 {
-   printf("   pragma Linker_Options (\"-lform%s\");\n", model);
+  printf("   pragma Linker_Options (\"-lform%s\");\n", model);
 }
 
 /*
  * Generate the linker options for the panel facility
  */
-static void gen_panel_linkopts (void)
+static void
+gen_panel_linkopts(void)
 {
-   printf("   pragma Linker_Options (\"-lpanel%s\");\n", model);
+  printf("   pragma Linker_Options (\"-lpanel%s\");\n", model);
 }
 
-static void gen_version_info (void)
+static void
+gen_version_info(void)
 {
-  static const charv1 =
-    "   NC_Major_Version : constant := %d; --  Major version of the library\n";
-  static const charv2 =
-    "   NC_Minor_Version : constant := %d; --  Minor version of the library\n";
-  static const charv3 =
-    "   NC_Version : constant String := %c%d.%d%c;  --  Version of library\n";
+  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,'"');
+  printf(v3, '"', NCURSES_VERSION_MAJOR, NCURSES_VERSION_MINOR, '"');
 }
 
 static int
-eti_gen(char*buf, int code, const char* name, int* etimin, int* etimax)
+eti_gen(char *buf, int code, const char *name, int *etimin, int *etimax)
 {
-  sprintf(buf,"   E_%-16s : constant Eti_Error := %d;\n",name,code);
+  sprintf(buf, "   E_%-16s : constant Eti_Error := %d;\n", name, code);
   if (code < *etimin)
     *etimin = code;
   if (code > *etimax)
@@ -1136,68 +1183,77 @@ eti_gen(char*buf, int code, const char* name, int* etimin, int* etimax)
     o = offsetof(WINDOW, member);                                   \
     if ((o%sizeof(itype) == 0)) {                                   \
        printf("   Offset%-*s : constant Natural := %2ld; --  %s\n", \
-              12, #member, o/sizeof(itype),#itype);                 \
+              12, #member, (long)(o/sizeof(itype)),#itype);         \
     }                                                               \
   }
-  
+
 static void
 gen_offsets(void)
 {
   long o;
-  const char* s_bool = "";
-
-  GEN_OFFSET(_maxy,short);
-  GEN_OFFSET(_maxx,short);
-  GEN_OFFSET(_begy,short);
-  GEN_OFFSET(_begx,short);
-  GEN_OFFSET(_cury,short);
-  GEN_OFFSET(_curx,short);
-  GEN_OFFSET(_yoffset,short);
-  GEN_OFFSET(_pary,int);
-  GEN_OFFSET(_parx,int);
-  if (sizeof(bool) == sizeof(char)) {
-    GEN_OFFSET(_notimeout,char);
-    GEN_OFFSET(_clear,char);
-    GEN_OFFSET(_leaveok,char);
-    GEN_OFFSET(_scroll,char);
-    GEN_OFFSET(_idlok,char);
-    GEN_OFFSET(_idcok,char);
-    GEN_OFFSET(_immed,char);
-    GEN_OFFSET(_sync,char);
-    GEN_OFFSET(_use_keypad,char);
-    s_bool = "char";
-  } else if (sizeof(bool) == sizeof(short)) {
-    GEN_OFFSET(_notimeout,short);
-    GEN_OFFSET(_clear,short);
-    GEN_OFFSET(_leaveok,short);
-    GEN_OFFSET(_scroll,short);
-    GEN_OFFSET(_idlok,short);
-    GEN_OFFSET(_idcok,short);
-    GEN_OFFSET(_immed,short);
-    GEN_OFFSET(_sync,short);
-    GEN_OFFSET(_use_keypad,short);
-    s_bool = "short";
-  } else if (sizeof(bool) == sizeof(int)) {
-    GEN_OFFSET(_notimeout,int);
-    GEN_OFFSET(_clear,int);
-    GEN_OFFSET(_leaveok,int);
-    GEN_OFFSET(_scroll,int);
-    GEN_OFFSET(_idlok,int);
-    GEN_OFFSET(_idcok,int);
-    GEN_OFFSET(_immed,int);
-    GEN_OFFSET(_sync,int);
-    GEN_OFFSET(_use_keypad,int);
-    s_bool = "int";
-  }
+  const char *s_bool = "";
+
+  GEN_OFFSET(_maxy, short);
+  GEN_OFFSET(_maxx, short);
+  GEN_OFFSET(_begy, short);
+  GEN_OFFSET(_begx, short);
+  GEN_OFFSET(_cury, short);
+  GEN_OFFSET(_curx, short);
+  GEN_OFFSET(_yoffset, short);
+  GEN_OFFSET(_pary, int);
+  GEN_OFFSET(_parx, int);
+  if (sizeof(bool) == sizeof(char))
+    {
+      GEN_OFFSET(_notimeout, char);
+      GEN_OFFSET(_clear, char);
+      GEN_OFFSET(_leaveok, char);
+      GEN_OFFSET(_scroll, char);
+      GEN_OFFSET(_idlok, char);
+      GEN_OFFSET(_idcok, char);
+      GEN_OFFSET(_immed, char);
+      GEN_OFFSET(_sync, char);
+      GEN_OFFSET(_use_keypad, char);
+
+      s_bool = "char";
+    }
+  else if (sizeof(bool) == sizeof(short))
+    {
+      GEN_OFFSET(_notimeout, short);
+      GEN_OFFSET(_clear, short);
+      GEN_OFFSET(_leaveok, short);
+      GEN_OFFSET(_scroll, short);
+      GEN_OFFSET(_idlok, short);
+      GEN_OFFSET(_idcok, short);
+      GEN_OFFSET(_immed, short);
+      GEN_OFFSET(_sync, short);
+      GEN_OFFSET(_use_keypad, short);
+
+      s_bool = "short";
+    }
+  else if (sizeof(bool) == sizeof(int))
+    {
+      GEN_OFFSET(_notimeout, int);
+      GEN_OFFSET(_clear, int);
+      GEN_OFFSET(_leaveok, int);
+      GEN_OFFSET(_scroll, int);
+      GEN_OFFSET(_idlok, int);
+      GEN_OFFSET(_idcok, int);
+      GEN_OFFSET(_immed, int);
+      GEN_OFFSET(_sync, int);
+      GEN_OFFSET(_use_keypad, int);
+
+      s_bool = "int";
+    }
   printf("   Sizeof%-*s : constant Natural := %2ld; --  %s\n",
-        12, "_bool", (long) sizeof(bool),"bool");
+        12, "_bool", (long)sizeof(bool), "bool");
+
   /* In ncurses _maxy and _maxx needs an offset for the "public"
    * value
    */
   printf("   Offset%-*s : constant Natural := %2d; --  %s\n",
-        12, "_XY",1,"int");
+        12, "_XY", 1, "int");
   printf("\n");
-  printf("   type Curses_Bool is mod 2 ** Interfaces.C.%s'Size;\n",s_bool);
+  printf("   type Curses_Bool is mod 2 ** Interfaces.C.%s'Size;\n", s_bool);
 }
 
 /*
@@ -1213,7 +1269,8 @@ gen_offsets(void)
  * The second character then denotes the specific output that should be
  * generated for the selected facility.
  */
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
 {
   int x = 0x12345678;
   char *s = (char *)&x;
@@ -1221,216 +1278,226 @@ int main(int argc, char *argv[])
   if (*s == 0x78)
     little_endian = 1;
 
-  if (argc!=4)
+  if (argc != 4)
     exit(1);
   model = *++argv;
 
-  switch(argv[1][0])
+  switch (argv[1][0])
     {
-      /* ---------------------------------------------------------------*/   
-    case 'B': /* The Base facility */
-      switch(argv[2][0])
+      /* --------------------------------------------------------------- */
+    case 'B':                  /* The Base facility */
+      switch (argv[2][0])
        {
-       case 'A': /* chtype translation into Ada95 record type */
+       case 'A':               /* chtype translation into Ada95 record type */
          gen_attr_set("Character_Attribute_Set");
          break;
-       case 'K': /* translation of keycodes */
+       case 'K':               /* translation of keycodes */
          gen_keydefs(0);
          break;
-       case 'B': /* write some initial comment lines */
+       case 'B':               /* write some initial comment lines */
          basedefs();
          break;
-       case 'C': /* generate color constants */
+       case 'C':               /* generate color constants */
          gen_color();
          break;
-       case 'D': /* generate displacements of fields in WINDOW struct. */
+       case 'D':               /* generate displacements of fields in WINDOW struct. */
          gen_offsets();
          break;
-       case 'E': /* generate Mouse Event codes */
+       case 'E':               /* generate Mouse Event codes */
          gen_mouse_events();
          break;
-       case 'M': /* generate constants for the ACS characters */
+       case 'M':               /* generate constants for the ACS characters */
          gen_acs();
          break;
-       case 'L': /* generate the Linker_Options pragma */
+       case 'L':               /* generate the Linker_Options pragma */
          gen_linkopts();
          break;
-       case 'O': /* generate definitions of the old key code names */
+       case 'O':               /* generate definitions of the old key code names */
          gen_keydefs(1);
          break;
-       case 'R': /* generate representation clause for Attributed character */
+       case 'R':               /* generate representation clause for Attributed character */
          gen_chtype_rep("Attributed_Character");
          break;
-       case 'V': /* generate version info */
+       case 'V':               /* generate version info */
          gen_version_info();
          break;
-       case 'T': /* generate the Trace info */
+       case 'T':               /* generate the Trace info */
          gen_trace("Trace_Attribute_Set");
          break;
        default:
          break;
        }
       break;
-      /* ---------------------------------------------------------------*/   
-    case 'M': /* The Menu facility */
-      switch(argv[2][0])
+      /* --------------------------------------------------------------- */
+    case 'M':                  /* The Menu facility */
+      switch (argv[2][0])
        {
-       case 'R': /* generate representation clause for Menu_Option_Set */
+       case 'R':               /* generate representation clause for Menu_Option_Set */
          gen_menu_opt_rep("Menu_Option_Set");
          break;
-       case 'B': /* write some initial comment lines */
+       case 'B':               /* write some initial comment lines */
          menu_basedefs();
          break;
-       case 'L': /* generate the Linker_Options pragma */
+       case 'L':               /* generate the Linker_Options pragma */
          gen_menu_linkopts();
          break;
-       case 'I': /* generate representation clause for Item_Option_Set */
+       case 'I':               /* generate representation clause for Item_Option_Set */
          gen_item_opt_rep("Item_Option_Set");
          break;
        default:
          break;
        }
       break;
-      /* ---------------------------------------------------------------*/   
-    case 'F': /* The Form facility */
-      switch(argv[2][0])
+      /* --------------------------------------------------------------- */
+    case 'F':                  /* The Form facility */
+      switch (argv[2][0])
        {
-       case 'R': /* generate representation clause for Form_Option_Set */
+       case 'R':               /* generate representation clause for Form_Option_Set */
          gen_form_opt_rep("Form_Option_Set");
          break;
-       case 'B': /* write some initial comment lines */
+       case 'B':               /* write some initial comment lines */
          form_basedefs();
          break;
-       case 'L': /* generate the Linker_Options pragma */
+       case 'L':               /* generate the Linker_Options pragma */
          gen_form_linkopts();
          break;
-       case 'I': /* generate representation clause for Field_Option_Set */
+       case 'I':               /* generate representation clause for Field_Option_Set */
          gen_field_opt_rep("Field_Option_Set");
          break;
        default:
          break;
        }
       break;
-      /* ---------------------------------------------------------------*/   
-    case 'P': /* The Pointer(=Mouse) facility */
-      switch(argv[2][0]) {
-       case 'B': /* write some initial comment lines */
+      /* --------------------------------------------------------------- */
+    case 'P':                  /* The Pointer(=Mouse) facility */
+      switch (argv[2][0])
+       {
+       case 'B':               /* write some initial comment lines */
          mouse_basedefs();
          break;
-       case 'M': /* generate representation clause for Mouse_Event */
+       case 'M':               /* generate representation clause for Mouse_Event */
          gen_mrep_rep("Mouse_Event");
          break;
-       case 'L': /* generate the Linker_Options pragma */
+       case 'L':               /* generate the Linker_Options pragma */
          gen_panel_linkopts();
          break;
        default:
          break;
        }
-       break;
-      /* ---------------------------------------------------------------*/   
-    case 'E' : /* chtype size detection */
-      switch(argv[2][0]) {
-      case 'C':
+      break;
+      /* --------------------------------------------------------------- */
+    case 'E':                  /* chtype size detection */
+      switch (argv[2][0])
        {
-         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");
+       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(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");
+             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(afmt,"C_UInt");
-         }
-         else if (sizeof(attr_t)==sizeof(long)) {
-           printf(afmt,"C_ULong");
-         }
-         else
-           printf("Error\n");
+             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("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);
          }
-         printf("   subtype Eti_Error is C_Int range %d .. %d;\n\n",
-                etimin,etimax);
-         printf(buf);
+         break;
+       default:
+         break;
        }
-       break;
-      default:
-       break;
-      }
       break;
-      /* ---------------------------------------------------------------*/   
-    case 'V' : /* plain version dump */
+      /* --------------------------------------------------------------- */
+    case 'V':                  /* plain version dump */
       {
-       switch(argv[2][0]) {
-       case '1': /* major version */
+       switch (argv[2][0])
+         {
+         case '1':             /* major version */
 #ifdef NCURSES_VERSION_MAJOR
-         printf("%d",NCURSES_VERSION_MAJOR);
+           printf("%d", NCURSES_VERSION_MAJOR);
 #endif
-         break;
-       case '2': /* minor version */
+           break;
+         case '2':             /* minor version */
 #ifdef NCURSES_VERSION_MINOR
-         printf("%d",NCURSES_VERSION_MINOR);
+           printf("%d", NCURSES_VERSION_MINOR);
 #endif
-         break;
-       case '3': /* patch level */
+           break;
+         case '3':             /* patch level */
 #ifdef NCURSES_VERSION_PATCH
-         printf("%d",NCURSES_VERSION_PATCH);
+           printf("%d", NCURSES_VERSION_PATCH);
 #endif
-         break;
-       default:
-         break;
-       }
+           break;
+         default:
+           break;
+         }
       }
       break;
-      /* ---------------------------------------------------------------*/     
+      /* --------------------------------------------------------------- */
     default:
       break;
     }
   return 0;
 }
-  
index bb9516f708a086468ed65259148e033abd6116bf..5ca079cf66187ef437305c823be9955793ea90ec 100644 (file)
@@ -10,7 +10,7 @@ include(M4MACRO)dnl
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,7 +38,8 @@ include(M4MACRO)dnl
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.22 $
+--  $Revision: 1.25 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 include(`Mouse_Base_Defs')
@@ -169,7 +170,6 @@ private
          Bstate  : Event_Mask;
       end record;
    pragma Convention (C, Mouse_Event);
-   pragma Pack (Mouse_Event);
 
 include(`Mouse_Event_Rep')
    Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER;
index a8e9795b20754e7b788f6ef10932cae1040be1f9..32922f1e401898e7fda961b540a550e3da533f79 100644 (file)
@@ -9,7 +9,7 @@ include(M4MACRO)----------------------------------------------------------------
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -37,7 +37,8 @@ include(M4MACRO)----------------------------------------------------------------
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.31 $
+--  $Revision: 1.35 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 include(`Base_Defs')
@@ -59,11 +60,12 @@ include(`Version_Info')
    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;
+   type Key_Code is new Integer;
    --  That is anything including real characters, special keys and logical
    --  request codes.
 
-   subtype Real_Key_Code is Key_Code range 0 .. M4_KEY_MAX;
+   --  FIXME: The "-1" should be Curses_Err
+   subtype Real_Key_Code is Key_Code range -1 .. M4_KEY_MAX;
    --  This are the codes that potentially represent a real keystroke.
    --  Not all codes may be possible on a specific terminal. To check the
    --  availability of a special key, the Has_Key function is provided.
index 8c8dd72f0949c9b9330c52caeb9adb411cd6f0ba..e88c119bc33e7c748aafdf0e150411d1a564836f 100644 (file)
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998 Free Software Foundation, Inc.                          #
+# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -28,8 +28,7 @@
 #
 #  Author:  Juergen Pfeifer, 1996
 #
-#  Version Control
-#  $Revision: 1.30 $
+#  $Id: Makefile.in,v 1.33 2005/05/28 16:11:01 tom Exp $
 #
 .SUFFIXES:
 
@@ -84,7 +83,7 @@ ALIB         = @cf_ada_package@
 ABASE        = $(ALIB)-curses
 
 CARGS        =-cargs $(ADAFLAGS)
-LARGS        =-largs -L../../lib @TEST_ARGS@ $(LD_FLAGS) -lAdaCurses @EXTRA_LIBS@
+LARGS        =-largs @TEST_ARG2@ $(LD_FLAGS) -lAdaCurses
  
 PROGS        = tour rain ncurses 
 
@@ -111,19 +110,19 @@ NCURSES_OBJS = ncurses.o          ncurses2-getch_test.o \
 
 
 all ::  tour$x rain$x ncurses$x
-       @
+       @echo made $@
 
 sources :
-       @
+       @echo made $@
 
 libs \
 install \
 install.libs ::
-       @
+       @echo made $@
 
 uninstall \
 uninstall.libs ::
-       @
+       @echo made $@
 
 ncurses$x :
        $(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS)
@@ -138,7 +137,7 @@ rain$x :
        $(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS)
 
 mostlyclean:
-       @
+       @echo made $@
 
 clean :: mostlyclean
        rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \
@@ -148,6 +147,4 @@ distclean :: clean
        rm -f Makefile
 
 realclean :: distclean
-       @
-
-
+       @echo made $@
index 65c2939a8597426b277f5675fcfc16892389a088..66384cae080cf11539ce53e7a5dc5bbf3996a036 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.6 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  Windows and scrolling tester.
@@ -224,8 +225,8 @@ procedure ncurses2.acs_and_scroll is
          );
 
       buf : Bounded_String;
-      do_keypad : Boolean := HaveKeyPad (curpw);
-      do_scroll : Boolean := HaveScroll (curpw);
+      do_keypad : constant Boolean := HaveKeyPad (curpw);
+      do_scroll : constant Boolean := HaveScroll (curpw);
 
       pos : Natural;
 
@@ -331,8 +332,8 @@ procedure ncurses2.acs_and_scroll is
       res : pair;
       i : Line_Position := 0;
       j : Column_Position := 0;
-      si : Line_Position := lri - uli + 1;
-      sj : Column_Position := lrj - ulj + 1;
+      si : constant Line_Position := lri - uli + 1;
+      sj : constant Column_Position := lrj - ulj + 1;
    begin
       res.y := uli;
       res.x := ulj;
@@ -714,7 +715,7 @@ begin
 
    Allow_Scrolling (Mode => True);
 
-   End_Mouse;
+   End_Mouse (Mask2);
    Set_Raw_Mode (SwitchOn => True);
    Erase;
    End_Windows;
index ab072132494701c364f6f35909c70015a448800b..1ed4c6433834eebacefa0c52a8f64e2749a7a543 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.4 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -57,8 +58,8 @@ procedure ncurses2.acs_display is
 
 
    procedure show_upper_chars (first : Integer)  is
-      C1 : Boolean := (first = 128);
-      last : Integer := first + 31;
+      C1 : constant Boolean := (first = 128);
+      last : constant Integer := first + 31;
       package p is new ncurses2.genericPuts (200);
       use p;
       use p.BS;
@@ -91,9 +92,11 @@ procedure ncurses2.acs_display is
 
       for code in first .. last loop
          declare
-            row : Line_Position := Line_Position (4 + ((code - first) mod 16));
-            col : Column_Position := Column_Position (((code - first) / 16) *
-                                                      Integer (Columns) / 2);
+            row : constant Line_Position
+                := Line_Position (4 + ((code - first) mod 16));
+            col : constant Column_Position
+                := Column_Position (((code - first) / 16) *
+                                    Integer (Columns) / 2);
             tmp3 : String (1 .. 3);
             tmpx : String (1 .. Integer (Columns / 4));
             reply : Key_Code;
@@ -129,8 +132,8 @@ procedure ncurses2.acs_display is
                         code :  Attributed_Character)
                        return Integer is
       height : constant Integer := 16;
-      row : Line_Position := Line_Position (4 + (N mod height));
-      col : Column_Position := Column_Position ((N / height) *
+      row : constant Line_Position := Line_Position (4 + (N mod height));
+      col : constant Column_Position := Column_Position ((N / height) *
                                                 Integer (Columns) / 2);
       tmpx : String (1 .. Integer (Columns) / 3);
    begin
index d852bb7f2749f1e18650157ecc6a3dbc89b8c034..bb7769194e2ccc2e492adb2234894105567fb2c8 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2001,2004 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.2 $
+--  $Revision: 1.5 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -222,7 +223,7 @@ procedure ncurses2.attr_test is
             elsif ncv > 0 and has_A_COLOR (Get_Background) then
                declare
                   Color_Supported_Attributes :
-                    Character_Attribute_Set := make_record (ncv);
+                    constant Character_Attribute_Set := make_record (ncv);
                begin
                   if intersect (Color_Supported_Attributes, attr) then
                      Add (Str => " (NCV) ");
@@ -236,7 +237,7 @@ procedure ncurses2.attr_test is
 
    procedure attr_getc (skip : out Integer; fg, bg : in out Color_Number;
                                             result : out Boolean) is
-      ch : Key_Code := Getchar;
+      ch : constant Key_Code := Getchar;
       nc : constant Color_Number := Color_Number (Number_Of_Colors);
       curscr : Window;
       pragma Import (C, curscr, "curscr");
@@ -293,7 +294,7 @@ begin
          --  row := 2; -- weird, row is set to 0 without this.
          --  TODO delete the above line, it was a gdb quirk that confused me
          if Has_Colors then declare
-            pair : Color_Pair :=
+            pair : constant Color_Pair :=
               Color_Pair (fg * Color_Number (Number_Of_Colors) + bg);
          begin
             --  Go though each color pair. Assume that the number of
index ac14628fd9909da004aed77e676545435f0bec91..a678ccf4bc5268d024a80da5fe5f98620d570b9d 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.4 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -101,7 +102,6 @@ procedure ncurses2.color_edit is
    current : Color_Number := 0;
    field : RGB_Enum := Redx;
    this_c : Key_Code := 0;
-   last_c : Key_Code;
 begin
    Refresh;
 
@@ -185,7 +185,6 @@ begin
 
       Move_Cursor (Line => 2 + Line_Position (current), Column => 0);
 
-      last_c := this_c;
       this_c := Getchar;
       if Is_Digit (this_c) then
          value := 0;
index 7f4cefc960f97ce5c82277acf5a6e1a7c3335aea..2cc99daef1eae81652e497b00b49a91a938f77e6 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.4 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -282,7 +283,7 @@ procedure ncurses2.demo_forms is
          );
 
       c : Key_Code := Getchar (w);
-      me : Field := Current (f);
+      me : constant Field := Current (f);
 
    begin
       if c = Character'Pos (']') mod 16#20# then
@@ -314,7 +315,7 @@ procedure ncurses2.demo_forms is
    end form_virtualize;
 
    function my_form_driver (f : Form; c : Key_Code) return Boolean is
-      flag : Driver_Result := Driver (f, F_Validate_Field);
+      flag : constant Driver_Result := Driver (f, F_Validate_Field);
    begin
       if c = Form_Request_Code'Last + 1
         and flag = Form_Ok then
@@ -328,7 +329,7 @@ procedure ncurses2.demo_forms is
    function make_label (frow  : Line_Position;
                         fcol  : Column_Position;
                         label : String) return Field is
-      f : Field := Create (1, label'Length, frow, fcol, 0, 0);
+      f : constant Field := Create (1, label'Length, frow, fcol, 0, 0);
       o : Field_Option_Set := Get_Options (f);
    begin
       if f /= Null_Field then
index 1b17cbd54cb83c4202822416b8c13112616bf09f..399a2f4b5c82ba3deb0cb8740151475aaf17b5b9 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.5 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -104,7 +105,7 @@ procedure ncurses2.demo_pad is
       package myP is new System.Address_To_Access_Conversions (timeval);
       use myP;
 
-      t : Object_Pointer := new timeval;
+      t : constant Object_Pointer := new timeval;
 
       function gettimeofday
         (TP : System.Storage_Elements.Integer_Address;
@@ -116,8 +117,13 @@ procedure ncurses2.demo_pad is
                            (myP.To_Address (t)),
                            System.Storage_Elements.To_Integer
                            (myP.To_Address (null)));
-      retval.seconds := Integer (t.tv_sec);
-      retval.microseconds := Integer (t.tv_usec);
+      if tmp < 0 then
+         retval.seconds := 0;
+         retval.microseconds := 0;
+      else
+         retval.seconds := Integer (t.tv_sec);
+         retval.microseconds := Integer (t.tv_usec);
+      end if;
       return retval;
    end gettime;
 
@@ -202,7 +208,7 @@ procedure ncurses2.demo_pad is
          "Use <,> (or h,l) to grow/shrink the panner horizontally.     ");
       legendsize : constant := 4;
 
-      n : Integer := legendsize - Integer (Lines - line);
+      n : constant Integer := legendsize - Integer (Lines - line);
    begin
       if line < Lines and n >= 0 then
          Move_Cursor (Line => line, Column => 0);
@@ -216,9 +222,10 @@ procedure ncurses2.demo_pad is
    end panner_legend;
 
    procedure panner_legend (line : Line_Position) is
-      tmp : Boolean;
    begin
-      tmp := panner_legend (line);
+      if not panner_legend (line) then
+         Beep;
+      end if;
    end panner_legend;
 
    procedure panner_h_cleanup (from_y : Line_Position;
@@ -435,8 +442,8 @@ procedure ncurses2.demo_pad is
             when Key_Cursor_Right =>
                --  pan rightwards
                --  if (basex + portx - (pymax > porty) < pxmax)
-               if (basex + portx -
-                   Column_Position (greater (pymax, porty)) < pxmax) then
+               if basex + portx -
+                   Column_Position (greater (pymax, porty)) < pxmax then
                   --  if basex + portx  < pxmax or
                   --      (pymax > porty and basex + portx - 1 < pxmax) then
                   basex := basex + 1;
@@ -455,8 +462,8 @@ procedure ncurses2.demo_pad is
             when Key_Cursor_Down =>
                --  pan downwards
                --  same as if (basey + porty - (pxmax > portx) < pymax)
-               if (basey + porty -
-                   Line_Position (greater (pxmax, portx)) < pymax) then
+               if basey + porty -
+                   Line_Position (greater (pxmax, portx)) < pymax then
                   --  if (basey + porty  < pymax) or
                   --      (pxmax > portx and basey + porty - 1 < pymax) then
                   basey := basey + 1;
@@ -472,9 +479,10 @@ procedure ncurses2.demo_pad is
             when   Character'Pos ('E') |
               Key_End |
               Key_Select =>
-               basey := pymax - porty;
-               if basey < 0 then --  basey := max(basey, 0);
+               if pymax < porty then
                   basey := 0;
+               else
+                  basey := pymax - porty;
                end if;
 
             when others =>
@@ -500,7 +508,7 @@ procedure ncurses2.demo_pad is
          --  in C was ... pxmax > portx - 1
          if scrollers and pxmax >= portx then
             declare
-               length : Column_Position := portx - top_x - 1;
+               length : constant Column_Position := portx - top_x - 1;
                lowend, highend : Column_Position;
             begin
                --  Instead of using floats, I'll use integers only.
@@ -527,7 +535,7 @@ procedure ncurses2.demo_pad is
 
          if scrollers and pymax >= porty then
             declare
-               length : Line_Position := porty - top_y - 1;
+               length : constant Line_Position := porty - top_y - 1;
                lowend, highend : Line_Position;
             begin
                lowend := top_y + (basey * length) / pymax;
index 9988a9f1359d708a9a2bf449424b3f24ee82f61b..6a0b60368c0fa16363ac1f0e1a3dc157e95e3c6e 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.4 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -115,10 +116,10 @@ procedure ncurses2.demo_panels (nap_mseci : Integer) is
    procedure wait_a_while (msec : Integer) is
    begin
       --  The C version had some #ifdef blocks here
-      if nap_msec = 1 then
+      if msec = 1 then
          Getchar;
       else
-         Nap_Milli_Seconds (nap_msec);
+         Nap_Milli_Seconds (msec);
       end if;
    end wait_a_while;
 
@@ -137,8 +138,8 @@ procedure ncurses2.demo_panels (nap_mseci : Integer) is
    use PUD;
 
    procedure fill_panel (pan : Panel) is
-      win : Window := Panel_Window (pan);
-      num : Character := Get_User_Data (pan) (2);
+      win : constant Window := Panel_Window (pan);
+      num : constant Character := Get_User_Data (pan) (2);
       tmp6 : String (1 .. 6) := "-panx-";
       maxy : Line_Count;
       maxx : Column_Count;
@@ -158,7 +159,7 @@ procedure ncurses2.demo_panels (nap_mseci : Integer) is
       end loop;
    end fill_panel;
 
-   modstr : array (0 .. 5) of String (1 .. 5) :=
+   modstr : constant array (0 .. 5) of String (1 .. 5) :=
      ("test ",
       "TEST ",
       "(**) ",
@@ -185,11 +186,11 @@ begin
    for y in 0 .. 4 loop
       declare
          p1, p2, p3, p4, p5 : Panel;
-         U1 : User_Data_Access := new User_Data'("p1");
-         U2 : User_Data_Access := new User_Data'("p2");
-         U3 : User_Data_Access := new User_Data'("p3");
-         U4 : User_Data_Access := new User_Data'("p4");
-         U5 : User_Data_Access := new User_Data'("p5");
+         U1 : constant User_Data_Access := new User_Data'("p1");
+         U2 : constant User_Data_Access := new User_Data'("p2");
+         U3 : constant User_Data_Access := new User_Data'("p3");
+         U4 : constant User_Data_Access := new User_Data'("p4");
+         U5 : constant User_Data_Access := new User_Data'("p5");
 
       begin
          p1 := mkpanel (Red, Lines / 2 - 2, Columns / 8 + 1, 0, 0);
@@ -295,8 +296,8 @@ begin
 
          for itmp in  0 ..  5 loop
             declare
-               w4 : Window := Panel_Window (p4);
-               w5 : Window := Panel_Window (p5);
+               w4 : constant Window := Panel_Window (p4);
+               w5 : constant Window := Panel_Window (p5);
             begin
 
                saywhat ("m4; press any key to continue");
@@ -364,7 +365,7 @@ begin
          rmpanel (p5);
          pflush;
          wait_a_while (nap_msec);
-         if (nap_msec = 1) then
+         if nap_msec = 1 then
             exit;
          else
             nap_msec := 100;
index d786d49644f6bda040ca213e4584beed6fe856e8..57ceb961dc6281ed29e958f9115904ddde57e9fc 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.5 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  Character input test
@@ -96,6 +97,7 @@ procedure ncurses2.getch_test is
    y : Line_Position;
    tmpx : Integer;
    incount : Integer := 0;
+
 begin
    Refresh;
    tmp2 := Start_Mouse (All_Events);
@@ -135,7 +137,7 @@ begin
             Add (Ch => newl);
          elsif c > 16#80# then --  TODO fix, use constant if possible
             declare
-               c2 : Character := Character'Val (c mod 16#80#);
+               c2 : constant Character := Character'Val (c mod 16#80#);
             begin
                if Ada.Characters.Handling.Is_Graphic (c2) then
                   Add (Str => "M-");
@@ -150,7 +152,7 @@ begin
                Add (Ch => newl);
             end;
          else declare
-            c2 : Character := Character'Val (c mod 16#80#);
+            c2 : constant Character := Character'Val (c mod 16#80#);
          begin
             if Ada.Characters.Handling.Is_Graphic (c2) then
                Add (Ch => c2);
@@ -242,7 +244,7 @@ begin
       end loop;
    end loop;
 
-   tmp2 := Start_Mouse (No_Events);
+   End_Mouse (tmp2);
    Set_Timeout_Mode (Mode => Blocking, Amount => 0); --  amount is ignored
    Set_Raw_Mode (SwitchOn => False);
    Set_NL_Mode (SwitchOn => True);
index 176073b0bb59197171a8e85136cc060d7c6d4019..5719b1b01eb6d489b084ae923d64a851f965106b 100644 (file)
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.3 $
+--  $Revision: 1.6 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  A simplified version of the  GNU getopt function
@@ -47,8 +48,6 @@ with Ada.Text_IO; use Ada.Text_IO;
 
 package body ncurses2.getopt is
 
-   optopt : Character := '?';
-
    nextchar : Natural := 0;
 
    --  Ncurses doesn't use the non option elements so we are spared
@@ -104,13 +103,12 @@ package body ncurses2.getopt is
       --  Look at and handle the next short option-character.
       declare
          c : Character := argv (optind) (nextchar);
-         temp : Natural :=
+         temp : constant Natural :=
            Ada.Strings.Fixed.Index (optstring, String'(1 => c));
       begin
          if temp = 0 or c = ':' then
             Put_Line (Standard_Error,
                       argv (optind) & ": invalid option -- " & c);
-            optopt := c;
             c := '?';
             return;
          end if;
@@ -134,7 +132,6 @@ package body ncurses2.getopt is
                   Put_Line (Standard_Error,
                             argv (optind) &
                             ": option requires an argument -- " & c);
-                  optopt := c;
                   if optstring (1) = ':'  then
                      c := ':';
                   else
index 214c735bf9ac685ef6a9330ed7c0c39c53d93607..7b49fc52d1eb91b7e65842714dd795fa00f444c7 100644 (file)
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.2 $
+--  $Revision: 1.5 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  TODO use Default_Character where appropriate
@@ -332,7 +333,7 @@ package body ncurses2.m is
                default_colors := True;
             when 'e' =>
                myio.Get (optarg.all, tmpi, length);
-               if Integer (tmpi) > 3 then
+               if tmpi > 3 then
                   usage;
                   return 1;
                end if;
index 0b96315e1c04cbf8a2db48a91bb2c0f5a54b956c..297940da6fa9942c30e567a22bfea1a803339221 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.5 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -92,6 +93,7 @@ procedure ncurses2.menu_test is
    items_a : Item_Array_Access := new Item_Array (1 .. animals'Last + 1);
 
    tmp : Event_Mask;
+
    procedure xAdd (l : Line_Position; c : Column_Position; s : String) is
    begin
       Add (Line => l, Column => c, Str => s);
@@ -161,5 +163,5 @@ begin
 
    Delete (m);
 
-   tmp := Start_Mouse (No_Events);
+   End_Mouse (tmp);
 end ncurses2.menu_test;
index 5d3fc6d5e447639f1bc56ccb10799fb23d397215..37e8d4c2eb5a88a6359e087a181b9fa5f9d15ed3 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.4 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -71,8 +72,8 @@ procedure ncurses2.overlap_test is
       Get_Size (win, y1, x1);
       for y in 0 .. y1 - 1 loop
          for x in 0 .. x1 - 1 loop
-            if (((x > (x1 - 1) / 3) and (x <= (2 * (x1 - 1)) / 3))
-                or (((y > (y1 - 1) / 3) and (y <= (2 * (y1 - 1)) / 3)))) then
+            if ((x > (x1 - 1) / 3) and (x <= (2 * (x1 - 1)) / 3))
+                or (((y > (y1 - 1) / 3) and (y <= (2 * (y1 - 1)) / 3))) then
                Move_Cursor (win, y, x);
                Add (win, Ch => ch);
             end if;
index 77ca2843fa68a98a13b821ecc0fbe3a50f32ca38..de4edb572ca11efb1b22e0a8a140da83dbc774e9 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.6 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -63,10 +64,13 @@ procedure ncurses2.slk_test is
                          Len : int) return int;
       pragma Import (C, Wgetnstr, "wgetnstr");
 
-      Txt : char_array (0 .. 10);
+      --  FIXME: how to construct "(Len > 0) ? Len : 80"?
+      Ask : constant Interfaces.C.size_t := Interfaces.C.size_t'Val (Len + 80);
+      Txt : char_array (0 .. Ask);
+
    begin
       Txt (0) := Interfaces.C.char'First;
-      if Wgetnstr (Win, Txt, 8) = Curses_Err then
+      if Wgetnstr (Win, Txt, Txt'Length) = Curses_Err then
          raise Curses_Exception;
       end if;
       Str := To_Unbounded_String (To_Ada (Txt, True));
index 907dcef9c7aa846a53c9607f61c33d395321ba4b..3e88ea8b001ccf49583ec77faf982c222ef6a398 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.5 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -104,9 +105,10 @@ package body ncurses2.util is
    end Getchar;
 
    procedure Getchar (win : Window := Standard_Window) is
-      x : Key_Code;
    begin
-      x := Getchar (win);
+      if Getchar (win) < 0 then
+         Beep;
+      end if;
    end Getchar;
 
 
index aab45c29890a20be2a70e7baec1a9b2e3b320a7b..700da7684be10a0579ae66fcdb978fc064e03fdc 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.12 $
+--  $Revision: 1.15 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -74,7 +75,7 @@ package body Sample.Curses_Demo is
          New_Item ("Mouse Demo"),
          Null_Item);
       M  : Menu := New_Menu (Itm);
-      U1 : User_Data_Access := new User_Data'(4711);
+      U1 : constant User_Data_Access := new User_Data'(4711);
       U2 : User_Data_Access;
 
       function My_Driver (M : Menu;
index 705e02da5e5ffdd321313884ace41a848514f800..66efb0db5190865a383125af885667c5178abb51 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.15 $
+--  $Revision: 1.18 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  Poor mans help system. This scans a sequential file for key lines and
@@ -57,7 +58,7 @@ package body Sample.Explanation is
    Help_Keys : constant String := "HELPKEYS";
    In_Help   : constant String := "INHELP";
 
-   File_Name : String := "explain.msg";
+   File_Name : constant String := "explain.msg";
    F : File_Type;
 
    type Help_Line;
@@ -116,7 +117,7 @@ package body Sample.Explanation is
       Current  : Help_Line_Access;
       Top_Line : Help_Line_Access;
 
-      Has_More : Boolean;
+      Has_More : Boolean := True;
 
       procedure Unknown_Key
       is
index 712fb5d122837edb5bfbc2f8a8a89ddec9839a32..81c97ad0b841191927024add1d09b50cbbda6190 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.13 $
+--  $Revision: 1.16 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
@@ -198,7 +199,7 @@ package body Sample.Form_Demo.Aux is
                   Text        : String) return Field
    is
       Fld : Field;
-      C : Column_Count := Column_Count (Text'Length);
+      C : constant Column_Count := Column_Count (Text'Length);
    begin
       Fld := New_Field (1, C, Top, Left);
       Set_Buffer (Fld, 0, Text);
@@ -215,7 +216,7 @@ package body Sample.Form_Demo.Aux is
                    Left        : Column_Position;
                    Off_Screen  : Natural := 0) return Field
    is
-      Fld : Field := New_Field (Height, Width, Top, Left, Off_Screen);
+      Fld : constant Field := New_Field (Height, Width, Top, Left, Off_Screen);
    begin
       if Has_Colors then
          Set_Foreground (Fld => Fld, Color => Form_Fore_Color);
@@ -231,6 +232,9 @@ package body Sample.Form_Demo.Aux is
                             P : Panel) return Boolean
    is
    begin
+      if P = Null_Panel then
+         raise Panel_Exception;
+      end if;
       if K in User_Key_Code'Range and then K = QUIT then
          if Driver (F, F_Validate_Field) = Form_Ok  then
             return True;
index 667df4ddec1cf6d162433ed28cc8b7aba73b1d6b..afe86f71111b99b54de03db52507384546399ad5 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.10 $
+--  $Revision: 1.13 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Sample.Form_Demo.Aux;
@@ -72,7 +73,7 @@ package body Sample.Form_Demo.Handler is
       end if;
       loop
          declare
-            K : Key_Code := Aux.Get_Request (F, Pan, Handle_CRLF);
+            K : constant Key_Code := Aux.Get_Request (F, Pan, Handle_CRLF);
             R : Driver_Result;
          begin
             if (K = 13 or else K = 10) and then not Handle_CRLF then
index c5df36f7c0bf4cb99c5b986d400943450230c285..df138139737621562314aa8a47826472d685f4d1 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.10 $
+--  $Revision: 1.13 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses; use Terminal_Interface.Curses;
 with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
 with Terminal_Interface.Curses.Forms.Field_User_Data;
-with Terminal_Interface.Curses.Forms.Form_User_Data;
 with Sample.My_Field_Type; use Sample.My_Field_Type;
 with Sample.Explanation; use Sample.Explanation;
 with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux;
@@ -66,10 +66,6 @@ package body Sample.Form_Demo is
      Terminal_Interface.Curses.Forms.Field_User_Data (User_Data,
                                                       User_Access);
 
-   package Frm_U is new
-     Terminal_Interface.Curses.Forms.Form_User_Data (User_Data,
-                                                     User_Access);
-
    type Weekday is (Sunday, Monday, Tuesday, Wednesday, Thursday,
                     Friday, Saturday);
 
index 9c7a31e8e38860a2bd8ce9d3c2a5d8e956511e56..e40e4a40500092f7e8774a33ccb46d2ff15b9b50 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.10 $
+--  $Revision: 1.13 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Unchecked_Deallocation;
@@ -97,7 +98,7 @@ package body Sample.Function_Key_Setting is
       P.Help := Active_Context;
       P.Notepad := Active_Notepad;
       --  The notepad must now vanish and the new notepad is empty.
-      if (P.Notepad /= Null_Panel) then
+      if P.Notepad /= Null_Panel then
          Hide (P.Notepad);
          Update_Panels;
       end if;
index 2c51e94193d512ff5c85a75d013b0344095ba494..b187f9763874687978304ff137d53c6167749033 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.11 $
+--  $Revision: 1.14 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Calendar; use Ada.Calendar;
@@ -111,12 +112,12 @@ package body Sample.Header_Handler is
          "November ",
          "December ");
 
-      Now : Time := Clock;
-      Sec : Integer := Integer (Seconds (Now));
-      Hour   : Integer := Sec / 3600;
-      Minute : Integer := (Sec - Hour * 3600) / 60;
-      Mon    : Month_Number := Month (Now);
-      D      : Day_Number   := Day (Now);
+      Now    : constant Time         := Clock;
+      Sec    : constant Integer      := Integer (Seconds (Now));
+      Hour   : constant Integer      := Sec / 3600;
+      Minute : constant Integer      := (Sec - Hour * 3600) / 60;
+      Mon    : constant Month_Number := Month (Now);
+      D      : constant Day_Number   := Day (Now);
    begin
       if Header_Window /= Null_Window then
          if Minute /= Display_Min or else Hour /= Display_Hour
index 60043581c02c6571b5b7c6c9d1463ed956232fbb..5629ea77b7bec55e3367b3918c26e013e8890ad6 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.9 $
+--  $Revision: 1.12 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Strings; use Ada.Strings;
@@ -95,6 +96,9 @@ package body Sample.Keyboard_Handler is
          is
             Ch : Character;
          begin
+            if P = Null_Panel then
+               raise Panel_Exception;
+            end if;
             if C in User_Key_Code'Range and then C = QUIT then
                if Driver (F, F_Validate_Field) = Form_Ok  then
                   K := Key_None;
@@ -102,7 +106,7 @@ package body Sample.Keyboard_Handler is
                end if;
             elsif C in Normal_Key_Code'Range then
                Ch := Character'Val (C);
-               if (Ch = LF or else Ch = CR) then
+               if Ch = LF or else Ch = CR then
                   if Driver (F, F_Validate_Field) = Form_Ok  then
                      declare
                         Buffer : String (1 .. Positive (Columns - 11));
index 6098a2504a9db90aa9cfca76251dd549abed4786..18747e9fef66745c4e2ccdf26ff3f16e99979811 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.12 $
+--  $Revision: 1.15 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Sample.Menu_Demo.Aux;
@@ -75,7 +76,7 @@ package body Sample.Menu_Demo.Handler is
       loop
          declare
             K : Key_Code := Aux.Get_Request (M, Pan);
-            R : Driver_Result := Driver (M, K);
+            R : constant Driver_Result := Driver (M, K);
          begin
             case R is
                when Menu_Ok => null;
index a0ebf6952e144fbb99787f976272485917c02133..261658f90057afa61c6990a6d46dbfa92ccbf74a 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.13 $
+--  $Revision: 1.17 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -105,6 +106,12 @@ package body Sample.Menu_Demo is
                              P : Panel) return Boolean
          is
          begin
+            if M = Null_Menu then
+               raise Menu_Exception;
+            end if;
+            if P = Null_Panel then
+               raise Panel_Exception;
+            end if;
             To_Change := No_Change;
             if K in User_Key_Code'Range then
                if K = QUIT then
@@ -331,9 +338,9 @@ package body Sample.Menu_Demo is
          Null_Item);
       M : Menu := New_Menu (Itm);
 
-      U1 : User_Data_Access := new User_Data'(4711);
+      U1 : constant User_Data_Access := new User_Data'(4711);
       U2 : User_Data_Access;
-      U3 : User_Data_Access := new User_Data'(4712);
+      U3 : constant User_Data_Access := new User_Data'(4712);
       U4 : User_Data_Access;
 
       function My_Driver (M : Menu;
index cd289b91cbd6dd67d21956a67a889d5c6ade981a..0dacfc3a5681fbd23724ed821a211378fddb39a1 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.9 $
+--  $Revision: 1.13 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
@@ -45,11 +46,14 @@ with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
 --
 package body Sample.My_Field_Type is
 
-   --  That's simple. There are no field validity checks.
+   --  That's simple. There are minimal field validity checks.
    function Field_Check (Fld : Field;
                          Typ : My_Data) return Boolean
    is
    begin
+      if Fld = Null_Field or Typ.Ch = Character'Val (0) then
+         return False;
+      end if;
       return True;
    end Field_Check;
 
index 43b24232becab26c1db776637bfef1a7cb7a7fb9..b2448c1a9f97890c6ecee7286896cb2a59d4d2a1 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.11 $
+--  $Revision: 1.14 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Numerics.Generic_Elementary_Functions;
@@ -109,9 +110,9 @@ package body Sample.Text_IO_Demo is
       W : Window;
       P : Panel := Create (Standard_Window);
       K : Real_Key_Code;
-      Im : Complex := (0.0, 1.0);
-      Fx : Fix := 3.14;
-      Dc : Dec := 2.72;
+      Im : constant Complex := (0.0, 1.0);
+      Fx : constant Fix := 3.14;
+      Dc : constant Dec := 2.72;
       L : Md;
 
    begin
index 01823144f9dee7dd62e465d58db8242e9ac3c35c..634e7459ad59ea2411faba3a82185ea3525b735b 100644 (file)
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998 Free Software Foundation, Inc.                          #
+# Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -28,8 +28,7 @@
 #
 #  Author:  Juergen Pfeifer, 1996
 #
-#  Version Control
-#  $Revision: 1.28 $
+#  $Id: Makefile.in,v 1.30 2004/08/21 21:29:50 tom Exp $
 #
 .SUFFIXES:
 
@@ -175,17 +174,17 @@ dotouch :
        @sh -c 'for f in $(LIBALIS) $(GENALIS); do test -f $$f || touch $$f; done'
 
 sources :
-       @
+       @echo made $@
 
 libs \
 install \
 install.libs \
 uninstall \
 uninstall.libs ::
-       @
+       @echo made $@
 
 generics: $(GENALIS)
-       @
+       @echo made $@
 
 mostlyclean ::
        rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a
@@ -232,7 +231,7 @@ $(ABASE)-putwin.o: \
 
 $(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p
        rm -f $@
-       $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ $(srcdir)/$(ABASE)-trace.adb_p $@
+       $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ -DPRAGMA_UNREF=@PRAGMA_UNREF@ $(srcdir)/$(ABASE)-trace.adb_p $@
 
 $(ABASE)-trace.o: \
                $(ABASE)-trace.ads \
index 84f276af83ee677d9edc4308ef4f199934c1c4b4..b3eaf447ad88023b1dba4364d8dd1c0bea77aee5 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.7 $
+--  $Revision: 1.10 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Characters.Handling; use Ada.Characters.Handling;
@@ -54,7 +55,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is
       I.Match_Must_Be_Unique := Must_Be_Unique;
 
       for E in T'Range loop
-         I.Names (J) := new String'(T'Image (T (E)));
+         I.Names (J) := new String'(T'Image (E));
          --  The Image attribute defaults to upper case, so we have to handle
          --  only the other ones...
          if Set /= Upper_Case then
index d9ed454b0a65129fff5111b31960c67b1f709f6a..8d2f6c4cd67a69037c25b7d8f802393c0e7e7a23 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.13 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Unchecked_Conversion;
@@ -53,7 +54,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
                           Usr : System.Address) return C_Int
    is
       Result : Boolean;
-      Udf    : User_Defined_Field_Type_With_Choice_Access :=
+      Udf    : constant User_Defined_Field_Type_With_Choice_Access :=
         User_Defined_Field_Type_With_Choice_Access
         (To_Argument_Access (Usr).Typ);
    begin
@@ -65,7 +66,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
                           Usr : System.Address) return C_Int
    is
       Result : Boolean;
-      Udf    : User_Defined_Field_Type_With_Choice_Access :=
+      Udf    : constant User_Defined_Field_Type_With_Choice_Access :=
         User_Defined_Field_Type_With_Choice_Access
         (To_Argument_Access (Usr).Typ);
    begin
index 6e348b93dd2b34e1ae3c03bb98b10d57283ccfe5..18320ef19d3beaa401c6a3bca812bf7a1d5855bf 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.13 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Unchecked_Conversion;
@@ -63,7 +64,8 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User is
       function Allocate_Arg (T : User_Defined_Field_Type'Class)
                              return Argument_Access
       is
-         Ptr : Field_Type_Access := new User_Defined_Field_Type'Class'(T);
+         Ptr : constant Field_Type_Access
+             := new User_Defined_Field_Type'Class'(T);
       begin
          return new Argument'(Usr => System.Null_Address,
                               Typ => Ptr,
@@ -84,7 +86,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User is
                                  Usr : System.Address) return C_Int
    is
       Result : Boolean;
-      Udf    : User_Defined_Field_Type_Access :=
+      Udf    : constant User_Defined_Field_Type_Access :=
         User_Defined_Field_Type_Access (To_Argument_Access (Usr).Typ);
    begin
       Result := Field_Check (Fld, Udf.all);
@@ -95,7 +97,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User is
                                 Usr : System.Address) return C_Int
    is
       Result : Boolean;
-      Udf    : User_Defined_Field_Type_Access :=
+      Udf    : constant User_Defined_Field_Type_Access :=
         User_Defined_Field_Type_Access (To_Argument_Access (Usr).Typ);
    begin
       Result := Character_Check (Character'Val (Ch), Udf.all);
index e003058b0ede8aa6fb5250fa24cc2205a1f48249..47efa4c249f43f9c8e46cf7cbe120b444777fc06 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.14 $
+--  $Revision: 1.17 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Interfaces.C;
@@ -144,7 +145,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
                            Typ : Field_Type'Class;
                            Cft : C_Field_Type := C_Builtin_Router)
    is
-      Usr_Arg   : System.Address := Get_Arg (Fld);
+      Usr_Arg   : constant System.Address := Get_Arg (Fld);
       Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
       Arg : Argument_Access;
       Res : Eti_Error;
index b50b031ba5f85fe27b2cc28eeec768f13cba6d8d..e3c053c61e102cade946d040d44954970613bb27 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.22 $
+--  $Revision: 1.25 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Unchecked_Deallocation;
@@ -330,7 +331,7 @@ package body Terminal_Interface.Curses.Forms is
                                Opt : C_Int) return C_Int;
       pragma Import (C, Set_Field_Opts, "set_field_opts");
 
-      Opt : C_Int := FOS_2_CInt (Options);
+      Opt : constant C_Int := FOS_2_CInt (Options);
       Res : Eti_Error;
    begin
       Res := Set_Field_Opts (Fld, Opt);
@@ -353,7 +354,7 @@ package body Terminal_Interface.Curses.Forms is
       pragma Import (C, Field_Opts_Off, "field_opts_off");
 
       Err : Eti_Error;
-      Opt : C_Int := FOS_2_CInt (Options);
+      Opt : constant C_Int := FOS_2_CInt (Options);
    begin
       if On then
          Err := Field_Opts_On (Fld, Opt);
@@ -373,7 +374,7 @@ package body Terminal_Interface.Curses.Forms is
       function Field_Opts (Fld : Field) return C_Int;
       pragma Import (C, Field_Opts, "field_opts");
 
-      Res : C_Int := Field_Opts (Fld);
+      Res : constant C_Int := Field_Opts (Fld);
    begin
       Options := CInt_2_FOS (Res);
    end Get_Options;
@@ -845,7 +846,7 @@ package body Terminal_Interface.Curses.Forms is
                               Opt : C_Int) return C_Int;
       pragma Import (C, Set_Form_Opts, "set_form_opts");
 
-      Opt : C_Int := FrmOS_2_CInt (Options);
+      Opt : constant C_Int := FrmOS_2_CInt (Options);
       Res : Eti_Error;
    begin
       Res := Set_Form_Opts (Frm, Opt);
@@ -868,7 +869,7 @@ package body Terminal_Interface.Curses.Forms is
       pragma Import (C, Form_Opts_Off, "form_opts_off");
 
       Err : Eti_Error;
-      Opt : C_Int := FrmOS_2_CInt (Options);
+      Opt : constant C_Int := FrmOS_2_CInt (Options);
    begin
       if On then
          Err := Form_Opts_On (Frm, Opt);
@@ -888,7 +889,7 @@ package body Terminal_Interface.Curses.Forms is
       function Form_Opts (Frm : Form) return C_Int;
       pragma Import (C, Form_Opts, "form_opts");
 
-      Res : C_Int := Form_Opts (Frm);
+      Res : constant C_Int := Form_Opts (Frm);
    begin
       Options := CInt_2_FrmOS (Res);
    end Get_Options;
@@ -995,7 +996,7 @@ package body Terminal_Interface.Curses.Forms is
       function Frm_Driver (Frm : Form; Key : C_Int) return C_Int;
       pragma Import (C, Frm_Driver, "form_driver");
 
-      R : Eti_Error := Frm_Driver (Frm, C_Int (Key));
+      R : constant Eti_Error := Frm_Driver (Frm, C_Int (Key));
    begin
       if R /= E_Ok then
          if R = E_Unknown_Command then
@@ -1135,7 +1136,7 @@ package body Terminal_Interface.Curses.Forms is
    begin
       if FA /= null and then Free_Fields then
          for I in FA'First .. (FA'Last - 1) loop
-            if (FA (I) /= Null_Field) then
+            if FA (I) /= Null_Field then
                Delete (FA (I));
             end if;
          end loop;
index 3dac213dd8f318deb2ab9ee1333a91840b6c495c..4f218ffbbdbdbe63e02815c580f886db422b6961 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.22 $
+--  $Revision: 1.25 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Unchecked_Deallocation;
@@ -105,8 +106,8 @@ package body Terminal_Interface.Curses.Menus is
       type Desc_String_Ptr is access Desc_String;
       pragma Controlled (Desc_String_Ptr);
 
-      Name_Str : Name_String_Ptr := new Name_String;
-      Desc_Str : Desc_String_Ptr := new Desc_String;
+      Name_Str : constant Name_String_Ptr := new Name_String;
+      Desc_Str : constant Desc_String_Ptr := new Desc_String;
       Name_Len, Desc_Len : size_t;
       Result : Item;
    begin
@@ -194,7 +195,7 @@ package body Terminal_Interface.Curses.Menus is
                               Opt : C_Int) return C_Int;
       pragma Import (C, Set_Item_Opts, "set_item_opts");
 
-      Opt : C_Int := IOS_2_CInt (Options);
+      Opt : constant C_Int := IOS_2_CInt (Options);
       Res : Eti_Error;
    begin
       Res := Set_Item_Opts (Itm, Opt);
@@ -214,7 +215,7 @@ package body Terminal_Interface.Curses.Menus is
                               Opt : C_Int) return C_Int;
       pragma Import (C, Item_Opts_Off, "item_opts_off");
 
-      Opt : C_Int := IOS_2_CInt (Options);
+      Opt : constant C_Int := IOS_2_CInt (Options);
       Err : Eti_Error;
    begin
       if On then
@@ -233,7 +234,7 @@ package body Terminal_Interface.Curses.Menus is
       function Item_Opts (Itm : Item) return C_Int;
       pragma Import (C, Item_Opts, "item_opts");
 
-      Res : C_Int := Item_Opts (Itm);
+      Res : constant C_Int := Item_Opts (Itm);
    begin
       Options := CInt_2_IOS (Res);
    end Get_Options;
@@ -374,7 +375,7 @@ package body Terminal_Interface.Curses.Menus is
                               Opt : C_Int) return C_Int;
       pragma Import (C, Set_Menu_Opts, "set_menu_opts");
 
-      Opt : C_Int := MOS_2_CInt (Options);
+      Opt : constant C_Int := MOS_2_CInt (Options);
       Res : Eti_Error;
    begin
       Res := Set_Menu_Opts (Men, Opt);
@@ -394,7 +395,7 @@ package body Terminal_Interface.Curses.Menus is
                               Opt : C_Int) return C_Int;
       pragma Import (C, Menu_Opts_Off, "menu_opts_off");
 
-      Opt : C_Int := MOS_2_CInt (Options);
+      Opt : constant C_Int := MOS_2_CInt (Options);
       Err : Eti_Error;
    begin
       if On then
@@ -413,7 +414,7 @@ package body Terminal_Interface.Curses.Menus is
       function Menu_Opts (Men : Menu) return C_Int;
       pragma Import (C, Menu_Opts, "menu_opts");
 
-      Res : C_Int := Menu_Opts (Men);
+      Res : constant C_Int := Menu_Opts (Men);
    begin
       Options := CInt_2_MOS (Res);
    end Get_Options;
@@ -973,7 +974,7 @@ package body Terminal_Interface.Curses.Menus is
                        Key : C_Int) return C_Int;
       pragma Import (C, Driver, "menu_driver");
 
-      R : Eti_Error := Driver (Men, C_Int (Key));
+      R : constant Eti_Error := Driver (Men, C_Int (Key));
    begin
       if R /= E_Ok then
          case R is
@@ -996,7 +997,7 @@ package body Terminal_Interface.Curses.Menus is
    begin
       if IA /= null and then Free_Items then
          for I in IA'First .. (IA'Last - 1) loop
-            if (IA (I) /= Null_Item) then
+            if IA (I) /= Null_Item then
                Delete (IA (I));
             end if;
          end loop;
index 52ac522ebfa56501ae93ac47113aecbfa73db409..10bcbf9a91f08e18ad2f6a36edd79cba6b91163a 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.18 $
+--  $Revision: 1.21 $
+--  $Date: 2004/08/21 21:37:00 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with System;
@@ -116,13 +117,18 @@ package body Terminal_Interface.Curses.Mouse is
       Old : aliased Event_Mask;
    begin
       R := MMask (Mask, Old'Access);
+      if R = No_Events then
+         Beep;
+      end if;
       return Old;
    end Start_Mouse;
 
    procedure End_Mouse (Mask : in Event_Mask := No_Events)
    is
    begin
-      null;
+      if Mask /= No_Events then
+         Beep;
+      end if;
    end End_Mouse;
 
    procedure Dispatch_Event (Mask   : in  Event_Mask;
diff --git