diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-01-18 19:10:28 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-01-18 19:10:28 +0000 |
commit | 2ab6a45cb794e8f5ff7b3d8c9fe25b0ef0f5b669 (patch) | |
tree | 68bbd31bb6b70c640ee51637367f12996de516f7 /lib | |
parent | 369038865daffb176f8616ac082675a6e8116a0f (diff) |
ncurses-4.2-990116
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcurses/Caps | 25 | ||||
-rw-r--r-- | lib/libcurses/MKkeys.awk | 1 | ||||
-rw-r--r-- | lib/libcurses/Makefile | 113 | ||||
-rw-r--r-- | lib/libcurses/README | 19 | ||||
-rw-r--r-- | lib/libcurses/base/MKkeyname.awk (renamed from lib/libcurses/MKkeyname.awk) | 8 | ||||
-rw-r--r-- | lib/libcurses/base/MKlib_gen.sh (renamed from lib/libcurses/MKlib_gen.sh) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/MKunctrl.awk (renamed from lib/libcurses/MKunctrl.awk) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/define_key.c (renamed from lib/libcurses/define_key.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/keyok.c (renamed from lib/libcurses/keyok.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_adabind.c (renamed from lib/libcurses/lib_adabind.c) | 38 | ||||
-rw-r--r-- | lib/libcurses/base/lib_addch.c (renamed from lib/libcurses/lib_addch.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_addstr.c (renamed from lib/libcurses/lib_addstr.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_beep.c (renamed from lib/libcurses/lib_beep.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_bkgd.c (renamed from lib/libcurses/lib_bkgd.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_box.c (renamed from lib/libcurses/lib_box.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_chgat.c (renamed from lib/libcurses/lib_chgat.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_clear.c (renamed from lib/libcurses/lib_clear.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_clearok.c (renamed from lib/libcurses/lib_clearok.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_clrbot.c (renamed from lib/libcurses/lib_clrbot.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_clreol.c (renamed from lib/libcurses/lib_clreol.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_color.c (renamed from lib/libcurses/lib_color.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_colorset.c (renamed from lib/libcurses/lib_colorset.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_delch.c (renamed from lib/libcurses/lib_delch.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_delwin.c (renamed from lib/libcurses/lib_delwin.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_dft_fgbg.c (renamed from lib/libcurses/lib_dft_fgbg.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_echo.c (renamed from lib/libcurses/lib_echo.c) | 5 | ||||
-rw-r--r-- | lib/libcurses/base/lib_endwin.c (renamed from lib/libcurses/lib_endwin.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_erase.c (renamed from lib/libcurses/lib_erase.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_flash.c (renamed from lib/libcurses/lib_flash.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_freeall.c (renamed from lib/libcurses/lib_freeall.c) | 7 | ||||
-rw-r--r-- | lib/libcurses/base/lib_getch.c (renamed from lib/libcurses/lib_getch.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_getstr.c (renamed from lib/libcurses/lib_getstr.c) | 8 | ||||
-rw-r--r-- | lib/libcurses/base/lib_hline.c (renamed from lib/libcurses/lib_hline.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_immedok.c (renamed from lib/libcurses/lib_immedok.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_inchstr.c (renamed from lib/libcurses/lib_inchstr.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_initscr.c (renamed from lib/libcurses/lib_initscr.c) | 18 | ||||
-rw-r--r-- | lib/libcurses/base/lib_insch.c (renamed from lib/libcurses/lib_insch.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_insdel.c (renamed from lib/libcurses/lib_insdel.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_insstr.c (renamed from lib/libcurses/lib_insstr.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_instr.c (renamed from lib/libcurses/lib_instr.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_isendwin.c (renamed from lib/libcurses/lib_isendwin.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_leaveok.c (renamed from lib/libcurses/lib_leaveok.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_mouse.c (renamed from lib/libcurses/lib_mouse.c) | 85 | ||||
-rw-r--r-- | lib/libcurses/base/lib_move.c (renamed from lib/libcurses/lib_move.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_mvwin.c (renamed from lib/libcurses/lib_mvwin.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_newterm.c (renamed from lib/libcurses/lib_newterm.c) | 14 | ||||
-rw-r--r-- | lib/libcurses/base/lib_newwin.c (renamed from lib/libcurses/lib_newwin.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_nl.c (renamed from lib/libcurses/lib_nl.c) | 5 | ||||
-rw-r--r-- | lib/libcurses/base/lib_overlay.c (renamed from lib/libcurses/lib_overlay.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_pad.c (renamed from lib/libcurses/lib_pad.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_printw.c (renamed from lib/libcurses/lib_printw.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_redrawln.c (renamed from lib/libcurses/lib_redrawln.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_refresh.c (renamed from lib/libcurses/lib_refresh.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_restart.c (renamed from lib/libcurses/lib_restart.c) | 57 | ||||
-rw-r--r-- | lib/libcurses/base/lib_scanw.c (renamed from lib/libcurses/lib_scanw.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_screen.c (renamed from lib/libcurses/lib_screen.c) | 6 | ||||
-rw-r--r-- | lib/libcurses/base/lib_scroll.c (renamed from lib/libcurses/lib_scroll.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_scrollok.c (renamed from lib/libcurses/lib_scrollok.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_scrreg.c (renamed from lib/libcurses/lib_scrreg.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_set_term.c (renamed from lib/libcurses/lib_set_term.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slk.c (renamed from lib/libcurses/lib_slk.c) | 9 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slkatr_set.c (renamed from lib/libcurses/lib_slkatr_set.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slkatrof.c (renamed from lib/libcurses/lib_slkatrof.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slkatron.c (renamed from lib/libcurses/lib_slkatron.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slkatrset.c (renamed from lib/libcurses/lib_slkatrset.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slkattr.c (renamed from lib/libcurses/lib_slkattr.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slkclear.c (renamed from lib/libcurses/lib_slkclear.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slkcolor.c (renamed from lib/libcurses/lib_slkcolor.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slkinit.c (renamed from lib/libcurses/lib_slkinit.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slklab.c (renamed from lib/libcurses/lib_slklab.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slkrefr.c (renamed from lib/libcurses/lib_slkrefr.c) | 8 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slkset.c (renamed from lib/libcurses/lib_slkset.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_slktouch.c (renamed from lib/libcurses/lib_slktouch.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_touch.c (renamed from lib/libcurses/lib_touch.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_ungetch.c (renamed from lib/libcurses/lib_ungetch.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_vline.c (renamed from lib/libcurses/lib_vline.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_wattroff.c (renamed from lib/libcurses/lib_wattroff.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_wattron.c (renamed from lib/libcurses/lib_wattron.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_winch.c (renamed from lib/libcurses/lib_winch.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/lib_window.c (renamed from lib/libcurses/lib_window.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/nc_panel.c (renamed from lib/libcurses/nc_panel.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/resizeterm.c (renamed from lib/libcurses/resizeterm.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/safe_sprintf.c (renamed from lib/libcurses/safe_sprintf.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/sigaction.c (renamed from lib/libcurses/sigaction.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/tries.c (renamed from lib/libcurses/tries.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/base/wresize.c (renamed from lib/libcurses/wresize.c) | 5 | ||||
-rw-r--r-- | lib/libcurses/curs_addch.3tbl | 4 | ||||
-rw-r--r-- | lib/libcurses/curs_attr.3tbl | 30 | ||||
-rw-r--r-- | lib/libcurses/curs_border.3 | 14 | ||||
-rw-r--r-- | lib/libcurses/curs_getch.3tbl | 4 | ||||
-rw-r--r-- | lib/libcurses/curs_inch.3tbl | 4 | ||||
-rw-r--r-- | lib/libcurses/curs_mouse.3tbl | 62 | ||||
-rw-r--r-- | lib/libcurses/curs_outopts.3 | 6 | ||||
-rw-r--r-- | lib/libcurses/curs_overlay.3 | 10 | ||||
-rw-r--r-- | lib/libcurses/curs_pad.3 | 16 | ||||
-rw-r--r-- | lib/libcurses/curs_printw.3 | 6 | ||||
-rw-r--r-- | lib/libcurses/curs_scanw.3 | 8 | ||||
-rw-r--r-- | lib/libcurses/curs_window.3 | 12 | ||||
-rw-r--r-- | lib/libcurses/curses.3tbl | 467 | ||||
-rw-r--r-- | lib/libcurses/curses.h | 41 | ||||
-rw-r--r-- | lib/libcurses/curses.priv.h | 10 | ||||
-rw-r--r-- | lib/libcurses/hashsize.h | 6 | ||||
-rw-r--r-- | lib/libcurses/ncurses_cfg.h | 5 | ||||
-rw-r--r-- | lib/libcurses/parametrized.h | 6 | ||||
-rw-r--r-- | lib/libcurses/screensize.c | 54 | ||||
-rw-r--r-- | lib/libcurses/shlib_version | 2 | ||||
-rw-r--r-- | lib/libcurses/softscroll.c | 259 | ||||
-rw-r--r-- | lib/libcurses/term.5tbl | 212 | ||||
-rw-r--r-- | lib/libcurses/term.7 | 205 | ||||
-rw-r--r-- | lib/libcurses/term.h | 89 | ||||
-rw-r--r-- | lib/libcurses/term_entry.h | 12 | ||||
-rw-r--r-- | lib/libcurses/termcap.h | 21 | ||||
-rw-r--r-- | lib/libcurses/terminfo.5tbl | 1543 | ||||
-rw-r--r-- | lib/libcurses/tinfo/MKcaptab.awk (renamed from lib/libcurses/MKcaptab.awk) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/MKfallback.sh (renamed from lib/libcurses/MKfallback.sh) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/MKnames.awk (renamed from lib/libcurses/MKnames.awk) | 6 | ||||
-rw-r--r-- | lib/libcurses/tinfo/access.c (renamed from lib/libcurses/access.c) | 0 | ||||
-rw-r--r-- | lib/libcurses/tinfo/add_tries.c (renamed from lib/libcurses/add_tries.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/alloc_entry.c (renamed from lib/libcurses/alloc_entry.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/captoinfo.c (renamed from lib/libcurses/captoinfo.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/comp_error.c (renamed from lib/libcurses/comp_error.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/comp_expand.c (renamed from lib/libcurses/comp_expand.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/comp_hash.c (renamed from lib/libcurses/comp_hash.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/comp_parse.c (renamed from lib/libcurses/comp_parse.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/comp_scan.c (renamed from lib/libcurses/comp_scan.c) | 0 | ||||
-rw-r--r-- | lib/libcurses/tinfo/doalloc.c (renamed from lib/libcurses/doalloc.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/getenv_num.c (renamed from lib/libcurses/getenv_num.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/home_terminfo.c (renamed from lib/libcurses/home_terminfo.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/keys.list (renamed from lib/libcurses/keys.list) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_acs.c (renamed from lib/libcurses/lib_acs.c) | 9 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_baudrate.c (renamed from lib/libcurses/lib_baudrate.c) | 62 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_cur_term.c (renamed from lib/libcurses/lib_cur_term.c) | 26 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_data.c (renamed from lib/libcurses/lib_data.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_has_cap.c | 65 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_kernel.c (renamed from lib/libcurses/lib_kernel.c) | 62 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_longname.c (renamed from lib/libcurses/lib_longname.c) | 10 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_napms.c (renamed from lib/libcurses/lib_napms.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_options.c (renamed from lib/libcurses/lib_options.c) | 19 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_print.c (renamed from lib/libcurses/lib_print.c) | 6 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_raw.c (renamed from lib/libcurses/lib_raw.c) | 18 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_setup.c (renamed from lib/libcurses/lib_setup.c) | 8 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_termcap.c (renamed from lib/libcurses/lib_termcap.c) | 136 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_termname.c | 48 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_ti.c (renamed from lib/libcurses/lib_ti.c) | 22 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_tparm.c (renamed from lib/libcurses/lib_tparm.c) | 22 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_tputs.c (renamed from lib/libcurses/lib_tputs.c) | 59 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_ttyflags.c | 163 | ||||
-rw-r--r-- | lib/libcurses/tinfo/make_keys.c (renamed from lib/libcurses/make_keys.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/name_match.c (renamed from lib/libcurses/name_match.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/parse_entry.c (renamed from lib/libcurses/parse_entry.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/read_bsd_terminfo.c (renamed from lib/libcurses/read_bsd_terminfo.c) | 4 | ||||
-rw-r--r-- | lib/libcurses/tinfo/read_entry.c (renamed from lib/libcurses/read_entry.c) | 32 | ||||
-rw-r--r-- | lib/libcurses/tinfo/read_termcap.c (renamed from lib/libcurses/read_termcap.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tinfo/setbuf.c (renamed from lib/libcurses/setbuf.c) | 7 | ||||
-rw-r--r-- | lib/libcurses/tinfo/write_entry.c (renamed from lib/libcurses/write_entry.c) | 9 | ||||
-rw-r--r-- | lib/libcurses/trace/lib_trace.c (renamed from lib/libcurses/lib_trace.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/trace/lib_traceatr.c (renamed from lib/libcurses/lib_traceatr.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/trace/lib_tracebits.c (renamed from lib/libcurses/lib_tracebits.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/trace/lib_tracechr.c (renamed from lib/libcurses/lib_tracechr.c) | 0 | ||||
-rw-r--r-- | lib/libcurses/trace/lib_tracedmp.c (renamed from lib/libcurses/lib_tracedmp.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/trace/lib_tracemse.c (renamed from lib/libcurses/lib_tracemse.c) | 17 | ||||
-rw-r--r-- | lib/libcurses/trace/trace_buf.c (renamed from lib/libcurses/trace_buf.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tty/MKexpanded.sh (renamed from lib/libcurses/MKexpanded.sh) | 10 | ||||
-rw-r--r-- | lib/libcurses/tty/hardscroll.c (renamed from lib/libcurses/hardscroll.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tty/hashmap.c (renamed from lib/libcurses/hashmap.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tty/lib_mvcur.c (renamed from lib/libcurses/lib_mvcur.c) | 18 | ||||
-rw-r--r-- | lib/libcurses/tty/lib_tstp.c (renamed from lib/libcurses/lib_tstp.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tty/lib_twait.c (renamed from lib/libcurses/lib_twait.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tty/lib_vidattr.c (renamed from lib/libcurses/lib_vidattr.c) | 2 | ||||
-rw-r--r-- | lib/libcurses/tty/tty_display.h | 148 | ||||
-rw-r--r-- | lib/libcurses/tty/tty_input.h | 63 | ||||
-rw-r--r-- | lib/libcurses/tty/tty_update.c (renamed from lib/libcurses/lib_doupdate.c) | 4 |
172 files changed, 2793 insertions, 1993 deletions
diff --git a/lib/libcurses/Caps b/lib/libcurses/Caps index f50372e987f..47ad3c1ebf2 100644 --- a/lib/libcurses/Caps +++ b/lib/libcurses/Caps @@ -29,8 +29,8 @@ # Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 # and: Eric S. Raymond <esr@snark.thyrsus.com> # -# $OpenBSD: Caps,v 1.1 1998/07/23 21:17:19 millert Exp $ -# $From: Caps,v 1.21 1998/06/30 01:07:56 tom Exp $ +# $OpenBSD: Caps,v 1.2 1999/01/18 19:06:44 millert Exp $ +# $From: Caps,v 1.24 1999/01/17 02:01:44 tom Exp $ # # This is the master termcap/terminfo capability table. # @@ -216,7 +216,7 @@ eat_newline_glitch xenl bool xn YBCGE newline ignored after 80 cols (concept) erase_overstrike eo bool eo YBCG- can erase overstrikes with a blank generic_type gn bool gn YB-G- generic line type hard_copy hc bool hc YBCG- hardcopy terminal -has_meta_key km bool km YB-GE Has a meta key, sets msb high +has_meta_key km bool km YB-GE Has a meta key (shift, sets parity bit) has_status_line hs bool hs YB-G- has extra status line insert_null_glitch in bool in YBCGE insert mode distinguishes nulls memory_above da bool da YBCG- display may be retained above the screen @@ -237,7 +237,7 @@ no_pad_char npc bool NP ----- pad character does not exist non_dest_scroll_region ndscr bool ND ----- scrolling region is non-destructive can_change ccc bool cc ----- terminal can re-define existing colors back_color_erase bce bool ut ----- screen erased with background color -hue_lightness_saturation hls bool hl ----- terminal uses only HLS color notation (tektronix) +hue_lightness_saturation hls bool hl ----- terminal uses only HLS color notation (Tektronix) col_addr_glitch xhpa bool YA ----- only positive motion for hpa/mhpa caps cr_cancels_micro_mode crxm bool YB ----- using cr turns off micro mode has_print_wheel daisy bool YC ----- printer needs operator to change character set @@ -261,11 +261,11 @@ lpi_changes_res lpix bool YG ----- changing line pitch changes resolution columns cols num co YBCGE number of columns in a line init_tabs it num it YB-G- tabs initially every # spaces lines lines num li YBCGE number of lines on screen or page -lines_of_memory lm num lm YB-G- lines of memory if > line. 0 => varies +lines_of_memory lm num lm YB-G- lines of memory if > line. 0 means varies magic_cookie_glitch xmc num sg YBCGE number of blank characters left by smso or rmso padding_baud_rate pb num pb YB-GE lowest baud rate where padding needed virtual_terminal vt num vt YB--- virtual terminal number (CB/unix) -width_status_line wsl num ws YB-G- columns in status line +width_status_line wsl num ws YB-G- number of columns in status line num_labels nlab num Nl ----- number of labels on screen label_height lh num lh ----- rows in each label label_width lw num lw ----- columns in each label @@ -295,8 +295,8 @@ dot_vert_spacing spinv num Yb ----- spacing of pins vertically in pins per inch dot_horz_spacing spinh num Yc ----- spacing of dots horizontally in dots per inch max_micro_address maddr num Yd ----- maximum value in micro_..._address max_micro_jump mjump num Ye ----- maximum value in parm_..._micro -micro_char_size mcs num Yf ----- character size when in micro mode -micro_line_size mls num Yg ----- line size when in micro mode +micro_col_size mcs num Yf ----- character step size when in micro mode +micro_line_size mls num Yg ----- line step size when in micro mode number_of_pins npins num Yh ----- numbers of pins in print-head output_res_char orc num Yi ----- horizontal resolution in units per line output_res_line orl num Yj ----- vertical resolution in units per line @@ -337,7 +337,7 @@ cursor_invisible civis str vi YB-G- make cursor invisible cursor_left cub1 str le YBCGE move left one space cursor_mem_address mrcup str CM YB-G- memory relative cursor addressing cursor_normal cnorm str ve YBCGE make cursor appear normal (undo civis/cvvis) -cursor_right cuf1 str nd YBCGE move right one space +cursor_right cuf1 str nd YBCGE non-destructive space (move right one space) cursor_to_ll ll str ll YBCGE last line, first column (if no cup) cursor_up cuu1 str up YBCGE up one line cursor_visible cvvis str vs YBCGE make cursor very visible @@ -737,9 +737,8 @@ alt_scancode_esc scesa str S8 ----- Alternate escape for scancode emulation #%.ad #% #%.in .8i -#%The XSI Curses standard added these. They are probably in some post-4.1 -#%version of System V curses as well, but because XSI Curses lists them in -#%strict alphabetical order we don't know if this is the right binary order. +#%The XSI Curses standard added these. They are some post-4.1 +#%versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x. #%The \fBncurses\fR termcap names for them are invented; according to the #%XSI Curses standard, they have no termcap names. If your compiled terminfo #%entries use these, they may not be binary-compatible with System V terminfo @@ -759,6 +758,8 @@ enter_low_hl_mode elohlm str Xo ----- Enter low highlight mode enter_right_hl_mode erhlm str Xr ----- Enter right highlight mode enter_top_hl_mode ethlm str Xt ----- Enter top highlight mode enter_vertical_hl_mode evhlm str Xv ----- Enter vertical highlight mode +set_a_attributes sgr1 str sA ----- Define second set of video attributes #1-#6 +set_pglen_inch slength str sL ----- YI Set page length to #1 hundredth of an inch #%.TE #%.ad # diff --git a/lib/libcurses/MKkeys.awk b/lib/libcurses/MKkeys.awk deleted file mode 100644 index 3618300ad1a..00000000000 --- a/lib/libcurses/MKkeys.awk +++ /dev/null @@ -1 +0,0 @@ -/^[^#]/ { if ($1 != "" && $2 != "" ) { printf "\tadd_to_try(%s, %s);\n", $2, $1;} } diff --git a/lib/libcurses/Makefile b/lib/libcurses/Makefile index 2c6f36c1baf..efbcc140aca 100644 --- a/lib/libcurses/Makefile +++ b/lib/libcurses/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.33 1998/11/30 15:49:15 millert Exp $ +# $OpenBSD: Makefile,v 1.34 1999/01/18 19:06:57 millert Exp $ # Uncomment this to enable tracing in libcurses #CURSESTRACE=-DTRACE @@ -9,36 +9,47 @@ FALLBACK_LIST= # XXX - should be defined elsewhere AWK?= /usr/bin/awk +# Search in subdirs +.PATH: ${.CURDIR}/base ${.CURDIR}/tinfo ${.CURDIR}/trace ${.CURDIR}/tty + LIB= curses -SRCS= access.c add_tries.c alloc_entry.c captoinfo.c codes.c comp_captab.c \ - comp_error.c comp_expand.c comp_hash.c comp_parse.c comp_scan.c \ - define_key.c doalloc.c expanded.c fallback.c getenv_num.c hardscroll.c \ - hashmap.c home_terminfo.c keyok.c lib_acs.c lib_adabind.c lib_addch.c \ - lib_addstr.c lib_baudrate.c lib_beep.c lib_bkgd.c lib_box.c \ - lib_chgat.c lib_clear.c lib_clearok.c lib_clrbot.c lib_clreol.c \ - lib_color.c lib_colorset.c lib_cur_term.c lib_data.c lib_delch.c \ - lib_delwin.c lib_dft_fgbg.c lib_doupdate.c lib_echo.c \ - lib_endwin.c lib_erase.c lib_flash.c lib_freeall.c lib_gen.c \ - lib_getch.c lib_getstr.c lib_hline.c lib_immedok.c lib_inchstr.c \ - lib_initscr.c lib_insch.c lib_insdel.c lib_insstr.c lib_instr.c \ - lib_isendwin.c lib_kernel.c lib_keyname.c lib_leaveok.c \ - lib_longname.c lib_mouse.c lib_move.c lib_mvcur.c lib_mvwin.c \ - lib_napms.c lib_newterm.c lib_newwin.c lib_nl.c lib_options.c \ - lib_overlay.c lib_pad.c lib_print.c lib_printw.c lib_raw.c \ - lib_redrawln.c lib_refresh.c lib_restart.c lib_scanw.c \ - lib_screen.c lib_scroll.c lib_scrollok.c lib_scrreg.c \ - lib_set_term.c lib_setup.c lib_slk.c lib_slkatr_set.c \ - lib_slkatrof.c lib_slkatron.c lib_slkatrset.c lib_slkattr.c \ - lib_slkclear.c lib_slkcolor.c lib_slkinit.c lib_slklab.c \ - lib_slkrefr.c lib_slkset.c lib_slktouch.c lib_termcap.c \ - lib_ti.c lib_touch.c lib_tparm.c lib_tputs.c lib_trace.c \ - lib_traceatr.c lib_tracebits.c lib_tracechr.c lib_tracedmp.c \ - lib_tracemse.c lib_tstp.c lib_twait.c lib_ungetch.c lib_vidattr.c \ - lib_vline.c lib_wattroff.c lib_wattron.c lib_winch.c lib_window.c \ - name_match.c names.c nc_panel.c parse_entry.c read_bsd_terminfo.c \ - read_entry.c read_termcap.c resizeterm.c safe_sprintf.c setbuf.c \ - sigaction.c softscroll.c trace_buf.c tries.c unctrl.c wresize.c \ - write_entry.c +SRCS= codes.c comp_captab.c expanded.c fallback.c lib_gen.c lib_keyname.c \ + names.c unctrl.c +# base +SRCS+= define_key.c keyok.c lib_adabind.c lib_addch.c lib_addstr.c \ + lib_beep.c lib_bkgd.c lib_box.c lib_chgat.c lib_clear.c \ + lib_clearok.c lib_clrbot.c lib_clreol.c lib_color.c \ + lib_colorset.c lib_delch.c lib_delwin.c lib_dft_fgbg.c \ + lib_echo.c lib_endwin.c lib_erase.c lib_flash.c lib_freeall.c \ + lib_getch.c lib_getstr.c lib_hline.c lib_immedok.c lib_inchstr.c \ + lib_initscr.c lib_insch.c lib_insdel.c lib_insstr.c lib_instr.c \ + lib_isendwin.c lib_leaveok.c lib_mouse.c lib_move.c lib_mvwin.c \ + lib_newterm.c lib_newwin.c lib_nl.c lib_overlay.c lib_pad.c \ + lib_printw.c lib_redrawln.c lib_refresh.c lib_restart.c \ + lib_scanw.c lib_screen.c lib_scroll.c lib_scrollok.c \ + lib_scrreg.c lib_set_term.c lib_slk.c lib_slkatr_set.c \ + lib_slkatrof.c lib_slkatron.c lib_slkatrset.c lib_slkattr.c \ + lib_slkclear.c lib_slkcolor.c lib_slkinit.c lib_slklab.c \ + lib_slkrefr.c lib_slkset.c lib_slktouch.c lib_touch.c \ + lib_ungetch.c lib_vline.c lib_wattroff.c lib_wattron.c \ + lib_winch.c lib_window.c nc_panel.c resizeterm.c safe_sprintf.c \ + sigaction.c tries.c wresize.c +# tinfo +SRCS+= access.c add_tries.c alloc_entry.c captoinfo.c comp_error.c \ + comp_expand.c comp_hash.c comp_parse.c comp_scan.c doalloc.c \ + getenv_num.c home_terminfo.c lib_acs.c lib_baudrate.c \ + lib_cur_term.c lib_data.c lib_has_cap.c lib_kernel.c \ + lib_longname.c lib_napms.c lib_options.c lib_print.c lib_raw.c \ + lib_setup.c lib_termcap.c lib_termname.c lib_ti.c lib_tparm.c \ + lib_tputs.c lib_ttyflags.c name_match.c \ + parse_entry.c read_bsd_terminfo.c read_entry.c read_termcap.c \ + setbuf.c write_entry.c +# trace +SRCS+= lib_trace.c lib_traceatr.c lib_tracebits.c lib_tracechr.c \ + lib_tracedmp.c lib_tracemse.c trace_buf.c +# tty +SRCS+= hardscroll.c hashmap.c lib_mvcur.c lib_tstp.c lib_twait.c \ + lib_vidattr.c tty_update.c CFLAGS+= -I. -I${.CURDIR} ${CURSESTRACE} # XXX - missing stuff here MAN= curs_addch.3 curs_addchstr.3 curs_addstr.3 curs_attr.3 curs_beep.3 \ @@ -50,7 +61,7 @@ MAN= curs_addch.3 curs_addchstr.3 curs_addstr.3 curs_attr.3 curs_beep.3 \ curs_scanw.3 curs_scr_dump.3 curs_scroll.3 curs_slk.3 curs_termattrs.3 \ curs_touch.3 curs_util.3 curs_window.3 curses.3 define_key.3 \ dft_fgbg.3 keyok.3 resizeterm.3 wresize.3 termcap.3 terminfo.3 \ - terminfo.5 + terminfo.5 term.5 term.7 MLINKS+=curses.3 ncurses.3 MLINKS+=curs_addch.3 addch.3 curs_addch.3 waddch.3 curs_addch.3 mvaddch.3 \ curs_addch.3 mvwaddch.3 curs_addch.3 echochar.3 curs_addch.3 \ @@ -166,41 +177,41 @@ includes: ${INSTALL} ${INSTALL_COPY} -m 444 -o $(BINOWN) -g $(BINGRP) $$i \ ${DESTDIR}/usr/include; done -fallback.c: ${.CURDIR}/term.h ${.CURDIR}/curses.priv.h ${.CURDIR}/MKfallback.sh - sh ${.CURDIR}/MKfallback.sh $(FALLBACK_LIST) > ${.TARGET} +fallback.c: ${.CURDIR}/term.h ${.CURDIR}/curses.priv.h ${.CURDIR}/tinfo/MKfallback.sh + sh ${.CURDIR}/tinfo/MKfallback.sh $(FALLBACK_LIST) > ${.TARGET} -lib_gen.c: ${.CURDIR}/curses.h ${.CURDIR}/MKlib_gen.sh - sh ${.CURDIR}/MKlib_gen.sh "${CPP} -I${.CURDIR}" "${AWK}" < ${.CURDIR}/curses.h > lib_gen.c +lib_gen.c: ${.CURDIR}/curses.h ${.CURDIR}/base/MKlib_gen.sh + sh ${.CURDIR}/base/MKlib_gen.sh "${CPP} -I${.CURDIR}" "${AWK}" < ${.CURDIR}/curses.h > lib_gen.c -nomacros.h: ${.CURDIR}/MKlib_gen.sh lib_gen.c +nomacros.h: ${.CURDIR}/base/MKlib_gen.sh lib_gen.c fgrep undef lib_gen.c > ${.TARGET} -keys.tries: make_keys ${.CURDIR}/keys.list - ./make_keys ${.CURDIR}/keys.list > ${.TARGET} +keys.tries: make_keys ${.CURDIR}/tinfo/keys.list + ./make_keys ${.CURDIR}/tinfo/keys.list > ${.TARGET} -make_keys: ${.CURDIR}/make_keys.c names.c - ${HOSTCC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.CURDIR}/make_keys.c ${LDADD} +make_keys: ${.CURDIR}/tinfo/make_keys.c names.c + ${HOSTCC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.CURDIR}/tinfo/make_keys.c ${LDADD} -make_hash: ${.CURDIR}/comp_hash.c ${.CURDIR}/hashsize.h - ${HOSTCC} ${CFLAGS} -DMAIN_PROGRAM ${LDFLAGS} -o ${.TARGET} ${.CURDIR}/comp_hash.c ${LDADD} +make_hash: ${.CURDIR}/tinfo/comp_hash.c ${.CURDIR}/hashsize.h + ${HOSTCC} ${CFLAGS} -DMAIN_PROGRAM ${LDFLAGS} -o ${.TARGET} ${.CURDIR}/tinfo/comp_hash.c ${LDADD} -expanded.c: ${.CURDIR}/term.h ${.CURDIR}/curses.priv.h ${.CURDIR}/MKexpanded.sh - sh ${.CURDIR}/MKexpanded.sh "${CPP}" ${CPPFLAGS} +expanded.c: ${.CURDIR}/term.h ${.CURDIR}/curses.priv.h ${.CURDIR}/tty/MKexpanded.sh + sh ${.CURDIR}/tty/MKexpanded.sh "${CPP}" ${CPPFLAGS} > ${.TARGET} comp_captab.c: make_hash ${.CURDIR}/ncurses_cfg.h ${.CURDIR}/tic.h ${.CURDIR}/term.h - sh ${.CURDIR}/MKcaptab.awk ${AWK} ${.CURDIR}/Caps > ${.TARGET} + sh ${.CURDIR}/tinfo/MKcaptab.awk ${AWK} ${.CURDIR}/Caps > ${.TARGET} -lib_keyname.c: ${.CURDIR}/ncurses_cfg.h ${.CURDIR}/curses.h ${.CURDIR}/term.h ${.CURDIR}/keys.list ${.CURDIR}/MKkeyname.awk - ${AWK} -f ${.CURDIR}/MKkeyname.awk ${.CURDIR}/keys.list > ${.TARGET} +lib_keyname.c: ${.CURDIR}/ncurses_cfg.h ${.CURDIR}/curses.h ${.CURDIR}/term.h ${.CURDIR}/tinfo/keys.list ${.CURDIR}/base/MKkeyname.awk + ${AWK} -f ${.CURDIR}/base/MKkeyname.awk ${.CURDIR}/tinfo/keys.list > ${.TARGET} -names.c codes.c: ${.CURDIR}/MKnames.awk - ${AWK} -f ${.CURDIR}/MKnames.awk ${.CURDIR}/Caps +names.c codes.c: ${.CURDIR}/tinfo/MKnames.awk + ${AWK} -f ${.CURDIR}/tinfo/MKnames.awk ${.CURDIR}/Caps cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr > names.c cat namehdr boolcodes numcodes strcodes codeftr > codes.c -rm -f namehdr nameftr codeftr boolnames boolfnames boolcodes numnames numfnames numcodes strnames strfnames strcodes -unctrl.c: ${.CURDIR}/MKunctrl.awk - echo | ${AWK} -f ${.CURDIR}/MKunctrl.awk > ${.TARGET} +unctrl.c: ${.CURDIR}/base/MKunctrl.awk + echo | ${AWK} -f ${.CURDIR}/base/MKunctrl.awk > ${.TARGET} # Link libtermlib, libtermcap to libcurses so we don't break people's Makefiles afterinstall: diff --git a/lib/libcurses/README b/lib/libcurses/README deleted file mode 100644 index be4b8b0046d..00000000000 --- a/lib/libcurses/README +++ /dev/null @@ -1,19 +0,0 @@ -For discussion of the package internals, see hackguide.html in the misc -directory. - -Here are some -D options you might need to compile with. -The 'configure' script gets most other definitions right automatically. - --DHAVE_SIGACTION if the sigaction function is present - --DHAVE_USLEEP if the usleep function is present - --DSVR4_ACTION if (e.g., svr4) you need _POSIX_SOURCE to have sigaction - --DSVR4_TERMIO if (e.g., svr4) you need _POSIX_SOURCE to have termio - --DOPT_MVCUR if you want mvcur() to cost its actions or you have a - terminal that doesn't have direct cursor addressing. - -There are several problems with strict POSIX systems so extra flags -or #define's may be needed. diff --git a/lib/libcurses/MKkeyname.awk b/lib/libcurses/base/MKkeyname.awk index b60184b799b..64a27a09895 100644 --- a/lib/libcurses/MKkeyname.awk +++ b/lib/libcurses/base/MKkeyname.awk @@ -1,5 +1,5 @@ -# $OpenBSD: MKkeyname.awk,v 1.5 1998/11/17 03:16:20 millert Exp $ -# $From: MKkeyname.awk,v 1.14 1998/05/10 17:00:39 tom Exp $ +# $OpenBSD: MKkeyname.awk,v 1.1 1999/01/18 19:09:31 millert Exp $ +# $From: MKkeyname.awk,v 1.15 1999/01/16 22:56:44 tom Exp $ BEGIN { print "/* generated by MKkeyname.awk */" print "" @@ -13,7 +13,7 @@ BEGIN { print "\tint code;" print "};" print "" - print "const struct kn key_names[] = {" + print "static const struct kn key_names[] = {" } /^[^#]/ { @@ -27,7 +27,7 @@ END { print "NCURSES_CONST char *keyname(int c)" print "{" print "int i, size = sizeof(key_names)/sizeof(struct kn);" - print "static char name[5];" + print "static char name[20];" print "char *p;" print "" print "\tfor (i = 0; i < size; i++)" diff --git a/lib/libcurses/MKlib_gen.sh b/lib/libcurses/base/MKlib_gen.sh index 87c6b468f2b..283a614c72d 100644 --- a/lib/libcurses/MKlib_gen.sh +++ b/lib/libcurses/base/MKlib_gen.sh @@ -2,7 +2,7 @@ # # MKlib_gen.sh -- generate sources from curses.h macro definitions # -# $OpenBSD: MKlib_gen.sh,v 1.4 1998/07/23 21:17:22 millert Exp $ +# $OpenBSD: MKlib_gen.sh,v 1.1 1999/01/18 19:09:32 millert Exp $ # ($From: MKlib_gen.sh,v 1.11 1998/01/17 14:16:52 Juan.Jose.Garcia.Ripoll Exp $) # # The XSI Curses standard requires all curses entry points to exist as diff --git a/lib/libcurses/MKunctrl.awk b/lib/libcurses/base/MKunctrl.awk index df529532533..b3e05a3dd39 100644 --- a/lib/libcurses/MKunctrl.awk +++ b/lib/libcurses/base/MKunctrl.awk @@ -1,4 +1,4 @@ -# $OpenBSD: MKunctrl.awk,v 1.1 1998/07/23 21:17:23 millert Exp $ +# $OpenBSD: MKunctrl.awk,v 1.1 1999/01/18 19:09:32 millert Exp $ # $From: MKunctrl.awk,v 1.6 1998/06/06 18:18:07 tom Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # diff --git a/lib/libcurses/define_key.c b/lib/libcurses/base/define_key.c index 8753efe7f6a..ac73c578212 100644 --- a/lib/libcurses/define_key.c +++ b/lib/libcurses/base/define_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: define_key.c,v 1.2 1998/07/23 21:18:14 millert Exp $ */ +/* $OpenBSD: define_key.c,v 1.1 1999/01/18 19:09:33 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/keyok.c b/lib/libcurses/base/keyok.c index ab4e462b79d..fb343b12162 100644 --- a/lib/libcurses/keyok.c +++ b/lib/libcurses/base/keyok.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keyok.c,v 1.2 1998/07/23 21:18:21 millert Exp $ */ +/* $OpenBSD: keyok.c,v 1.1 1999/01/18 19:09:34 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_adabind.c b/lib/libcurses/base/lib_adabind.c index 50a780c7473..2fd7faa23ed 100644 --- a/lib/libcurses/lib_adabind.c +++ b/lib/libcurses/base/lib_adabind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_adabind.c,v 1.1 1998/07/23 21:18:25 millert Exp $ */ +/* $OpenBSD: lib_adabind.c,v 1.1 1999/01/18 19:09:34 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -37,15 +37,15 @@ // // Some small wrappers to ease the implementation of an Ada95 // binding. Especially functionalities only available as macros -// in (n)curses are wrapped here by functions. +// in (n)curses are wrapped here by functions. // See the documentation and copyright notices in the ../Ada95 // subdirectory. */ #include "curses.priv.h" -MODULE_ID("$From: lib_adabind.c,v 1.7 1998/02/11 12:13:59 tom Exp $") +MODULE_ID("$From: lib_adabind.c,v 1.10 1998/12/06 04:30:32 juergen Exp $") -/* In (n)curses are a few functionalities that can't be expressed as +/* In (n)curses are a few functionalities that can't be expressed as // functions, because for historic reasons they use as macro argument // variable names that are "out" parameters. For those macros we provide // small wrappers. @@ -112,34 +112,6 @@ int _nc_ada_isscroll (const WINDOW *win) return win ? (win->_scroll ? TRUE : FALSE) : ERR; } -int _nc_ada_coord_transform (const WINDOW *win, int *Y, int *X, int dir) -{ - if (win && Y && X) - { - int y = *Y; int x = *X; - if (dir) - { /* to screen coordinates */ - y += win->_yoffset; - y += win->_begy; - x += win->_begx; - if (!wenclose(win,y,x)) - return FALSE; - } - else - { /* from screen coordinates */ - if (!wenclose(win,y,x)) - return FALSE; - y -= win->_yoffset; - y -= win->_begy; - x -= win->_begx; - } - *X = x; - *Y = y; - return TRUE; - } - return FALSE; -} - #define BUTTON1_EVENTS (BUTTON1_RELEASED |\ BUTTON1_PRESSED |\ BUTTON1_CLICKED |\ @@ -218,7 +190,7 @@ void _nc_ada_mouse_event( mmask_t m, int *b, int *s ) int _nc_ada_mouse_mask ( int button, int state, mmask_t *mask ) { - mmask_t b = (button<4) ? ((1<<button) << (6 * state)) : + mmask_t b = (button<4) ? ((1<<6*button) << state) : (BUTTON_CTRL << (button-4)); if (button>=4 && state!=1) diff --git a/lib/libcurses/lib_addch.c b/lib/libcurses/base/lib_addch.c index 7d9c65edb34..cc22401c8ee 100644 --- a/lib/libcurses/lib_addch.c +++ b/lib/libcurses/base/lib_addch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_addch.c,v 1.5 1998/07/23 21:18:25 millert Exp $ */ +/* $OpenBSD: lib_addch.c,v 1.1 1999/01/18 19:09:34 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_addstr.c b/lib/libcurses/base/lib_addstr.c index 68c82a02c88..2514981ce62 100644 --- a/lib/libcurses/lib_addstr.c +++ b/lib/libcurses/base/lib_addstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_addstr.c,v 1.4 1998/07/23 21:18:26 millert Exp $ */ +/* $OpenBSD: lib_addstr.c,v 1.1 1999/01/18 19:09:35 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_beep.c b/lib/libcurses/base/lib_beep.c index 84b4d25139e..e4ca5aaaed9 100644 --- a/lib/libcurses/lib_beep.c +++ b/lib/libcurses/base/lib_beep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_beep.c,v 1.4 1998/07/23 21:18:29 millert Exp $ */ +/* $OpenBSD: lib_beep.c,v 1.1 1999/01/18 19:09:35 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_bkgd.c b/lib/libcurses/base/lib_bkgd.c index ce9c4ff9d50..eacb4c36510 100644 --- a/lib/libcurses/lib_bkgd.c +++ b/lib/libcurses/base/lib_bkgd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_bkgd.c,v 1.4 1998/07/23 21:18:30 millert Exp $ */ +/* $OpenBSD: lib_bkgd.c,v 1.1 1999/01/18 19:09:36 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_box.c b/lib/libcurses/base/lib_box.c index 7e368e02fef..29918f229bc 100644 --- a/lib/libcurses/lib_box.c +++ b/lib/libcurses/base/lib_box.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_box.c,v 1.4 1998/07/23 21:18:31 millert Exp $ */ +/* $OpenBSD: lib_box.c,v 1.1 1999/01/18 19:09:37 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_chgat.c b/lib/libcurses/base/lib_chgat.c index dc235249b7a..1ed997d1499 100644 --- a/lib/libcurses/lib_chgat.c +++ b/lib/libcurses/base/lib_chgat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_chgat.c,v 1.1 1998/07/23 21:18:32 millert Exp $ */ +/* $OpenBSD: lib_chgat.c,v 1.1 1999/01/18 19:09:37 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_clear.c b/lib/libcurses/base/lib_clear.c index 0b7400c4cfe..c668ea1c42b 100644 --- a/lib/libcurses/lib_clear.c +++ b/lib/libcurses/base/lib_clear.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_clear.c,v 1.4 1998/07/23 21:18:32 millert Exp $ */ +/* $OpenBSD: lib_clear.c,v 1.1 1999/01/18 19:09:38 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_clearok.c b/lib/libcurses/base/lib_clearok.c index 26d1fce7a06..3c51e6fac99 100644 --- a/lib/libcurses/lib_clearok.c +++ b/lib/libcurses/base/lib_clearok.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_clearok.c,v 1.1 1998/07/23 21:18:33 millert Exp $ */ +/* $OpenBSD: lib_clearok.c,v 1.1 1999/01/18 19:09:38 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_clrbot.c b/lib/libcurses/base/lib_clrbot.c index 624a8c7967c..ba68bd574e7 100644 --- a/lib/libcurses/lib_clrbot.c +++ b/lib/libcurses/base/lib_clrbot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_clrbot.c,v 1.4 1998/07/23 21:18:33 millert Exp $ */ +/* $OpenBSD: lib_clrbot.c,v 1.1 1999/01/18 19:09:38 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_clreol.c b/lib/libcurses/base/lib_clreol.c index 7a24b3237bb..163bd2d06ff 100644 --- a/lib/libcurses/lib_clreol.c +++ b/lib/libcurses/base/lib_clreol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_clreol.c,v 1.4 1998/07/23 21:18:35 millert Exp $ */ +/* $OpenBSD: lib_clreol.c,v 1.1 1999/01/18 19:09:39 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_color.c b/lib/libcurses/base/lib_color.c index bd1b43b6534..1aa3602c853 100644 --- a/lib/libcurses/lib_color.c +++ b/lib/libcurses/base/lib_color.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_color.c,v 1.7 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: lib_color.c,v 1.1 1999/01/18 19:09:39 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_colorset.c b/lib/libcurses/base/lib_colorset.c index 3b14aff1a36..d86e3fae5c2 100644 --- a/lib/libcurses/lib_colorset.c +++ b/lib/libcurses/base/lib_colorset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_colorset.c,v 1.1 1998/07/23 21:18:37 millert Exp $ */ +/* $OpenBSD: lib_colorset.c,v 1.1 1999/01/18 19:09:40 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_delch.c b/lib/libcurses/base/lib_delch.c index 462976dd587..7832e20db1d 100644 --- a/lib/libcurses/lib_delch.c +++ b/lib/libcurses/base/lib_delch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_delch.c,v 1.4 1998/07/23 21:18:38 millert Exp $ */ +/* $OpenBSD: lib_delch.c,v 1.1 1999/01/18 19:09:40 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_delwin.c b/lib/libcurses/base/lib_delwin.c index a69a2af04ee..0ef17261a65 100644 --- a/lib/libcurses/lib_delwin.c +++ b/lib/libcurses/base/lib_delwin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_delwin.c,v 1.4 1998/07/23 21:18:39 millert Exp $ */ +/* $OpenBSD: lib_delwin.c,v 1.1 1999/01/18 19:09:41 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_dft_fgbg.c b/lib/libcurses/base/lib_dft_fgbg.c index 3b48f27fa4d..b1bef7ceb4d 100644 --- a/lib/libcurses/lib_dft_fgbg.c +++ b/lib/libcurses/base/lib_dft_fgbg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_dft_fgbg.c,v 1.3 1998/07/23 21:18:41 millert Exp $ */ +/* $OpenBSD: lib_dft_fgbg.c,v 1.1 1999/01/18 19:09:41 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_echo.c b/lib/libcurses/base/lib_echo.c index 50541155db8..5ca72d31a42 100644 --- a/lib/libcurses/lib_echo.c +++ b/lib/libcurses/base/lib_echo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_echo.c,v 1.1 1998/07/23 21:18:43 millert Exp $ */ +/* $OpenBSD: lib_echo.c,v 1.1 1999/01/18 19:09:42 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -44,9 +44,8 @@ */ #include <curses.priv.h> -#include <term.h> /* cur_term */ -MODULE_ID("$From: lib_echo.c,v 1.2 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$From: lib_echo.c,v 1.3 1998/10/12 13:15:33 Alexander.V.Lukyanov Exp $") int echo(void) { diff --git a/lib/libcurses/lib_endwin.c b/lib/libcurses/base/lib_endwin.c index b9ff914e93a..5ebe5a11323 100644 --- a/lib/libcurses/lib_endwin.c +++ b/lib/libcurses/base/lib_endwin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_endwin.c,v 1.7 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: lib_endwin.c,v 1.1 1999/01/18 19:09:42 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_erase.c b/lib/libcurses/base/lib_erase.c index b0a93e1e39e..e341ed6064e 100644 --- a/lib/libcurses/lib_erase.c +++ b/lib/libcurses/base/lib_erase.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_erase.c,v 1.4 1998/07/23 21:18:44 millert Exp $ */ +/* $OpenBSD: lib_erase.c,v 1.1 1999/01/18 19:09:42 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_flash.c b/lib/libcurses/base/lib_flash.c index e407d13c52b..06fea72969a 100644 --- a/lib/libcurses/lib_flash.c +++ b/lib/libcurses/base/lib_flash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_flash.c,v 1.2 1998/07/23 21:18:45 millert Exp $ */ +/* $OpenBSD: lib_flash.c,v 1.1 1999/01/18 19:09:43 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_freeall.c b/lib/libcurses/base/lib_freeall.c index 15ab0c0517d..c91707f99a6 100644 --- a/lib/libcurses/lib_freeall.c +++ b/lib/libcurses/base/lib_freeall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_freeall.c,v 1.2 1998/11/17 03:16:21 millert Exp $ */ +/* $OpenBSD: lib_freeall.c,v 1.1 1999/01/18 19:09:45 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -41,7 +41,7 @@ extern int malloc_errfd; /* FIXME */ #endif -MODULE_ID("$From: lib_freeall.c,v 1.12 1998/11/08 01:33:09 tom Exp $") +MODULE_ID("$From: lib_freeall.c,v 1.13 1998/11/12 19:42:42 Alexander.V.Lukyanov Exp $") static void free_slk(SLK *p) { @@ -113,7 +113,8 @@ void _nc_freeall(void) free_slk(SP->_slk); FreeIfNeeded(SP->_color_pairs); FreeIfNeeded(SP->_color_table); - _nc_set_buffer(SP->_ofp, FALSE); + /* it won't free buffer anyway */ +/* _nc_set_buffer(SP->_ofp, FALSE);*/ #if !BROKEN_LINKER FreeAndNull(SP); #endif diff --git a/lib/libcurses/lib_getch.c b/lib/libcurses/base/lib_getch.c index 920989b3919..e4b65e62ff8 100644 --- a/lib/libcurses/lib_getch.c +++ b/lib/libcurses/base/lib_getch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_getch.c,v 1.7 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: lib_getch.c,v 1.1 1999/01/18 19:09:46 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_getstr.c b/lib/libcurses/base/lib_getstr.c index fba89a82fc6..431a60cef5c 100644 --- a/lib/libcurses/lib_getstr.c +++ b/lib/libcurses/base/lib_getstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_getstr.c,v 1.4 1998/07/23 21:18:48 millert Exp $ */ +/* $OpenBSD: lib_getstr.c,v 1.1 1999/01/18 19:09:46 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -44,7 +44,7 @@ #include <curses.priv.h> #include <term.h> -MODULE_ID("$From: lib_getstr.c,v 1.19 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$From: lib_getstr.c,v 1.20 1998/12/20 00:16:01 tom Exp $") /* * This wipes out the last character, no matter whether it was a tab, control @@ -86,7 +86,7 @@ int y, x; if (!win) returnCode(ERR); - _nc_get_curterm(&buf); + _nc_get_tty_mode(&buf); oldnl = SP->_nl; oldecho = SP->_echo; @@ -182,7 +182,7 @@ int y, x; SP->_raw = oldraw; SP->_cbreak = oldcbreak; - _nc_set_curterm(&buf); + _nc_set_tty_mode(&buf); *str = '\0'; if (ch == ERR) diff --git a/lib/libcurses/lib_hline.c b/lib/libcurses/base/lib_hline.c index a1dc7a632ad..a9c7d8d2d13 100644 --- a/lib/libcurses/lib_hline.c +++ b/lib/libcurses/base/lib_hline.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_hline.c,v 1.2 1998/07/23 21:18:49 millert Exp $ */ +/* $OpenBSD: lib_hline.c,v 1.1 1999/01/18 19:09:46 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_immedok.c b/lib/libcurses/base/lib_immedok.c index 6df5836f0bc..4bd7234bef6 100644 --- a/lib/libcurses/lib_immedok.c +++ b/lib/libcurses/base/lib_immedok.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_immedok.c,v 1.1 1998/07/23 21:18:50 millert Exp $ */ +/* $OpenBSD: lib_immedok.c,v 1.1 1999/01/18 19:09:47 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_inchstr.c b/lib/libcurses/base/lib_inchstr.c index 01b1a2ea65b..ee0b93d7332 100644 --- a/lib/libcurses/lib_inchstr.c +++ b/lib/libcurses/base/lib_inchstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_inchstr.c,v 1.4 1998/07/23 21:18:50 millert Exp $ */ +/* $OpenBSD: lib_inchstr.c,v 1.1 1999/01/18 19:09:48 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_initscr.c b/lib/libcurses/base/lib_initscr.c index 8f9400788c4..8d179b4bc7e 100644 --- a/lib/libcurses/lib_initscr.c +++ b/lib/libcurses/base/lib_initscr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_initscr.c,v 1.6 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: lib_initscr.c,v 1.1 1999/01/18 19:09:48 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -47,7 +47,7 @@ #include <sys/termio.h> /* needed for ISC */ #endif -MODULE_ID("$From: lib_initscr.c,v 1.25 1998/09/19 21:39:25 tom Exp $") +MODULE_ID("$From: lib_initscr.c,v 1.26 1998/12/19 23:10:09 tom Exp $") WINDOW *initscr(void) { @@ -78,17 +78,3 @@ int value; } returnWin(stdscr); } - -char *termname(void) -{ -char *term = getenv("TERM"); -static char ret[MAX_ALIAS]; - - T(("termname() called")); - - if (term != 0) { - (void) strlcpy(ret, term, sizeof(ret)); - term = ret; - } - return term; -} diff --git a/lib/libcurses/lib_insch.c b/lib/libcurses/base/lib_insch.c index 519d98f1d6f..dae6ce048ea 100644 --- a/lib/libcurses/lib_insch.c +++ b/lib/libcurses/base/lib_insch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_insch.c,v 1.4 1998/07/23 21:18:53 millert Exp $ */ +/* $OpenBSD: lib_insch.c,v 1.1 1999/01/18 19:09:49 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_insdel.c b/lib/libcurses/base/lib_insdel.c index a2823953f21..51dcc51124e 100644 --- a/lib/libcurses/lib_insdel.c +++ b/lib/libcurses/base/lib_insdel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_insdel.c,v 1.4 1998/07/23 21:18:54 millert Exp $ */ +/* $OpenBSD: lib_insdel.c,v 1.1 1999/01/18 19:09:49 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_insstr.c b/lib/libcurses/base/lib_insstr.c index d14133c054e..8fcef043c4a 100644 --- a/lib/libcurses/lib_insstr.c +++ b/lib/libcurses/base/lib_insstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_insstr.c,v 1.4 1998/07/23 21:18:55 millert Exp $ */ +/* $OpenBSD: lib_insstr.c,v 1.1 1999/01/18 19:09:50 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_instr.c b/lib/libcurses/base/lib_instr.c index 1281c4bb289..78127c403df 100644 --- a/lib/libcurses/lib_instr.c +++ b/lib/libcurses/base/lib_instr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_instr.c,v 1.4 1998/07/23 21:18:56 millert Exp $ */ +/* $OpenBSD: lib_instr.c,v 1.1 1999/01/18 19:09:50 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_isendwin.c b/lib/libcurses/base/lib_isendwin.c index c35e8e0e141..093bf9311f2 100644 --- a/lib/libcurses/lib_isendwin.c +++ b/lib/libcurses/base/lib_isendwin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_isendwin.c,v 1.4 1998/07/23 21:18:57 millert Exp $ */ +/* $OpenBSD: lib_isendwin.c,v 1.1 1999/01/18 19:09:51 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_leaveok.c b/lib/libcurses/base/lib_leaveok.c index 5db30d00465..f89eb5eb35b 100644 --- a/lib/libcurses/lib_leaveok.c +++ b/lib/libcurses/base/lib_leaveok.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_leaveok.c,v 1.1 1998/07/23 21:18:59 millert Exp $ */ +/* $OpenBSD: lib_leaveok.c,v 1.1 1999/01/18 19:09:51 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_mouse.c b/lib/libcurses/base/lib_mouse.c index 608534277d8..2454f0d5f5f 100644 --- a/lib/libcurses/lib_mouse.c +++ b/lib/libcurses/base/lib_mouse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_mouse.c,v 1.8 1998/10/31 06:30:30 millert Exp $ */ +/* $OpenBSD: lib_mouse.c,v 1.1 1999/01/18 19:09:52 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -86,7 +86,7 @@ #endif #endif -MODULE_ID("$From: lib_mouse.c,v 1.38 1998/10/03 19:08:33 tom Exp $") +MODULE_ID("$From: lib_mouse.c,v 1.41 1998/12/02 15:03:22 juergen Exp $") #define MY_TRACE TRACE_ICALLS|TRACE_IEVENT @@ -143,6 +143,9 @@ static void _trace_slot(const char *tag) static int mouse_wfd; static int mouse_thread; +static int mouse_activated; +static char mouse_buttons[] = { 0, 1, 3, 2}; + # define M_FD(sp) sp->_mouse_fd @@ -181,6 +184,8 @@ mouse_server(unsigned long ignored GCC_UNUSED) /* sit and wait on the event queue */ if (MouReadEventQue(&mouev,&fWait,hmou)) break; + if (!mouse_activated) + goto finish; /* * OS/2 numbers a 3-button mouse inconsistently from other @@ -190,12 +195,16 @@ mouse_server(unsigned long ignored GCC_UNUSED) * 3 = middle. */ if ((mouev.fs ^ oldstate) & MOUSE_BN1_DOWN) - write_event(mouev.fs & MOUSE_BN1_DOWN, 1, mouev.col, mouev.row); + write_event(mouev.fs & MOUSE_BN1_DOWN, + mouse_buttons[1], mouev.col, mouev.row); if ((mouev.fs ^ oldstate) & MOUSE_BN2_DOWN) - write_event(mouev.fs & MOUSE_BN2_DOWN, 2, mouev.col, mouev.row); + write_event(mouev.fs & MOUSE_BN2_DOWN, + mouse_buttons[3], mouev.col, mouev.row); if ((mouev.fs ^ oldstate) & MOUSE_BN3_DOWN) - write_event(mouev.fs & MOUSE_BN3_DOWN, 3, mouev.col, mouev.row); + write_event(mouev.fs & MOUSE_BN3_DOWN, + mouse_buttons[2], mouev.col, mouev.row); + finish: oldstate = mouev.fs; } } @@ -205,6 +214,12 @@ mouse_server(unsigned long ignored GCC_UNUSED) } DosExit(EXIT_THREAD, 0L ); } +static void +server_state(const int state) +{ /* It would be nice to implement pointer-off and stop looping... */ + mouse_activated = state; +} + #endif /* FIXME: The list of names should be configurable */ @@ -216,11 +231,12 @@ static int is_xterm(const char *name) || !strncmp(name, "color_xterm", 11)); } +static int initialized; + static void _nc_mouse_init(void) /* initialize the mouse */ { int i; - static int initialized; if (initialized) { return; @@ -261,6 +277,16 @@ static void _nc_mouse_init(void) } else { int rc; + if (!mouse_buttons[0]) { + char *s = getenv("MOUSE_BUTTONS_123"); + + mouse_buttons[0] = 1; + if (s && strlen(s) >= 3) { + mouse_buttons[1] = s[0] - '0'; + mouse_buttons[2] = s[1] - '0'; + mouse_buttons[3] = s[2] - '0'; + } + } mouse_wfd = handles[1]; M_FD(SP) = handles[0]; /* Needed? */ @@ -464,6 +490,9 @@ static bool _nc_mouse_inline(SCREEN *sp) static void mouse_activate(bool on) { + if (!on && !initialized) + return; + _nc_mouse_init(); if (on) { @@ -474,7 +503,11 @@ static void mouse_activate(bool on) keyok(KEY_MOUSE, on); #endif TPUTS_TRACE("xterm mouse initialization"); +#ifdef USE_EMX_MOUSE + server_state(1); +#else putp("\033[?1000h"); +#endif break; #if USE_GPM_SUPPORT case M_GPM: @@ -496,7 +529,11 @@ static void mouse_activate(bool on) switch (mousetype) { case M_XTERM: TPUTS_TRACE("xterm mouse deinitialization"); +#ifdef USE_EMX_MOUSE + server_state(0); +#else putp("\033[?1000l"); +#endif break; #if USE_GPM_SUPPORT case M_GPM: @@ -842,6 +879,9 @@ mmask_t mousemask(mmask_t newmask, mmask_t *oldmask) if (oldmask) *oldmask = eventmask; + if (!newmask && !initialized) + returnCode(0); + _nc_mouse_init(); if ( mousetype != M_NONE ) { @@ -898,4 +938,37 @@ int _nc_has_mouse(void) { return (mousetype==M_NONE ? 0:1); } +bool wmouse_trafo(const WINDOW* win, int* pY, int* pX, bool to_screen) +{ + bool result = FALSE; + + if (win && pY && pX) + { + int y = *pY; int x = *pX; + + if (to_screen) + { + y += win->_begy + win->_yoffset; + x += win->_begx; + if (wenclose(win,y,x)) + result = TRUE; + } + else + { + if (wenclose(win,y,x)) + { + y -= (win->_begy + win->_yoffset); + x -= win->_begx; + result = TRUE; + } + } + if (result) + { + *pX = x; + *pY = y; + } + } + return(result); +} + /* lib_mouse.c ends here */ diff --git a/lib/libcurses/lib_move.c b/lib/libcurses/base/lib_move.c index 9701c038cf1..96b93998838 100644 --- a/lib/libcurses/lib_move.c +++ b/lib/libcurses/base/lib_move.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_move.c,v 1.4 1998/07/23 21:19:02 millert Exp $ */ +/* $OpenBSD: lib_move.c,v 1.1 1999/01/18 19:09:52 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_mvwin.c b/lib/libcurses/base/lib_mvwin.c index 92ee18d1f7e..b41bea721be 100644 --- a/lib/libcurses/lib_mvwin.c +++ b/lib/libcurses/base/lib_mvwin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_mvwin.c,v 1.5 1998/07/23 21:19:04 millert Exp $ */ +/* $OpenBSD: lib_mvwin.c,v 1.1 1999/01/18 19:09:53 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_newterm.c b/lib/libcurses/base/lib_newterm.c index f3d130c073c..a82c2e1b247 100644 --- a/lib/libcurses/lib_newterm.c +++ b/lib/libcurses/base/lib_newterm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_newterm.c,v 1.6 1998/10/31 06:30:30 millert Exp $ */ +/* $OpenBSD: lib_newterm.c,v 1.1 1999/01/18 19:09:53 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -50,7 +50,7 @@ #include <term.h> /* clear_screen, cup & friends, cur_term */ -MODULE_ID("$From: lib_newterm.c,v 1.35 1998/09/19 21:43:22 tom Exp $") +MODULE_ID("$From: lib_newterm.c,v 1.37 1999/01/02 22:56:08 tom Exp $") #ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */ #define ONLCR 0 @@ -77,7 +77,7 @@ static inline int _nc_initscr(void) #else cur_term->Nttyb.sg_flags &= ~(ECHO|CRMOD); #endif - return _nc_set_curterm(&cur_term->Nttyb); + return _nc_set_tty_mode(&cur_term->Nttyb); } /* @@ -130,16 +130,13 @@ int t = _nc_getenv_num("NCURSES_TRACE"); if (filter_mode) { LINES = 1; -#ifdef init_tabs if (init_tabs != -1) TABSIZE = init_tabs; else -#endif /* init_tabs */ TABSIZE = 8; T(("TABSIZE = %d", TABSIZE)); -#ifdef clear_screen clear_screen = 0; cursor_down = parm_down_cursor = 0; cursor_address = 0; @@ -147,16 +144,13 @@ int t = _nc_getenv_num("NCURSES_TRACE"); row_address = 0; cursor_home = carriage_return; -#endif /* clear_screen */ } /* If we must simulate soft labels, grab off the line to be used. We assume that we must simulate, if it is none of the standard formats (4-4 or 3-2-3) for which there may be some hardware support. */ -#ifdef num_labels if (num_labels <= 0 || !SLK_STDFMT) -#endif /* num_labels */ if (_nc_slk_format) { if (ERR==_nc_ripoffline(-SLK_LINES, _nc_slk_initialize)) @@ -172,11 +166,9 @@ int t = _nc_getenv_num("NCURSES_TRACE"); return 0; } -#ifdef num_labels /* if the terminal type has real soft labels, set those up */ if (_nc_slk_format && num_labels > 0 && SLK_STDFMT) _nc_slk_initialize(stdscr, COLS); -#endif /* num_labels */ SP->_ifd = fileno(ifp); SP->_checkfd = fileno(ifp); diff --git a/lib/libcurses/lib_newwin.c b/lib/libcurses/base/lib_newwin.c index 1fa06a339be..db0df629fff 100644 --- a/lib/libcurses/lib_newwin.c +++ b/lib/libcurses/base/lib_newwin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_newwin.c,v 1.4 1998/07/23 21:19:07 millert Exp $ */ +/* $OpenBSD: lib_newwin.c,v 1.1 1999/01/18 19:09:54 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_nl.c b/lib/libcurses/base/lib_nl.c index c7d795621b0..2b4fe387462 100644 --- a/lib/libcurses/lib_nl.c +++ b/lib/libcurses/base/lib_nl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_nl.c,v 1.1 1998/07/23 21:19:08 millert Exp $ */ +/* $OpenBSD: lib_nl.c,v 1.1 1999/01/18 19:09:54 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -44,9 +44,8 @@ */ #include <curses.priv.h> -#include <term.h> /* cur_term */ -MODULE_ID("$From: lib_nl.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$From: lib_nl.c,v 1.3 1998/10/14 15:14:08 Alexander.V.Lukyanov Exp $") #ifdef __EMX__ #include <io.h> diff --git a/lib/libcurses/lib_overlay.c b/lib/libcurses/base/lib_overlay.c index 2d3a8e1621f..87fa1bd2ee3 100644 --- a/lib/libcurses/lib_overlay.c +++ b/lib/libcurses/base/lib_overlay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_overlay.c,v 1.6 1998/07/23 21:19:09 millert Exp $ */ +/* $OpenBSD: lib_overlay.c,v 1.1 1999/01/18 19:09:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_pad.c b/lib/libcurses/base/lib_pad.c index d35fea99396..c031c018853 100644 --- a/lib/libcurses/lib_pad.c +++ b/lib/libcurses/base/lib_pad.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_pad.c,v 1.4 1998/07/23 21:19:11 millert Exp $ */ +/* $OpenBSD: lib_pad.c,v 1.1 1999/01/18 19:09:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_printw.c b/lib/libcurses/base/lib_printw.c index d4f83defb4d..0b1380ce5df 100644 --- a/lib/libcurses/lib_printw.c +++ b/lib/libcurses/base/lib_printw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_printw.c,v 1.6 1998/07/23 21:19:13 millert Exp $ */ +/* $OpenBSD: lib_printw.c,v 1.1 1999/01/18 19:09:56 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_redrawln.c b/lib/libcurses/base/lib_redrawln.c index 9b0e99cdebb..51a22c3d8f1 100644 --- a/lib/libcurses/lib_redrawln.c +++ b/lib/libcurses/base/lib_redrawln.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_redrawln.c,v 1.3 1998/10/31 06:30:30 millert Exp $ */ +/* $OpenBSD: lib_redrawln.c,v 1.1 1999/01/18 19:09:57 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_refresh.c b/lib/libcurses/base/lib_refresh.c index a31c63bb7e7..e841c2ac754 100644 --- a/lib/libcurses/lib_refresh.c +++ b/lib/libcurses/base/lib_refresh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_refresh.c,v 1.5 1998/07/23 21:19:16 millert Exp $ */ +/* $OpenBSD: lib_refresh.c,v 1.1 1999/01/18 19:09:57 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_restart.c b/lib/libcurses/base/lib_restart.c index ab4716f1c09..fb37b368ebd 100644 --- a/lib/libcurses/lib_restart.c +++ b/lib/libcurses/base/lib_restart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_restart.c,v 1.1 1998/07/23 21:19:18 millert Exp $ */ +/* $OpenBSD: lib_restart.c,v 1.1 1999/01/18 19:09:57 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -49,60 +49,9 @@ #include <term.h> /* lines, columns, cur_term */ -MODULE_ID("$From: lib_restart.c,v 1.16 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$From: lib_restart.c,v 1.1 1998/12/27 14:40:04 tom Exp $") -#undef tabs - -#ifdef TAB3 -# define tabs TAB3 -#else -# ifdef XTABS -# define tabs XTABS -# else -# ifdef OXTABS -# define tabs OXTABS -# else -# define tabs 0 -# endif -# endif -#endif - -int def_shell_mode(void) -{ - T((T_CALLED("def_shell_mode()"))); - - /* - * Turn off the XTABS bit in the tty structure if it was on. If XTABS - * was on, remove the tab and backtab capabilities. - */ - - if (_nc_get_curterm(&cur_term->Ottyb) != OK) - returnCode(ERR); -#ifdef TERMIOS - if (cur_term->Ottyb.c_oflag & tabs) - tab = back_tab = NULL; -#else - if (cur_term->Ottyb.sg_flags & XTABS) - tab = back_tab = NULL; -#endif - returnCode(OK); -} - -int def_prog_mode(void) -{ - T((T_CALLED("def_prog_mode()"))); - - if (_nc_get_curterm(&cur_term->Nttyb) != OK) - returnCode(ERR); -#ifdef TERMIOS - cur_term->Nttyb.c_oflag &= ~tabs; -#else - cur_term->Nttyb.sg_flags &= ~XTABS; -#endif - returnCode(OK); -} - -int restartterm(const char *term, int filenum, int *errret) +int restartterm(NCURSES_CONST char *term, int filenum, int *errret) { int saveecho = SP->_echo; int savecbreak = SP->_cbreak; diff --git a/lib/libcurses/lib_scanw.c b/lib/libcurses/base/lib_scanw.c index f38eb5aaee1..abf6154786d 100644 --- a/lib/libcurses/lib_scanw.c +++ b/lib/libcurses/base/lib_scanw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_scanw.c,v 1.4 1998/07/23 21:19:18 millert Exp $ */ +/* $OpenBSD: lib_scanw.c,v 1.1 1999/01/18 19:09:58 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_screen.c b/lib/libcurses/base/lib_screen.c index 6e7c6727d40..a112dc93abc 100644 --- a/lib/libcurses/lib_screen.c +++ b/lib/libcurses/base/lib_screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_screen.c,v 1.6 1998/07/27 03:37:31 millert Exp $ */ +/* $OpenBSD: lib_screen.c,v 1.1 1999/01/18 19:09:58 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -40,7 +40,7 @@ #include <time.h> #include <term.h> /* exit_ca_mode, non_rev_rmcup */ -MODULE_ID("$From: lib_screen.c,v 1.13 1998/07/25 20:10:48 tom Exp $") +MODULE_ID("$From: lib_screen.c,v 1.14 1999/01/02 22:56:17 tom Exp $") static time_t dumptime; @@ -168,10 +168,8 @@ int scr_init(const char *file) T((T_CALLED("scr_init(%s)"), _nc_visbuf(file))); -#ifdef exit_ca_mode if (exit_ca_mode && non_rev_rmcup) returnCode(ERR); -#endif /* exit_ca_mode */ if (_nc_access(file, R_OK) < 0 || (fp = fopen(file, "rb")) == 0) diff --git a/lib/libcurses/lib_scroll.c b/lib/libcurses/base/lib_scroll.c index 05ffed4402f..2742c911734 100644 --- a/lib/libcurses/lib_scroll.c +++ b/lib/libcurses/base/lib_scroll.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_scroll.c,v 1.4 1998/07/23 21:19:20 millert Exp $ */ +/* $OpenBSD: lib_scroll.c,v 1.1 1999/01/18 19:09:58 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_scrollok.c b/lib/libcurses/base/lib_scrollok.c index 45402988e98..927b5495518 100644 --- a/lib/libcurses/lib_scrollok.c +++ b/lib/libcurses/base/lib_scrollok.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_scrollok.c,v 1.1 1998/07/23 21:19:21 millert Exp $ */ +/* $OpenBSD: lib_scrollok.c,v 1.1 1999/01/18 19:09:58 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_scrreg.c b/lib/libcurses/base/lib_scrreg.c index b548918dc99..42a822b5a0d 100644 --- a/lib/libcurses/lib_scrreg.c +++ b/lib/libcurses/base/lib_scrreg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_scrreg.c,v 1.4 1998/07/23 21:19:21 millert Exp $ */ +/* $OpenBSD: lib_scrreg.c,v 1.1 1999/01/18 19:09:58 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_set_term.c b/lib/libcurses/base/lib_set_term.c index b71f60963d0..b08fb6a1af7 100644 --- a/lib/libcurses/lib_set_term.c +++ b/lib/libcurses/base/lib_set_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_set_term.c,v 1.9 1998/11/17 03:16:21 millert Exp $ */ +/* $OpenBSD: lib_set_term.c,v 1.1 1999/01/18 19:09:59 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slk.c b/lib/libcurses/base/lib_slk.c index 8bb4cd3766a..9605d61d9ed 100644 --- a/lib/libcurses/lib_slk.c +++ b/lib/libcurses/base/lib_slk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slk.c,v 1.4 1998/07/23 21:19:24 millert Exp $ */ +/* $OpenBSD: lib_slk.c,v 1.1 1999/01/18 19:09:59 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -43,7 +43,7 @@ #include <ctype.h> #include <term.h> /* num_labels, label_*, plab_norm */ -MODULE_ID("$From: lib_slk.c,v 1.14 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$From: lib_slk.c,v 1.15 1999/01/02 22:56:30 tom Exp $") /* * We'd like to move these into the screen context structure, but cannot, @@ -105,14 +105,9 @@ char *p; SP->_slk->buffer = NULL; SP->_slk->attr = A_STANDOUT; -#ifdef num_labels SP->_slk->maxlab = (num_labels > 0) ? num_labels : MAX_SKEY; SP->_slk->maxlen = (num_labels > 0) ? label_width * label_height : MAX_SKEY_LEN; SP->_slk->labcnt = (SP->_slk->maxlab < MAX_SKEY) ? MAX_SKEY : SP->_slk->maxlab; -#else - SP->_slk->labcnt = SP->_slk->maxlab = MAX_SKEY; - SP->_slk->maxlen = MAX_SKEY_LEN; -#endif /* num_labels */ SP->_slk->ent = typeCalloc(slk_ent, SP->_slk->labcnt); if (SP->_slk->ent == NULL) diff --git a/lib/libcurses/lib_slkatr_set.c b/lib/libcurses/base/lib_slkatr_set.c index 21f8b4e1835..05a3e3469de 100644 --- a/lib/libcurses/lib_slkatr_set.c +++ b/lib/libcurses/base/lib_slkatr_set.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slkatr_set.c,v 1.1 1998/07/23 21:19:25 millert Exp $ */ +/* $OpenBSD: lib_slkatr_set.c,v 1.1 1999/01/18 19:09:59 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slkatrof.c b/lib/libcurses/base/lib_slkatrof.c index fbbde5a21ce..3dcfb708042 100644 --- a/lib/libcurses/lib_slkatrof.c +++ b/lib/libcurses/base/lib_slkatrof.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slkatrof.c,v 1.2 1998/07/23 21:19:25 millert Exp $ */ +/* $OpenBSD: lib_slkatrof.c,v 1.1 1999/01/18 19:10:00 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slkatron.c b/lib/libcurses/base/lib_slkatron.c index a0208c41ad4..e809e6696fa 100644 --- a/lib/libcurses/lib_slkatron.c +++ b/lib/libcurses/base/lib_slkatron.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slkatron.c,v 1.2 1998/07/23 21:19:26 millert Exp $ */ +/* $OpenBSD: lib_slkatron.c,v 1.1 1999/01/18 19:10:01 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slkatrset.c b/lib/libcurses/base/lib_slkatrset.c index c3b7cabf665..7143fff4cb8 100644 --- a/lib/libcurses/lib_slkatrset.c +++ b/lib/libcurses/base/lib_slkatrset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slkatrset.c,v 1.2 1998/07/23 21:19:27 millert Exp $ */ +/* $OpenBSD: lib_slkatrset.c,v 1.1 1999/01/18 19:10:01 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slkattr.c b/lib/libcurses/base/lib_slkattr.c index f509ea6d451..e1252181f34 100644 --- a/lib/libcurses/lib_slkattr.c +++ b/lib/libcurses/base/lib_slkattr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slkattr.c,v 1.2 1998/07/23 21:19:28 millert Exp $ */ +/* $OpenBSD: lib_slkattr.c,v 1.1 1999/01/18 19:10:01 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slkclear.c b/lib/libcurses/base/lib_slkclear.c index 10c655f8eb9..aa28feda10b 100644 --- a/lib/libcurses/lib_slkclear.c +++ b/lib/libcurses/base/lib_slkclear.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slkclear.c,v 1.2 1998/07/23 21:19:29 millert Exp $ */ +/* $OpenBSD: lib_slkclear.c,v 1.1 1999/01/18 19:10:01 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slkcolor.c b/lib/libcurses/base/lib_slkcolor.c index 4f9c356ea56..c0d334600e4 100644 --- a/lib/libcurses/lib_slkcolor.c +++ b/lib/libcurses/base/lib_slkcolor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slkcolor.c,v 1.1 1998/07/23 21:19:31 millert Exp $ */ +/* $OpenBSD: lib_slkcolor.c,v 1.1 1999/01/18 19:10:02 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slkinit.c b/lib/libcurses/base/lib_slkinit.c index 52347c32761..320e581900b 100644 --- a/lib/libcurses/lib_slkinit.c +++ b/lib/libcurses/base/lib_slkinit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slkinit.c,v 1.2 1998/07/23 21:19:31 millert Exp $ */ +/* $OpenBSD: lib_slkinit.c,v 1.1 1999/01/18 19:10:03 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slklab.c b/lib/libcurses/base/lib_slklab.c index 8074b71ad26..0136b16292b 100644 --- a/lib/libcurses/lib_slklab.c +++ b/lib/libcurses/base/lib_slklab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slklab.c,v 1.2 1998/07/23 21:19:32 millert Exp $ */ +/* $OpenBSD: lib_slklab.c,v 1.1 1999/01/18 19:10:03 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slkrefr.c b/lib/libcurses/base/lib_slkrefr.c index d8aa7cd17b5..ab3df3b391e 100644 --- a/lib/libcurses/lib_slkrefr.c +++ b/lib/libcurses/base/lib_slkrefr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slkrefr.c,v 1.2 1998/07/23 21:19:33 millert Exp $ */ +/* $OpenBSD: lib_slkrefr.c,v 1.1 1999/01/18 19:10:03 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -40,7 +40,7 @@ #include <curses.priv.h> #include <term.h> /* num_labels, label_*, plab_norm */ -MODULE_ID("$From: lib_slkrefr.c,v 1.5 1998/04/04 19:08:36 juergen Exp $") +MODULE_ID("$From: lib_slkrefr.c,v 1.6 1999/01/02 22:56:59 tom Exp $") /* * Write the soft labels to the soft-key window. @@ -52,7 +52,6 @@ int i; for (i = 0; i < slk->labcnt; i++) { if (slk->dirty || slk->ent[i].dirty) { if (slk->ent[i].visible) { -#ifdef num_labels if (num_labels > 0 && SLK_STDFMT) { if (i < num_labels) { @@ -61,7 +60,6 @@ int i; } } else -#endif /* num_labels */ { wmove(slk->win,SLK_LINES-1,slk->ent[i].x); if (SP && SP->_slk) @@ -78,7 +76,6 @@ int i; } slk->dirty = FALSE; -#ifdef num_labels if (num_labels > 0) { if (slk->hidden) { @@ -91,7 +88,6 @@ int i; putp(label_on); } } -#endif /* num_labels */ } /* diff --git a/lib/libcurses/lib_slkset.c b/lib/libcurses/base/lib_slkset.c index fa82ddd220b..8d2ae2c403e 100644 --- a/lib/libcurses/lib_slkset.c +++ b/lib/libcurses/base/lib_slkset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slkset.c,v 1.2 1998/07/23 21:19:34 millert Exp $ */ +/* $OpenBSD: lib_slkset.c,v 1.1 1999/01/18 19:10:04 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_slktouch.c b/lib/libcurses/base/lib_slktouch.c index 0b5d15c314a..b7d217fe4c6 100644 --- a/lib/libcurses/lib_slktouch.c +++ b/lib/libcurses/base/lib_slktouch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_slktouch.c,v 1.2 1998/07/23 21:19:35 millert Exp $ */ +/* $OpenBSD: lib_slktouch.c,v 1.1 1999/01/18 19:10:04 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_touch.c b/lib/libcurses/base/lib_touch.c index 9c88adc6ffe..7b223b666d0 100644 --- a/lib/libcurses/lib_touch.c +++ b/lib/libcurses/base/lib_touch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_touch.c,v 1.4 1998/07/23 21:19:37 millert Exp $ */ +/* $OpenBSD: lib_touch.c,v 1.1 1999/01/18 19:10:05 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_ungetch.c b/lib/libcurses/base/lib_ungetch.c index cd962789cff..81b315d6a42 100644 --- a/lib/libcurses/lib_ungetch.c +++ b/lib/libcurses/base/lib_ungetch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_ungetch.c,v 1.2 1998/07/23 21:19:46 millert Exp $ */ +/* $OpenBSD: lib_ungetch.c,v 1.1 1999/01/18 19:10:05 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_vline.c b/lib/libcurses/base/lib_vline.c index e5fdce24359..a36969418d0 100644 --- a/lib/libcurses/lib_vline.c +++ b/lib/libcurses/base/lib_vline.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_vline.c,v 1.2 1998/07/23 21:19:49 millert Exp $ */ +/* $OpenBSD: lib_vline.c,v 1.1 1999/01/18 19:10:05 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_wattroff.c b/lib/libcurses/base/lib_wattroff.c index f8158f98398..cb4bf92b812 100644 --- a/lib/libcurses/lib_wattroff.c +++ b/lib/libcurses/base/lib_wattroff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_wattroff.c,v 1.2 1998/07/23 21:19:50 millert Exp $ */ +/* $OpenBSD: lib_wattroff.c,v 1.1 1999/01/18 19:10:06 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_wattron.c b/lib/libcurses/base/lib_wattron.c index b48573bb2db..cd3c195e120 100644 --- a/lib/libcurses/lib_wattron.c +++ b/lib/libcurses/base/lib_wattron.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_wattron.c,v 1.2 1998/07/23 21:19:51 millert Exp $ */ +/* $OpenBSD: lib_wattron.c,v 1.1 1999/01/18 19:10:06 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_winch.c b/lib/libcurses/base/lib_winch.c index 395527b98f8..8148b890a06 100644 --- a/lib/libcurses/lib_winch.c +++ b/lib/libcurses/base/lib_winch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_winch.c,v 1.1 1998/11/17 03:16:21 millert Exp $ */ +/* $OpenBSD: lib_winch.c,v 1.1 1999/01/18 19:10:06 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_window.c b/lib/libcurses/base/lib_window.c index f4c16a2266a..51f459fb509 100644 --- a/lib/libcurses/lib_window.c +++ b/lib/libcurses/base/lib_window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_window.c,v 1.4 1998/07/23 21:19:52 millert Exp $ */ +/* $OpenBSD: lib_window.c,v 1.1 1999/01/18 19:10:06 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/nc_panel.c b/lib/libcurses/base/nc_panel.c index 755ecb8d326..5900b317c4b 100644 --- a/lib/libcurses/nc_panel.c +++ b/lib/libcurses/base/nc_panel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nc_panel.c,v 1.2 1998/07/23 21:19:55 millert Exp $ */ +/* $OpenBSD: nc_panel.c,v 1.1 1999/01/18 19:10:06 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/resizeterm.c b/lib/libcurses/base/resizeterm.c index 7ecd31ec689..3219be06cf5 100644 --- a/lib/libcurses/resizeterm.c +++ b/lib/libcurses/base/resizeterm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resizeterm.c,v 1.4 1998/10/31 06:30:31 millert Exp $ */ +/* $OpenBSD: resizeterm.c,v 1.1 1999/01/18 19:10:07 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/safe_sprintf.c b/lib/libcurses/base/safe_sprintf.c index dab3c69221d..3e01e47bf16 100644 --- a/lib/libcurses/safe_sprintf.c +++ b/lib/libcurses/base/safe_sprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: safe_sprintf.c,v 1.5 1998/09/13 19:16:30 millert Exp $ */ +/* $OpenBSD: safe_sprintf.c,v 1.1 1999/01/18 19:10:07 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/sigaction.c b/lib/libcurses/base/sigaction.c index c703c9102b3..cfa5db79b70 100644 --- a/lib/libcurses/sigaction.c +++ b/lib/libcurses/base/sigaction.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sigaction.c,v 1.1 1998/07/23 21:20:03 millert Exp $ */ +/* $OpenBSD: sigaction.c,v 1.1 1999/01/18 19:10:07 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/tries.c b/lib/libcurses/base/tries.c index 599f9a8bac9..522bc6542bd 100644 --- a/lib/libcurses/tries.c +++ b/lib/libcurses/base/tries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tries.c,v 1.4 1998/11/17 03:16:22 millert Exp $ */ +/* $OpenBSD: tries.c,v 1.1 1999/01/18 19:10:07 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/wresize.c b/lib/libcurses/base/wresize.c index d904dcca229..47ed197ca62 100644 --- a/lib/libcurses/wresize.c +++ b/lib/libcurses/base/wresize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wresize.c,v 1.7 1998/09/13 19:16:31 millert Exp $ */ +/* $OpenBSD: wresize.c,v 1.1 1999/01/18 19:10:08 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -33,9 +33,8 @@ ****************************************************************************/ #include <curses.priv.h> -#include <term.h> -MODULE_ID("$From: wresize.c,v 1.10 1998/08/15 22:59:39 tom Exp $") +MODULE_ID("$From: wresize.c,v 1.11 1998/10/12 12:24:40 Alexander.V.Lukyanov Exp $") /* * Reallocate a curses WINDOW struct to either shrink or grow to the specified diff --git a/lib/libcurses/curs_addch.3tbl b/lib/libcurses/curs_addch.3tbl index 6dd600b47fd..a6547e7521d 100644 --- a/lib/libcurses/curs_addch.3tbl +++ b/lib/libcurses/curs_addch.3tbl @@ -1,5 +1,5 @@ '\" t -.\" $OpenBSD: curs_addch.3tbl,v 1.6 1998/09/13 19:16:16 millert Exp $ +.\" $OpenBSD: curs_addch.3tbl,v 1.7 1999/01/18 19:07:11 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -29,7 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_addch.3x,v 1.14 1998/08/27 21:21:04 Rick.Ohnemus Exp $ +.\" $From: curs_addch.3x,v 1.15 1998/11/29 01:03:52 Rick.Ohnemus Exp $ .TH curs_addch 3 "" .SH NAME \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR, diff --git a/lib/libcurses/curs_attr.3tbl b/lib/libcurses/curs_attr.3tbl index 4aa58a5a558..2e90f33d9fc 100644 --- a/lib/libcurses/curs_attr.3tbl +++ b/lib/libcurses/curs_attr.3tbl @@ -1,5 +1,5 @@ '\" t -.\" $OpenBSD: curs_attr.3tbl,v 1.6 1998/09/13 19:16:16 millert Exp $ +.\" $OpenBSD: curs_attr.3tbl,v 1.7 1999/01/18 19:07:11 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -29,7 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_attr.3x,v 1.17 1998/08/27 21:21:04 Rick.Ohnemus Exp $ +.\" $From: curs_attr.3x,v 1.19 1998/12/26 19:25:35 tom Exp $ .TH curs_attr 3 "" .SH NAME \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR, @@ -53,8 +53,8 @@ .br \fBint color_set(short color_pair_number, void* opts);\fR .br -\fBint wcolor_set(WINDOW *win, short color_pair_number, - void* opts);\fR +\fBint wcolor_set(WINDOW *win, short color_pair_number,\fR + \fBvoid* opts);\fR .br \fBint standend(void);\fR .br @@ -66,8 +66,8 @@ .br \fBint attr_get(attr_t *attrs, short *pair, void *opts);\fR .br -\fBint wattr_get(WINDOW *win, attr_t *attrs, short *pair, - void *opts);\fR +\fBint wattr_get(WINDOW *win, attr_t *attrs, short *pair,\fR + \fBvoid *opts);\fR .br \fBint attr_off(attr_t attrs, void *opts);\fR .br @@ -81,17 +81,17 @@ .br \fBint wattr_set(WINDOW *win, attr_t attrs, void *opts);\fR .br -\fBint chgat(int n, attr_t attr, short color, - const void *opts)\fR +\fBint chgat(int n, attr_t attr, short color,\fR + \fBconst void *opts)\fR .br -\fBint wchgat(WINDOW *win, int n, attr_t attr, - short color, const void *opts)\fR +\fBint wchgat(WINDOW *win, int n, attr_t attr,\fR + \fBshort color, const void *opts)\fR .br -\fBint mvchgat(int y, int x, int n, attr_t attr, - short color, const void *opts)\fR +\fBint mvchgat(int y, int x, int n, attr_t attr,\fR + \fBshort color, const void *opts)\fR .br -\fBint mvwchgat(WINDOW *win, int y, int x, int n, - attr_t attr, short color, const void *opts)\fR +\fBint mvwchgat(WINDOW *win, int y, int x, int n,\fR + \fBattr_t attr, short color, const void *opts)\fR .br .SH DESCRIPTION These routines manipulate the current attributes of the named window. The @@ -156,7 +156,7 @@ l l . The following macro is the reverse of \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR: .DS C -\fBPAIR_NUMBER(\fIattrs\fR) Returns the pair number associated +\fBPAIR_NUMBER(\fR\fIattrs\fR) Returns the pair number associated with the \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR attribute. .DE diff --git a/lib/libcurses/curs_border.3 b/lib/libcurses/curs_border.3 index 88427015b58..67d6b0dc3a7 100644 --- a/lib/libcurses/curs_border.3 +++ b/lib/libcurses/curs_border.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: curs_border.3,v 1.6 1998/09/13 19:16:17 millert Exp $ +.\" $OpenBSD: curs_border.3,v 1.7 1999/01/18 19:07:12 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -28,7 +28,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_border.3x,v 1.9 1998/03/11 21:12:53 juergen Exp $ +.\" $From: curs_border.3x,v 1.10 1998/12/26 20:07:03 tom Exp $ .TH curs_border 3 "" .SH NAME \fBborder\fR, \fBwborder\fR, \fBbox\fR, @@ -37,12 +37,12 @@ .SH SYNOPSIS \fB#include <curses.h>\fR .br -\fBint border(chtype ls, chtype rs, chtype ts, chtype bs, - chtype tl, chtype tr, chtype bl, chtype br);\fR +\fBint border(chtype ls, chtype rs, chtype ts, chtype bs,\fR + \fBchtype tl, chtype tr, chtype bl, chtype br);\fR .br -\fBint wborder(WINDOW *win, chtype ls, chtype rs, - chtype ts, chtype bs, chtype tl, chtype tr, - chtype bl, chtype br);\fR +\fBint wborder(WINDOW *win, chtype ls, chtype rs,\fR + \fBchtype ts, chtype bs, chtype tl, chtype tr,\fR + \fBchtype bl, chtype br);\fR .br \fBint box(WINDOW *win, chtype verch, chtype horch);\fR .br diff --git a/lib/libcurses/curs_getch.3tbl b/lib/libcurses/curs_getch.3tbl index e24cbcc02ff..5fda56239ab 100644 --- a/lib/libcurses/curs_getch.3tbl +++ b/lib/libcurses/curs_getch.3tbl @@ -1,5 +1,5 @@ '\" t -.\" $OpenBSD: curs_getch.3tbl,v 1.6 1998/09/13 19:16:18 millert Exp $ +.\" $OpenBSD: curs_getch.3tbl,v 1.7 1999/01/18 19:07:12 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -29,7 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_getch.3x,v 1.14 1998/08/27 21:21:04 Rick.Ohnemus Exp $ +.\" $From: curs_getch.3x,v 1.15 1998/11/29 01:04:26 Rick.Ohnemus Exp $ .TH curs_getch 3 "" .SH NAME \fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR, diff --git a/lib/libcurses/curs_inch.3tbl b/lib/libcurses/curs_inch.3tbl index 5dd3525250b..d29aac44a90 100644 --- a/lib/libcurses/curs_inch.3tbl +++ b/lib/libcurses/curs_inch.3tbl @@ -1,5 +1,5 @@ '\" t -.\" $OpenBSD: curs_inch.3tbl,v 1.6 1998/09/13 19:16:19 millert Exp $ +.\" $OpenBSD: curs_inch.3tbl,v 1.7 1999/01/18 19:07:13 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -29,7 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_inch.3x,v 1.10 1998/08/27 21:21:04 Rick.Ohnemus Exp $ +.\" $From: curs_inch.3x,v 1.11 1998/11/29 01:04:34 Rick.Ohnemus Exp $ .TH curs_inch 3 "" .SH NAME \fBinch\fR, \fBwinch\fR, \fBmvinch\fR, \fBmvwinch\fR diff --git a/lib/libcurses/curs_mouse.3tbl b/lib/libcurses/curs_mouse.3tbl index 9ab5ab6a03c..4da4bcdff3b 100644 --- a/lib/libcurses/curs_mouse.3tbl +++ b/lib/libcurses/curs_mouse.3tbl @@ -1,5 +1,5 @@ -'\" t -.\" $OpenBSD: curs_mouse.3tbl,v 1.6 1998/09/13 19:16:20 millert Exp $ +'\" t +.\" $OpenBSD: curs_mouse.3tbl,v 1.7 1999/01/18 19:07:13 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -29,11 +29,12 @@ .\" authorization. * .\"*************************************************************************** .\" -.'" $From: curs_mouse.3x,v 1.9 1998/08/27 21:21:04 Rick.Ohnemus Exp $ +.'" $From: curs_mouse.3x,v 1.12 1999/01/09 22:53:22 tom Exp $ .TH curs_mouse 3 "" .SH NAME -\fBgetmouse\fR, \fBungetmouse\fR, -\fBmousemask\fR - mouse interface through curses +\fBgetmouse\fR, \fBungetmouse\fR, +\fBmousemask\fR, \fBwenclose\fR, +\fBwmouse_trafo\fR, \fBmouseinterval\fR - mouse interface through curses .SH SYNOPSIS .nf \fB#include <curses.h>\fR @@ -55,9 +56,11 @@ MEVENT;\fR .br \fBmmask_t mousemask(mmask_t newmask, mmask_t *oldmask);\fR .br -\fBbool wenclose(WINDOW *win, int y, int x)\fR +\fBbool wenclose(WINDOW *win, int y, int x);\fR .br -\fBint mouseinterval(int erval)\fR +\fBbool wmouse_trafo(const WINDOW* win, int* pY, int* pX, bool to_screen);\fR +.br +\fBint mouseinterval(int erval);\fR .br .SH DESCRIPTION These functions provide an interface to mouse events from @@ -82,23 +85,23 @@ l l _ _ l l. \fIName\fR \fIDescription\fR -BUTTON1_PRESSED mouse button 1 down -BUTTON1_RELEASED mouse button 1 up +BUTTON1_PRESSED mouse button 1 down +BUTTON1_RELEASED mouse button 1 up BUTTON1_CLICKED mouse button 1 clicked BUTTON1_DOUBLE_CLICKED mouse button 1 double clicked BUTTON1_TRIPLE_CLICKED mouse button 1 triple clicked -BUTTON2_PRESSED mouse button 2 down -BUTTON2_RELEASED mouse button 2 up +BUTTON2_PRESSED mouse button 2 down +BUTTON2_RELEASED mouse button 2 up BUTTON2_CLICKED mouse button 2 clicked BUTTON2_DOUBLE_CLICKED mouse button 2 double clicked BUTTON2_TRIPLE_CLICKED mouse button 2 triple clicked -BUTTON3_PRESSED mouse button 3 down -BUTTON3_RELEASED mouse button 3 up +BUTTON3_PRESSED mouse button 3 down +BUTTON3_RELEASED mouse button 3 up BUTTON3_CLICKED mouse button 3 clicked BUTTON3_DOUBLE_CLICKED mouse button 3 double clicked BUTTON3_TRIPLE_CLICKED mouse button 3 triple clicked -BUTTON4_PRESSED mouse button 4 down -BUTTON4_RELEASED mouse button 4 up +BUTTON4_PRESSED mouse button 4 down +BUTTON4_RELEASED mouse button 4 up BUTTON4_CLICKED mouse button 4 clicked BUTTON4_DOUBLE_CLICKED mouse button 4 double clicked BUTTON4_TRIPLE_CLICKED mouse button 4 triple clicked @@ -129,6 +132,25 @@ character-cell coordinates is enclosed by a given window, returning TRUE if it is and FALSE otherwise. It is useful for determining what subset of the screen windows enclose the location of a mouse event. +The \fBwmouse_trafo\fR function transforms a given pair of coordinates from +stdscr-relative coordinates to screen-relative coordinates or vice versa. +Please remember, that stdscr-relative coordinates are not always identical +to screen-relative coordinates due to the mechanism to reserve lines on top +or bottom of the screen for other purposes (ripoff() call, see also slk_... +functions). If the parameter \fBto_screen\fR is \fBTRUE\fR, the pointers +\fBpY, pX\fR must reference the coordinates of a location inside the window +\fBwin\fR. They are converted to screen-relative coordinates and returned +through the pointers. If the conversion was successful, the function +returns \fBTRUE\fR. If one of the parameters was NULL or the location is +not inside the window, \fBFALSE\fR is returned. If \fBto_screen\fR is +\fBFALSE\fR, the pointers \fBpY, pX\fR must reference screen-relative +coordinates. They are converted to stdscr-relative coordinates if the +window \fBwin\fR encloses this point. In this case the function returns +\fBTRUE\fR. If one of the parameters is NULL or the point is not inside the +window, \fBFALSE\fR is returned. Please notice, that the referenced coordinates +are only replaced by the converted coordinates if the transformation was +successful. + The \fBmouseinterval\fR function sets the maximum time (in thousands of a second) that can elapse between press and release events in order for them to be recognized as a click. This function returns the previous interval value. @@ -140,8 +162,12 @@ function such as \fBgetstr\fR that expects a linefeed for input-loop termination. .SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure or \fBOK\fR -upon successful completion. +\fBgetmouse\fR, \fBungetmouse\fR and \fBmouseinterval\fR +return the integer \fBERR\fR upon failure or \fBOK\fR +upon successful completion. \fBmousemask\fR returns the +mask of reportable events. \fBwenclose\fR and \fBwmouse_trafo\fR +are boolean functions returning \fBTRUE\fR or \fBFALSE\fR depending +on their test result. .SH PORTABILITY These calls were designed for \fBncurses\fR, and are not found in SVr4 curses, 4.4BSD curses, or any other previous version of curses. @@ -152,7 +178,7 @@ THIS INTERFACE IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE! If the interface is changed, the value of \fBNCURSES_MOUSE_VERSION\fR will be incremented. -The order of the \fBMEVENT\fR structure members is not guaranteed. +The order of the \fBMEVENT\fR structure members is not guaranteed. Additional fields may be added to the structure in the future. Under \fBncurses\fR, these calls are implemented using either diff --git a/lib/libcurses/curs_outopts.3 b/lib/libcurses/curs_outopts.3 index 00306deba86..b164824f51b 100644 --- a/lib/libcurses/curs_outopts.3 +++ b/lib/libcurses/curs_outopts.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: curs_outopts.3,v 1.6 1998/09/13 19:16:21 millert Exp $ +.\" $OpenBSD: curs_outopts.3,v 1.7 1999/01/18 19:07:14 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -28,7 +28,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_outopts.3x,v 1.12 1998/03/21 22:56:02 jtc Exp $ +.\" $From: curs_outopts.3x,v 1.13 1998/12/26 20:02:04 tom Exp $ .TH curs_outopts 3 "" .SH NAME \fBclearok\fR, \fBidlok\fR, \fBidcok immedok\fR, @@ -120,7 +120,7 @@ also necessary to call \fBidlok\fR). The \fBnl\fR and \fBnonl\fR routines control whether the underlying display device translates the return key into newline on input, and whether it translates newline into return and line-feed on output (in either case, the -call \fBaddch('\n')\fR does the equivalent of return and line feed on the +call \fBaddch('\\n')\fR does the equivalent of return and line feed on the virtual screen). Initially, these translations do occur. If you disable them using \fBnonl\fR, \fBcurses\fR will be able to make better use of the line-feed capability, resulting in faster cursor motion. Also, \fBcurses\fR will then be diff --git a/lib/libcurses/curs_overlay.3 b/lib/libcurses/curs_overlay.3 index 5c43788942e..21daa9c2116 100644 --- a/lib/libcurses/curs_overlay.3 +++ b/lib/libcurses/curs_overlay.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: curs_overlay.3,v 1.5 1998/09/13 19:16:21 millert Exp $ +.\" $OpenBSD: curs_overlay.3,v 1.6 1999/01/18 19:07:14 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -28,7 +28,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_overlay.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ +.\" $From: curs_overlay.3x,v 1.8 1998/12/26 20:08:30 tom Exp $ .TH curs_overlay 3 "" .SH NAME \fBoverlay\fR, \fBoverwrite\fR, \fBcopywin\fR - overlay and @@ -40,9 +40,9 @@ manipulate overlapped \fBcurses\fR windows .br \fBint overwrite(const WINDOW *srcwin, WINDOW *dstwin);\fR .br -\fBint copywin(WINDOW *srcwin, WINDOW *dstwin, int sminrow, - int smincol, int dminrow, int dmincol, int dmaxrow, - int dmaxcol, int overlay);\fR +\fBint copywin(WINDOW *srcwin, WINDOW *dstwin, int sminrow,\fR + \fBint smincol, int dminrow, int dmincol, int dmaxrow,\fR + \fBint dmaxcol, int overlay);\fR .SH DESCRIPTION The \fBoverlay\fR and \fBoverwrite\fR routines overlay \fIsrcwin\fR on top of \fIdstwin\fR. \fIscrwin\fR and \fIdstwin\fR are not required diff --git a/lib/libcurses/curs_pad.3 b/lib/libcurses/curs_pad.3 index 1a43e5ffd60..4f81f8ae486 100644 --- a/lib/libcurses/curs_pad.3 +++ b/lib/libcurses/curs_pad.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: curs_pad.3,v 1.5 1998/09/13 19:16:21 millert Exp $ +.\" $OpenBSD: curs_pad.3,v 1.6 1999/01/18 19:07:15 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -28,7 +28,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_pad.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ +.\" $From: curs_pad.3x,v 1.8 1998/12/26 20:09:03 tom Exp $ .TH curs_pad 3 "" .SH NAME \fBnewpad\fR, \fBsubpad\fR, \fBprefresh\fR, @@ -39,14 +39,14 @@ pads \fBWINDOW *newpad(int nlines, int ncols);\fR .br -\fBWINDOW *subpad(WINDOW *orig, int nlines, int ncols, - int begin_y, int begin_x);\fR +\fBWINDOW *subpad(WINDOW *orig, int nlines, int ncols,\fR + \fBint begin_y, int begin_x);\fR .br -\fBint prefresh(WINDOW *pad, int pminrow, int pmincol, - int sminrow, int smincol, int smaxrow, int smaxcol);\fR +\fBint prefresh(WINDOW *pad, int pminrow, int pmincol,\fR + \fBint sminrow, int smincol, int smaxrow, int smaxcol);\fR .br -\fBint pnoutrefresh(WINDOW *pad, int pminrow, int pmincol, - int sminrow, int smincol, int smaxrow, int smaxcol);\fR +\fBint pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,\fR + \fBint sminrow, int smincol, int smaxrow, int smaxcol);\fR .br \fBint pechochar(WINDOW *pad, chtype ch);\fR .SH DESCRIPTION diff --git a/lib/libcurses/curs_printw.3 b/lib/libcurses/curs_printw.3 index 58577df8181..e1ae42b529e 100644 --- a/lib/libcurses/curs_printw.3 +++ b/lib/libcurses/curs_printw.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: curs_printw.3,v 1.7 1998/09/13 19:16:22 millert Exp $ +.\" $OpenBSD: curs_printw.3,v 1.8 1999/01/18 19:07:15 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -28,7 +28,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_printw.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ +.\" $From: curs_printw.3x,v 1.8 1998/12/26 20:09:36 tom Exp $ .TH curs_printw 3 "" .SH NAME \fBprintw\fR, \fBwprintw\fR, \fBmvprintw\fR, @@ -43,7 +43,7 @@ .br \fBint mvprintw(int y, int x, char *fmt\fR [\fB, arg\fR] \fB...);\fR .br -\fBint mvwprintw(WINDOW *win, int y, int x, +\fBint mvwprintw(WINDOW *win, int y, int x,\fR \fBchar *fmt\fR [\fB, arg]\fR ...); \fB#include <varargs.h>\fR diff --git a/lib/libcurses/curs_scanw.3 b/lib/libcurses/curs_scanw.3 index 09792b77f89..55bf063c8e5 100644 --- a/lib/libcurses/curs_scanw.3 +++ b/lib/libcurses/curs_scanw.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: curs_scanw.3,v 1.6 1998/09/13 19:16:22 millert Exp $ +.\" $OpenBSD: curs_scanw.3,v 1.7 1999/01/18 19:07:16 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -28,7 +28,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_scanw.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ +.\" $From: curs_scanw.3x,v 1.8 1998/12/26 20:10:12 tom Exp $ .TH curs_scanw 3 "" .SH NAME \fBscanw\fR, \fBwscanw\fR, \fBmvscanw\fR, @@ -43,8 +43,8 @@ .br \fBint mvscanw(int y, int x, char *fmt\fR [\fB, arg\fR] \fB...);\fR .br -\fBint mvwscanw(WINDOW *win, int y, int x, - char *fmt\fR [\fB, arg]\fR \fB...);\fR +\fBint mvwscanw(WINDOW *win, int y, int x,\fR + \fBchar *fmt\fR [\fB, arg]\fR \fB...);\fR .br \fBint vwscanw(WINDOW *win, char *fmt, va_list varglist);\fR .SH DESCRIPTION diff --git a/lib/libcurses/curs_window.3 b/lib/libcurses/curs_window.3 index 4ce91b57dc7..6f1efc039a7 100644 --- a/lib/libcurses/curs_window.3 +++ b/lib/libcurses/curs_window.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: curs_window.3,v 1.5 1998/09/13 19:16:23 millert Exp $ +.\" $OpenBSD: curs_window.3,v 1.6 1999/01/18 19:07:16 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -28,7 +28,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_window.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ +.\" $From: curs_window.3x,v 1.7 1998/12/26 20:11:01 tom Exp $ .TH curs_window 3 "" .SH NAME \fBnewwin\fR, \fBdelwin\fR, \fBmvwin\fR, @@ -45,11 +45,11 @@ create \fBcurses\fR windows .br \fBint mvwin(WINDOW *win, int y, int x);\fR .br -\fBWINDOW *subwin(WINDOW *orig, int nlines, int ncols, - int begin_y, int begin_x);\fR +\fBWINDOW *subwin(WINDOW *orig, int nlines, int ncols,\fR + \fBint begin_y, int begin_x);\fR .br -\fBWINDOW *derwin(WINDOW *orig, int nlines, int ncols, - int begin_y, int begin_x);\fR +\fBWINDOW *derwin(WINDOW *orig, int nlines, int ncols,\fR + \fBint begin_y, int begin_x);\fR .br \fBint mvderwin(WINDOW *win, int par_y, int par_x);\fR .br diff --git a/lib/libcurses/curses.3tbl b/lib/libcurses/curses.3tbl index c8f0907f003..de9b1626bd3 100644 --- a/lib/libcurses/curses.3tbl +++ b/lib/libcurses/curses.3tbl @@ -1,5 +1,5 @@ '\" t -.\" $OpenBSD: curses.3tbl,v 1.8 1998/09/13 19:16:24 millert Exp $ +.\" $OpenBSD: curses.3tbl,v 1.9 1999/01/18 19:07:17 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -29,7 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: ncurses.3x,v 1.25 1998/08/27 21:21:04 Rick.Ohnemus Exp $ +.\" $From: ncurses.3x,v 1.33 1999/01/07 23:22:30 juergen Exp $ .TH ncurses 3 "" .ds n 5 .ds d /usr/share/terminfo @@ -124,7 +124,7 @@ If the environment variables \fBLINES\fR and \fBCOLUMNS\fR are set, or if the program is executing in a window environment, line and column information in the environment will override information read by \fIterminfo\fR. This would effect a program running in an AT&T 630 layer, for example, where the size of a -screen is changeable. +screen is changeable (see \fBENVIRONMENT\fR). If the environment variable \fBTERMINFO\fR is defined, any program using \fBcurses\fR checks for a local terminal definition before checking in the @@ -198,6 +198,10 @@ addch/\fBcurs_addch\fR(3) addchnstr/\fBcurs_addchstr\fR(3) addchstr/\fBcurs_addchstr\fR(3) addnstr/\fBcurs_addstr\fR(3) +attr_get/\fBcurs_attr\fR(3) +attr_off/\fBcurs_attr\fR(3) +attr_on/\fBcurs_attr\fR(3) +attr_set/\fBcurs_attr\fR(3) addstr/\fBcurs_addstr\fR(3) attroff/\fBcurs_attr\fR(3) attron/\fBcurs_attr\fR(3) @@ -210,6 +214,7 @@ border/\fBcurs_border\fR(3) box/\fBcurs_border\fR(3) can_change_color/\fBcurs_color\fR(3) cbreak/\fBcurs_inopts\fR(3) +chgat/\fBcurs_attr\fR(3) clear/\fBcurs_clear\fR(3) clearok/\fBcurs_outopts\fR(3) clrtobot/\fBcurs_clear\fR(3) @@ -239,9 +244,11 @@ filter/\fBcurs_util\fR(3) flash/\fBcurs_beep\fR(3) flushinp/\fBcurs_util\fR(3) getbegyx/\fBcurs_getyx\fR(3) +getbkgd/\fBcurs_bkgd\fR(3) getch/\fBcurs_getch\fR(3) getmaxyx/\fBcurs_getyx\fR(3) getmouse/\fBcurs_mouse\fR(3)* +getnstr/\fBcurs_getstr\fR(3) getparyx/\fBcurs_getyx\fR(3) getstr/\fBcurs_getstr\fR(3) getsyx/\fBcurs_kernel\fR(3) @@ -289,11 +296,14 @@ mvaddchnstr/\fBcurs_addchstr\fR(3) mvaddchstr/\fBcurs_addchstr\fR(3) mvaddnstr/\fBcurs_addstr\fR(3) mvaddstr/\fBcurs_addstr\fR(3) +mvchgat/\fBcurs_attr\fR(3) mvcur/\fBterminfo\fR(3) mvdelch/\fBcurs_delch\fR(3) mvderwin/\fBcurs_window\fR(3) mvgetch/\fBcurs_getch\fR(3) +mvgetnstr/\fBcurs_getstr\fR(3) mvgetstr/\fBcurs_getstr\fR(3) +mvhline/\fBcurs_border\fR(3) mvinch/\fBcurs_inch\fR(3) mvinchnstr/\fBcurs_inchstr\fR(3) mvinchstr/\fBcurs_inchstr\fR(3) @@ -309,9 +319,12 @@ mvwaddchnstr/\fBcurs_addchstr\fR(3) mvwaddchstr/\fBcurs_addchstr\fR(3) mvwaddnstr/\fBcurs_addstr\fR(3) mvwaddstr/\fBcurs_addstr\fR(3) +mvwchgat/\fBcurs_attr\fR(3) mvwdelch/\fBcurs_delch\fR(3) mvwgetch/\fBcurs_getch\fR(3) +mvwgetnstr/\fBcurs_getstr\fR(3) mvwgetstr/\fBcurs_getstr\fR(3) +mvwhline/\fBcurs_border\fR(3) mvwin/\fBcurs_window\fR(3) mvwinch/\fBcurs_inch\fR(3) mvwinchnstr/\fBcurs_inchstr\fR(3) @@ -323,6 +336,7 @@ mvwinsstr/\fBcurs_insstr\fR(3) mvwinstr/\fBcurs_instr\fR(3) mvwprintw/\fBcurs_printw\fR(3) mvwscanw/\fBcurs_scanw\fR(3) +mvwvline/\fBcurs_border\fR(3) napms/\fBcurs_kernel\fR(3) newpad/\fBcurs_pad\fR(3) newterm/\fBcurs_initscr\fR(3) @@ -370,6 +384,9 @@ setsyx/\fBcurs_kernel\fR(3) setterm/\fBterminfo\fR(3) setupterm/\fBterminfo\fR(3) slk_attr/\fBcurs_slk\fR(3)* +slk_attr_off/\fBcurs_slk\fR(3) +slk_attr_on/\fBcurs_slk\fR(3) +slk_attr_set/\fBcurs_slk\fR(3) slk_attroff/\fBcurs_slk\fR(3) slk_attron/\fBcurs_slk\fR(3) slk_attrset/\fBcurs_slk\fR(3) @@ -414,6 +431,8 @@ use_env/\fBcurs_util\fR(3) vidattr/\fBterminfo\fR(3) vidputs/\fBterminfo\fR(3) vline/\fBcurs_border\fR(3) +vw_printw/\fBcurs_printw\fR(3) +vw_scanw/\fBcurs_scanw\fR(3) vwprintw/\fBcurs_printw\fR(3) vwscanw/\fBcurs_scanw\fR(3) waddch/\fBcurs_addch\fR(3) @@ -421,12 +440,17 @@ waddchnstr/\fBcurs_addchstr\fR(3) waddchstr/\fBcurs_addchstr\fR(3) waddnstr/\fBcurs_addstr\fR(3) waddstr/\fBcurs_addstr\fR(3) +wattr_get/\fBcurs_attr\fR(3) +wattr_off/\fBcurs_attr\fR(3) +wattr_on/\fBcurs_attr\fR(3) +wattr_set/\fBcurs_attr\fR(3) wattroff/\fBcurs_attr\fR(3) wattron/\fBcurs_attr\fR(3) wattrset/\fBcurs_attr\fR(3) wbkgd/\fBcurs_bkgd\fR(3) wbkgdset/\fBcurs_bkgd\fR(3) wborder/\fBcurs_border\fR(3) +wchgat/\fBcurs_attr\fR(3) wclear/\fBcurs_clear\fR(3) wclrtobot/\fBcurs_clear\fR(3) wclrtoeol/\fBcurs_clear\fR(3) @@ -451,6 +475,7 @@ winsertln/\fBcurs_deleteln\fR(3) winsnstr/\fBcurs_insstr\fR(3) winsstr/\fBcurs_insstr\fR(3) winstr/\fBcurs_instr\fR(3) +wmouse_trafo/\fBcurs_mouse\fR(3) wmove/\fBcurs_move\fR(3) wnoutrefresh/\fBcurs_refresh\fR(3) wprintw/\fBcurs_printw\fR(3) @@ -480,39 +505,228 @@ values of \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and right-hand side of assignment statements). Routines that return pointers return \fBNULL\fR on error. +.SH ENVIRONMENT +The following environment symbols are useful for customizing the +runtime behavior of the \fBcurses\fR library. The most important +ones have been already discussed in detail. +.TP 5 +BAUDRATE +The debugging library checks this environment symbol when the application +has redirected output to a file. +The symbol's numeric value is used for the baudrate. +If no value is found \fBcurses\fR uses 9600. +This allows testers to construct repeatable test-cases +that take into account costs that depend on baudrate. +.TP 5 +CC +When set, change occurrences of the command_character +(i.e., the \fBcmdch\fP capability) +of the loaded terminfo entries to the value of this symbol. +Very few terminfo entries provide this feature. +.TP 5 +COLUMNS +Specify the width of the screen in characters. +Applications running in a windowing environment usually are able to +obtain the width of the window in which they are executing. +If neither the $COLUMNS value nor the terminal's screen size is available, +\fBcurses\fR uses the size which may be specified in the terminfo database +(i.e., the \fBcols\fR capability). + +It is important that your application use a correct size for the screen. +However, this is not always possible because your application may be +running on a host which does not honor NAWS (Negotiations About Window +Size), or because you are temporarily running as another user. + +Either COLUMNS or LINES symbols may be specified independently. +This is mainly useful to circumvent legacy misfeatures of terminal descriptions, +e.g., xterm which commonly specifies a 65 line screen. +For best results, \fBlines\fR and \fBcols\fR should not be specified in +a terminal description for terminals which are run as emulations. + +Use the \fBuse_env\fR function to disable this feature. +.TP 5 +ESCDELAY +Specifies the total time, in milliseconds, for which curses will +await a character sequence, e.g., a function key. +The default value, 1000 milliseconds, is enough for most uses. +However, it is made a variable to accommodate unusual applications. + +The most common instance where you may wish to change this value +is to work with slow hosts, e.g., running on a network. +If the host cannot read characters rapidly enough, it will have the same +effect as if the terminal did not send characters rapidly enough. +The library will still see a timeout. + +Note that xterm mouse events are built up from character sequences +received from the xterm. +If your application makes heavy use of multiple-clicking, you may +wish to lengthen this default value because the timeout applies +to the composed multi-click event as well as the individual clicks. +.TP 5 +HOME +Tells \fBcurses\fR where your home directory is. +That is where it may read and write auxiliary terminal descriptions: + +$HOME/.termcap +.br +$HOME/.terminfo +.TP 5 +LINES +Like COLUMNS, specify the height of the screen in characters. +See COLUMNS for a detailed description. +.TP 5 +MOUSE_BUTTONS_123 +This applies only to the OS/2 EMX port. +It specifies the order of buttons on the mouse. +OS/2 numbers a 3-button mouse inconsistently from other +platforms: + +1 = left +.br +2 = right +.br +3 = middle. + +This symbol lets you customize the mouse. +The symbol must be three numeric digits 1-3 in any order, e.g., 123 or 321. +If it is not specified, \fBcurses\fR uses 132. +.TP 5 +NCURSES_NO_PADDING +Most of the terminal descriptions in the terminfo database are written +for real "hardware" terminals. +Many people use terminal emulators +which run in a windowing environment and use curses-based applications. +Terminal emulators can duplicate +all of the important aspects of a hardware terminal, but they do not +have the same limitations. +The chief limitation of a hardware terminal from the standpoint +of your application is the management of dataflow, i.e., timing. +Unless a hardware terminal is interfaced into a terminal concentrator +(which does flow control), +it (or your application) must manage dataflow, preventing overruns. +The cheapest solution (no hardware cost) +is for your program to do this by pausing after +operations that the terminal does slowly, such as clearing the display. + +As a result, many terminal descriptions (including the vt100) +have delay times embedded. You may wish to use these descriptions, +but not want to pay the performance penalty. + +Set the NCURSES_NO_PADDING symbol to disable all but mandatory +padding. Mandatory padding is used as a part of special control +sequences such as \fIflash\fR. +.TP 5 +NCURSES_NO_SETBUF +Normally \fBcurses\fR enables buffered output during terminal initialization. +This is done (as in SVr4 curses) for performance reasons. +For testing purposes, both of \fBcurses\fR and certain applications, +this feature is made optional. Setting the NCURSES_NO_SETBUF variable +disables output buffering, leaving the output in the original (usually +line buffered) mode. +.TP 5 +NCURSES_TRACE +During initialization, the \fBcurses\fR debugging library +checks the NCURSES_TRACE symbol. +If it is defined, to a numeric value, \fBcurses\fR calls the \fBtrace\fR +function, using that value as the argument. + +The argument values, which are defined in \fBcurses.h\fR, provide several +types of information. +When running with traces enabled, your application will write the +file \fBtrace\fR to the current directory. +.TP 5 +TERM +Denotes your terminal type. +Each terminal type is distinct, though many are similar. +.TP 5 +TERMCAP +If the \fBcurses\fR library has been configured with \fItermcap\fR +support, \fBcurses\fR will check for a terminal's description in +termcap form if it is not available in the terminfo database. + +The TERMCAP symbol contains either a terminal description (with +newlines stripped out), +or a file name telling where the information denoted by the TERM symbol exists. +In either case, setting it directs \fBcurses\fR to ignore +the usual place for this information, e.g., /etc/termcap. +.TP 5 +TERMINFO +Overrides the directory in which \fBcurses\fR searches for your terminal +description. +This is the simplest, but not the only way to change the list of directories. +The complete list of directories in order follows: +.RS +.TP 3 +- +the last directory to which \fBcurses\fR wrote, if any, is searched first. +.TP 3 +- +the directory specified by the TERMINFO symbol +.TP 3 +- +$HOME/.terminfo +.TP 3 +- +directories listed in the TERMINFO_DIRS symbol +.TP 3 +- +one or more directories whose names are configured and compiled into the +curses library, e.g., +/usr/share/terminfo +.RE +.TP 5 +TERMINFO_DIRS +Specifies a list of directories to search for terminal descriptions. +The list is separated by colons (i.e., ":"). +All of the terminal descriptions are in terminfo form, which makes +a subdirectory named for the first letter of the terminal names therein. +.TP 5 +TERMPATH +If TERMCAP does not hold a file name then \fBcurses\fR checks +the TERMPATH symbol. +This is a list of filenames separated by colons (i.e., ":"). +If the TERMPATH symbol is not set, \fBcurses\fR looks in the files +/etc/termcap, /usr/share/termcap and $HOME/.termcap, in that order. +.SH FILES +.TP 5 +/usr/share/tabset +directory containing initialization files for the terminal capability database +/usr/share/terminfo +terminal capability database .SH SEE ALSO -\fBterminfo\fR(\*n) and 3X pages whose names begin "curs_" for detailed routine +\fBterminfo\fR(\*n) and 3 pages whose names begin "curs_" for detailed routine descriptions. .SH EXTENSIONS -The \fBcurses\fR library can be compiled with an option (\fB-DTERMCAP_FILE\fR) +The \fBcurses\fR library can be compiled with an option (\fB-DUSE_GETCAP\fR) that falls back to the old-style /etc/termcap file if the terminal setup code cannot find a terminfo entry corresponding to \fBTERM\fR. Use of this feature is not recommended, as it essentially includes an entire termcap compiler in the \fBcurses\fR startup code, at significant cost in core and startup cycles. -Compiling with \fB-DTERMCAP_FILE\fR changes the library's initialization -sequence in a way intended to mimic the behavior of 4.4BSD curses. If there is -no local or system terminfo entry matching \fBTERM\fR, then the library looks -for termcap entries in the following places: (1) if \fBTERMINFO\fR is -undefined, in the file named by \fBTERMCAP_FILE\fR; (2) if \fBTERMINFO\fR is -defined and begins with a slash, it is interpreted as the name of a termcap -file to search for \fBTERM\fR; (3) otherwise, if \fBTERMINFO\fR has a leading -string that looks like a terminal entry name list, and it matches \fBTERM\fR, -the contents of \fBTERMINFO\fR is interpreted as a termcap; (4) if -\fBTERMINFO\fR looks like a termcap but doesn't match \fBTERM\fR, the termcap -file is searched for among the colon-separated paths in the environment -variable \fBTERMPATHS\fR if that is defined, and in ~/.termcap and the file -value of \fBTERMCAP_FILE\fR otherwise. - -Versions of \fBcurses\fR compiled on PC clones support display of the PC ROM -characters (including ROM characters 0-31, which stock SVr4 curses cannot -display). See the EXTENSIONS sections of \fBcurs_addch\fR(3) and -\fBcurs_attr\fR(3). - The \fBcurses\fR library includes facilities for capturing mouse events on certain terminals (including xterm). See the \fBcurs_mouse\fR(3) manual page for details. +The \fBcurses\fR library includes facilities for responding to window +resizing events, e.g., when running in an xterm. +See the \fBresizeterm\fR(3) +and \fBwresize\fR(3) manual pages for details. +In addition, the library may be configured with a SIGWINCH handler. + +The \fBcurses\fR library extends the fixed set of function key capabilities +of terminals by allowing the application designer to define additional +key sequences at runtime. +See the \fBdefine_key\fR(3) +and \fBkeyok\fR(3) manual pages for details. + +The \fBcurses\fR library can exploit the capabilities of terminals which +implement the ISO-6429 SGR 39 and SGR 49 controls, which allow an application +to reset the terminal to its original foreground and background colors. +From the users' perspective, the application is able to draw colored +text on a background whose color is set independently, providing better +control over color contrasts. +See the \fBuse_default_colors\fR(3) manual page for details. + The \fBcurses\fR library includes a function for directing application output to a printer attached to the terminal device. See the \fBcurs_print\fR(3) manual page for details. @@ -521,91 +735,113 @@ The \fBcurses\fR library is intended to be BASE-level conformant with the XSI Curses standard. Certain portions of the EXTENDED XSI Curses functionality (including color support) are supported. The following EXTENDED XSI Curses calls in support of wide (multibyte) characters are not yet implemented: -\fBaddnwstr\fB, -\fBaddwstr\fB, -\fBmvaddnwstr\fB, -\fBmvwaddnwstr\fB, -\fBmvaddwstr\fB, -\fBwaddnwstr\fB, -\fBwaddwstr\fB, -\fBadd_wch\fB, -\fBwadd_wch\fB, -\fBmvadd_wch\fB, -\fBmvwadd_wch\fB, -\fBadd_wchnstr\fB, -\fBadd_wchstr\fB, -\fBwadd_wchnstr\fB, -\fBwadd_wchstr\fB, -\fBmvadd_wchnstr\fB, -\fBmvadd_wchstr\fB, -\fBmvwadd_wchnstr\fB, -\fBmvwadd_wchstr\fB, -\fBbkgrndset\fB, -\fBbkgrnd\fB, -\fBgetbkgrnd\fB, -\fBwbkgrnd\fB, -\fBwbkgrndset\fB, -\fBwgetbkgrnd\fB, -\fBborder_set\fB, -\fBwborder_set\fB, -\fBbox_set\fB, -\fBhline_set\fB, -\fBmvhline_set\fB, -\fBmvvline_set\fB, -\fBmvwhline_set\fB, -\fBmvwvline_set\fB, -\fBwhline_set\fB, -\fBvhline_set\fB, -\fBwvline_set\fB, -\fBecho_wchar\fB, -\fBwecho_wchar\fB, -\fBerasewchar\fB, -\fBkillwchar\fB, -\fBget_wch\fB, -\fBmvget_wch\fB, -\fBmvwget_ch\fB, -\fBwget_wch\fB, -\fBgetwchtype\fB, -\fBget_wstr\fB, -\fBgetn_wstr\fB, -\fBwget_wstr\fB, -\fBwgetn_wstr\fB, -\fBmvget_wstr\fB, -\fBmvgetn_wstr\fB, -\fBmvwget_wstr\fB, -\fBmvwgetn_wstr\fB, -\fBinnwstr\fB, -\fBinwstr\fB, -\fBwinnwstr\fB, -\fBwinwstr\fB, -\fBmvinnwstr\fB, -\fBmvinwstr\fB, -\fBmvwinnwstr\fB, -\fBmvwinwstr\fB, -\fBins_nwstr\fB, -\fBins_wstr\fB, -\fBmvins_nwstr\fB, -\fBmvins_wstr\fB, -\fBmvwins_nwstr\fB, -\fBmvwins_wstr\fB, -\fBwins_nwstr\fB, -\fBwins_wstr\fB, -\fBins_wch\fB, -\fBwins_wch\fB, -\fBmvins_wch\fB, -\fBmvwins_wch\fB, -\fBin_wch\fB, -\fBwin_wch\fB, -\fBmvin_wch\fB, -\fBmvwin_wch\fB, -\fBinwchstr\fB, -\fBinwchnstr\fB, -\fBwinwchstr\fB, -\fBwinwchnstr\fB, -\fBmvinwchstr\fB, -\fBmvinwchnstr\fB, -\fBmvinwchstr\fB, -\fBmvwinwchnstr\fB. +\fBadd_wch\fP, +\fBadd_wchnstr\fP, +\fBadd_wchstr\fP, +\fBaddnwstr\fP, +\fBaddwstr\fP, +\fBbkgrnd\fP, +\fBbkgrndset\fP, +\fBborder_set\fP, +\fBbox_set\fP, +\fBecho_wchar\fP, +\fBerasewchar\fP, +\fBget_wch\fP, +\fBget_wstr\fP, +\fBgetbkgrnd\fP, +\fBgetcchar\fP, +\fBgetn_wstr\fP, +\fBgetwchtype\fP, +\fBhline_set\fP, +\fBin_wch\fP, +\fBin_wchnstr\fP, +\fBin_wchstr\fP, +\fBinnwstr\fP, +\fBins_nwstr\fP, +\fBins_wch\fP, +\fBins_wstr\fP, +\fBinwchnstr\fP, +\fBinwchstr\fP, +\fBinwstr\fP, +\fBkey_name\fP, +\fBkillwchar\fP, +\fBmvadd_wch\fP, +\fBmvadd_wchnstr\fP, +\fBmvadd_wchstr\fP, +\fBmvaddnwstr\fP, +\fBmvaddwstr\fP, +\fBmvget_wch\fP, +\fBmvget_wstr\fP, +\fBmvgetn_wstr\fP, +\fBmvhline_set\fP, +\fBmvin_wch\fP, +\fBmvinnwstr\fP, +\fBmvins_nwstr\fP, +\fBmvins_wch\fP, +\fBmvins_wstr\fP, +\fBmvinwchnstr\fP, +\fBmvinwchstr\fP, +\fBmvinwchstr\fP, +\fBmvinwstr\fP, +\fBmvvline_set\fP, +\fBmvwadd_wch\fP, +\fBmvwadd_wchnstr\fP, +\fBmvwadd_wchstr\fP, +\fBmvwaddnwstr\fP, +\fBmvwaddwstr\fP, +\fBmvwget_ch\fP, +\fBmvwget_wch\fP, +\fBmvwget_wstr\fP, +\fBmvwgetn_wstr\fP, +\fBmvwhline_set\fP, +\fBmvwin_wch\fP, +\fBmvwin_wchnstr\fP, +\fBmvwin_wchstr\fP, +\fBmvwinnwstr\fP, +\fBmvwins_nwstr\fP, +\fBmvwins_wch\fP, +\fBmvwins_wstr\fP, +\fBmvwinwchnstr\fP. +\fBmvwinwstr\fP, +\fBmvwvline_set\fP, +\fBpecho_wchar\fP, +\fBsetcchar\fP, +\fBslk_wset\fP, +\fBterm_attrs\fP, +\fBunget_wch\fP, +\fBvhline_set\fP, +\fBvid_attr\fP, +\fBvid_puts\fP, +\fBvline_set\fP, +\fBwadd_wch\fP, +\fBwadd_wchnstr\fP, +\fBwadd_wchstr\fP, +\fBwaddnwstr\fP, +\fBwaddwstr\fP, +\fBwaddwstr\fP, +\fBwbkgrnd\fP, +\fBwbkgrndset\fP, +\fBwbkgrndset\fP, +\fBwborder_set\fP, +\fBwecho_wchar\fP, +\fBwecho_wchar\fP, +\fBwget_wch\fP, +\fBwget_wstr\fP, +\fBwgetbkgrnd\fP, +\fBwgetn_wstr\fP, +\fBwhline_set\fP, +\fBwin_wch\fP, +\fBwin_wchnstr\fP, +\fBwin_wchstr\fP, +\fBwinnwstr\fP, +\fBwins_nwstr\fP, +\fBwins_wch\fP, +\fBwins_wstr\fP, +\fBwinwchnstr\fP, +\fBwinwchstr\fP, +\fBwinwstr\fP, +\fBwunctrl\fP, +\fBwvline_set\fP, .PP A small number of local differences (that is, individual differences between the XSI Curses and \fBcurses\fR calls) are described in \fBPORTABILITY\fR @@ -636,11 +872,12 @@ to the UNIX kernel significantly and increases the package's portability correspondingly. .PP In the XSI standard and SVr4 manual pages, many entry points have prototype -arguments of the for \fBchar *const\fR (or \fBcchar_t *const\fR, or \fBwchar_t -*const\fR, or \fBvoid *const\fR). Depending on one's interpretation of the +arguments of the for \fBchar *const\fR (or \fBcchar_t *const\fR, or +\fBwchar_t *const\fR, or \fBvoid *const\fR). Depending on one's interpretation of the ANSI C standard (see section 3.5.4.1), these declarations are either (a) -meaningless, or (b) meaningless and illegal. The declaration \fBconst char -*x\fR is a modifiable pointer to unmodifiable data, but \fBchar *const x\fR' is +meaningless, or (b) meaningless and illegal. The declaration +\fBconst char *x\fR is a modifiable pointer to unmodifiable data, but +\fBchar *const x\fR' is an unmodifiable pointer to modifiable data. Given that C passes arguments by value, \fB<type> *const\fR as a formal type is at best dubious. Some compilers choke on the prototypes. Therefore, in this implementation, they have been @@ -653,8 +890,8 @@ If standard output from a \fBcurses\fR program is re-directed to something which is not a tty, screen updates will be directed to standard error. This was an undocumented feature of AT&T System V Release 3 curses. .SH AUTHORS -Zeyd M. Ben-Halim, Eric S. Raymond. Descends from the original pcurses -by Pavel Curtis. +Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey. +Based on pcurses by Pavel Curtis. .\"# .\"# The following sets edit modes for GNU EMACS .\"# Local Variables: diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h index 038e71cc972..10752d08753 100644 --- a/lib/libcurses/curses.h +++ b/lib/libcurses/curses.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.h,v 1.14 1998/11/17 03:16:20 millert Exp $ */ +/* $OpenBSD: curses.h,v 1.15 1999/01/18 19:07:17 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -33,7 +33,7 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ -/* $From: curses.h.in,v 1.71 1998/09/05 22:03:59 tom Exp $ */ +/* $From: curses.h.in,v 1.78 1999/01/10 03:21:11 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -50,7 +50,7 @@ /* These are defined only in curses.h, and are used for conditional compiles */ #define NCURSES_VERSION_MAJOR 4 #define NCURSES_VERSION_MINOR 2 -#define NCURSES_VERSION_PATCH 981114 +#define NCURSES_VERSION_PATCH 990116 /* This is defined in more than one ncurses header, for identification */ #undef NCURSES_VERSION @@ -64,7 +64,7 @@ #define NCURSES_ATTR_T int #endif -#undef NCURSES_CONST +#undef NCURSES_CONST #define NCURSES_CONST typedef unsigned long chtype; @@ -398,7 +398,7 @@ extern int bkgrnd(const cchar_t *); /* missing */ #endif /* _XOPEN_SOURCE_EXTENDED */ extern int border(chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* generated */ #ifdef _XOPEN_SOURCE_EXTENDED -extern int border_set(cchar_t*,cchar_t*,cchar_t*,cchar_t*,cchar_t*,cchar_t*,cchar_t*,cchar_t*); /* missing */ +extern int border_set(const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* missing */ #endif /* _XOPEN_SOURCE_EXTENDED */ extern int box(WINDOW *, chtype, chtype); /* generated */ #ifdef _XOPEN_SOURCE_EXTENDED @@ -434,9 +434,6 @@ extern int erasewchar(wchar_t*); /* missing */ #endif /* _XOPEN_SOURCE_EXTENDED */ extern int endwin(void); /* implemented */ extern char erasechar(void); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int erase_wchar(wchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern void filter(void); /* implemented */ extern int flash(void); /* implemented */ extern int flushinp(void); /* implemented */ @@ -495,7 +492,7 @@ extern int intrflush(WINDOW *,bool); /* implemented */ extern int inwstr(wchar_t *); /* missing */ extern int in_wch(NCURSES_CONST cchar_t *); /* missing */ extern int in_wchstr(NCURSES_CONST cchar_t *); /* missing */ -extern int in_wchntr(NCURSES_CONST cchar_t *, int); /* missing */ +extern int in_wchnstr(NCURSES_CONST cchar_t *, int); /* missing */ #endif /* _XOPEN_SOURCE_EXTENDED */ extern bool isendwin(void); /* implemented */ extern bool is_linetouched(WINDOW *,int); /* implemented */ @@ -563,7 +560,7 @@ extern int mvins_wstr(int, int, const wchar_t *); /* missing */ extern int mvinwstr(int, int, wchar_t *); /* missing */ extern int mvin_wch(int, int, NCURSES_CONST cchar_t *); /* missing */ extern int mvin_wchstr(int, int, NCURSES_CONST cchar_t *); /* missing */ -extern int mvin_wchntr(int, int, NCURSES_CONST cchar_t *, int); /* missing */ +extern int mvin_wchnstr(int, int, NCURSES_CONST cchar_t *, int); /* missing */ #endif /* _XOPEN_SOURCE_EXTENDED */ extern int mvprintw(int,int, NCURSES_CONST char *,...) /* implemented */ GCC_PRINTFLIKE(3,4); @@ -742,6 +739,7 @@ extern int waddnstr(WINDOW *,const char *const,int); /* implemented */ extern int waddstr(WINDOW *,const char *); /* generated */ #ifdef _XOPEN_SOURCE_EXTENDED extern int waddwstr(WINDOW *,const wchar_t *); /* missing */ +extern int waddnwstr(WINDOW *,const wchar_t *,int); /* missing */ extern int wadd_wch(WINDOW *,const cchar_t *); /* missing */ extern int wadd_wchnstr(WINDOW *,const cchar_t *,int); /* missing */ extern int wadd_wchstr(WINDOW *,const cchar_t *); /* missing */ @@ -761,7 +759,7 @@ extern int wbkgrnd(WINDOW *,const cchar_t *); /* missing */ #endif /* _XOPEN_SOURCE_EXTENDED */ extern int wborder(WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */ #ifdef _XOPEN_SOURCE_EXTENDED -extern int wborder_set(WINDOW *,cchar_t*,cchar_t*,cchar_t*,cchar_t*,cchar_t*,cchar_t*,cchar_t*,cchar_t*); /* missing */ +extern int wborder_set(WINDOW *,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* missing */ #endif /* _XOPEN_SOURCE_EXTENDED */ extern int wchgat(WINDOW *, int, attr_t, short, const void *);/* implemented */ extern int wclear(WINDOW *); /* implemented */ @@ -839,6 +837,8 @@ extern int wvline(WINDOW *,chtype,int); /* implemented */ extern int wvline_set(WINDOW *, const cchar_t *, int); /* missing */ #endif /* _XOPEN_SOURCE_EXTENDED */ +extern bool mouse_trafo(int*, int*, bool); /* generated */ + /* attributes */ #define NCURSES_BITS(mask,shift) ((mask) << ((shift) + 8)) @@ -1040,14 +1040,14 @@ extern int wvline_set(WINDOW *, const cchar_t *, int); /* missing */ * winnwstr(), wins_nwstr(), wins_wch(), win_wch(), win_wchnstr(). * Except for wchgat(), these are not yet implemented. They will be someday. */ -#define add_wch(c) wadd_wch(stsdscr,c) +#define add_wch(c) wadd_wch(stdscr,c) #define addnwstr(wstr,n) waddnwstr(stdscr,wstr,n) #define addwstr(wstr,n) waddnwstr(stdscr,wstr,-1) #define attr_get(a,pair,opts) wattr_get(stdscr,a,pair,opts) #define attr_off(a,opts) wattr_off(stdscr,a,opts) #define attr_on(a,opts) wattr_on(stdscr,a,opts) #define attr_set(a,pair,opts) wattr_set(stdscr,a,pair,opts) -#define box_set(w,v,h) wborder_set(w,v,v,h,h,0,0,0,9) +#define box_set(w,v,h) wborder_set(w,v,v,h,h,0,0,0,0) #define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o) #define echo_wchar(c) wecho_wchar(stdscr,c) #define getbkgd(win) ((win)->_bkgd) @@ -1082,11 +1082,11 @@ extern int wvline_set(WINDOW *, const cchar_t *, int); /* missing */ #define mvinwstr(y,x,c) mvwinnwstr(stdscr,y,x,c,-1) #define mvvline_set(y,x,c,n) mvwvline_set(stdscr,y,x,c,n) -#define mvwadd_wch(y,x,win,c) (wmove(win,y,x) == ERR ? ERR : wadd_wch(stsdscr,c)) -#define mvwaddnwstr(y,x,win,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(stdscr,wstr,n)) -#define mvwaddwstr(y,x,win,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(stdscr,wstr,-1)) +#define mvwadd_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wadd_wch(stdscr,c)) +#define mvwaddnwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(stdscr,wstr,n)) +#define mvwaddwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(stdscr,wstr,-1)) #define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o)) -#define mvwget_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wget_wch(win,n)) +#define mvwget_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wget_wch(win,c)) #define mvwget_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,-1)) #define mvwgetn_wstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,n)) #define mvwhline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline_set(win,c,n)) @@ -1095,7 +1095,7 @@ extern int wvline_set(WINDOW *, const cchar_t *, int); /* missing */ #define mvwin_wchstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wchnstr(stdscr,c,-1)) #define mvwinnwstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : winnwstr(stdscr,c,n)) #define mvwins_nwstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(stdscr,t,n)) -#define mvwins_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wins_wch(c)) +#define mvwins_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wins_wch(stdscr,c)) #define mvwins_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(stdscr,t,-1)) #define mvwinwstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winnwstr(stdscr,c,-1)) #define mvwvline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline_set(win,c,n)) @@ -1104,7 +1104,7 @@ extern int wvline_set(WINDOW *, const cchar_t *, int); /* missing */ #define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a)) #define vid_attr(a,pair,opts) vidattr(a) -#define vline_set(c,n) vhline_set(stdscr,c,n) +#define vline_set(c,n) wvline_set(stdscr,c,n) #define waddwstr(win,wstr,n) waddnwstr(win,wstr,-1) #define wattr_get(win,a,p,opts) ((void)((a) != 0 && (*(a) = (win)->_attrs)), \ (void)((p) != 0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \ @@ -1288,6 +1288,9 @@ extern int ungetmouse(MEVENT *); extern mmask_t mousemask(mmask_t, mmask_t *); extern bool wenclose(const WINDOW *, int, int); extern int mouseinterval(int); +extern bool wmouse_trafo(const WINDOW* win,int* y, int* x, bool to_screen); + +#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) /* other non-XSI functions */ diff --git a/lib/libcurses/curses.priv.h b/lib/libcurses/curses.priv.h index 5b66f2a5308..34a90d8554e 100644 --- a/lib/libcurses/curses.priv.h +++ b/lib/libcurses/curses.priv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.priv.h,v 1.10 1998/10/31 06:30:28 millert Exp $ */ +/* $OpenBSD: curses.priv.h,v 1.11 1999/01/18 19:07:18 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -35,7 +35,7 @@ /* - * $From: curses.priv.h,v 1.123 1998/10/03 23:35:34 tom Exp $ + * $From: curses.priv.h,v 1.126 1999/01/03 01:00:41 tom Exp $ * * curses.priv.h * @@ -285,6 +285,9 @@ struct screen { SLK *_slk; /* ptr to soft key struct / NULL */ /* cursor movement costs; units are 10ths of milliseconds */ +#ifdef NCURSES_NO_PADDING + int _no_padding; /* flag to set if padding disabled */ +#endif int _char_padding; /* cost of character put */ int _cr_cost; /* cost of (carriage_return) */ int _cup_cost; /* cost of (cursor_address) */ @@ -672,8 +675,10 @@ extern char *_nc_trace_buf(int, size_t); extern chtype _nc_background(WINDOW *); extern chtype _nc_render(WINDOW *, chtype); extern int _nc_access(const char *, int); +extern int _nc_baudrate(int); extern int _nc_getenv_num(const char *); extern int _nc_keypad(bool); +extern int _nc_ospeed(int); extern int _nc_outch(int); extern int _nc_setupscreen(short, short const, FILE *); extern int _nc_timed_wait(int, int, int *); @@ -682,6 +687,7 @@ extern void _nc_do_color(int, bool, int (*)(int)); extern void _nc_freeall(void); extern void _nc_freewin(WINDOW *win); extern void _nc_hash_map(void); +extern void _nc_keep_tic_dir(const char *); extern void _nc_make_oldhash(int i); extern void _nc_outstr(const char *str); extern void _nc_scroll_oldhash(int n, int top, int bot); diff --git a/lib/libcurses/hashsize.h b/lib/libcurses/hashsize.h index b11af9bded0..b6992abc67f 100644 --- a/lib/libcurses/hashsize.h +++ b/lib/libcurses/hashsize.h @@ -1,8 +1,8 @@ -/* $OpenBSD: hashsize.h,v 1.1 1998/07/23 21:18:20 millert Exp $ */ +/* $OpenBSD: hashsize.h,v 1.2 1999/01/18 19:07:24 millert Exp $ */ /* * hashsize.h -- hash and token table constants */ -#define CAPTABSIZE 495 -#define HASHTABSIZE ( 495 * 2) +#define CAPTABSIZE 497 +#define HASHTABSIZE ( 497 * 2) diff --git a/lib/libcurses/ncurses_cfg.h b/lib/libcurses/ncurses_cfg.h index f5535f8d735..9e8dff756b3 100644 --- a/lib/libcurses/ncurses_cfg.h +++ b/lib/libcurses/ncurses_cfg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ncurses_cfg.h,v 1.7 1998/10/31 06:30:31 millert Exp $ */ +/* $OpenBSD: ncurses_cfg.h,v 1.8 1999/01/18 19:09:03 millert Exp $ */ /* include/ncurses_cfg.h. Generated automatically by configure. */ /**************************************************************************** @@ -51,6 +51,7 @@ #define GCC_PRINTF 1 #define GCC_SCANF 1 #define GCC_UNUSED __attribute__((unused)) +#define HAVE_BIG_CORE 1 #define HAVE_BUILTIN_H 1 #define HAVE_DIRENT_H 1 #define HAVE_ERRNO 1 @@ -101,6 +102,7 @@ #define HAVE_VSSCANF 1 #define HAVE_BSD_CGETENT 1 #define NCURSES_EXT_FUNCS 1 +#define NCURSES_NO_PADDING 1 #define NDEBUG 1 /* #define PURE_TERMINFO 1 */ #define RETSIGTYPE void @@ -110,7 +112,6 @@ #define TYPEOF_CHTYPE long #define USE_DATABASE 1 #define USE_HASHMAP 1 -#define USE_SCROLL_HINTS 1 #define USE_GETCAP 1 /* The C compiler may not treat these properly but C++ has to */ diff --git a/lib/libcurses/parametrized.h b/lib/libcurses/parametrized.h index 0cfebb318d4..fefc00c0406 100644 --- a/lib/libcurses/parametrized.h +++ b/lib/libcurses/parametrized.h @@ -1,4 +1,4 @@ -/* $OpenBSD: parametrized.h,v 1.1 1998/07/23 21:19:58 millert Exp $ */ +/* $OpenBSD: parametrized.h,v 1.2 1999/01/18 19:09:04 millert Exp $ */ /* * parametrized.h --- is a termcap capability parametrized? @@ -402,6 +402,8 @@ static short const parametrized[] = { 0, /* erhlm */ 0, /* ethlm */ 0, /* evhlm */ +1, /* sgr1 */ +1, /* slength */ 0, /* OTi2 */ 0, /* OTrs */ 0, /* OTnl */ @@ -607,5 +609,5 @@ static short const parametrized[] = { 0, /* btml */ 0, /* rvert */ 0, /* lvert */ -} /* 597 entries */; +} /* 599 entries */; diff --git a/lib/libcurses/screensize.c b/lib/libcurses/screensize.c deleted file mode 100644 index e840f4b1e39..00000000000 --- a/lib/libcurses/screensize.c +++ /dev/null @@ -1,54 +0,0 @@ -/* $OpenBSD: screensize.c,v 1.1 1998/01/17 16:27:38 millert Exp $ */ - -/*************************************************************************** -* COPYRIGHT NOTICE * -**************************************************************************** -* ncurses is copyright (C) 1992-1995 * -* Zeyd M. Ben-Halim * -* zmbenhal@netcom.com * -* Eric S. Raymond * -* esr@snark.thyrsus.com * -* * -* Permission is hereby granted to reproduce and distribute ncurses * -* by any means and for any fee, whether alone or as part of a * -* larger distribution, in source or in binary form, PROVIDED * -* this notice is included with any such distribution, and is not * -* removed from any of its header files. Mention of ncurses in any * -* applications linked with it is highly appreciated. * -* * -* ncurses comes AS IS with no warranty, implied or expressed. * -* * -***************************************************************************/ - - -#include <curses.priv.h> - -#if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE) -#define _POSIX_SOURCE -#endif - -#include <term.h> /* lines, columns, cur_term */ - -#ifdef EXTERN_TERMINFO -void _ti_get_screensize(int *, int *, int *); -#endif - -/**************************************************************************** - * - * Terminal size computation - * - ****************************************************************************/ - -#if USE_SIZECHANGE -void _nc_update_screensize(void) -{ - int my_lines, my_cols; -#ifdef EXTERN_TERMINFO - _ti_get_screensize(&my_lines, &my_cols, NULL); -#else - _nc_get_screensize(&my_lines, &my_cols); -#endif - if (SP != 0 && SP->_resize != 0) - SP->_resize(my_lines, my_cols); -} -#endif diff --git a/lib/libcurses/shlib_version b/lib/libcurses/shlib_version index 3066b9771e7..900b4048a96 100644 --- a/lib/libcurses/shlib_version +++ b/lib/libcurses/shlib_version @@ -1,2 +1,2 @@ major=5 -minor=0 +minor=1 diff --git a/lib/libcurses/softscroll.c b/lib/libcurses/softscroll.c deleted file mode 100644 index 6a4f415688f..00000000000 --- a/lib/libcurses/softscroll.c +++ /dev/null @@ -1,259 +0,0 @@ -/* $OpenBSD: softscroll.c,v 1.2 1998/07/23 21:20:04 millert Exp $ */ - -/**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Thomas E. Dickey <dickey@clark.net> 1997 * - ****************************************************************************/ -#include <curses.priv.h> -#include <term.h> - -MODULE_ID("$From: softscroll.c,v 1.6 1998/02/11 12:13:56 tom Exp $") - -/* - * Compute indices for the given WINDOW, preparing it for scrolling. - * - * TODO (this implementation is only for proof-of-concept) - * (a) ensure that curscr's oldindex values are cached properly so we - * don't have to recompute them on each pass. - * (b) investigate if there are gains to be made by iterating newscr's - * row indices outward from the current position, rather than by - * all rows. - */ -static void compute_curscr(void) -{ - int y, x, z; - for (y = 0; y < screen_lines; y++) { - struct ldat *nline = &curscr->_line[y]; - int found = y; - for (z = 0; z < y; z++) { - int same = TRUE; - struct ldat *oline = &curscr->_line[z]; - for (x = 0; x < screen_columns; x++) { - if (nline->text[x] != oline->text[x]) { - same = FALSE; - break; - } - } - if (same) { - found = z; - break; - } - } - nline->oldindex = found; - } -} - -static void compute_newscr(void) -{ - int y, x, z; - for (y = 0; y < screen_lines; y++) { - struct ldat *nline = &newscr->_line[y]; - int found = _NEWINDEX; - for (z = 0; z < screen_lines; z++) { - int same = TRUE; - struct ldat *oline = &curscr->_line[z]; - for (x = 0; x < screen_columns; x++) { - if (nline->text[x] != oline->text[x]) { - same = FALSE; - break; - } - } - if (same) { - found = z; - break; - } - } - nline->oldindex = found; - } -} - -void -_nc_setup_scroll(void) -{ -#ifdef TRACE - if (_nc_tracing & TRACE_UPDATE) { - _tracef("_nc_setup_scroll"); - _nc_linedump(); - } -#endif /* TRACE */ - compute_curscr(); - compute_newscr(); -#ifdef TRACE - if (_nc_tracing & TRACE_UPDATE) { - _tracef("..._nc_setup_scroll"); - _nc_linedump(); - } -#endif -} - -#define MINDISP 2 -#define NEWNUM(n) newscr->_line[n].oldindex -#define OLDNUM(n) curscr->_line[n].oldindex - -/* - * This performs essentially the same function as _nc_scroll_optimize(), but - * uses different assumptions about the .oldindex values. More than one line - * may have the same .oldindex value. We don't assume the values are ordered. - * - * (Neither algorithm takes into account the cost of constructing the lines - * which are scrolled) - */ -void -_nc_perform_scroll(void) -{ - int disp; - int row; - int top, bottom, maxdisp; - int partial; - - /* - * Find the top/bottom lines that are different between curscr and - * newscr, limited by the terminal's ability to scroll portions of the - * screen. - * - * FIXME: this doesn't account for special cases of insert/delete line. - */ - if (change_scroll_region - && (scroll_forward || parm_index) - && (scroll_reverse || parm_rindex)) { - partial = TRUE; - for (row = 0, top = -1; row < screen_lines; row++) { - if (OLDNUM(row) != NEWNUM(row)) { - break; - } - top = row; - } - top++; - - for (row = screen_lines-1, bottom = screen_lines; row >= 0; row--) { - if (OLDNUM(row) != NEWNUM(row)) { - break; - } - bottom = row; - } - bottom--; - } else { - partial = FALSE; - top = 0; - bottom = screen_lines - 1; - } - - maxdisp = (bottom - top + 1) / 2; - if (maxdisp < MINDISP) - return; - - T(("_nc_perform_scroll %d..%d (maxdisp=%d)", top, bottom, maxdisp)); - - for (disp = 1; disp < maxdisp; disp++) { - int n; - int fn, fwd = 0; - int bn, bak = 0; - int first, last; - int moved; - - do { - /* check for forward-movement */ - for (fn = top + disp; fn < screen_lines - disp; fn++) { - int eql = 0; - for (n = fn, fwd = 0; n < screen_lines; n++) { - if (NEWNUM(n) == _NEWINDEX - || NEWNUM(n) != OLDNUM(n-disp)) - break; - fwd++; - if (OLDNUM(n) == NEWNUM(n)) - eql++; - } - if (eql == fwd) - fwd = 0; - if (fwd >= disp) - break; - fwd = 0; - } - - /* check for backward-movement */ - for (bn = top + disp; bn < screen_lines - disp; bn++) { - int eql = 0; - for (n = bn, bak = 0; n < screen_lines; n++) { - if (OLDNUM(n) == _NEWINDEX - || OLDNUM(n) != NEWNUM(n-disp)) - break; - bak++; - if (OLDNUM(n-disp) == NEWNUM(n-disp)) - eql++; - } - if (eql == bak) - bak = 0; - if (bak >= disp) - break; - bak = 0; - } - - /* choose only one, in case they overlap */ - if (fwd > bak) { - first = fn - disp; - last = fn + fwd - 1; - moved = -disp; - } else if (bak) { - first = bn - disp; - last = bn + bak - 1; - moved = disp; - } else { - break; - } - - TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", first, last, moved)); - if (_nc_scrolln(moved, first, last, screen_lines - 1) == ERR) - { - TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); - break; - } - - /* If the scrolled text was at one end of the range - * of changed lines, adjust the loop limits. - */ - if (first == top) - top = last + 1; - if (last == bottom) - bottom = first - 1; - - maxdisp = (bottom - top + 1) / 2; - if (maxdisp < MINDISP) - return; - - /* In any case, mark the lines so we don't try to - * use them in a subsequent scroll. - */ - for (fn = first; fn <= last; fn++) { - OLDNUM(fn) = - NEWNUM(fn) = _NEWINDEX; - } - } while (partial); - } -} diff --git a/lib/libcurses/term.5tbl b/lib/libcurses/term.5tbl new file mode 100644 index 00000000000..647d7f17698 --- /dev/null +++ b/lib/libcurses/term.5tbl @@ -0,0 +1,212 @@ +.\"*************************************************************************** +.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $From: term.5,v 1.9 1998/03/11 21:12:53 juergen Exp $ +.\" $OpenBSD: term.5tbl,v 1.1 1999/01/18 19:09:15 millert Exp $ +.TH TERM 5 +.ds n 5 +.ds d /usr/share/terminfo +.SH NAME +term \- format of compiled term file. +.SH SYNOPSIS +.B term +.SH DESCRIPTION +.PP +NOTE: OpenBSD uses a Berkeley DB-style terminfo database instead +of the SVR4 method of one description per file described below. +.PP +Compiled terminfo descriptions are placed under the directory \fB\*d\fP. +In order to avoid a linear search of a huge \s-1UNIX\s+1 system directory, a +two-level scheme is used: \fB\*b/c/name\fP +where +.I name +is the name of the terminal, and +.I c +is the first character of +.IR name . +Thus, +.I act4 +can be found in the file \fB\*d/a/act4\fP. +Synonyms for the same terminal are implemented by multiple +links to the same compiled file. +.PP +The format has been chosen so that it will be the same on all hardware. +An 8 or more bit byte is assumed, but no assumptions about byte ordering +or sign extension are made. +.PP +The compiled file is created with the +.I tic +program, and read by the routine +.IR setupterm . +The file is divided into six parts: +the header, +terminal names, +boolean flags, +numbers, +strings, +and +string table. +.PP +The header section begins the file. +This section contains six short integers in the format +described below. +These integers are +(1) the magic number (octal 0432); +(2) the size, in bytes, of the names section; +(3) the number of bytes in the boolean section; +(4) the number of short integers in the numbers section; +(5) the number of offsets (short integers) in the strings section; +(6) the size, in bytes, of the string table. +.PP +Short integers are stored in two 8-bit bytes. +The first byte contains the least significant 8 bits of the value, +and the second byte contains the most significant 8 bits. +(Thus, the value represented is 256*second+first.) +The value \-1 is represented by the two bytes 0377, 0377; other negative +values are illegal. This value generally +means that the corresponding capability is missing from this terminal. +Note that this format corresponds to the hardware of the \s-1VAX\s+1 +and \s-1PDP\s+1-11 (that is, little-endian machines). +Machines where this does not correspond to the hardware must read the +integers as two bytes and compute the little-endian value. +.PP +The terminal names section comes next. +It contains the first line of the terminfo description, +listing the various names for the terminal, +separated by the `|' character. +The section is terminated with an \s-1ASCII NUL\s+1 character. +.PP +The boolean flags have one byte for each flag. +This byte is either 0 or 1 as the flag is present or absent. +The capabilities are in the same order as the file <term.h>. +.PP +Between the boolean section and the number section, +a null byte will be inserted, if necessary, +to ensure that the number section begins on an even byte (this is a +relic of the PDP-11's word-addressed architecture, originally +designed in to avoid IOT traps induced by addressing a word on an +odd byte boundary). +All short integers are aligned on a short word boundary. +.PP +The numbers section is similar to the flags section. +Each capability takes up two bytes, +and is stored as a little-endian short integer. +If the value represented is \-1, the capability is taken to be missing. +.PP +The strings section is also similar. +Each capability is stored as a short integer, in the format above. +A value of \-1 means the capability is missing. +Otherwise, the value is taken as an offset from the beginning +of the string table. +Special characters in ^X or \ec notation are stored in their +interpreted form, not the printing representation. +Padding information $<nn> and parameter information %x are +stored intact in uninterpreted form. +.PP +The final section is the string table. +It contains all the values of string capabilities referenced in +the string section. +Each string is null terminated. +.PP +Note that it is possible for +.I setupterm +to expect a different set of capabilities +than are actually present in the file. +Either the database may have been updated since +.I setupterm +has been recompiled +(resulting in extra unrecognized entries in the file) +or the program may have been recompiled more recently +than the database was updated +(resulting in missing entries). +The routine +.I setupterm +must be prepared for both possibilities \- +this is why the numbers and sizes are included. +Also, new capabilities must always be added at the end of the lists +of boolean, number, and string capabilities. +.PP +Despite the consistent use of little-endian for numbers and the otherwise +self-describing format, it is not wise to count on portability of binary +terminfo entries between commercial UNIX versions. The problem is that there +are at least three versions of terminfo (under HP-UX, AIX, and OSF/1) which +diverged from System V terminfo after SVr1, and have added extension +capabilities to the string table that (in the binary format) collide with +System V and XSI Curses extensions. See \fBterminfo\fR(\*n) for detailed +discussion of terminfo source compatibility issues. +.PP +As an example, here is a hex dump of the description for the Lear-Siegler +ADM-3, a popular though rather stupid early terminal: +.nf +.sp +adm3a|lsi adm3a, + am, + cols#80, lines#24, + bel=^G, clear=\032$<1>, cr=^M, cub1=^H, cud1=^J, + cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, + home=^^, ind=^J, +.sp +.ft CW +\s-20000 1a 01 10 00 02 00 03 00 82 00 31 00 61 64 6d 33 ........ ..1.adm3 +0010 61 7c 6c 73 69 20 61 64 6d 33 61 00 00 01 50 00 a|lsi ad m3a...P. +0020 ff ff 18 00 ff ff 00 00 02 00 ff ff ff ff 04 00 ........ ........ +0030 ff ff ff ff ff ff ff ff 0a 00 25 00 27 00 ff ff ........ ..%.'... +0040 29 00 ff ff ff ff 2b 00 ff ff 2d 00 ff ff ff ff ).....+. ..-..... +0050 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +0060 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +0070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +0080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +0090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +00a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +00b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +00c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +00d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +00e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +00f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +0100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +0110 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ +0120 ff ff ff ff ff ff 2f 00 07 00 0d 00 1a 24 3c 31 ....../. .....$<1 +0130 3e 00 1b 3d 25 70 31 25 7b 33 32 7d 25 2b 25 63 >..=%p1% {32}%+%c +0140 25 70 32 25 7b 33 32 7d 25 2b 25 63 00 0a 00 1e %p2%{32} %+%c.... +0150 00 08 00 0c 00 0b 00 0a 00 ........ .\s+2 +.ft R +.fi +.sp +.PP +Some limitations: total compiled entries cannot exceed 4096 bytes. +The name field cannot exceed 128 bytes. +.SH FILES +\*d/*/* compiled terminal capability data base +.SH "SEE ALSO" +\fBcurses\fR(3), \fBterminfo\fR(\*n). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/lib/libcurses/term.7 b/lib/libcurses/term.7 new file mode 100644 index 00000000000..fabb93ae2bc --- /dev/null +++ b/lib/libcurses/term.7 @@ -0,0 +1,205 @@ +.\"*************************************************************************** +.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $From: term.7,v 1.10 1998/12/26 01:58:56 tom Exp $ +.\" $OpenBSD: term.7,v 1.1 1999/01/18 19:09:15 millert Exp $ +.TH TERM 7 +.ds n 5 +.ds d /usr/share/terminfo +.SH NAME +term \- conventions for naming terminal types +.SH DESCRIPTION +.PP +The environment variable \fBTERM\fR should normally contain the type name of +the terminal, console or display-device type you are using. This information +is critical for all screen-oriented programs, including your editor and mailer. +.PP +A default \fBTERM\fR value will be set on a per-line basis by either +\fB/etc/inittab\fR (Linux and System-V-like UNIXes) or \fB/etc/ttys\fR (BSD +UNIXes). This will nearly always suffice for workstation and microcomputer +consoles. +.PP +If you use a dialup line, the type of device attached to it may vary. Older +UNIX systems pre-set a very dumb terminal type like `dumb' or `dialup' on +dialup lines. Newer ones may pre-set `vt100', reflecting the prevalence of DEC +VT100-compatible terminals and personal-computer emulators. +.PP +Modern telnets pass your \fBTERM\fR environment variable from the local side to +the remote one. There can be problems if the remote terminfo or termcap entry +for your type is not compatible with yours, but this situation is rare and +can almost always be avoided by explicitly exporting `vt100' (assuming you +are in fact using a VT100-superset console, terminal, or terminal emulator.) +.PP +In any case, you are free to override the system \fBTERM\fR setting to your +taste in your shell profile. The \fBtset\fP(1) utility may be of assistance; +you can give it a set of rules for deducing or requesting a terminal type based +on the tty device and baud rate. +.PP +Setting your own \fBTERM\fR value may also be useful if you have created a +custom entry incorporating options (such as visual bell or reverse-video) +which you wish to override the system default type for your line. +.PP +Terminal type descriptions are stored as files of capability data underneath +\*d. To browse a list of all terminal names recognized by the system, do + + toe | more + +from your shell. These capability files are in a binary format optimized for +retrieval speed (unlike the old text-based \fBtermcap\fR format they replace); +to examine an entry, you must use the \fBinfocmp\fR(1) command. Invoke it as +follows: + + infocmp \fIentry-name\fR + +where \fIentry-name\fR is the name of the type you wish to examine (and the +name of its capability file the subdirectory of \*d named for its first +letter). This command dumps a capability file in the text format described by +\fBterminfo\fR(\*n). +.PP +The first line of a \fBterminfo\fR(\*n) description gives the names by which +terminfo knows a terminal, separated by `|' (pipe-bar) characters with the last +name field terminated by a comma. The first name field is the type's +\fIprimary name\fR, and is the one to use when setting \fBTERM\fR. The last +name field (if distinct from the first) is actually a description of the +terminal type (it may contain blanks; the others must be single words). Name +fields between the first and last (if present) are aliases for the terminal, +usually historical names retained for compatibility. +.PP +There are some conventions for how to choose terminal primary names that help +keep them informative and unique. Here is a step-by-step guide to naming +terminals that also explains how to parse them: +.PP +First, choose a root name. The root will consist of a lower-case letter +followed by up to seven lower-case letters or digits. You need to avoid using +punctuation characters in root names, because they are used and interpreted as +filenames and shell meta-characters (such as !, $, *, ? etc.) embedded in them +may cause odd and unhelpful behavior. The slash (/), or any other character +that may be interpreted by anyone's file system (\e, $, [, ]), is especially +dangerous (terminfo is platform-independent, and choosing names with special +characters could someday make life difficult for users of a future port). The +dot (.) character is relatively safe as long as there is at most one per root +name; some historical terminfo names use it. +.PP +The root name for a terminal or workstation console type should almost always +begin with a vendor prefix (such as \fBhp\fR for Hewlett-Packard, \fBwy\fR for +Wyse, or \fBatt\fR for AT&T terminals), or a common name of the terminal line +(\fBvt\fR for the VT series of terminals from DEC, or \fBsun\fR for Sun +Microsystems workstation consoles, or \fBregent\fR for the ADDS Regent series. +You can list the terminfo tree to see what prefixes are already in common use. +The root name prefix should be followed when appropriate by a model number; +thus \fBvt100\fR, \fBhp2621\fR, \fBwy50\fR. +.PP +The root name for a PC-Unix console type should be the OS name, +i.e. \fBlinux\fR, \fBbsdos\fR, \fBfreebsd\fR, \fBnetbsd\fR. It should +\fInot\fR be \fBconsole\fR or any other generic that might cause confusion in a +multi-platform environment! If a model number follows, it should indicate +either the OS release level or the console driver release level. +.PP +The root name for a terminal emulator (assuming it doesn't fit one of the +standard ANSI or vt100 types) should be the program name or a readily +recognizable abbreviation of it (i.e. \fBversaterm\fR, \fBctrm\fR). +.PP +Following the root name, you may add any reasonable number of hyphen-separated +feature suffixes. +.TP 5 +2p +Has two pages of memory. Likewise 4p, 8p, etc. +.TP 5 +mc +Magic-cookie. Some terminals (notably older Wyses) can only support one +attribute without magic-cookie lossage. Their base entry is usually paired +with another that has this suffix and uses magic cookies to support multiple +attributes. +.TP 5 +-am +Enable auto-margin (right-margin wraparound) +.TP 5 +-m +Mono mode - suppress color support +.TP 5 +-na +No arrow keys - termcap ignores arrow keys which are actually there on the +terminal, so the user can use the arrow keys locally. +.TP 5 +-nam +No auto-margin - suppress am capability +.TP 5 +-nl +No labels - suppress soft labels +.TP 5 +-nsl +No status line - suppress status line +.TP 5 +-pp +Has a printer port which is used. +.TP 5 +-rv +Terminal in reverse video mode (black on white) +.TP 5 +-s +Enable status line. +.TP 5 +-vb +Use visible bell (flash) rather than beep. +.TP 5 +-w +Wide; terminal is in 132 column mode. +.PP +Conventionally, if your terminal type is a variant intended to specify a +line height, that suffix should go first. So, for a hypothetical FuBarCo +model 2317 terminal in 30-line mode with reverse video, best form would be +\fBfubar-30-rv\fR (rather than, say, `fubar-rv-30'). +.PP +Terminal types that are written not as standalone entries, but rather as +components to be plugged into other entries via \fBuse\fP capabilities, +are distinguished by using embedded plus signs rather than dashes. +.PP +Commands which use a terminal type to control display often accept a -T +option that accepts a terminal name argument. Such programs should fall back +on the \fBTERM\fR environment variable when no -T option is specified. +.SH PORTABILITY +For maximum compatibility with older System V UNIXes, names and aliases +should be unique within the first 14 characters. +.SH FILES +.TP 5 +\*d/?/* +compiled terminal capability data base +.TP 5 +/etc/inittab +tty line initialization (AT&T-like UNIXes). +.TP 5 +/etc/ttys +tty line initialization (BSD-like UNIXes). +.SH "SEE ALSO" +\fBcurses\fR(3), \fBterminfo\fR(\*n), \fBterm\fR(\*n). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/lib/libcurses/term.h b/lib/libcurses/term.h index 8de32b1fff3..39154bc0b68 100644 --- a/lib/libcurses/term.h +++ b/lib/libcurses/term.h @@ -1,4 +1,4 @@ -/* $OpenBSD: term.h,v 1.4 1998/11/17 03:16:22 millert Exp $ */ +/* $OpenBSD: term.h,v 1.5 1999/01/18 19:09:16 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -33,7 +33,7 @@ /* and: Eric S. Raymond <esr@snark.thyrsus.com> */ /****************************************************************************/ -/* $From: MKterm.h.awk.in,v 1.26 1998/11/07 21:10:18 tom Exp $ */ +/* $From: MKterm.h.awk.in,v 1.32 1999/01/09 22:01:45 tom Exp $ */ /* ** term.h -- Definition of struct term @@ -43,7 +43,7 @@ #define _NCU_TERM_H 1 #ifdef _USE_OLD_CURSES_ -#error Cannot mix new term.h with old curses.h +#error Cannot mix new term.h with old curses.h #endif #undef NCURSES_VERSION @@ -92,6 +92,7 @@ extern "C" { /* Assume Posix termio if we have the header and function */ #if HAVE_TERMIOS_H && HAVE_TCGETATTR + #undef TERMIOS #define TERMIOS 1 @@ -130,13 +131,13 @@ extern "C" { #ifndef cfgetospeed #define cfgetospeed(t) ((t)->c_cflag & CBAUD) #endif -#ifndef TCIFLUSH +#ifndef TCIFLUSH #define TCIFLUSH 0 #endif -#ifndef TCOFLUSH +#ifndef TCOFLUSH #define TCOFLUSH 1 #endif -#ifndef TCIOFLUSH +#ifndef TCIOFLUSH #define TCIOFLUSH 2 #endif #ifndef tcflush @@ -145,7 +146,7 @@ extern "C" { #else /* !HAVE_TERMIO_H */ -#undef TERMIOS +#undef TERMIOS #include <sgtty.h> #include <sys/ioctl.h> #define TTY struct sgttyb @@ -226,7 +227,7 @@ extern "C" { #define dot_horz_spacing CUR Numbers[18] #define max_micro_address CUR Numbers[19] #define max_micro_jump CUR Numbers[20] -#define micro_char_size CUR Numbers[21] +#define micro_col_size CUR Numbers[21] #define micro_line_size CUR Numbers[22] #define number_of_pins CUR Numbers[23] #define output_res_char CUR Numbers[24] @@ -630,58 +631,58 @@ extern "C" { #define enter_right_hl_mode CUR Strings[389] #define enter_top_hl_mode CUR Strings[390] #define enter_vertical_hl_mode CUR Strings[391] +#define set_a_attributes CUR Strings[392] +#define set_pglen_inch CUR Strings[393] #define BOOLWRITE 37 #define NUMWRITE 33 -#define STRWRITE 392 +#define STRWRITE 394 /* older synonyms for some capabilities */ #define beehive_glitch no_esc_ctlc #define teleray_glitch dest_tabs_magic_smso - -/* XSI synonyms */ -#define micro_col_size micro_char_size +#define micro_char_size micro_col_size #ifdef __INTERNAL_CAPS_VISIBLE -#define termcap_init2 CUR Strings[392] -#define termcap_reset CUR Strings[393] +#define termcap_init2 CUR Strings[394] +#define termcap_reset CUR Strings[395] #define magic_cookie_glitch_ul CUR Numbers[33] #define backspaces_with_bs CUR Booleans[37] #define crt_no_scrolling CUR Booleans[38] #define no_correctly_working_cr CUR Booleans[39] #define carriage_return_delay CUR Numbers[34] #define new_line_delay CUR Numbers[35] -#define linefeed_if_not_lf CUR Strings[394] -#define backspace_if_not_bs CUR Strings[395] +#define linefeed_if_not_lf CUR Strings[396] +#define backspace_if_not_bs CUR Strings[397] #define gnu_has_meta_key CUR Booleans[40] #define linefeed_is_newline CUR Booleans[41] #define backspace_delay CUR Numbers[36] #define horizontal_tab_delay CUR Numbers[37] #define number_of_function_keys CUR Numbers[38] -#define other_non_function_keys CUR Strings[396] -#define arrow_key_map CUR Strings[397] +#define other_non_function_keys CUR Strings[398] +#define arrow_key_map CUR Strings[399] #define has_hardware_tabs CUR Booleans[42] #define return_does_clr_eol CUR Booleans[43] -#define acs_ulcorner CUR Strings[398] -#define acs_llcorner CUR Strings[399] -#define acs_urcorner CUR Strings[400] -#define acs_lrcorner CUR Strings[401] -#define acs_ltee CUR Strings[402] -#define acs_rtee CUR Strings[403] -#define acs_btee CUR Strings[404] -#define acs_ttee CUR Strings[405] -#define acs_hline CUR Strings[406] -#define acs_vline CUR Strings[407] -#define acs_plus CUR Strings[408] -#define memory_lock CUR Strings[409] -#define memory_unlock CUR Strings[410] -#define box_chars_1 CUR Strings[411] +#define acs_ulcorner CUR Strings[400] +#define acs_llcorner CUR Strings[401] +#define acs_urcorner CUR Strings[402] +#define acs_lrcorner CUR Strings[403] +#define acs_ltee CUR Strings[404] +#define acs_rtee CUR Strings[405] +#define acs_btee CUR Strings[406] +#define acs_ttee CUR Strings[407] +#define acs_hline CUR Strings[408] +#define acs_vline CUR Strings[409] +#define acs_plus CUR Strings[410] +#define memory_lock CUR Strings[411] +#define memory_unlock CUR Strings[412] +#define box_chars_1 CUR Strings[413] #endif /* __INTERNAL_CAPS_VISIBLE */ #define BOOLCOUNT 44 #define NUMCOUNT 39 -#define STRCOUNT 412 +#define STRCOUNT 414 typedef struct termtype { /* in-core form of terminfo data */ char *term_names; /* str_table offset of term names */ @@ -738,8 +739,8 @@ extern NCURSES_CONST char *const strfnames[]; #endif /* internals */ -extern int _nc_set_curterm(TTY *buf); -extern int _nc_get_curterm(TTY *buf); +extern int _nc_set_tty_mode(TTY *buf); +extern int _nc_get_tty_mode(TTY *buf); extern int _nc_read_entry(const char * const, char * const, TERMTYPE *const); extern int _nc_read_file_entry(const char *const, TERMTYPE *); extern char *_nc_first_name(const char *const); @@ -752,26 +753,28 @@ extern TERMINAL *set_curterm(TERMINAL *); extern int del_curterm(TERMINAL *); /* miscellaneous entry points */ -extern int restartterm(const char *, int, int *); -extern int setupterm(const char *,int,int *); -extern int tputs(const char *, int, int (*)(int)); +extern int restartterm(NCURSES_CONST char *, int, int *); +extern int setupterm(NCURSES_CONST char *,int,int *); /* terminfo entry points, also declared in curses.h */ -#if !defined(__NCURSES_H) && !defined(_TERMCAP_H) -extern char ttytype[]; +#if !defined(__NCURSES_H) extern char *tigetstr(NCURSES_CONST char *); extern char *tparm(NCURSES_CONST char *, ...); +extern char ttytype[]; extern int putp(const char *); extern int tigetflag(NCURSES_CONST char *); extern int tigetnum(NCURSES_CONST char *); #endif /* __NCURSES_H */ /* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */ -extern char *tgetstr(const char *, char **); +#if !defined(_NCU_TERMCAP_H) +extern char *tgetstr(NCURSES_CONST char *, char **); extern char *tgoto(const char *, int, int); extern int tgetent(char *, const char *); -extern int tgetflag(const char *); -extern int tgetnum(const char *); +extern int tgetflag(NCURSES_CONST char *); +extern int tgetnum(NCURSES_CONST char *); +extern int tputs(const char *, int, int (*)(int)); +#endif /* _NCU_TERMCAP_H */ #ifdef __cplusplus } diff --git a/lib/libcurses/term_entry.h b/lib/libcurses/term_entry.h index f99c1a02ff2..69be127a0ff 100644 --- a/lib/libcurses/term_entry.h +++ b/lib/libcurses/term_entry.h @@ -1,4 +1,4 @@ -/* $OpenBSD: term_entry.h,v 1.1 1998/07/23 21:20:05 millert Exp $ */ +/* $OpenBSD: term_entry.h,v 1.2 1999/01/18 19:09:16 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -41,6 +41,10 @@ #ifndef _TERM_ENTRY_H #define _TERM_ENTRY_H +#ifdef __cplusplus +extern "C" { +#endif + #define MAX_USES 32 typedef struct entry { @@ -86,6 +90,8 @@ extern bool _nc_entry_match(char *, char *); extern int _nc_resolve_uses(void); extern void _nc_free_entries(ENTRY *); -#endif /* _TERM_ENTRY_H */ +#ifdef __cplusplus +} +#endif -/* term_entry.h ends here */ +#endif /* _TERM_ENTRY_H */ diff --git a/lib/libcurses/termcap.h b/lib/libcurses/termcap.h index 9a0f5a642be..203a03cddb9 100644 --- a/lib/libcurses/termcap.h +++ b/lib/libcurses/termcap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: termcap.h,v 1.2 1998/09/13 19:16:30 millert Exp $ */ +/* $OpenBSD: termcap.h,v 1.3 1999/01/18 19:09:17 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -33,10 +33,10 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ -/* $From: termcap.h.in,v 1.7 1998/09/05 22:20:45 tom Exp $ */ +/* $From: termcap.h.in,v 1.10 1999/01/09 22:38:04 Uchiyama.Yasushi Exp $ */ -#ifndef _TERMCAP_H -#define _TERMCAP_H 1 +#ifndef _NCU_TERMCAP_H +#define _NCU_TERMCAP_H 1 #undef NCURSES_VERSION #define NCURSES_VERSION "4.2" @@ -49,17 +49,20 @@ extern "C" #include <sys/types.h> #include <termios.h> +#undef NCURSES_CONST +#define NCURSES_CONST + extern char PC; extern char *UP; extern char *BC; extern speed_t ospeed; -#if !defined(__NCURSES_H) && !defined(_TERM_H) -extern char *tgetstr(const char *, char **); +#if !defined(_NCU_TERM_H) +extern char *tgetstr(NCURSES_CONST char *, char **); extern char *tgoto(const char *, int, int); extern int tgetent(char *, const char *); -extern int tgetflag(const char *); -extern int tgetnum(const char *); +extern int tgetflag(NCURSES_CONST char *); +extern int tgetnum(NCURSES_CONST char *); extern int tputs(const char *, int, int (*)(int)); #endif @@ -67,4 +70,4 @@ extern int tputs(const char *, int, int (*)(int)); } #endif -#endif /* _TERMCAP_H */ +#endif /* _NCU_TERMCAP_H */ diff --git a/lib/libcurses/terminfo.5tbl b/lib/libcurses/terminfo.5tbl index ccddc4c2e3d..5503a80d478 100644 --- a/lib/libcurses/terminfo.5tbl +++ b/lib/libcurses/terminfo.5tbl @@ -33,7 +33,7 @@ .\"*************************************************************************** .\" .\" $From: terminfo.head,v 1.8 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: terminfo.5tbl,v 1.1 1998/07/23 21:20:05 millert Exp $ +.\" $OpenBSD: terminfo.5tbl,v 1.2 1999/01/18 19:09:17 millert Exp $ .TH TERMINFO 5 "" "" "File Formats" .ds n 5 .ds d /usr/share/terminfo @@ -112,7 +112,7 @@ accesses the capability. The \fBcapname\fR is the short name used in the text of the database, and is used by a person updating the database. Whenever possible, capnames are chosen to be the same as or similar to -the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses +the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses identical or very similar names). Semantics are also intended to match those of the specification. @@ -145,7 +145,7 @@ lines affected indicates the \fIi\fP\uth\d parameter. .PP - These are the boolean capabilities: +These are the boolean capabilities: .na .TS H @@ -161,12 +161,27 @@ T} auto_right_margin am am T{ terminal has automatic margins T} -no_esc_ctlc xsb xb T{ -beehive (f1=escape, f2=ctrl C) +back_color_erase bce ut T{ +screen erased with background color +T} +can_change ccc cc T{ +terminal can re-define existing colors T} ceol_standout_glitch xhp xs T{ standout not erased by overwriting (hp) T} +col_addr_glitch xhpa YA T{ +only positive motion for hpa/mhpa caps +T} +cpi_changes_res cpix YF T{ +changing character pitch changes resolution +T} +cr_cancels_micro_mode crxm YB T{ +using cr turns off micro mode +T} +dest_tabs_magic_smso xt xt T{ +tabs destructive, magic so char (t1061) +T} eat_newline_glitch xenl xn T{ newline ignored after 80 cols (concept) T} @@ -179,15 +194,27 @@ T} hard_copy hc hc T{ hardcopy terminal T} +hard_cursor chts HC T{ +cursor is hard to see +T} has_meta_key km km T{ -Has a meta key, sets msb high +Has a meta key (shift, sets parity bit) +T} +has_print_wheel daisy YC T{ +printer needs operator to change character set T} has_status_line hs hs T{ has extra status line T} +hue_lightness_saturation hls hl T{ +terminal uses only HLS color notation (Tektronix) +T} insert_null_glitch in in T{ insert mode distinguishes nulls T} +lpi_changes_res lpix YG T{ +changing line pitch changes resolution +T} memory_above da da T{ display may be retained above the screen T} @@ -200,35 +227,11 @@ T} move_standout_mode msgr ms T{ safe to move while in standout mode T} -over_strike os os T{ -terminal can overstrike -T} -status_line_esc_ok eslok es T{ -escape can be used on the status line -T} -dest_tabs_magic_smso xt xt T{ -tabs destructive, magic so char (t1061) -T} -tilde_glitch hz hz T{ -can't print ~'s (hazeltine) -T} -transparent_underline ul ul T{ -underline character overstrikes -T} -xon_xoff xon xo T{ -terminal uses xon/xoff handshaking -T} needs_xon_xoff nxon nx T{ padding won't work, xon/xoff required T} -prtr_silent mc5i 5i T{ -printer won't echo on screen -T} -hard_cursor chts HC T{ -cursor is hard to see -T} -non_rev_rmcup nrrmc NR T{ -smcup does not reverse rmcup +no_esc_ctlc xsb xb T{ +beehive (f1=escape, f2=ctrl C) T} no_pad_char npc NP T{ pad character does not exist @@ -236,23 +239,14 @@ T} non_dest_scroll_region ndscr ND T{ scrolling region is non-destructive T} -can_change ccc cc T{ -terminal can re-define existing colors -T} -back_color_erase bce ut T{ -screen erased with background color -T} -hue_lightness_saturation hls hl T{ -terminal uses only HLS color notation (tektronix) -T} -col_addr_glitch xhpa YA T{ -only positive motion for hpa/mhpa caps +non_rev_rmcup nrrmc NR T{ +smcup does not reverse rmcup T} -cr_cancels_micro_mode crxm YB T{ -using cr turns off micro mode +over_strike os os T{ +terminal can overstrike T} -has_print_wheel daisy YC T{ -printer needs operator to change character set +prtr_silent mc5i 5i T{ +printer won't echo on screen T} row_addr_glitch xvpa YD T{ only positive motion for vpa/mvpa caps @@ -260,11 +254,17 @@ T} semi_auto_right_margin sam YE T{ printing in last column causes cr T} -cpi_changes_res cpix YF T{ -changing character pitch changes resolution +status_line_esc_ok eslok es T{ +escape can be used on the status line T} -lpi_changes_res lpix YG T{ -changing line pitch changes resolution +tilde_glitch hz hz T{ +can't print ~'s (hazeltine) +T} +transparent_underline ul ul T{ +underline character overstrikes +T} +xon_xoff xon xo T{ +terminal uses xon/xoff handshaking T} .TE .ad @@ -285,48 +285,48 @@ T} init_tabs it it T{ tabs initially every # spaces T} +label_height lh lh T{ +rows in each label +T} +label_width lw lw T{ +columns in each label +T} lines lines li T{ number of lines on screen or page T} lines_of_memory lm lm T{ -lines of memory if > line. 0 => varies +lines of memory if > line. 0 means varies T} magic_cookie_glitch xmc sg T{ number of blank characters left by smso or rmso T} -padding_baud_rate pb pb T{ -lowest baud rate where padding needed -T} -virtual_terminal vt vt T{ -virtual terminal number (CB/unix) -T} -width_status_line wsl ws T{ -columns in status line -T} -num_labels nlab Nl T{ -number of labels on screen -T} -label_height lh lh T{ -rows in each label -T} -label_width lw lw T{ -columns in each label -T} max_attributes ma ma T{ maximum combined attributes terminal can handle T} -maximum_windows wnum MW T{ -maximum number of defineable windows -T} max_colors colors Co T{ maximum number of colors on screen T} max_pairs pairs pa T{ maximum number of color-pairs on the screen T} +maximum_windows wnum MW T{ +maximum number of defineable windows +T} no_color_video ncv NC T{ video attributes that can't be used with colors T} +num_labels nlab Nl T{ +number of labels on screen +T} +padding_baud_rate pb pb T{ +lowest baud rate where padding needed +T} +virtual_terminal vt vt T{ +virtual terminal number (CB/unix) +T} +width_status_line wsl ws T{ +number of columns in status line +T} .TE .ad @@ -342,26 +342,35 @@ c l l c lw25 lw6 lw2 lw20. \fBVariable Cap- TCap Description\fR \fBNumeric name Code\fR +bit_image_entwining bitwin Yo T{ +number of passes for each bit-image row +T} +bit_image_type bitype Yp T{ +type of bit-image device +T} buffer_capacity bufsz Ya T{ numbers of bytes buffered before printing T} -dot_vert_spacing spinv Yb T{ -spacing of pins vertically in pins per inch +buttons btns BT T{ +number of buttons on mouse T} dot_horz_spacing spinh Yc T{ spacing of dots horizontally in dots per inch T} +dot_vert_spacing spinv Yb T{ +spacing of pins vertically in pins per inch +T} max_micro_address maddr Yd T{ maximum value in micro_..._address T} max_micro_jump mjump Ye T{ maximum value in parm_..._micro T} -micro_char_size mcs Yf T{ -character size when in micro mode +micro_col_size mcs Yf T{ +character step size when in micro mode T} micro_line_size mls Yg T{ -line size when in micro mode +line step size when in micro mode T} number_of_pins npins Yh T{ numbers of pins in print-head @@ -369,12 +378,12 @@ T} output_res_char orc Yi T{ horizontal resolution in units per line T} -output_res_line orl Yj T{ -vertical resolution in units per line -T} output_res_horz_inch orhi Yk T{ horizontal resolution in units per inch T} +output_res_line orl Yj T{ +vertical resolution in units per line +T} output_res_vert_inch orvi Yl T{ vertical resolution in units per inch T} @@ -384,15 +393,6 @@ T} wide_char_size widcs Yn T{ character step size when in double wide mode T} -buttons btns BT T{ -number of buttons on mouse -T} -bit_image_entwining bitwin Yo T{ -number of passes for each bit-image row -T} -bit_image_type bitype Yp T{ -type of bit-image device -T} .TE .ad @@ -406,6 +406,9 @@ c l l c lw25 lw6 lw2 lw20. \fBVariable Cap- TCap Description\fR \fBString name Code\fR +acs_chars acsc ac T{ +graphics charset pairs, based on vt100 +T} back_tab cbt bt T{ back tab (P) T} @@ -415,15 +418,36 @@ T} carriage_return cr cr T{ carriage return (P*) (P*) T} +change_char_pitch cpi ZA T{ +Change number of characters per inch +T} +change_line_pitch lpi ZB T{ +Change number of lines per inch +T} +change_res_horz chr ZC T{ +Change horizontal resolution +T} +change_res_vert cvr ZD T{ +Change vertical resolution +T} change_scroll_region csr cs T{ change region to line #1 to line #2 (P) T} +char_padding rmp rP T{ +like ip but when in insert mode +T} clear_all_tabs tbc ct T{ clear all tab stops (P) T} +clear_margins mgc MC T{ +clear right and left soft margins +T} clear_screen clear cl T{ clear screen and home cursor (P*) T} +clr_bol el1 cb T{ +Clear to beginning of line +T} clr_eol el ce T{ clear to end of line (P) T} @@ -436,6 +460,9 @@ T} command_character cmdch CC T{ terminal settable cmd character in prototype !? T} +create_window cwin CW T{ +define a window #1 from #2,#3 to #4,#5 +T} cursor_address cup cm T{ move to row #1 columns #2 T} @@ -458,7 +485,7 @@ cursor_normal cnorm ve T{ make cursor appear normal (undo civis/cvvis) T} cursor_right cuf1 nd T{ -move right one space +non-destructive space (move right one space) T} cursor_to_ll ll ll T{ last line, first column (if no cup) @@ -469,21 +496,36 @@ T} cursor_visible cvvis vs T{ make cursor very visible T} +define_char defc ZE T{ +Define a character +T} delete_character dch1 dc T{ delete character (P*) T} delete_line dl1 dl T{ delete line (P*) T} +dial_phone dial DI T{ +dial number #1 +T} dis_status_line dsl ds T{ disable status line T} +display_clock dclk DK T{ +display clock at (#1,#2) +T} down_half_line hd hd T{ half a line down T} +ena_acs enacs eA T{ +enable alternate char set +T} enter_alt_charset_mode smacs as T{ start alternate character set (P) T} +enter_am_mode smam SA T{ +turn on automatic margins +T} enter_blink_mode blink mb T{ turn on blinking T} @@ -499,11 +541,29 @@ T} enter_dim_mode dim mh T{ turn on half-bright mode T} +enter_doublewide_mode swidm ZF T{ +Enter double-wide mode +T} +enter_draft_quality sdrfq ZG T{ +Enter draft-quality mode +T} enter_insert_mode smir im T{ enter insert mode T} -enter_secure_mode invis mk T{ -turn on blank mode (characters invisible) +enter_italics_mode sitm ZH T{ +Enter italic mode +T} +enter_leftward_mode slm ZI T{ +Start leftward carriage motion +T} +enter_micro_mode smicm ZJ T{ +Start micro-motion mode +T} +enter_near_letter_quality snlq ZK T{ +Enter NLQ mode +T} +enter_normal_quality snrmq ZL T{ +Enter normal-quality mode T} enter_protected_mode prot mp T{ turn on protected mode @@ -511,18 +571,39 @@ T} enter_reverse_mode rev mr T{ turn on reverse video mode T} +enter_secure_mode invis mk T{ +turn on blank mode (characters invisible) +T} +enter_shadow_mode sshm ZM T{ +Enter shadow-print mode +T} enter_standout_mode smso so T{ begin standout mode T} +enter_subscript_mode ssubm ZN T{ +Enter subscript mode +T} +enter_superscript_mode ssupm ZO T{ +Enter superscript mode +T} enter_underline_mode smul us T{ begin underline mode T} +enter_upward_mode sum ZP T{ +Start upward carriage motion +T} +enter_xon_mode smxon SX T{ +turn on xon/xoff handshaking +T} erase_chars ech ec T{ erase #1 characters (P) T} exit_alt_charset_mode rmacs ae T{ end alternate character set (P) T} +exit_am_mode rmam RA T{ +turn off automatic margins +T} exit_attribute_mode sgr0 me T{ turn off all attributes T} @@ -532,15 +613,48 @@ T} exit_delete_mode rmdc ed T{ end delete mode T} +exit_doublewide_mode rwidm ZQ T{ +End double-wide mode +T} exit_insert_mode rmir ei T{ exit insert mode T} +exit_italics_mode ritm ZR T{ +End italic mode +T} +exit_leftward_mode rlm ZS T{ +End left-motion mode +T} +exit_micro_mode rmicm ZT T{ +End micro-motion mode +T} +exit_shadow_mode rshm ZU T{ +End shadow-print mode +T} exit_standout_mode rmso se T{ exit standout mode T} +exit_subscript_mode rsubm ZV T{ +End subscript mode +T} +exit_superscript_mode rsupm ZW T{ +End superscript mode +T} exit_underline_mode rmul ue T{ exit underline mode T} +exit_upward_mode rum ZX T{ +End reverse character motion +T} +exit_xon_mode rmxon RX T{ +turn off xon/xoff handshaking +T} +fixed_pause pause PA T{ +pause for 2-3 seconds +T} +flash_hook hook fh T{ +flash switch hook +T} flash_screen flash vb T{ visible bell (may not move cursor) T} @@ -550,6 +664,12 @@ T} from_status_line fsl fs T{ return from status line T} +goto_window wingo WG T{ +go to window #1 +T} +hangup hup HU T{ +hang-up phone +T} init_1string is1 i1 T{ initialization string T} @@ -562,6 +682,15 @@ T} init_file if if T{ name of initialization file T} +init_prog iprog iP T{ +path name of program for initialization +T} +initialize_color initc Ic T{ +initialize color #1 to (#2,#3,#4) +T} +initialize_pair initp Ip T{ +Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +T} insert_character ich1 ic T{ insert character (P) T} @@ -571,15 +700,51 @@ T} insert_padding ip ip T{ insert padding after inserted character T} +key_a1 ka1 K1 T{ +upper left of keypad +T} +key_a3 ka3 K3 T{ +upper right of keypad +T} +key_b2 kb2 K2 T{ +center of keypad +T} key_backspace kbs kb T{ backspace key T} +key_beg kbeg @1 T{ +begin key +T} +key_btab kcbt kB T{ +back-tab key +T} +key_c1 kc1 K4 T{ +lower left of keypad +T} +key_c3 kc3 K5 T{ +lower right of keypad +T} +key_cancel kcan @2 T{ +cancel key +T} key_catab ktbc ka T{ clear-all-tabs key T} key_clear kclr kC T{ clear-screen or erase key T} +key_close kclo @3 T{ +close key +T} +key_command kcmd @4 T{ +command key +T} +key_copy kcpy @5 T{ +copy key +T} +key_create kcrt @6 T{ +create key +T} key_ctab kctab kt T{ clear-tab key T} @@ -595,12 +760,21 @@ T} key_eic krmir kM T{ sent by rmir or smir in insert mode T} +key_end kend @7 T{ +end key +T} +key_enter kent @8 T{ +enter/send key +T} key_eol kel kE T{ clear-to-end-of-line key T} key_eos ked kS T{ clear-to-end-of-screen key T} +key_exit kext @9 T{ +exit key +T} key_f0 kf0 k0 T{ F0 function key T} @@ -610,308 +784,209 @@ T} key_f10 kf10 k; T{ F10 function key T} -key_f2 kf2 k2 T{ -F2 function key -T} -key_f3 kf3 k3 T{ -F3 function key -T} -key_f4 kf4 k4 T{ -F4 function key -T} -key_f5 kf5 k5 T{ -F5 function key -T} -key_f6 kf6 k6 T{ -F6 function key -T} -key_f7 kf7 k7 T{ -F7 function key -T} -key_f8 kf8 k8 T{ -F8 function key -T} -key_f9 kf9 k9 T{ -F9 function key -T} -key_home khome kh T{ -home key -T} -key_ic kich1 kI T{ -insert-character key -T} -key_il kil1 kA T{ -insert-line key -T} -key_left kcub1 kl T{ -left-arrow key -T} -key_ll kll kH T{ -lower-left key (home down) -T} -key_npage knp kN T{ -next-page key -T} -key_ppage kpp kP T{ -previous-page key -T} -key_right kcuf1 kr T{ -right-arrow key -T} -key_sf kind kF T{ -scroll-forward key -T} -key_sr kri kR T{ -scroll-backward key -T} -key_stab khts kT T{ -set-tab key -T} -key_up kcuu1 ku T{ -up-arrow key -T} -keypad_local rmkx ke T{ -leave 'keyboard_transmit' mode -T} -keypad_xmit smkx ks T{ -enter 'keyboard_transmit' mode -T} -lab_f0 lf0 l0 T{ -label on function key f0 if not f0 -T} -lab_f1 lf1 l1 T{ -label on function key f1 if not f1 -T} -lab_f10 lf10 la T{ -label on function key f10 if not f10 -T} -lab_f2 lf2 l2 T{ -label on function key f2 if not f2 -T} -lab_f3 lf3 l3 T{ -label on function key f3 if not f3 -T} -lab_f4 lf4 l4 T{ -label on function key f4 if not f4 -T} -lab_f5 lf5 l5 T{ -label on function key f5 if not f5 -T} -lab_f6 lf6 l6 T{ -label on function key f6 if not f6 -T} -lab_f7 lf7 l7 T{ -label on function key f7 if not f7 -T} -lab_f8 lf8 l8 T{ -label on function key f8 if not f8 -T} -lab_f9 lf9 l9 T{ -label on function key f9 if not f9 -T} -meta_off rmm mo T{ -turn off meta mode +key_f11 kf11 F1 T{ +F11 function key T} -meta_on smm mm T{ -turn on meta mode (8th-bit on) +key_f12 kf12 F2 T{ +F12 function key T} -newline nel nw T{ -newline (behave like cr followed by lf) +key_f13 kf13 F3 T{ +F13 function key T} -pad_char pad pc T{ -padding char (instead of null) +key_f14 kf14 F4 T{ +F14 function key T} -parm_dch dch DC T{ -delete #1 characters (P*) +key_f15 kf15 F5 T{ +F15 function key T} -parm_delete_line dl DL T{ -delete #1 lines (P*) +key_f16 kf16 F6 T{ +F16 function key T} -parm_down_cursor cud DO T{ -down #1 lines (P*) +key_f17 kf17 F7 T{ +F17 function key T} -parm_ich ich IC T{ -insert #1 characters (P*) +key_f18 kf18 F8 T{ +F18 function key T} -parm_index indn SF T{ -scroll forward #1 lines (P) +key_f19 kf19 F9 T{ +F19 function key T} -parm_insert_line il AL T{ -insert #1 lines (P*) +key_f2 kf2 k2 T{ +F2 function key T} -parm_left_cursor cub LE T{ -move #1 characters to the left (P) +key_f20 kf20 FA T{ +F20 function key T} -parm_right_cursor cuf RI T{ -move #1 characters to the right (P*) +key_f21 kf21 FB T{ +F21 function key T} -parm_rindex rin SR T{ -scroll back #1 lines (P) +key_f22 kf22 FC T{ +F22 function key T} -parm_up_cursor cuu UP T{ -up #1 lines (P*) +key_f23 kf23 FD T{ +F23 function key T} -pkey_key pfkey pk T{ -program function key #1 to type string #2 +key_f24 kf24 FE T{ +F24 function key T} -pkey_local pfloc pl T{ -program function key #1 to execute string #2 +key_f25 kf25 FF T{ +F25 function key T} -pkey_xmit pfx px T{ -program function key #1 to transmit string #2 +key_f26 kf26 FG T{ +F26 function key T} -print_screen mc0 ps T{ -print contents of screen +key_f27 kf27 FH T{ +F27 function key T} -prtr_off mc4 pf T{ -turn off printer +key_f28 kf28 FI T{ +F28 function key T} -prtr_on mc5 po T{ -turn on printer +key_f29 kf29 FJ T{ +F29 function key T} -repeat_char rep rp T{ -repeat char #1 #2 times (P*) +key_f3 kf3 k3 T{ +F3 function key T} -reset_1string rs1 r1 T{ -reset string +key_f30 kf30 FK T{ +F30 function key T} -reset_2string rs2 r2 T{ -reset string +key_f31 kf31 FL T{ +F31 function key T} -reset_3string rs3 r3 T{ -reset string +key_f32 kf32 FM T{ +F32 function key T} -reset_file rf rf T{ -name of reset file +key_f33 kf33 FN T{ +F33 function key T} -restore_cursor rc rc T{ -restore cursor to position of last save_cursor +key_f34 kf34 FO T{ +F34 function key T} -row_address vpa cv T{ -vertical position #1 absolute (P) +key_f35 kf35 FP T{ +F35 function key T} -save_cursor sc sc T{ -save current cursor position (P) +key_f36 kf36 FQ T{ +F36 function key T} -scroll_forward ind sf T{ -scroll text up (P) +key_f37 kf37 FR T{ +F37 function key T} -scroll_reverse ri sr T{ -scroll text down (P) +key_f38 kf38 FS T{ +F38 function key T} -set_attributes sgr sa T{ -define video attributes #1-#9 (PG9) +key_f39 kf39 FT T{ +F39 function key T} -set_tab hts st T{ -set a tab in every row, current columns +key_f4 kf4 k4 T{ +F4 function key T} -set_window wind wi T{ -current window is lines #1-#2 cols #3-#4 +key_f40 kf40 FU T{ +F40 function key T} -tab ht ta T{ -tab to next 8-space hardware tab stop +key_f41 kf41 FV T{ +F41 function key T} -to_status_line tsl ts T{ -move to status line +key_f42 kf42 FW T{ +F42 function key T} -underline_char uc uc T{ -underline char and move past it +key_f43 kf43 FX T{ +F43 function key T} -up_half_line hu hu T{ -half a line up +key_f44 kf44 FY T{ +F44 function key T} -init_prog iprog iP T{ -path name of program for initialization +key_f45 kf45 FZ T{ +F45 function key T} -key_a1 ka1 K1 T{ -upper left of keypad +key_f46 kf46 Fa T{ +F46 function key T} -key_a3 ka3 K3 T{ -upper right of keypad +key_f47 kf47 Fb T{ +F47 function key T} -key_b2 kb2 K2 T{ -center of keypad +key_f48 kf48 Fc T{ +F48 function key T} -key_c1 kc1 K4 T{ -lower left of keypad +key_f49 kf49 Fd T{ +F49 function key T} -key_c3 kc3 K5 T{ -lower right of keypad +key_f5 kf5 k5 T{ +F5 function key T} -prtr_non mc5p pO T{ -turn on printer for #1 bytes +key_f50 kf50 Fe T{ +F50 function key T} -char_padding rmp rP T{ -like ip but when in insert mode +key_f51 kf51 Ff T{ +F51 function key T} -acs_chars acsc ac T{ -graphics charset pairs, based on vt100 +key_f52 kf52 Fg T{ +F52 function key T} -plab_norm pln pn T{ -program label #1 to show string #2 +key_f53 kf53 Fh T{ +F53 function key T} -key_btab kcbt kB T{ -back-tab key +key_f54 kf54 Fi T{ +F54 function key T} -enter_xon_mode smxon SX T{ -turn on xon/xoff handshaking +key_f55 kf55 Fj T{ +F55 function key T} -exit_xon_mode rmxon RX T{ -turn off xon/xoff handshaking +key_f56 kf56 Fk T{ +F56 function key T} -enter_am_mode smam SA T{ -turn on automatic margins +key_f57 kf57 Fl T{ +F57 function key T} -exit_am_mode rmam RA T{ -turn off automatic margins +key_f58 kf58 Fm T{ +F58 function key T} -xon_character xonc XN T{ -XON character +key_f59 kf59 Fn T{ +F59 function key T} -xoff_character xoffc XF T{ -XOFF character +key_f6 kf6 k6 T{ +F6 function key T} -ena_acs enacs eA T{ -enable alternate char set +key_f60 kf60 Fo T{ +F60 function key T} -label_on smln LO T{ -turn on soft labels +key_f61 kf61 Fp T{ +F61 function key T} -label_off rmln LF T{ -turn off soft labels +key_f62 kf62 Fq T{ +F62 function key T} -key_beg kbeg @1 T{ -begin key +key_f63 kf63 Fr T{ +F63 function key T} -key_cancel kcan @2 T{ -cancel key +key_f7 kf7 k7 T{ +F7 function key T} -key_close kclo @3 T{ -close key +key_f8 kf8 k8 T{ +F8 function key T} -key_command kcmd @4 T{ -command key +key_f9 kf9 k9 T{ +F9 function key T} -key_copy kcpy @5 T{ -copy key +key_find kfnd @0 T{ +find key T} -key_create kcrt @6 T{ -create key +key_help khlp %1 T{ +help key T} -key_end kend @7 T{ -end key +key_home khome kh T{ +home key T} -key_enter kent @8 T{ -enter/send key +key_ic kich1 kI T{ +insert-character key T} -key_exit kext @9 T{ -exit key +key_il kil1 kA T{ +insert-line key T} -key_find kfnd @0 T{ -find key +key_left kcub1 kl T{ +left-arrow key T} -key_help khlp %1 T{ -help key +key_ll kll kH T{ +lower-left key (home down) T} key_mark kmrk %2 T{ mark key @@ -925,12 +1000,18 @@ T} key_next knxt %5 T{ next key T} +key_npage knp kN T{ +next-page key +T} key_open kopn %6 T{ open key T} key_options kopt %7 T{ options key T} +key_ppage kpp kP T{ +previous-page key +T} key_previous kprv %8 T{ previous key T} @@ -955,15 +1036,12 @@ T} key_resume kres &5 T{ resume key T} +key_right kcuf1 kr T{ +right-arrow key +T} key_save ksav &6 T{ save key T} -key_suspend kspd &7 T{ -suspend key -T} -key_undo kund &8 T{ -undo key -T} key_sbeg kBEG &9 T{ shifted begin key T} @@ -997,6 +1075,9 @@ T} key_sexit kEXT *9 T{ shifted exit key T} +key_sf kind kF T{ +scroll-forward key +T} key_sfind kFND *0 T{ shifted find key T} @@ -1030,6 +1111,9 @@ T} key_sprint kPRT %f T{ shifted print key T} +key_sr kri kR T{ +scroll-backward key +T} key_sredo kRDO %g T{ shifted redo key T} @@ -1048,266 +1132,233 @@ T} key_ssuspend kSPD !2 T{ shifted suspend key T} +key_stab khts kT T{ +set-tab key +T} key_sundo kUND !3 T{ shifted undo key T} -req_for_input rfi RF T{ -send next input char (for ptys) -T} -key_f11 kf11 F1 T{ -F11 function key -T} -key_f12 kf12 F2 T{ -F12 function key -T} -key_f13 kf13 F3 T{ -F13 function key -T} -key_f14 kf14 F4 T{ -F14 function key -T} -key_f15 kf15 F5 T{ -F15 function key -T} -key_f16 kf16 F6 T{ -F16 function key -T} -key_f17 kf17 F7 T{ -F17 function key -T} -key_f18 kf18 F8 T{ -F18 function key -T} -key_f19 kf19 F9 T{ -F19 function key -T} -key_f20 kf20 FA T{ -F20 function key -T} -key_f21 kf21 FB T{ -F21 function key +key_suspend kspd &7 T{ +suspend key T} -key_f22 kf22 FC T{ -F22 function key +key_undo kund &8 T{ +undo key T} -key_f23 kf23 FD T{ -F23 function key +key_up kcuu1 ku T{ +up-arrow key T} -key_f24 kf24 FE T{ -F24 function key +keypad_local rmkx ke T{ +leave 'keyboard_transmit' mode T} -key_f25 kf25 FF T{ -F25 function key +keypad_xmit smkx ks T{ +enter 'keyboard_transmit' mode T} -key_f26 kf26 FG T{ -F26 function key +lab_f0 lf0 l0 T{ +label on function key f0 if not f0 T} -key_f27 kf27 FH T{ -F27 function key +lab_f1 lf1 l1 T{ +label on function key f1 if not f1 T} -key_f28 kf28 FI T{ -F28 function key +lab_f10 lf10 la T{ +label on function key f10 if not f10 T} -key_f29 kf29 FJ T{ -F29 function key +lab_f2 lf2 l2 T{ +label on function key f2 if not f2 T} -key_f30 kf30 FK T{ -F30 function key +lab_f3 lf3 l3 T{ +label on function key f3 if not f3 T} -key_f31 kf31 FL T{ -F31 function key +lab_f4 lf4 l4 T{ +label on function key f4 if not f4 T} -key_f32 kf32 FM T{ -F32 function key +lab_f5 lf5 l5 T{ +label on function key f5 if not f5 T} -key_f33 kf33 FN T{ -F33 function key +lab_f6 lf6 l6 T{ +label on function key f6 if not f6 T} -key_f34 kf34 FO T{ -F34 function key +lab_f7 lf7 l7 T{ +label on function key f7 if not f7 T} -key_f35 kf35 FP T{ -F35 function key +lab_f8 lf8 l8 T{ +label on function key f8 if not f8 T} -key_f36 kf36 FQ T{ -F36 function key +lab_f9 lf9 l9 T{ +label on function key f9 if not f9 T} -key_f37 kf37 FR T{ -F37 function key +label_format fln Lf T{ +label format T} -key_f38 kf38 FS T{ -F38 function key +label_off rmln LF T{ +turn off soft labels T} -key_f39 kf39 FT T{ -F39 function key +label_on smln LO T{ +turn on soft labels T} -key_f40 kf40 FU T{ -F40 function key +meta_off rmm mo T{ +turn off meta mode T} -key_f41 kf41 FV T{ -F41 function key +meta_on smm mm T{ +turn on meta mode (8th-bit on) T} -key_f42 kf42 FW T{ -F42 function key +micro_column_address mhpa ZY T{ +Like column_address in micro mode T} -key_f43 kf43 FX T{ -F43 function key +micro_down mcud1 ZZ T{ +Like cursor_down in micro mode T} -key_f44 kf44 FY T{ -F44 function key +micro_left mcub1 Za T{ +Like cursor_left in micro mode T} -key_f45 kf45 FZ T{ -F45 function key +micro_right mcuf1 Zb T{ +Like cursor_right in micro mode T} -key_f46 kf46 Fa T{ -F46 function key +micro_row_address mvpa Zc T{ +Like row_address in micro mode T} -key_f47 kf47 Fb T{ -F47 function key +micro_up mcuu1 Zd T{ +Like cursor_up in micro mode T} -key_f48 kf48 Fc T{ -F48 function key +newline nel nw T{ +newline (behave like cr followed by lf) T} -key_f49 kf49 Fd T{ -F49 function key +order_of_pins porder Ze T{ +Match software bits to print-head pins T} -key_f50 kf50 Fe T{ -F50 function key +orig_colors oc oc T{ +Set all color pairs to the original ones T} -key_f51 kf51 Ff T{ -F51 function key +orig_pair op op T{ +Set default pair to its original value T} -key_f52 kf52 Fg T{ -F52 function key +pad_char pad pc T{ +padding char (instead of null) T} -key_f53 kf53 Fh T{ -F53 function key +parm_dch dch DC T{ +delete #1 characters (P*) T} -key_f54 kf54 Fi T{ -F54 function key +parm_delete_line dl DL T{ +delete #1 lines (P*) T} -key_f55 kf55 Fj T{ -F55 function key +parm_down_cursor cud DO T{ +down #1 lines (P*) T} -key_f56 kf56 Fk T{ -F56 function key +parm_down_micro mcud Zf T{ +Like parm_down_cursor in micro mode T} -key_f57 kf57 Fl T{ -F57 function key +parm_ich ich IC T{ +insert #1 characters (P*) T} -key_f58 kf58 Fm T{ -F58 function key +parm_index indn SF T{ +scroll forward #1 lines (P) T} -key_f59 kf59 Fn T{ -F59 function key +parm_insert_line il AL T{ +insert #1 lines (P*) T} -key_f60 kf60 Fo T{ -F60 function key +parm_left_cursor cub LE T{ +move #1 characters to the left (P) T} -key_f61 kf61 Fp T{ -F61 function key +parm_left_micro mcub Zg T{ +Like parm_left_cursor in micro mode T} -key_f62 kf62 Fq T{ -F62 function key +parm_right_cursor cuf RI T{ +move #1 characters to the right (P*) T} -key_f63 kf63 Fr T{ -F63 function key +parm_right_micro mcuf Zh T{ +Like parm_right_cursor in micro mode T} -clr_bol el1 cb T{ -Clear to beginning of line +parm_rindex rin SR T{ +scroll back #1 lines (P) T} -clear_margins mgc MC T{ -clear right and left soft margins +parm_up_cursor cuu UP T{ +up #1 lines (P*) T} -set_left_margin smgl ML T{ -set left soft margin at current column +parm_up_micro mcuu Zi T{ +Like parm_up_cursor in micro mode T} -set_right_margin smgr MR T{ -set right soft margin at current column +pkey_key pfkey pk T{ +program function key #1 to type string #2 T} -label_format fln Lf T{ -label format +pkey_local pfloc pl T{ +program function key #1 to execute string #2 T} -set_clock sclk SC T{ -set clock, #1 hrs #2 mins #3 secs +pkey_xmit pfx px T{ +program function key #1 to transmit string #2 T} -display_clock dclk DK T{ -display clock at (#1,#2) +plab_norm pln pn T{ +program label #1 to show string #2 T} -remove_clock rmclk RC T{ -remove clock +print_screen mc0 ps T{ +print contents of screen T} -create_window cwin CW T{ -define a window #1 from #2,#3 to #4,#5 +prtr_non mc5p pO T{ +turn on printer for #1 bytes T} -goto_window wingo WG T{ -go to window #1 +prtr_off mc4 pf T{ +turn off printer T} -hangup hup HU T{ -hang-up phone +prtr_on mc5 po T{ +turn on printer T} -dial_phone dial DI T{ -dial number #1 +pulse pulse PU T{ +select pulse dialing T} quick_dial qdial QD T{ dial number #1 without checking T} -tone tone TO T{ -select touch tone dialing -T} -pulse pulse PU T{ -select pulse dialing +remove_clock rmclk RC T{ +remove clock T} -flash_hook hook fh T{ -flash switch hook +repeat_char rep rp T{ +repeat char #1 #2 times (P*) T} -fixed_pause pause PA T{ -pause for 2-3 seconds +req_for_input rfi RF T{ +send next input char (for ptys) T} -wait_tone wait WA T{ -wait for dial-tone +reset_1string rs1 r1 T{ +reset string T} -user0 u0 u0 T{ -User string #0 +reset_2string rs2 r2 T{ +reset string T} -user1 u1 u1 T{ -User string #1 +reset_3string rs3 r3 T{ +reset string T} -user2 u2 u2 T{ -User string #2 +reset_file rf rf T{ +name of reset file T} -user3 u3 u3 T{ -User string #3 +restore_cursor rc rc T{ +restore cursor to position of last save_cursor T} -user4 u4 u4 T{ -User string #4 +row_address vpa cv T{ +vertical position #1 absolute (P) T} -user5 u5 u5 T{ -User string #5 +save_cursor sc sc T{ +save current cursor position (P) T} -user6 u6 u6 T{ -User string #6 +scroll_forward ind sf T{ +scroll text up (P) T} -user7 u7 u7 T{ -User string #7 +scroll_reverse ri sr T{ +scroll text down (P) T} -user8 u8 u8 T{ -User string #8 +select_char_set scs Zj T{ +Select character set T} -user9 u9 u9 T{ -User string #9 +set_attributes sgr sa T{ +define video attributes #1-#9 (PG9) T} -orig_pair op op T{ -Set default pair to its original value +set_background setb Sb T{ +Set background color #1 T} -orig_colors oc oc T{ -Set all color pairs to the original ones +set_bottom_margin smgb Zk T{ +Set bottom margin at current line T} -initialize_color initc Ic T{ -initialize color #1 to (#2,#3,#4) +set_bottom_margin_parm smgbp Zl T{ +Set bottom margin at line #1 or #2 lines from bottom T} -initialize_pair initp Ip T{ -Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +set_clock sclk SC T{ +set clock, #1 hrs #2 mins #3 secs T} set_color_pair scp sp T{ Set current color pair to #1 @@ -1315,135 +1366,30 @@ T} set_foreground setf Sf T{ Set foreground color #1 T} -set_background setb Sb T{ -Set background color #1 -T} -change_char_pitch cpi ZA T{ -Change number of characters per inch -T} -change_line_pitch lpi ZB T{ -Change number of lines per inch -T} -change_res_horz chr ZC T{ -Change horizontal resolution -T} -change_res_vert cvr ZD T{ -Change vertical resolution -T} -define_char defc ZE T{ -Define a character -T} -enter_doublewide_mode swidm ZF T{ -Enter double-wide mode -T} -enter_draft_quality sdrfq ZG T{ -Enter draft-quality mode -T} -enter_italics_mode sitm ZH T{ -Enter italic mode -T} -enter_leftward_mode slm ZI T{ -Start leftward carriage motion -T} -enter_micro_mode smicm ZJ T{ -Start micro-motion mode -T} -enter_near_letter_quality snlq ZK T{ -Enter NLQ mode -T} -enter_normal_quality snrmq ZL T{ -Enter normal-quality mode -T} -enter_shadow_mode sshm ZM T{ -Enter shadow-print mode -T} -enter_subscript_mode ssubm ZN T{ -Enter subscript mode -T} -enter_superscript_mode ssupm ZO T{ -Enter superscript mode -T} -enter_upward_mode sum ZP T{ -Start upward carriage motion -T} -exit_doublewide_mode rwidm ZQ T{ -End double-wide mode -T} -exit_italics_mode ritm ZR T{ -End italic mode -T} -exit_leftward_mode rlm ZS T{ -End left-motion mode -T} -exit_micro_mode rmicm ZT T{ -End micro-motion mode -T} -exit_shadow_mode rshm ZU T{ -End shadow-print mode -T} -exit_subscript_mode rsubm ZV T{ -End subscript mode -T} -exit_superscript_mode rsupm ZW T{ -End superscript mode -T} -exit_upward_mode rum ZX T{ -End reverse character motion -T} -micro_column_address mhpa ZY T{ -Like column_address in micro mode -T} -micro_down mcud1 ZZ T{ -Like cursor_down in micro mode -T} -micro_left mcub1 Za T{ -Like cursor_left in micro mode -T} -micro_right mcuf1 Zb T{ -Like cursor_right in micro mode -T} -micro_row_address mvpa Zc T{ -Like row_address in micro mode -T} -micro_up mcuu1 Zd T{ -Like cursor_up in micro mode -T} -order_of_pins porder Ze T{ -Match software bits to print-head pins -T} -parm_down_micro mcud Zf T{ -Like parm_down_cursor in micro mode -T} -parm_left_micro mcub Zg T{ -Like parm_left_cursor in micro mode -T} -parm_right_micro mcuf Zh T{ -Like parm_right_cursor in micro mode -T} -parm_up_micro mcuu Zi T{ -Like parm_up_cursor in micro mode -T} -select_char_set scs Zj T{ -Select character set -T} -set_bottom_margin smgb Zk T{ -Set bottom margin at current line -T} -set_bottom_margin_parm smgbp Zl T{ -Set bottom margin at line #1 or #2 lines from bottom +set_left_margin smgl ML T{ +set left soft margin at current column T} set_left_margin_parm smglp Zm T{ Set left (right) margin at column #1 (#2) T} +set_right_margin smgr MR T{ +set right soft margin at current column +T} set_right_margin_parm smgrp Zn T{ Set right margin at column #1 T} +set_tab hts st T{ +set a tab in every row, current columns +T} set_top_margin smgt Zo T{ Set top margin at current line T} set_top_margin_parm smgtp Zp T{ Set top (bottom) margin at row #1 (#2) T} +set_window wind wi T{ +current window is lines #1-#2 cols #3-#4 +T} start_bit_image sbim Zq T{ Start printing bit image graphics T} @@ -1462,9 +1408,63 @@ T} superscript_characters supcs Zv T{ List of superscriptable characters T} +tab ht ta T{ +tab to next 8-space hardware tab stop +T} these_cause_cr docr Zw T{ Printing any of these characters causes CR T} +to_status_line tsl ts T{ +move to status line +T} +tone tone TO T{ +select touch tone dialing +T} +underline_char uc uc T{ +underline char and move past it +T} +up_half_line hu hu T{ +half a line up +T} +user0 u0 u0 T{ +User string #0 +T} +user1 u1 u1 T{ +User string #1 +T} +user2 u2 u2 T{ +User string #2 +T} +user3 u3 u3 T{ +User string #3 +T} +user4 u4 u4 T{ +User string #4 +T} +user5 u5 u5 T{ +User string #5 +T} +user6 u6 u6 T{ +User string #6 +T} +user7 u7 u7 T{ +User string #7 +T} +user8 u8 u8 T{ +User string #8 +T} +user9 u9 u9 T{ +User string #9 +T} +wait_tone wait WA T{ +wait for dial-tone +T} +xoff_character xoffc XF T{ +XOFF character +T} +xon_character xonc XN T{ +XON character +T} zero_motion zerom Zx T{ No motion for subsequent character T} @@ -1482,35 +1482,71 @@ c l l c lw25 lw6 lw2 lw18. \fBVariable Cap- TCap Description\fR \fBString name Code\fR +alt_scancode_esc scesa S8 T{ +Alternate escape for scancode emulation +T} +bit_image_carriage_return bicr Yv T{ +Move to beginning of same row +T} +bit_image_newline binel Zz T{ +Move to next row of the bit image +T} +bit_image_repeat birep Xy T{ +Repeat bit image cell #1 #2 times +T} char_set_names csnm Zy T{ List of character set names T} -key_mouse kmous Km T{ -Mouse event has occurred +code_set_init csin ci T{ +Init sequence for multiple codesets T} -mouse_info minfo Mi T{ -Mouse status information +color_names colornm Yw T{ +Give name for color #1 T} -req_mouse_pos reqmp RQ T{ -Request mouse position +define_bit_image_region defbi Yx T{ +Define rectangualar bit image region +T} +device_type devt dv T{ +Indicate language/codeset support +T} +display_pc_char dispc S1 T{ +Display PC character +T} +end_bit_image_region endbi Yy T{ +End a bit-image region +T} +enter_pc_charset_mode smpch S2 T{ +Enter PC character display mode +T} +enter_scancode_mode smsc S4 T{ +Enter PC scancode mode +T} +exit_pc_charset_mode rmpch S3 T{ +Exit PC character display mode +T} +exit_scancode_mode rmsc S5 T{ +Exit PC scancode mode T} get_mouse getm Gm T{ Curses should get button events T} -set_a_foreground setaf AF T{ -Set foreground color using ANSI escape +key_mouse kmous Km T{ +Mouse event has occurred T} -set_a_background setab AB T{ -Set background color using ANSI escape +mouse_info minfo Mi T{ +Mouse status information +T} +pc_term_options pctrm S6 T{ +PC terminal options T} pkey_plab pfxl xl T{ Program function key #1 to type string #2 and show string #3 T} -device_type devt dv T{ -Indicate language/codeset support +req_mouse_pos reqmp RQ T{ +Request mouse position T} -code_set_init csin ci T{ -Init sequence for multiple codesets +scancode_escape scesc S7 T{ +Escape for scancode emulation T} set0_des_seq s0ds s0 T{ Shift to code set 0 (EUC set 0, ASCII) @@ -1524,67 +1560,30 @@ T} set3_des_seq s3ds s3 T{ Shift to code set 3 T} -set_lr_margin smglr ML T{ -Set both left and right margins to #1, #2 -T} -set_tb_margin smgtb MT T{ -Sets both top and bottom margins to #1, #2 -T} -bit_image_repeat birep Xy T{ -Repeat bit image cell #1 #2 times -T} -bit_image_newline binel Zz T{ -Move to next row of the bit image -T} -bit_image_carriage_return bicr Yv T{ -Move to beginning of same row -T} -color_names colornm Yw T{ -Give name for color #1 -T} -define_bit_image_region defbi Yx T{ -Define rectangualar bit image region +set_a_background setab AB T{ +Set background color using ANSI escape T} -end_bit_image_region endbi Yy T{ -End a bit-image region +set_a_foreground setaf AF T{ +Set foreground color using ANSI escape T} set_color_band setcolor Yz T{ Change to ribbon color #1 T} +set_lr_margin smglr ML T{ +Set both left and right margins to #1, #2 +T} set_page_length slines YZ T{ Set page length to #1 lines T} -display_pc_char dispc S1 T{ -Display PC character -T} -enter_pc_charset_mode smpch S2 T{ -Enter PC character display mode -T} -exit_pc_charset_mode rmpch S3 T{ -Exit PC character display mode -T} -enter_scancode_mode smsc S4 T{ -Enter PC scancode mode -T} -exit_scancode_mode rmsc S5 T{ -Exit PC scancode mode -T} -pc_term_options pctrm S6 T{ -PC terminal options -T} -scancode_escape scesc S7 T{ -Escape for scancode emulation -T} -alt_scancode_esc scesa S8 T{ -Alternate escape for scancode emulation +set_tb_margin smgtb MT T{ +Sets both top and bottom margins to #1, #2 T} .TE .ad .in .8i -The XSI Curses standard added these. They are probably in some post-4.1 -version of System V curses as well, but because XSI Curses lists them in -strict alphabetical order we don't know if this is the right binary order. +The XSI Curses standard added these. They are some post-4.1 +versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x. The \fBncurses\fR termcap names for them are invented; according to the XSI Curses standard, they have no termcap names. If your compiled terminfo entries use these, they may not be binary-compatible with System V terminfo @@ -1616,9 +1615,15 @@ T} enter_vertical_hl_mode evhlm Xv T{ Enter vertical highlight mode T} +set_a_attributes sgr1 sA T{ +Define second set of video attributes #1-#6 +T} +set_pglen_inch slength sL T{ +YI Set page length to #1 hundredth of an inch +T} .TE .ad -.\" $From: terminfo.tail,v 1.19 1998/06/30 01:10:04 tom Exp $ +.\" $Id: terminfo.5tbl,v 1.2 1999/01/18 19:09:17 millert Exp $ .\" Beginning of terminfo.tail file .ps +1 .PP @@ -1637,7 +1642,7 @@ of what a \fBterminfo\fR entry for a modern terminal typically looks like. cub=\\E[%p1%dD, cud=\\E[%p1%dB, cuf=\\E[%p1%dC, cuu=\\E[%p1%dA, dch=\\E[%p1%dP, dl=\\E[%p1%dM, ech=\\E[%p1%dX, el1=\\E[1K, hpa=\\E[%p1%dG, ht=\\E[I, - ich=\\E[%p1%d@, il=\\E[%p1%dL, indn=\\E[%p1%dS, + ich=\\E[%p1%d@, il=\\E[%p1%dL, indn=\\E[%p1%dS, .indn=\\E[%p1%dT, kbs=^H, kcbt=\\E[Z, kcub1=\\E[D, kcud1=\\E[B, kcuf1=\\E[C, kcuu1=\\E[A, kf1=\\E[M, kf10=\\E[V, kf11=\\E[W, kf12=\\E[X, kf2=\\E[N, kf3=\\E[O, kf4=\\E[P, @@ -1675,9 +1680,11 @@ ANSI-standard terminals have (i.e., an automatic return and line-feed when the end of a line is reached) is indicated by the capability \fBam\fR. Hence the description of ansi includes \fBam\fR. -Numeric capabilities are followed by the character `#' and then the value. +Numeric capabilities are followed by the character `#' and then a positive value. Thus \fBcols\fR, which indicates the number of columns the terminal has, gives the value `80' for ansi. +Values for numeric capabilities may be specified in decimal, octal or hexadecimal, +using the C programming language conventions (e.g., 255, 0377 and 0xff or 0xFF). .PP Finally, string valued capabilities, such as \fBel\fR (clear to end of line sequence) are given by the two-character code, an `=', and then a string @@ -1903,7 +1910,7 @@ while the Lear Siegler \s-1ADM\-3\s0 is described as Cursor addressing and other strings requiring parameters in the terminal are described by a parameterized string capability, with -.IR printf (3S) +.IR printf (3 like escapes \fB%x\fR in it. For example, to address the cursor, the .B cup @@ -2286,6 +2293,69 @@ Not all modes need be supported by .BR sgr , only those for which corresponding separate attribute commands exist. .PP +For example, the DEC vt220 supports most of the modes: +.PP +.TS +center; +l c c +l c c +lw28 lw6 lw2 lw20. +\fBtparm parameter attribute escape sequence\fP + +none none \\E[0m +p1 standout \\E[0;1;7m +p2 underline \\E[0;4m +p3 reverse \\E[0;7m +p4 blink \\E[0;5m +p5 dim not available +p6 bold \\E[0;1m +p7 invis \\E[0;8m +p8 protect not used +p9 altcharset ^O (off) ^N (on) +.TE +.PP +We begin each escape sequence by turning off any existing modes, since +there is no quick way to determine whether they are active. +Standout is set up to be the combination of reverse and bold. +The vt220 terminal has a protect mode, +though it is not commonly used in sgr +because it protects characters on the screen from the host's erasures. +The altcharset mode also is different in that it is either ^O or ^N, +depending on whether it is off or on. +If all modes are turned on, the resulting sequence is \\E[0;1;4;5;7;8m^N. +.PP +Some sequences are common to different modes. +For example, ;7 is output when either p1 or p3 is true, that is, if +either standout or reverse modes are turned on. +.PP +Writing out the above sequences, along with their dependencies yields +.PP +.TS +center; +l c c +l c c +lw28 lw6 lw2 lw20. +\fBsequence when to output terminfo translation\fP + +\\E[0 always \\E[0 +;1 if p1 or p6 %?%p1%p6%|%t;1%; +;4 if p2 %?%p2%|%t;4%; +;5 if p4 %?%p4%|%t;5%; +;7 if p1 or p3 %?%p1%p3%|%t;7%; +;8 if p7 %?%p7%|%t;8%; +m always m +^N or ^O if p9 ^N, else ^O %?%p9%t^N%e^O%; +.TE +.PP +Putting this all together into the sgr sequence gives: +.PP +.nf + sgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%; + %?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;, +.fi +.PP +Remember that if you specify sgr, you must also specify sgr0. +.PP Terminals with the ``magic cookie'' glitch .RB ( xmc ) deposit special ``cookies'' when they receive mode-setting sequences, @@ -2333,8 +2403,8 @@ If the keypad can be set to transmit or not transmit, give these codes as \fBsmkx\fR and \fBrmkx\fR. Otherwise the keypad is assumed to always transmit. The codes sent by the left arrow, right arrow, up arrow, down arrow, -and home keys can be given as \fBkcub1, kcuf1, kcuu1, kcud1, -\fRand\fB khome\fR respectively. +and home keys can be given as +\fBkcub1, kcuf1, kcuu1, kcud1, \fRand\fB khome\fR respectively. If there are function keys such as f0, f1, ..., f10, the codes they send can be given as \fBkf0, kf1, ..., kf10\fR. If these keys have labels other than the default f0 through f10, the labels @@ -2454,20 +2524,30 @@ and \fBif\fR, the name of a file containing long initialization strings. These strings are expected to set the terminal into modes consistent with the rest of the terminfo description. They are normally sent to the terminal, by the -.IR tset +.I init +option of the +.IR tput program, each time the user logs in. They will be printed in the following order: +run the program +.BR iprog ; +output .BR is1 ; .BR is2 ; -setting tabs using +set the margins using +.BR mgc , +.BR smgl and +.BR smgr ; +set tabs using .B tbc and .BR hts ; +print the file .BR if ; -running the program -.BR iprog ; and finally +output .BR is3 . +.PP Most initialization is done with .BR is2 . Special terminal modes can be set up without duplicating strings @@ -2584,35 +2664,42 @@ This alternate character set may be specified by the \fBacsc\fR capability. center expand; c l l c c l l c -lw25 lw6 lw2 lw20. +lw28 lw6 lw2 lw20. .\".TH -\fBGlyph ACS Ascii VT100 -Name Name Default Name\fR -upper left corner ACS_ULCORNER + l -lower left corner ACS_LLCORNER + m -upper right corner ACS_URCORNER + k -lower right corner ACS_LRCORNER + j -tee pointing right ACS_LTEE + t -tee pointing left ACS_RTEE + u -tee pointing up ACS_BTEE + v -tee pointing down ACS_TTEE + w -horizontal line ACS_HLINE - q -vertical line ACS_VLINE | x -large plus or crossover ACS_PLUS + n -scan line 1 ACS_S1 ~ o -scan line 9 ACS_S9 \&_ s -diamond ACS_DIAMOND + ` -checker board (stipple) ACS_CKBOARD : a -degree symbol ACS_DEGREE \e f -plus/minus ACS_PLMINUS # g -bullet ACS_BULLET o ~ +\fBGlyph ACS Ascii VT100\fR +\fBName Name Default Name\fR +UK pound sign ACS_STERLING f } +arrow pointing down ACS_DARROW v . arrow pointing left ACS_LARROW < , arrow pointing right ACS_RARROW > + -arrow pointing down ACS_DARROW v . arrow pointing up ACS_UARROW ^ - board of squares ACS_BOARD # h +bullet ACS_BULLET o ~ +checker board (stipple) ACS_CKBOARD : a +degree symbol ACS_DEGREE \e f +diamond ACS_DIAMOND + ` +greater-than-or-equal-to ACS_GEQUAL > z +greek pi ACS_PI * { +horizontal line ACS_HLINE - q lantern symbol ACS_LANTERN # i +large plus or crossover ACS_PLUS + n +less-than-or-equal-to ACS_LEQUAL < y +lower left corner ACS_LLCORNER + m +lower right corner ACS_LRCORNER + j +not-equal ACS_NEQUAL ! | +plus/minus ACS_PLMINUS # g +scan line 1 ACS_S1 ~ o +scan line 3 ACS_S3 - p +scan line 7 ACS_S7 - r +scan line 9 ACS_S9 \&_ s solid square block ACS_BLOCK # 0 +tee pointing down ACS_TTEE + w +tee pointing left ACS_RTEE + u +tee pointing right ACS_LTEE + t +tee pointing up ACS_BTEE + v +upper left corner ACS_ULCORNER + l +upper right corner ACS_URCORNER + k +vertical line ACS_VLINE | x .TE .PP The best way to define a new device's graphics set is to add a column @@ -2849,7 +2936,7 @@ Note that in older terminfo versions, this capability was called `beehive_glitch'; it is now `no_esc_ctl_c'. .PP Other specific terminal problems may be corrected by adding more -capabilities of the form \fBx\fIx\fR. +capabilities of the form \fBx\fR\fIx\fR. .PP .SS Similar Terminals .PP @@ -3015,7 +3102,7 @@ file containing terminal descriptions on OpenBSD \*d/?/* files containing terminal descriptions on other systems .SH "SEE ALSO" -\fBinfo_mkdb(1)\fR, \fBtic\fR(1), \fBcurses\fR(3), \fBprintf\fR(3), \fBterm\fR(\*n). +\fBinfo_mkdb(1)\fR, \fBtic\fR(1M), \fBcurses\fR(3), \fBprintf\fR(3), \fBterm\fR(\*n). .SH AUTHORS Zeyd M. Ben-Halim, Eric S. Raymond. Descends from the original pcurses by Pavel Curtis. diff --git a/lib/libcurses/MKcaptab.awk b/lib/libcurses/tinfo/MKcaptab.awk index f758a8f99b4..2ea3236af3b 100644 --- a/lib/libcurses/MKcaptab.awk +++ b/lib/libcurses/tinfo/MKcaptab.awk @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: MKcaptab.awk,v 1.1 1998/07/23 21:17:19 millert Exp $ +# $OpenBSD: MKcaptab.awk,v 1.1 1999/01/18 19:10:12 millert Exp $ # $From: MKcaptab.awk,v 1.10 1997/09/11 17:40:46 tom Exp $ AWK=${1-awk} DATA=${2-../include/Caps} diff --git a/lib/libcurses/MKfallback.sh b/lib/libcurses/tinfo/MKfallback.sh index 18eb102a644..d6631b2ca8a 100644 --- a/lib/libcurses/MKfallback.sh +++ b/lib/libcurses/tinfo/MKfallback.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: MKfallback.sh,v 1.1 1998/07/23 21:17:21 millert Exp $ +# $OpenBSD: MKfallback.sh,v 1.1 1999/01/18 19:10:12 millert Exp $ # $From: MKfallback.sh,v 1.8 1996/09/15 01:44:13 tom Exp $ # # MKfallback.sh -- create fallback table for entry reads diff --git a/lib/libcurses/MKnames.awk b/lib/libcurses/tinfo/MKnames.awk index ad7a1459e1b..7f49c21b9f5 100644 --- a/lib/libcurses/MKnames.awk +++ b/lib/libcurses/tinfo/MKnames.awk @@ -1,15 +1,11 @@ # $OpenBSD -# $From: MKnames.awk,v 1.9 1997/10/18 19:57:23 tom Exp $ +# $From: MKnames.awk,v 1.10 1999/01/16 23:36:34 tom Exp $ BEGIN { print "/* This file was generated by MKnames.awk */" > "namehdr" print "" > "namehdr" print "#include <curses.priv.h>" > "namehdr" print "" > "namehdr" - print "#ifdef __cplusplus" > "namehdr" - print "#define extern IT NCURSES_CONST char * const" > "namehdr" - print "#else" > "namehdr" print "#define IT NCURSES_CONST char * const" > "namehdr" - print "#endif" > "namehdr" print "" > "namehdr" print "#if BROKEN_LINKER" > "namehdr" print "#include <term.h>" > "namehdr" diff --git a/lib/libcurses/access.c b/lib/libcurses/tinfo/access.c index 20ae2ed4773..20ae2ed4773 100644 --- a/lib/libcurses/access.c +++ b/lib/libcurses/tinfo/access.c diff --git a/lib/libcurses/add_tries.c b/lib/libcurses/tinfo/add_tries.c index 4dca2dbfbb3..31a6e6906ec 100644 --- a/lib/libcurses/add_tries.c +++ b/lib/libcurses/tinfo/add_tries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: add_tries.c,v 1.1 1998/11/17 03:16:20 millert Exp $ */ +/* $OpenBSD: add_tries.c,v 1.1 1999/01/18 19:10:12 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/alloc_entry.c b/lib/libcurses/tinfo/alloc_entry.c index c61a54ab548..49bb255f9a6 100644 --- a/lib/libcurses/alloc_entry.c +++ b/lib/libcurses/tinfo/alloc_entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alloc_entry.c,v 1.1 1998/07/23 21:17:25 millert Exp $ */ +/* $OpenBSD: alloc_entry.c,v 1.1 1999/01/18 19:10:13 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/captoinfo.c b/lib/libcurses/tinfo/captoinfo.c index ac66dca27a6..dcdc4c4ca62 100644 --- a/lib/libcurses/captoinfo.c +++ b/lib/libcurses/tinfo/captoinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: captoinfo.c,v 1.1 1998/07/23 21:17:25 millert Exp $ */ +/* $OpenBSD: captoinfo.c,v 1.1 1999/01/18 19:10:13 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/comp_error.c b/lib/libcurses/tinfo/comp_error.c index 4043f16cb50..2a5b115c7ad 100644 --- a/lib/libcurses/comp_error.c +++ b/lib/libcurses/tinfo/comp_error.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comp_error.c,v 1.2 1998/08/03 17:02:37 millert Exp $ */ +/* $OpenBSD: comp_error.c,v 1.1 1999/01/18 19:10:13 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/comp_expand.c b/lib/libcurses/tinfo/comp_expand.c index b118664a530..12c7113fb9d 100644 --- a/lib/libcurses/comp_expand.c +++ b/lib/libcurses/tinfo/comp_expand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comp_expand.c,v 1.5 1998/10/31 06:30:28 millert Exp $ */ +/* $OpenBSD: comp_expand.c,v 1.1 1999/01/18 19:10:13 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/comp_hash.c b/lib/libcurses/tinfo/comp_hash.c index 74133bb0944..a2d7de5866c 100644 --- a/lib/libcurses/comp_hash.c +++ b/lib/libcurses/tinfo/comp_hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comp_hash.c,v 1.2 1998/09/13 19:16:15 millert Exp $ */ +/* $OpenBSD: comp_hash.c,v 1.1 1999/01/18 19:10:14 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/comp_parse.c b/lib/libcurses/tinfo/comp_parse.c index 16527b9a35e..6416db292ae 100644 --- a/lib/libcurses/comp_parse.c +++ b/lib/libcurses/tinfo/comp_parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comp_parse.c,v 1.2 1998/11/17 03:16:20 millert Exp $ */ +/* $OpenBSD: comp_parse.c,v 1.1 1999/01/18 19:10:14 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/comp_scan.c b/lib/libcurses/tinfo/comp_scan.c index 0c9012c835d..0c9012c835d 100644 --- a/lib/libcurses/comp_scan.c +++ b/lib/libcurses/tinfo/comp_scan.c diff --git a/lib/libcurses/doalloc.c b/lib/libcurses/tinfo/doalloc.c index d973c47da44..a4d293e77ec 100644 --- a/lib/libcurses/doalloc.c +++ b/lib/libcurses/tinfo/doalloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: doalloc.c,v 1.1 1998/09/13 19:16:25 millert Exp $ */ +/* $OpenBSD: doalloc.c,v 1.1 1999/01/18 19:10:15 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/getenv_num.c b/lib/libcurses/tinfo/getenv_num.c index 0d561728928..21e48bdbafe 100644 --- a/lib/libcurses/getenv_num.c +++ b/lib/libcurses/tinfo/getenv_num.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getenv_num.c,v 1.1 1998/10/31 06:30:28 millert Exp $ */ +/* $OpenBSD: getenv_num.c,v 1.1 1999/01/18 19:10:15 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/home_terminfo.c b/lib/libcurses/tinfo/home_terminfo.c index 95ca64a955f..be4feaf927f 100644 --- a/lib/libcurses/home_terminfo.c +++ b/lib/libcurses/tinfo/home_terminfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: home_terminfo.c,v 1.1 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: home_terminfo.c,v 1.1 1999/01/18 19:10:15 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/keys.list b/lib/libcurses/tinfo/keys.list index 11a9b996d1f..078c4747aa5 100644 --- a/lib/libcurses/keys.list +++ b/lib/libcurses/tinfo/keys.list @@ -1,4 +1,4 @@ -# $OpenBSD: keys.list,v 1.3 1998/07/23 21:18:23 millert Exp $ +# $OpenBSD: keys.list,v 1.1 1999/01/18 19:10:15 millert Exp $ # $From: keys.list,v 1.5 1997/10/25 21:05:24 tom Exp $ # The first column is the #define symbol that is in curses.h # The second column is the term.h symbol, for terminfo diff --git a/lib/libcurses/lib_acs.c b/lib/libcurses/tinfo/lib_acs.c index 15a889fe19f..ffbd078af01 100644 --- a/lib/libcurses/lib_acs.c +++ b/lib/libcurses/tinfo/lib_acs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_acs.c,v 1.5 1998/07/23 21:18:24 millert Exp $ */ +/* $OpenBSD: lib_acs.c,v 1.1 1999/01/18 19:10:16 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -38,7 +38,7 @@ #include <curses.priv.h> #include <term.h> /* ena_acs, acs_chars */ -MODULE_ID("$From: lib_acs.c,v 1.13 1998/02/11 12:13:57 tom Exp $") +MODULE_ID("$From: lib_acs.c,v 1.14 1999/01/02 22:37:49 tom Exp $") chtype acs_map[ACS_LEN]; @@ -84,15 +84,12 @@ void init_acs(void) ACS_NEQUAL = '!'; /* should be not-equal */ ACS_STERLING = 'f'; /* should be pound-sterling symbol */ -#ifdef ena_acs if (ena_acs != NULL) { TPUTS_TRACE("ena_acs"); putp(ena_acs); } -#endif /* ena_acs */ -#ifdef acs_chars #define ALTCHAR(c) ((chtype)(((unsigned char)(c)) | A_ALTCHARSET)) if (acs_chars != NULL) { @@ -141,6 +138,4 @@ void init_acs(void) _nc_visbuf(show)); } #endif /* TRACE */ -#endif /* acs_char */ } - diff --git a/lib/libcurses/lib_baudrate.c b/lib/libcurses/tinfo/lib_baudrate.c index 1de84561fc7..97b5eb7c5be 100644 --- a/lib/libcurses/lib_baudrate.c +++ b/lib/libcurses/tinfo/lib_baudrate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_baudrate.c,v 1.5 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: lib_baudrate.c,v 1.1 1999/01/18 19:10:16 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -41,8 +41,9 @@ #include <curses.priv.h> #include <term.h> /* cur_term, pad_char */ +#include <termcap.h> /* ospeed */ -MODULE_ID("$From: lib_baudrate.c,v 1.13 1998/09/19 21:34:26 tom Exp $") +MODULE_ID("$From: lib_baudrate.c,v 1.14 1999/01/03 01:31:45 tom Exp $") /* * int @@ -100,11 +101,43 @@ static struct speed const speeds[] = { #endif }; +int _nc_baudrate(int OSpeed) +{ + int result = ERR; + unsigned i; + + if (OSpeed >= 0) { + for (i = 0; i < SIZEOF(speeds); i++) { + if (speeds[i].s == (speed_t)OSpeed) { + result = speeds[i].sp; + break; + } + } + } + return (result); +} + + +int _nc_ospeed(int BaudRate) +{ + speed_t result = 1; + unsigned i; + + if (BaudRate >= 0) { + for (i = 0; i < SIZEOF(speeds); i++) { + if (speeds[i].sp == BaudRate) { + result = speeds[i].s; + break; + } + } + } + return (result); +} + int baudrate(void) { -size_t i; -int ret; +int result; T((T_CALLED("baudrate()"))); @@ -116,26 +149,23 @@ int ret; #ifdef TRACE if (SP && !isatty(fileno(SP->_ofp)) && getenv("BAUDRATE") != 0) { + int ret; if ((ret = _nc_getenv_num("BAUDRATE")) <= 0) ret = 9600; + ospeed = _nc_ospeed(ret); returnCode(ret); } else #endif #ifdef TERMIOS - ret = cfgetospeed(&cur_term->Nttyb); + ospeed = cfgetospeed(&cur_term->Nttyb); #else - ret = cur_term->Nttyb.sg_ospeed; + ospeed = cur_term->Nttyb.sg_ospeed; #endif - if(ret < 0 || (speed_t)ret > speeds[SIZEOF(speeds)-1].s) - returnCode(ERR); - cur_term->_baudrate = ERR; - for (i = 0; i < SIZEOF(speeds); i++) - if (speeds[i].s == (speed_t)ret) - { - cur_term->_baudrate = speeds[i].sp; - break; - } - returnCode(cur_term->_baudrate); + result = _nc_baudrate(ospeed); + if (cur_term != 0) + cur_term->_baudrate = result; + + returnCode(result); } diff --git a/lib/libcurses/lib_cur_term.c b/lib/libcurses/tinfo/lib_cur_term.c index 541d7fe7523..0429da48316 100644 --- a/lib/libcurses/lib_cur_term.c +++ b/lib/libcurses/tinfo/lib_cur_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_cur_term.c,v 1.2 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: lib_cur_term.c,v 1.1 1999/01/18 19:10:17 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -40,32 +40,20 @@ #include <curses.priv.h> #include <term.h> /* TTY, cur_term */ +#include <termcap.h> /* ospeed */ -MODULE_ID("$From: lib_cur_term.c,v 1.3 1998/09/19 19:21:05 Alexander.V.Lukyanov Exp $") +MODULE_ID("$From: lib_cur_term.c,v 1.6 1999/01/10 00:48:44 tom Exp $") TERMINAL *cur_term; -int _nc_get_curterm(TTY *buf) -{ - if (cur_term == 0 - || GET_TTY(cur_term->Filedes, buf) != 0) - return(ERR); - return (OK); -} - -int _nc_set_curterm(TTY *buf) -{ - if (cur_term == 0 - || SET_TTY(cur_term->Filedes, buf) != 0) - return(ERR); - return (OK); -} - TERMINAL *set_curterm(TERMINAL *term) { TERMINAL *oldterm = cur_term; - cur_term = term; + if ((cur_term = term) != 0) { + ospeed = _nc_ospeed(cur_term->_baudrate); + PC = (pad_char != NULL) ? pad_char[0] : 0; + } return oldterm; } diff --git a/lib/libcurses/lib_data.c b/lib/libcurses/tinfo/lib_data.c index 571df81854d..9fad1c97b3e 100644 --- a/lib/libcurses/lib_data.c +++ b/lib/libcurses/tinfo/lib_data.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_data.c,v 1.4 1998/07/23 21:18:37 millert Exp $ */ +/* $OpenBSD: lib_data.c,v 1.1 1999/01/18 19:10:17 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/tinfo/lib_has_cap.c b/lib/libcurses/tinfo/lib_has_cap.c new file mode 100644 index 00000000000..de5ebb5c133 --- /dev/null +++ b/lib/libcurses/tinfo/lib_has_cap.c @@ -0,0 +1,65 @@ +/* $OpenBSD: lib_has_cap.c,v 1.1 1999/01/18 19:10:17 millert Exp $ */ + +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * + * and: Eric S. Raymond <esr@snark.thyrsus.com> * + ****************************************************************************/ + + +/* +** lib_has_cap.c +** +** The routines to query terminal capabilities +** +*/ + +#include <curses.priv.h> + +#include <term.h> + +MODULE_ID("$From: lib_has_cap.c,v 1.1 1998/10/23 15:32:21 tom Exp $") + +bool has_ic(void) +{ + T((T_CALLED("has_ic()"))); + returnCode(cur_term && + (insert_character || parm_ich + || (enter_insert_mode && exit_insert_mode)) + && (delete_character || parm_dch)); +} + +bool has_il(void) +{ + T((T_CALLED("has_il()"))); + returnCode(cur_term + && (insert_line || parm_insert_line) + && (delete_line || parm_delete_line)); +} diff --git a/lib/libcurses/lib_kernel.c b/lib/libcurses/tinfo/lib_kernel.c index 1d417ac3e0b..16cb06afe9d 100644 --- a/lib/libcurses/lib_kernel.c +++ b/lib/libcurses/tinfo/lib_kernel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_kernel.c,v 1.6 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: lib_kernel.c,v 1.1 1999/01/18 19:10:17 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -38,13 +38,9 @@ * lib_kernel.c * * Misc. low-level routines: - * reset_prog_mode() - * reset_shell_mode() * erasechar() * killchar() * flushinp() - * savetty() - * resetty() * * The baudrate() and delay_output() functions could logically live here, * but are in other modules to reduce the static-link size of programs @@ -54,40 +50,7 @@ #include <curses.priv.h> #include <term.h> /* cur_term */ -MODULE_ID("$From: lib_kernel.c,v 1.18 1998/09/20 03:34:18 tom Exp $") - -int reset_prog_mode(void) -{ - T((T_CALLED("reset_prog_mode()"))); - - if (cur_term != 0) { - _nc_set_curterm(&cur_term->Nttyb); - if (SP) { - if (stdscr && stdscr->_use_keypad) - _nc_keypad(TRUE); - NC_BUFFERED(TRUE); - } - returnCode(OK); - } - returnCode(ERR); -} - - -int reset_shell_mode(void) -{ - T((T_CALLED("reset_shell_mode()"))); - - if (cur_term != 0) { - if (SP) - { - _nc_keypad(FALSE); - fflush(SP->_ofp); - NC_BUFFERED(FALSE); - } - returnCode(_nc_set_curterm(&cur_term->Ottyb)); - } - returnCode(ERR); -} +MODULE_ID("$From: lib_kernel.c,v 1.19 1998/12/20 00:18:45 tom Exp $") /* * erasechar() @@ -167,24 +130,3 @@ int flushinp(void) } returnCode(ERR); } - -/* -** savetty() and resetty() -** -*/ - -static TTY buf; - -int savetty(void) -{ - T((T_CALLED("savetty()"))); - - returnCode(_nc_get_curterm(&buf)); -} - -int resetty(void) -{ - T((T_CALLED("resetty()"))); - - returnCode(_nc_set_curterm(&buf)); -} diff --git a/lib/libcurses/lib_longname.c b/lib/libcurses/tinfo/lib_longname.c index 4f9ad621032..558453a69bb 100644 --- a/lib/libcurses/lib_longname.c +++ b/lib/libcurses/tinfo/lib_longname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_longname.c,v 1.6 1998/07/23 21:19:00 millert Exp $ */ +/* $OpenBSD: lib_longname.c,v 1.1 1999/01/18 19:10:18 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -43,18 +43,18 @@ #include <curses.priv.h> -MODULE_ID("$From: lib_longname.c,v 1.6 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$From: lib_longname.c,v 1.7 1999/01/03 01:47:45 tom Exp $") char * longname(void) { char *ptr; - T(("longname() called")); + T((T_CALLED("longname()"))); for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--) if (*ptr == '|') - return(ptr + 1); + returnPtr(ptr + 1); - return(ttytype); + returnPtr(ttytype); } diff --git a/lib/libcurses/lib_napms.c b/lib/libcurses/tinfo/lib_napms.c index 4b147459b07..d5dd07be396 100644 --- a/lib/libcurses/lib_napms.c +++ b/lib/libcurses/tinfo/lib_napms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_napms.c,v 1.1 1998/07/23 21:19:06 millert Exp $ */ +/* $OpenBSD: lib_napms.c,v 1.1 1999/01/18 19:10:18 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_options.c b/lib/libcurses/tinfo/lib_options.c index 0b49f53272d..3ab600ab653 100644 --- a/lib/libcurses/lib_options.c +++ b/lib/libcurses/tinfo/lib_options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_options.c,v 1.5 1998/07/23 21:19:08 millert Exp $ */ +/* $OpenBSD: lib_options.c,v 1.1 1999/01/18 19:10:18 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -46,22 +46,7 @@ #include <term.h> /* keypad_xmit, keypad_local, meta_on, meta_off */ /* cursor_visible,cursor_normal,cursor_invisible */ -MODULE_ID("$From: lib_options.c,v 1.31 1998/04/11 23:40:51 tom Exp $") - -bool has_ic(void) -{ - T((T_CALLED("has_ic()"))); - returnCode((insert_character || parm_ich - || (enter_insert_mode && exit_insert_mode)) - && (delete_character || parm_dch)); -} - -bool has_il(void) -{ - T((T_CALLED("has_il()"))); - returnCode((insert_line || parm_insert_line) - && (delete_line || parm_delete_line)); -} +MODULE_ID("$From: lib_options.c,v 1.32 1998/12/19 23:09:50 tom Exp $") int idlok(WINDOW *win, bool flag) { diff --git a/lib/libcurses/lib_print.c b/lib/libcurses/tinfo/lib_print.c index 42103bef285..2d872a665ed 100644 --- a/lib/libcurses/lib_print.c +++ b/lib/libcurses/tinfo/lib_print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_print.c,v 1.3 1998/07/23 21:19:12 millert Exp $ */ +/* $OpenBSD: lib_print.c,v 1.1 1999/01/18 19:10:19 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -38,7 +38,7 @@ #include <term.h> -MODULE_ID("$From: lib_print.c,v 1.9 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$From: lib_print.c,v 1.10 1998/10/13 14:47:53 Alexander.V.Lukyanov Exp $") int mcprint(char *data, int len) /* ship binary character data to the printer via mc4/mc5/mc5p */ @@ -47,7 +47,7 @@ int mcprint(char *data, int len) size_t onsize, offsize, res; errno = 0; - if (!prtr_non && (!prtr_on || !prtr_off)) + if (!cur_term || (!prtr_non && (!prtr_on || !prtr_off))) { errno = ENODEV; return(ERR); diff --git a/lib/libcurses/lib_raw.c b/lib/libcurses/tinfo/lib_raw.c index 249cb834495..a9280a57edb 100644 --- a/lib/libcurses/lib_raw.c +++ b/lib/libcurses/tinfo/lib_raw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_raw.c,v 1.6 1998/11/17 03:16:21 millert Exp $ */ +/* $OpenBSD: lib_raw.c,v 1.1 1999/01/18 19:10:19 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -51,7 +51,7 @@ #include <curses.priv.h> #include <term.h> /* cur_term */ -MODULE_ID("$From: lib_raw.c,v 1.1 1998/11/08 00:26:05 tom Exp $") +MODULE_ID("$From: lib_raw.c,v 1.2 1998/12/20 00:42:58 tom Exp $") #if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -98,7 +98,7 @@ int raw(void) #else cur_term->Nttyb.sg_flags |= RAW; #endif - returnCode(_nc_set_curterm(&cur_term->Nttyb)); + returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); } returnCode(ERR); } @@ -124,7 +124,7 @@ int cbreak(void) #else cur_term->Nttyb.sg_flags |= CBREAK; #endif - returnCode(_nc_set_curterm( &cur_term->Nttyb)); + returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); } void qiflush(void) @@ -140,7 +140,7 @@ void qiflush(void) BEFORE("qiflush"); cur_term->Nttyb.c_lflag &= ~(NOFLSH); AFTER("qiflush"); - (void)_nc_set_curterm( &cur_term->Nttyb); + (void)_nc_set_tty_mode( &cur_term->Nttyb); returnVoid; #endif } @@ -165,7 +165,7 @@ int noraw(void) #else cur_term->Nttyb.sg_flags &= ~(RAW|CBREAK); #endif - returnCode(_nc_set_curterm( &cur_term->Nttyb)); + returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); } @@ -187,7 +187,7 @@ int nocbreak(void) #else cur_term->Nttyb.sg_flags &= ~CBREAK; #endif - returnCode(_nc_set_curterm( &cur_term->Nttyb)); + returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); } void noqiflush(void) @@ -203,7 +203,7 @@ void noqiflush(void) BEFORE("noqiflush"); cur_term->Nttyb.c_lflag |= NOFLSH; AFTER("noqiflush"); - (void)_nc_set_curterm( &cur_term->Nttyb); + (void)_nc_set_tty_mode( &cur_term->Nttyb); returnVoid; #endif } @@ -228,7 +228,7 @@ int intrflush(WINDOW *win GCC_UNUSED, bool flag) else cur_term->Nttyb.c_lflag |= (NOFLSH); AFTER("intrflush"); - returnCode(_nc_set_curterm( &cur_term->Nttyb)); + returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); #else returnCode(ERR); #endif diff --git a/lib/libcurses/lib_setup.c b/lib/libcurses/tinfo/lib_setup.c index 090c63e26c4..289309d4f65 100644 --- a/lib/libcurses/lib_setup.c +++ b/lib/libcurses/tinfo/lib_setup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_setup.c,v 1.4 1998/10/31 06:30:30 millert Exp $ */ +/* $OpenBSD: lib_setup.c,v 1.1 1999/01/18 19:10:19 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -50,7 +50,7 @@ #include <term.h> /* lines, columns, cur_term */ -MODULE_ID("$From: lib_setup.c,v 1.46 1998/09/26 12:22:30 tom Exp $") +MODULE_ID("$From: lib_setup.c,v 1.48 1999/01/02 23:11:56 tom Exp $") /**************************************************************************** * @@ -194,11 +194,9 @@ static void _nc_get_screensize(int *linep, int *colp) T(("screen size is %dx%d", *linep, *colp)); -#ifdef init_tabs if (init_tabs != -1) TABSIZE = (int)init_tabs; else -#endif /* init_tabs */ TABSIZE = 8; T(("TABSIZE = %d", TABSIZE)); @@ -292,7 +290,7 @@ char ttytype[NAMESIZE]; * */ -int setupterm(const char *tname, int Filedes, int *errret) +int setupterm(NCURSES_CONST char *tname, int Filedes, int *errret) { struct term *term_ptr; int status; diff --git a/lib/libcurses/lib_termcap.c b/lib/libcurses/tinfo/lib_termcap.c index fef5b435d68..e50b4a622da 100644 --- a/lib/libcurses/lib_termcap.c +++ b/lib/libcurses/tinfo/lib_termcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_termcap.c,v 1.4 1998/11/17 03:16:21 millert Exp $ */ +/* $OpenBSD: lib_termcap.c,v 1.1 1999/01/18 19:10:19 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -41,17 +41,15 @@ #define __INTERNAL_CAPS_VISIBLE #include <term.h> -MODULE_ID("$From: lib_termcap.c,v 1.22 1998/09/26 12:27:03 tom Exp $") +MODULE_ID("$From: lib_termcap.c,v 1.25 1999/01/10 00:48:11 tom Exp $") /* some of the code in here was contributed by: Magnus Bengtsson, d6mbeng@dtek.chalmers.se */ -char PC; char *UP; char *BC; -speed_t ospeed; /*************************************************************************** * @@ -71,86 +69,26 @@ speed_t ospeed; int tgetent(char *bufp GCC_UNUSED, const char *name) { int errcode; -#if defined(TERMIOS) -speed_t speed; -#endif - - T(("calling tgetent")); - setupterm(name, STDOUT_FILENO, &errcode); - - if (errcode != 1) - return(errcode); - - if (cursor_left) - if ((backspaces_with_bs = !strcmp(cursor_left, "\b")) == 0) - backspace_if_not_bs = cursor_left; - - /* we're required to export these */ - if (pad_char != NULL) - PC = pad_char[0]; - if (cursor_up != NULL) - UP = cursor_up; - if (backspace_if_not_bs != NULL) - BC = backspace_if_not_bs; -#if defined(TERMIOS) - /* - * Back-convert to the funny speed encoding used by the old BSD - * curses library. Method suggested by Andrey Chernov - * <ache@astral.msk.su> - */ - if ((speed = cfgetospeed(&cur_term->Nttyb)) < 1) - ospeed = 1; /* assume lowest non-hangup speed */ - else - { - const speed_t *sp; - static const speed_t speeds[] = { -#ifdef B115200 - B115200, -#endif -#ifdef B57600 - B57600, -#endif -#ifdef B38400 - B38400, -#else -#ifdef EXTB - EXTB, -#endif -#endif /* B38400 */ -#ifdef B19200 - B19200, -#else -#ifdef EXTA - EXTA, -#endif -#endif /* B19200 */ - B9600, - B4800, - B2400, - B1800, - B1200, - B600, - B300, - B200, - B150, - B134, - B110, - B75, - B50, - B0, - }; -#define MAXSPEED SIZEOF(speeds) - - for (sp = speeds; sp < speeds + MAXSPEED; sp++) { - if (sp[0] <= speed) { - break; - } - } - ospeed = MAXSPEED - (sp - speeds); - } -#else - ospeed = cur_term->Nttyb.sg_ospeed; -#endif + + T((T_CALLED("tgetent()"))); + + setupterm((NCURSES_CONST char *)name, STDOUT_FILENO, &errcode); + + if (errcode == 1) { + + if (cursor_left) + if ((backspaces_with_bs = !strcmp(cursor_left, "\b")) == 0) + backspace_if_not_bs = cursor_left; + + /* we're required to export these */ + if (pad_char != NULL) + PC = pad_char[0]; + if (cursor_up != NULL) + UP = cursor_up; + if (backspace_if_not_bs != NULL) + BC = backspace_if_not_bs; + + (void) baudrate(); /* sets ospeed as a side-effect */ /* LINT_PREPRO #if 0*/ @@ -158,7 +96,8 @@ speed_t speed; /* LINT_PREPRO #endif*/ - return errcode; + } + returnCode(errcode); } /*************************************************************************** @@ -170,20 +109,20 @@ speed_t speed; * ***************************************************************************/ -int tgetflag(const char *id) +int tgetflag(NCURSES_CONST char *id) { int i; - T(("tgetflag: %s", id)); + T((T_CALLED("tgetflag(%s)"), id)); if (cur_term != 0) { for (i = 0; i < BOOLCOUNT; i++) { if (!strncmp(id, boolcodes[i], 2)) { /* setupterm forces invalid booleans to false */ - return cur_term->type.Booleans[i]; + returnCode(cur_term->type.Booleans[i]); } } } - return 0; /* Solaris does this */ + returnCode(0); /* Solaris does this */ } /*************************************************************************** @@ -195,21 +134,21 @@ int i; * ***************************************************************************/ -int tgetnum(const char *id) +int tgetnum(NCURSES_CONST char *id) { int i; - T(("tgetnum: %s", id)); + T((T_CALLED("tgetnum(%s)"), id)); if (cur_term != 0) { for (i = 0; i < NUMCOUNT; i++) { if (!strncmp(id, numcodes[i], 2)) { if (!VALID_NUMERIC(cur_term->type.Numbers[i])) return -1; - return cur_term->type.Numbers[i]; + returnCode(cur_term->type.Numbers[i]); } } } - return ERR; + returnCode(ERR); } /*************************************************************************** @@ -221,22 +160,22 @@ int i; * ***************************************************************************/ -char *tgetstr(const char *id, char **area GCC_UNUSED) +char *tgetstr(NCURSES_CONST char *id, char **area GCC_UNUSED) { int i; - T(("tgetstr: %s", id)); + T((T_CALLED("tgetstr(%s,%p)"), id, area)); if (cur_term != 0) { for (i = 0; i < STRCOUNT; i++) { T(("trying %s", strcodes[i])); if (!strncmp(id, strcodes[i], 2)) { T(("found match : %s", _nc_visbuf(cur_term->type.Strings[i]))); /* setupterm forces cancelled strings to null */ - return cur_term->type.Strings[i]; + returnPtr(cur_term->type.Strings[i]); } } } - return NULL; + returnPtr(NULL); } /* @@ -250,5 +189,6 @@ int i; char *tgoto(const char *string, int x, int y) { - return(tparm((NCURSES_CONST char *)string, y, x)); + T((T_CALLED("tgoto(%s,%d,%d)"), string, x, y)); + returnPtr(tparm((NCURSES_CONST char *)string, y, x)); } diff --git a/lib/libcurses/tinfo/lib_termname.c b/lib/libcurses/tinfo/lib_termname.c new file mode 100644 index 00000000000..dc4e69e2907 --- /dev/null +++ b/lib/libcurses/tinfo/lib_termname.c @@ -0,0 +1,48 @@ +/* $OpenBSD: lib_termname.c,v 1.1 1999/01/18 19:10:20 millert Exp $ */ + +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +#include <curses.priv.h> +#include <tic.h> /* for MAX_ALIAS */ + +MODULE_ID("$From: lib_termname.c,v 1.1 1998/12/19 23:07:43 tom Exp $") + +char *termname(void) +{ +char *term = getenv("TERM"); +static char ret[MAX_ALIAS+1]; + + T(("termname() called")); + + if (term != 0) { + (void) strncpy(ret, term, sizeof(ret) - 1); + term = ret; + } + return term; +} diff --git a/lib/libcurses/lib_ti.c b/lib/libcurses/tinfo/lib_ti.c index ddb80607aaf..6d2d792df6e 100644 --- a/lib/libcurses/lib_ti.c +++ b/lib/libcurses/tinfo/lib_ti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_ti.c,v 1.2 1998/10/31 06:30:30 millert Exp $ */ +/* $OpenBSD: lib_ti.c,v 1.1 1999/01/18 19:10:20 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -39,59 +39,59 @@ #include <term.h> #include <tic.h> -MODULE_ID("$From: lib_ti.c,v 1.12 1998/09/26 12:26:38 tom Exp $") +MODULE_ID("$From: lib_ti.c,v 1.13 1999/01/03 01:44:27 tom Exp $") int tigetflag(NCURSES_CONST char *str) { int i; - T(("tigetflag(%s)", str)); + T((T_CALLED("tigetflag(%s)"), str)); if (cur_term != 0) { for (i = 0; i < BOOLCOUNT; i++) { if (!strcmp(str, boolnames[i])) { /* setupterm forces invalid booleans to false */ - return cur_term->type.Booleans[i]; + returnCode(cur_term->type.Booleans[i]); } } } - return ABSENT_BOOLEAN; + returnCode(ABSENT_BOOLEAN); } int tigetnum(NCURSES_CONST char *str) { int i; - T(("tigetnum(%s)", str)); + T((T_CALLED("tigetnum(%s)"), str)); if (cur_term != 0) { for (i = 0; i < NUMCOUNT; i++) { if (!strcmp(str, numnames[i])) { if (!VALID_NUMERIC(cur_term->type.Numbers[i])) return -1; - return cur_term->type.Numbers[i]; + returnCode(cur_term->type.Numbers[i]); } } } - return CANCELLED_NUMERIC; /* Solaris returns a -1 instead */ + returnCode(CANCELLED_NUMERIC); /* Solaris returns a -1 instead */ } char *tigetstr(NCURSES_CONST char *str) { int i; - T(("tigetstr(%s)", str)); + T((T_CALLED("tigetstr(%s)"), str)); if (cur_term != 0) { for (i = 0; i < STRCOUNT; i++) { if (!strcmp(str, strnames[i])) { /* setupterm forces cancelled strings to null */ - return cur_term->type.Strings[i]; + returnPtr(cur_term->type.Strings[i]); } } } - return CANCELLED_STRING; + returnPtr(CANCELLED_STRING); } diff --git a/lib/libcurses/lib_tparm.c b/lib/libcurses/tinfo/lib_tparm.c index f2461c7aaec..87fad7291c7 100644 --- a/lib/libcurses/lib_tparm.c +++ b/lib/libcurses/tinfo/lib_tparm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tparm.c,v 1.5 1998/10/31 06:30:30 millert Exp $ */ +/* $OpenBSD: lib_tparm.c,v 1.1 1999/01/18 19:10:20 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -45,7 +45,7 @@ #include <term.h> #include <tic.h> -MODULE_ID("$From: lib_tparm.c,v 1.36 1998/10/11 00:28:53 tom Exp $") +MODULE_ID("$From: lib_tparm.c,v 1.37 1999/01/02 22:38:25 tom Exp $") /* * char * @@ -585,21 +585,3 @@ char *result; va_end(ap); return result; } - -#ifdef __UNUSED__ /* we never documented this, and it confuses Emacs */ -char *tparam(const char *string, char *buffer, int bufsiz, ...) -{ -va_list ap; -char *result = 0; - - va_start(ap, bufsiz); -#ifdef TRACE - tname = "tparam"; -#endif /* TRACE */ - if (tparam_internal(string, ap) != 0 - && (int)out_used < bufsiz) - result = strcpy(buffer, out_buff); - va_end(ap); - return result; -} -#endif /* __UNUSED__ */ diff --git a/lib/libcurses/lib_tputs.c b/lib/libcurses/tinfo/lib_tputs.c index dfe3bcf8878..e4c778332df 100644 --- a/lib/libcurses/lib_tputs.c +++ b/lib/libcurses/tinfo/lib_tputs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tputs.c,v 1.2 1998/10/31 06:30:30 millert Exp $ */ +/* $OpenBSD: lib_tputs.c,v 1.1 1999/01/18 19:10:20 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -45,12 +45,16 @@ #include <curses.priv.h> #include <ctype.h> #include <term.h> /* padding_baud_rate, xon_xoff */ +#include <termcap.h> /* ospeed */ #include <tic.h> -MODULE_ID("$From: lib_tputs.c,v 1.33 1998/09/19 20:35:49 tom Exp $") +MODULE_ID("$From: lib_tputs.c,v 1.38 1999/01/10 00:57:41 tom Exp $") #define OUTPUT ((SP != 0) ? SP->_ofp : stdout) +char PC; /* used by termcap library */ +speed_t ospeed; /* used by termcap library */ + int _nc_nulls_sent; /* used by 'tack' program */ static int (*my_outch)(int c) = _nc_outch; @@ -59,26 +63,14 @@ int delay_output(int ms) { T((T_CALLED("delay_output(%d)"), ms)); - if (cur_term == 0 || cur_term->_baudrate <= 0) { - (void) fflush(OUTPUT); - _nc_timed_wait(0, ms, (int *)0); - } -#ifdef no_pad_char - else if (no_pad_char) + if (no_pad_char) napms(ms); -#endif /* no_pad_char */ else { register int nullcount; - char null = '\0'; -#ifdef pad_char - if (pad_char) - null = pad_char[0]; -#endif /* pad_char */ - - nullcount = ms * cur_term->_baudrate / 10000; + nullcount = (ms * _nc_baudrate(ospeed)) / 10000; for (_nc_nulls_sent += nullcount; nullcount > 0; nullcount--) - my_outch(null); + my_outch(PC); if (my_outch == _nc_outch) (void) fflush(OUTPUT); } @@ -143,8 +135,7 @@ char addrbuf[32]; #ifdef NCURSES_NO_PADDING && (SP == 0 || !(SP->_no_padding)) #endif - && (cur_term == 0 - || cur_term->_baudrate >= padding_baud_rate); + && (_nc_baudrate(ospeed) >= padding_baud_rate); } #ifdef BSD_TPUTS @@ -153,24 +144,26 @@ char addrbuf[32]; * (like nethack) actually do the likes of tputs("50") to get delays. */ trailpad = 0; - while (isdigit(*string)) { - trailpad = trailpad * 10 + (*string - '0'); - string++; - } - trailpad *= 10; - if (*string == '.') { - string++; - if (isdigit(*string)) { - trailpad += (*string - '0'); + if (isdigit(*string)) { + while (isdigit(*string)) { + trailpad = trailpad * 10 + (*string - '0'); string++; } - while (isdigit(*string)) + trailpad *= 10; + if (*string == '.') { string++; - } + if (isdigit(*string)) { + trailpad += (*string - '0'); + string++; + } + while (isdigit(*string)) + string++; + } - if (*string == '*') { - trailpad *= affcnt; - string++; + if (*string == '*') { + trailpad *= affcnt; + string++; + } } #endif /* BSD_TPUTS */ diff --git a/lib/libcurses/tinfo/lib_ttyflags.c b/lib/libcurses/tinfo/lib_ttyflags.c new file mode 100644 index 00000000000..f3b875c3bd4 --- /dev/null +++ b/lib/libcurses/tinfo/lib_ttyflags.c @@ -0,0 +1,163 @@ +/* $OpenBSD: lib_ttyflags.c,v 1.1 1999/01/18 19:10:21 millert Exp $ */ + +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/* + * def_prog_mode() + * def_shell_mode() + * reset_prog_mode() + * reset_shell_mode() + * savetty() + * resetty() + */ + +#include <curses.priv.h> +#include <term.h> /* cur_term */ + +MODULE_ID("$From: lib_ttyflags.c,v 1.1 1998/12/20 00:49:19 tom Exp $") + +#undef tabs + +#ifdef TAB3 +# define tabs TAB3 +#else +# ifdef XTABS +# define tabs XTABS +# else +# ifdef OXTABS +# define tabs OXTABS +# else +# define tabs 0 +# endif +# endif +#endif + +int _nc_get_tty_mode(TTY *buf) +{ + if (cur_term == 0 + || GET_TTY(cur_term->Filedes, buf) != 0) + return(ERR); + return (OK); +} + +int _nc_set_tty_mode(TTY *buf) +{ + if (cur_term == 0 + || SET_TTY(cur_term->Filedes, buf) != 0) + return(ERR); + return (OK); +} + +int def_shell_mode(void) +{ + T((T_CALLED("def_shell_mode()"))); + + /* + * Turn off the XTABS bit in the tty structure if it was on. If XTABS + * was on, remove the tab and backtab capabilities. + */ + + if (_nc_get_tty_mode(&cur_term->Ottyb) != OK) + returnCode(ERR); +#ifdef TERMIOS + if (cur_term->Ottyb.c_oflag & tabs) + tab = back_tab = NULL; +#else + if (cur_term->Ottyb.sg_flags & XTABS) + tab = back_tab = NULL; +#endif + returnCode(OK); +} + +int def_prog_mode(void) +{ + T((T_CALLED("def_prog_mode()"))); + + if (_nc_get_tty_mode(&cur_term->Nttyb) != OK) + returnCode(ERR); +#ifdef TERMIOS + cur_term->Nttyb.c_oflag &= ~tabs; +#else + cur_term->Nttyb.sg_flags &= ~XTABS; +#endif + returnCode(OK); +} + +int reset_prog_mode(void) +{ + T((T_CALLED("reset_prog_mode()"))); + + if (cur_term != 0) { + _nc_set_tty_mode(&cur_term->Nttyb); + if (SP) { + if (stdscr && stdscr->_use_keypad) + _nc_keypad(TRUE); + NC_BUFFERED(TRUE); + } + returnCode(OK); + } + returnCode(ERR); +} + +int reset_shell_mode(void) +{ + T((T_CALLED("reset_shell_mode()"))); + + if (cur_term != 0) { + if (SP) + { + _nc_keypad(FALSE); + fflush(SP->_ofp); + NC_BUFFERED(FALSE); + } + returnCode(_nc_set_tty_mode(&cur_term->Ottyb)); + } + returnCode(ERR); +} + +/* +** savetty() and resetty() +** +*/ + +static TTY buf; + +int savetty(void) +{ + T((T_CALLED("savetty()"))); + + returnCode(_nc_get_tty_mode(&buf)); +} + +int resetty(void) +{ + T((T_CALLED("resetty()"))); + + returnCode(_nc_set_tty_mode(&buf)); +} diff --git a/lib/libcurses/make_keys.c b/lib/libcurses/tinfo/make_keys.c index 33290d251c2..70617a42519 100644 --- a/lib/libcurses/make_keys.c +++ b/lib/libcurses/tinfo/make_keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: make_keys.c,v 1.1 1998/07/23 21:19:53 millert Exp $ */ +/* $OpenBSD: make_keys.c,v 1.1 1999/01/18 19:10:21 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/name_match.c b/lib/libcurses/tinfo/name_match.c index b86f1b0fadd..814e780a4d4 100644 --- a/lib/libcurses/name_match.c +++ b/lib/libcurses/tinfo/name_match.c @@ -1,4 +1,4 @@ -/* $OpenBSD: name_match.c,v 1.2 1998/10/31 06:30:31 millert Exp $ */ +/* $OpenBSD: name_match.c,v 1.1 1999/01/18 19:10:21 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/parse_entry.c b/lib/libcurses/tinfo/parse_entry.c index aef8830cc7a..ed44a9840d7 100644 --- a/lib/libcurses/parse_entry.c +++ b/lib/libcurses/tinfo/parse_entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse_entry.c,v 1.1 1998/07/23 21:19:58 millert Exp $ */ +/* $OpenBSD: parse_entry.c,v 1.1 1999/01/18 19:10:21 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/read_bsd_terminfo.c b/lib/libcurses/tinfo/read_bsd_terminfo.c index cccc1017178..4e6c6fb1425 100644 --- a/lib/libcurses/read_bsd_terminfo.c +++ b/lib/libcurses/tinfo/read_bsd_terminfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read_bsd_terminfo.c,v 1.6 1998/11/19 18:08:54 millert Exp $ */ +/* $OpenBSD: read_bsd_terminfo.c,v 1.1 1999/01/18 19:10:22 millert Exp $ */ /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: read_bsd_terminfo.c,v 1.6 1998/11/19 18:08:54 millert Exp $"; +static char rcsid[] = "$OpenBSD: read_bsd_terminfo.c,v 1.1 1999/01/18 19:10:22 millert Exp $"; #endif #include <curses.priv.h> diff --git a/lib/libcurses/read_entry.c b/lib/libcurses/tinfo/read_entry.c index db0f9235ac5..9ebf0779912 100644 --- a/lib/libcurses/read_entry.c +++ b/lib/libcurses/tinfo/read_entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read_entry.c,v 1.5 1998/10/31 06:30:31 millert Exp $ */ +/* $OpenBSD: read_entry.c,v 1.1 1999/01/18 19:10:22 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -49,7 +49,7 @@ #include <term.h> #include <tic.h> -MODULE_ID("$From: read_entry.c,v 1.46 1998/10/11 00:30:55 tom Exp $") +MODULE_ID("$From: read_entry.c,v 1.47 1998/12/20 02:51:50 tom Exp $") #ifndef O_BINARY #define O_BINARY 0 @@ -72,6 +72,7 @@ MODULE_ID("$From: read_entry.c,v 1.46 1998/10/11 00:30:55 tom Exp $") #define LOW_MSB(p) (BYTE(p,0) + 256*BYTE(p,1)) static bool have_tic_directory = FALSE; +static bool keep_tic_directory = FALSE; /* * Record the "official" location of the terminfo directory, according to @@ -79,17 +80,30 @@ static bool have_tic_directory = FALSE; */ const char *_nc_tic_dir(const char *path) { - static const char *result = TERMINFO; + static const char *result = TERMINFO; + if (!keep_tic_directory) { if (path != 0) { - result = path; - have_tic_directory = TRUE; + result = path; + have_tic_directory = TRUE; } else if (!have_tic_directory) { - char *envp; - if (!issetugid() && (envp = getenv("TERMINFO")) != 0) - return _nc_tic_dir(envp); + char *envp; + if (!issetugid() && (envp = getenv("TERMINFO")) != 0) + return _nc_tic_dir(envp); } - return result; + } + return result; +} + +/* + * Special fix to prevent the terminfo directory from being moved after tic + * has chdir'd to it. If we let it be changed, then if $TERMINFO has a + * relative path, we'll lose track of the actual directory. + */ +void _nc_keep_tic_dir(const char *path) +{ + _nc_tic_dir(path); + keep_tic_directory = TRUE; } int _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) diff --git a/lib/libcurses/read_termcap.c b/lib/libcurses/tinfo/read_termcap.c index 2c9593bc001..de240b648f3 100644 --- a/lib/libcurses/read_termcap.c +++ b/lib/libcurses/tinfo/read_termcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read_termcap.c,v 1.7 1998/11/19 17:22:23 millert Exp $ */ +/* $OpenBSD: read_termcap.c,v 1.1 1999/01/18 19:10:22 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/setbuf.c b/lib/libcurses/tinfo/setbuf.c index 16b8604a39d..03a8c896ba0 100644 --- a/lib/libcurses/setbuf.c +++ b/lib/libcurses/tinfo/setbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setbuf.c,v 1.1 1998/11/17 03:16:21 millert Exp $ */ +/* $OpenBSD: setbuf.c,v 1.1 1999/01/18 19:10:22 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -44,7 +44,7 @@ #include <curses.priv.h> -MODULE_ID("$From: setbuf.c,v 1.1 1998/11/08 00:51:33 tom Exp $") +MODULE_ID("$From: setbuf.c,v 1.2 1998/12/13 03:48:09 tom Exp $") /* * If the output file descriptor is connected to a tty (the typical case) it @@ -106,6 +106,9 @@ void _nc_set_buffer(FILE *ofp, bool buffered) unsigned buf_len; char *buf_ptr; + if (getenv("NCURSES_NO_SETBUF") != 0) + return; + fflush(ofp); if ((SP->_buffered = buffered) != 0) { buf_len = min(LINES * (COLS + 6), 2800); diff --git a/lib/libcurses/write_entry.c b/lib/libcurses/tinfo/write_entry.c index 8bf95fc8dfe..22c20151790 100644 --- a/lib/libcurses/write_entry.c +++ b/lib/libcurses/tinfo/write_entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: write_entry.c,v 1.5 1998/10/31 06:30:31 millert Exp $ */ +/* $OpenBSD: write_entry.c,v 1.1 1999/01/18 19:10:23 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -51,7 +51,7 @@ #define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR) #endif -MODULE_ID("$From: write_entry.c,v 1.33 1998/09/19 21:24:11 tom Exp $") +MODULE_ID("$From: write_entry.c,v 1.34 1998/12/20 02:49:27 tom Exp $") static int total_written; @@ -110,6 +110,7 @@ void _nc_set_writedir(char *dir) /* set the write directory for compiled entries */ { const char *destination; + char actual[PATH_MAX]; if (dir != 0) (void) _nc_tic_dir(dir); @@ -135,8 +136,10 @@ void _nc_set_writedir(char *dir) * Note: because of this code, this logic should be exercised * *once only* per run. */ - if (chdir(_nc_tic_dir(destination)) < 0) + if (chdir(_nc_tic_dir(destination)) < 0 + || getcwd(actual, sizeof(actual)) == 0) _nc_err_abort("%s: not a directory", destination); + _nc_keep_tic_dir(strcpy(malloc(strlen(actual)+1), actual)); } /* diff --git a/lib/libcurses/lib_trace.c b/lib/libcurses/trace/lib_trace.c index a64b90aa7af..11124a0167c 100644 --- a/lib/libcurses/lib_trace.c +++ b/lib/libcurses/trace/lib_trace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_trace.c,v 1.5 1998/10/31 06:30:30 millert Exp $ */ +/* $OpenBSD: lib_trace.c,v 1.1 1999/01/18 19:10:23 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_traceatr.c b/lib/libcurses/trace/lib_traceatr.c index 283041765b8..58c86c8081a 100644 --- a/lib/libcurses/lib_traceatr.c +++ b/lib/libcurses/trace/lib_traceatr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_traceatr.c,v 1.4 1998/07/23 21:19:39 millert Exp $ */ +/* $OpenBSD: lib_traceatr.c,v 1.1 1999/01/18 19:10:23 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_tracebits.c b/lib/libcurses/trace/lib_tracebits.c index b5941c85a66..b7038c6793b 100644 --- a/lib/libcurses/lib_tracebits.c +++ b/lib/libcurses/trace/lib_tracebits.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tracebits.c,v 1.1 1998/11/17 03:16:21 millert Exp $ */ +/* $OpenBSD: lib_tracebits.c,v 1.1 1999/01/18 19:10:24 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_tracechr.c b/lib/libcurses/trace/lib_tracechr.c index e97e6793146..e97e6793146 100644 --- a/lib/libcurses/lib_tracechr.c +++ b/lib/libcurses/trace/lib_tracechr.c diff --git a/lib/libcurses/lib_tracedmp.c b/lib/libcurses/trace/lib_tracedmp.c index f9128400723..50859050044 100644 --- a/lib/libcurses/lib_tracedmp.c +++ b/lib/libcurses/trace/lib_tracedmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tracedmp.c,v 1.3 1998/07/23 21:19:42 millert Exp $ */ +/* $OpenBSD: lib_tracedmp.c,v 1.1 1999/01/18 19:10:24 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_tracemse.c b/lib/libcurses/trace/lib_tracemse.c index e0de4543886..a1b649f5c88 100644 --- a/lib/libcurses/lib_tracemse.c +++ b/lib/libcurses/trace/lib_tracemse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tracemse.c,v 1.3 1998/07/23 21:19:43 millert Exp $ */ +/* $OpenBSD: lib_tracemse.c,v 1.1 1999/01/18 19:10:24 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -39,13 +39,11 @@ * lib_tracemse.c - Tracing/Debugging routines (mouse events) */ -#ifndef TRACE -#define TRACE /* turn on internal defs for this module */ -#endif - #include <curses.priv.h> -MODULE_ID("$From: lib_tracemse.c,v 1.5 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$From: lib_tracemse.c,v 1.6 1998/11/16 14:28:17 Alexander.V.Lukyanov Exp $") + +#ifdef TRACE char *_tracemouse(MEVENT const *ep) { @@ -92,5 +90,8 @@ char *_tracemouse(MEVENT const *ep) return(buf); } - - +#else /* !TRACE */ +/* don't make empty module */ +void _nc_lib_tracemouse(void); +void _nc_lib_tracemouse(void) {} +#endif diff --git a/lib/libcurses/trace_buf.c b/lib/libcurses/trace/trace_buf.c index 0fad3c81040..11117c5326b 100644 --- a/lib/libcurses/trace_buf.c +++ b/lib/libcurses/trace/trace_buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trace_buf.c,v 1.5 1998/09/13 19:16:31 millert Exp $ */ +/* $OpenBSD: trace_buf.c,v 1.1 1999/01/18 19:10:25 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/MKexpanded.sh b/lib/libcurses/tty/MKexpanded.sh index f1136763050..11e9fc16878 100644 --- a/lib/libcurses/MKexpanded.sh +++ b/lib/libcurses/tty/MKexpanded.sh @@ -29,8 +29,8 @@ # # Author: Thomas E. Dickey <dickey@clark.net> 1997 # -# $OpenBSD: MKexpanded.sh,v 1.3 1998/07/23 21:17:20 millert Exp $ -# $From: MKexpanded.sh,v 1.6 1998/02/11 12:13:54 tom Exp $ +# $OpenBSD: MKexpanded.sh,v 1.1 1999/01/18 19:10:25 millert Exp $ +# $From: MKexpanded.sh,v 1.7 1998/11/11 20:15:39 Alexander.V.Lukyanov Exp $ # # Script to generate 'expanded.c', a dummy source that contains functions # corresponding to complex macros used in this library. By making functions, @@ -51,7 +51,7 @@ fi TMP=gen$$.c trap "rm -f $TMP" 0 1 2 5 15 -cat >expanded.c <<EOF +cat <<EOF /* generated by MKexpanded.sh */ #include <curses.priv.h> #include <term.h> @@ -95,9 +95,9 @@ void _nc_UpdateAttrs(chtype c) } EOF -$preprocessor $TMP 2>/dev/null | sed -e '1,/^IGNORE$/d' >>expanded.c +$preprocessor $TMP 2>/dev/null | sed -e '1,/^IGNORE$/d' -cat >>expanded.c <<EOF +cat <<EOF #else /* ! NCURSES_EXPANDED */ void _nc_expanded(void) { } #endif /* NCURSES_EXPANDED */ diff --git a/lib/libcurses/hardscroll.c b/lib/libcurses/tty/hardscroll.c index 6e136a464b6..f27ece1915b 100644 --- a/lib/libcurses/hardscroll.c +++ b/lib/libcurses/tty/hardscroll.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hardscroll.c,v 1.8 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: hardscroll.c,v 1.1 1999/01/18 19:10:25 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/hashmap.c b/lib/libcurses/tty/hashmap.c index ef10b1e309e..77cb0e19158 100644 --- a/lib/libcurses/hashmap.c +++ b/lib/libcurses/tty/hashmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hashmap.c,v 1.4 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: hashmap.c,v 1.1 1999/01/18 19:10:26 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_mvcur.c b/lib/libcurses/tty/lib_mvcur.c index 718ee1a3382..9d15770f150 100644 --- a/lib/libcurses/lib_mvcur.c +++ b/lib/libcurses/tty/lib_mvcur.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_mvcur.c,v 1.12 1998/10/31 06:30:30 millert Exp $ */ +/* $OpenBSD: lib_mvcur.c,v 1.1 1999/01/18 19:10:26 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -155,7 +155,7 @@ #include <term.h> #include <ctype.h> -MODULE_ID("$From: lib_mvcur.c,v 1.54 1998/10/03 23:41:21 tom Exp $") +MODULE_ID("$From: lib_mvcur.c,v 1.55 1998/12/05 02:04:48 tom Exp $") #define STRLEN(s) (s != 0) ? strlen(s) : 0 @@ -576,6 +576,20 @@ relative_move(char *result, int from_y,int from_x,int to_y,int to_x, bool ovw) #endif /* USE_HARD_TABS */ #if defined(REAL_ATTR) && defined(WANT_CHAR) +#ifdef BSD_TPUTS + /* + * If we're allowing BSD-style padding in tputs, don't generate + * a string with a leading digit. Otherwise, that will be + * interpreted as a padding value rather than sent to the + * screen. + */ + if (ovw + && n > 0 + && vcost == 0 + && str[0] == '\0' + && isdigit(TextOf(WANT_CHAR(to_y, from_x)))) + ovw = FALSE; +#endif /* * If we have no attribute changes, overwrite is cheaper. * Note: must suppress this by passing in ovw = FALSE whenever diff --git a/lib/libcurses/lib_tstp.c b/lib/libcurses/tty/lib_tstp.c index 44cf937ad30..709b7ce492a 100644 --- a/lib/libcurses/lib_tstp.c +++ b/lib/libcurses/tty/lib_tstp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tstp.c,v 1.8 1998/07/23 21:19:44 millert Exp $ */ +/* $OpenBSD: lib_tstp.c,v 1.1 1999/01/18 19:10:26 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_twait.c b/lib/libcurses/tty/lib_twait.c index d17d1ea37bd..5a7cffeae2b 100644 --- a/lib/libcurses/lib_twait.c +++ b/lib/libcurses/tty/lib_twait.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_twait.c,v 1.4 1998/07/23 21:19:45 millert Exp $ */ +/* $OpenBSD: lib_twait.c,v 1.1 1999/01/18 19:10:27 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/lib_vidattr.c b/lib/libcurses/tty/lib_vidattr.c index fa375131990..b148877d992 100644 --- a/lib/libcurses/lib_vidattr.c +++ b/lib/libcurses/tty/lib_vidattr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_vidattr.c,v 1.5 1998/08/03 17:02:46 millert Exp $ */ +/* $OpenBSD: lib_vidattr.c,v 1.1 1999/01/18 19:10:27 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * diff --git a/lib/libcurses/tty/tty_display.h b/lib/libcurses/tty/tty_display.h new file mode 100644 index 00000000000..9aed32d8116 --- /dev/null +++ b/lib/libcurses/tty/tty_display.h @@ -0,0 +1,148 @@ +/* $OpenBSD: tty_display.h,v 1.1 1999/01/18 19:10:27 millert Exp $ */ + +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ************************************************************************** */ + +#ifndef TTY_DISPLAY_H +#define TTY_DISPLAY_H 1 + +extern bool _nc_tty_beep(void); +extern bool _nc_tty_check_resize(void); +extern bool _nc_tty_cursor(int); +extern bool _nc_tty_flash(void); +extern bool _nc_tty_init_color(int,int,int,int); +extern bool _nc_tty_init_pair(int,int,int); +extern bool _nc_tty_slk_hide(bool); +extern bool _nc_tty_slk_update(int,const char *); +extern bool _nc_tty_start_color(void); +extern void _nc_tty_display_resume(void); +extern void _nc_tty_display_suspend(void); +extern void _nc_tty_dispose(void); /* frees SP->_term */ +extern void _nc_tty_switch_to(void); +extern void _nc_tty_update(void); + +struct tty_display_data { + int _fifohold; /* set if breakout marked */ + unsigned long _current_attr; /* terminal attribute current set */ + int _cursrow; /* physical cursor row (-1=unknown) */ + int _curscol; /* physical cursor column */ + + /* cursor movement costs; units are 10ths of milliseconds */ + int _char_padding; /* cost of character put */ + int _cr_cost; /* cost of (carriage_return) */ + int _cup_cost; /* cost of (cursor_address) */ + int _home_cost; /* cost of (cursor_home) */ + int _ll_cost; /* cost of (cursor_to_ll) */ +#if USE_HARD_TABS + int _ht_cost; /* cost of (tab) */ + int _cbt_cost; /* cost of (backtab) */ +#endif /* USE_HARD_TABS */ + int _cub1_cost; /* cost of (cursor_left) */ + int _cuf1_cost; /* cost of (cursor_right) */ + int _cud1_cost; /* cost of (cursor_down) */ + int _cuu1_cost; /* cost of (cursor_up) */ + int _cub_cost; /* cost of (parm_cursor_left) */ + int _cuf_cost; /* cost of (parm_cursor_right) */ + int _cud_cost; /* cost of (parm_cursor_down) */ + int _cuu_cost; /* cost of (parm_cursor_up) */ + int _hpa_cost; /* cost of (column_address) */ + int _vpa_cost; /* cost of (row_address) */ + /* used in lib_doupdate.c, must be chars */ + int _ed_cost; /* cost of (clr_eos) */ + int _el_cost; /* cost of (clr_eol) */ + int _el1_cost; /* cost of (clr_bol) */ + int _dch1_cost; /* cost of (delete_character) */ + int _ich1_cost; /* cost of (insert_character) */ + int _dch_cost; /* cost of (parm_dch) */ + int _ich_cost; /* cost of (parm_ich) */ + int _ech_cost; /* cost of (erase_chars) */ + int _rep_cost; /* cost of (repeat_char) */ + int _hpa_ch_cost; /* cost of (column_address) */ + int _cup_ch_cost; /* cost of (cursor_address) */ + int _smir_cost; /* cost of (enter_insert_mode) */ + int _rmir_cost; /* cost of (exit_insert_mode) */ + int _ip_cost; /* cost of (insert_padding) */ + /* used in lib_mvcur.c */ + char * _address_cursor; + int _carriage_return_length; + int _cursor_home_length; + int _cursor_to_ll_length; + + chtype _xmc_suppress; /* attributes to suppress if xmc */ + chtype _xmc_triggers; /* attributes to process if xmc */ + + bool _sig_winch; +}; + + +#define DelCharCost(count) \ + ((parm_dch != 0) \ + ? D->_dch_cost \ + : ((delete_character != 0) \ + ? (D->_dch1_cost * count) \ + : INFINITY)) + +#define InsCharCost(count) \ + ((parm_ich != 0) \ + ? D->_ich_cost \ + : ((enter_insert_mode && exit_insert_mode) \ + ? D->_smir_cost + D->_rmir_cost + (D->_ip_cost * count) \ + : ((insert_character != 0) \ + ? (D->_ich1_cost * count) \ + : INFINITY))) + +#if USE_XMC_SUPPORT +#define UpdateAttrs(c) if (D->_current_attr != AttrOf(c)) { \ + attr_t chg = D->_current_attr; \ + vidattr(AttrOf(c)); \ + if (magic_cookie_glitch > 0 \ + && XMC_CHANGES((chg ^ D->_current_attr))) { \ + T(("%s @%d before glitch %d,%d", \ + __FILE__, __LINE__, \ + D->_cursrow, \ + D->_curscol)); \ + _nc_do_xmc_glitch(chg); \ + } \ + } +#else +#define UpdateAttrs(c) if (D->_current_attr != AttrOf(c)) \ + vidattr(AttrOf(c)); +#endif + +/* + * Check whether the given character can be output by clearing commands. This + * includes test for being a space and not including any 'bad' attributes, such + * as A_REVERSE. All attribute flags which don't affect appearance of a space + * or can be output by clearing (A_COLOR in case of bce-terminal) are excluded. + */ +#define can_clear_with(ch) \ + ((ch & ~(NONBLANK_ATTR|(back_color_erase ? A_COLOR:0))) == BLANK) + +#define XMC_CHANGES(c) ((c) & D->_xmc_suppress) + +#endif /* TTY_DISPLAY_H */ diff --git a/lib/libcurses/tty/tty_input.h b/lib/libcurses/tty/tty_input.h new file mode 100644 index 00000000000..c42774be14b --- /dev/null +++ b/lib/libcurses/tty/tty_input.h @@ -0,0 +1,63 @@ +/* $OpenBSD: tty_input.h,v 1.1 1999/01/18 19:10:27 millert Exp $ */ + +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/* + * $From: tty_input.h,v 1.1 1998/12/19 22:42:57 tom Exp $ + */ + +#ifndef TTY_INPUT_H +#define TTY_INPUT_H 1 + +extern bool _nc_tty_mouse_mask(mmask_t); +extern bool _nc_tty_pending(void); +extern int _nc_tty_next_event(int); +extern void _nc_tty_flags_changed(void); +extern void _nc_tty_flush(void); +extern void _nc_tty_input_resume(void); +extern void _nc_tty_input_suspend(void); + +struct tty_input_data { + int _ifd; /* input file ptr for screen */ + int _keypad_xmit; /* current terminal state */ + int _meta_on; /* current terminal state */ + + /* + * These are the data that support the mouse interface. + */ + bool (*_mouse_event) (SCREEN *); + bool (*_mouse_inline)(SCREEN *); + bool (*_mouse_parse) (int); + void (*_mouse_resume)(SCREEN *); + void (*_mouse_wrap) (SCREEN *); + int _mouse_fd; /* file-descriptor, if any */ + int mousetype; +}; + +#endif /* TTY_INPUT_H */ diff --git a/lib/libcurses/lib_doupdate.c b/lib/libcurses/tty/tty_update.c index d21c815c589..9fd81963b5e 100644 --- a/lib/libcurses/lib_doupdate.c +++ b/lib/libcurses/tty/tty_update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_doupdate.c,v 1.11 1998/10/31 06:30:29 millert Exp $ */ +/* $OpenBSD: tty_update.c,v 1.1 1999/01/18 19:10:27 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -77,7 +77,7 @@ #include <term.h> -MODULE_ID("$From: lib_doupdate.c,v 1.109 1998/10/03 19:08:33 tom Exp $") +MODULE_ID("$From: tty_update.c,v 1.109 1998/10/03 19:08:33 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a |