diff options
Diffstat (limited to 'lib')
130 files changed, 1882 insertions, 17492 deletions
diff --git a/lib/libncurses/COPYRIGHT.NEW b/lib/libncurses/COPYRIGHT.NEW deleted file mode 100644 index 7c5d22b55d9a..000000000000 --- a/lib/libncurses/COPYRIGHT.NEW +++ /dev/null @@ -1,19 +0,0 @@ -/*************************************************************************** -* COPYRIGHT NOTICE * -**************************************************************************** -* ncurses is copyright (C) 1992, 1993, 1994 * -* by Zeyd M. Ben-Halim * -* zmbenhal@netcom.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, not removed * -* from header files, and is reproduced in any documentation * -* accompanying it or the applications linked with it. * -* * -* ncurses comes AS IS with no warranty, implied or expressed. * -* * -***************************************************************************/ - - diff --git a/lib/libncurses/COPYRIGHT.OLD b/lib/libncurses/COPYRIGHT.OLD deleted file mode 100644 index 4049db08fd9e..000000000000 --- a/lib/libncurses/COPYRIGHT.OLD +++ /dev/null @@ -1,5 +0,0 @@ - -Pavel Curtis has given up his copyright to the public domain. This mean -his ORIGINAL sources are in the public domain, not this current release. -This current release IS copyrighted, see COPYRIGHT.NEW. - diff --git a/lib/libncurses/MKkeyname.awk b/lib/libncurses/MKkeyname.awk deleted file mode 100644 index 12613cea3895..000000000000 --- a/lib/libncurses/MKkeyname.awk +++ /dev/null @@ -1,30 +0,0 @@ - -BEGIN { - print "" - print "#include <stdlib.h>" - print "#include \"curses.h\"" - print "" - print "struct kn {" - print "\tchar *name;" - print "\tint code;" - print "};" - print "" - print "struct kn key_names[] = {" -} - -{printf "\t{\"%s\", %s,},\n", $1, $2;} - -END { - print "};" - print "" - print "char *keyname(int c)" - print "{" - print "int i, size = sizeof(key_names)/sizeof(struct kn);" - print "" - print "\tfor (i = 0; i < size; i++) {" - print "\t\tif (key_names[i].code == c) return key_names[i].name;" - print "\t}" - print "\treturn NULL;" - print "}" - print "" -} diff --git a/lib/libncurses/MKkeys.awk b/lib/libncurses/MKkeys.awk deleted file mode 100644 index 669c455ef547..000000000000 --- a/lib/libncurses/MKkeys.awk +++ /dev/null @@ -1 +0,0 @@ -{printf "\tadd_to_try(%s, %s);\n", $1, $2;} diff --git a/lib/libncurses/Makefile b/lib/libncurses/Makefile index 30886f5866fa..40f456df0fd2 100644 --- a/lib/libncurses/Makefile +++ b/lib/libncurses/Makefile @@ -1,205 +1,516 @@ -# Makefile for ncurses # $FreeBSD$ -LIB= ncurses -SHLIB_MAJOR= 3 -SHLIB_MINOR= 1 -SRCS= lib_kernel.c lib_pad.c lib_bkgd.c \ - lib_unctrl.c lib_raw.c lib_vidattr.c lib_trace.c lib_beep.c \ - lib_doupdate.c lib_refresh.c lib_initscr.c lib_newwin.c lib_addch.c \ - lib_addstr.c lib_scroll.c lib_clreol.c lib_touch.c lib_mvcur.c \ - lib_keyname.c keys.tries.h \ - lib_delwin.c lib_endwin.c lib_clrbot.c lib_move.c lib_printw.c \ - lib_scanw.c lib_erase.c lib_getch.c lib_options.c lib_acs.c lib_slk.c\ - lib_box.c lib_clear.c lib_delch.c lib_insch.c lib_instr.c \ - lib_getstr.c lib_mvwin.c lib_longname.c lib_tstp.c \ - lib_newterm.c lib_set_term.c lib_overlay.c lib_scrreg.c lib_color.c \ - lib_insstr.c lib_insdel.c lib_twait.c lib_window.c copyright.c - -CFLAGS+= -I. -I${.CURDIR} -Wall -DMYTINFO #-DTRACE -DPADD= ${LIBMYTINFO} -LDADD= -lmytinfo - -CLEANFILES+= lib_keyname.c keys.tries.h - -beforeinstall: - ${INSTALL} -C -m 444 -o $(BINOWN) -g $(BINGRP) ${.CURDIR}/unctrl.h \ - ${DESTDIR}/usr/include - ${INSTALL} -C -m 444 -o $(BINOWN) -g $(BINGRP) ${.CURDIR}/curses.h \ - ${DESTDIR}/usr/include/ncurses.h - -keys.tries.h: ${.CURDIR}/keys.list ${.CURDIR}/MKkeys.awk - awk -f ${.CURDIR}/MKkeys.awk ${.CURDIR}/keys.list > keys.tries.h - -lib_keyname.c: ${.CURDIR}/keys.list ${.CURDIR}/MKkeyname.awk - awk -f ${.CURDIR}/MKkeyname.awk ${.CURDIR}/keys.list > lib_keyname.c - -MAN3 = curs_addch.3 \ - curs_addchst.3 \ - curs_addstr.3 \ - curs_attr.3 \ - curs_beep.3 \ - curs_bkgd.3 \ - curs_border.3 \ - curs_clear.3 \ - curs_color.3 \ - curs_delch.3 \ - curs_delln.3 \ - curs_getch.3 \ - curs_getstr.3 \ - curs_getyx.3 \ - curs_inch.3 \ - curs_inchstr.3 \ - curs_initscr.3 \ - curs_inopts.3 \ - curs_insch.3 \ - curs_insstr.3 \ - curs_instr.3 \ - curs_kernel.3 \ - curs_move.3 \ - curs_outopts.3 \ - curs_overlay.3 \ - curs_pad.3 \ - curs_printw.3 \ - curs_refresh.3 \ - curs_scanw.3 \ - curs_scr_dmp.3 \ - curs_scroll.3 \ - curs_slk.3 \ - curs_termatt.3 \ - curs_termin.3 \ - curs_touch.3 \ - curs_util.3 \ - curs_window.3 \ - ncurses.3 - -MAN5 = term.5 - -MLINKS+=curs_addch.3 addch.3 curs_addch.3 waddch.3 curs_addch.3 echochar.3 \ - curs_addch.3 wechochar.3 curs_addch.3 mvaddch.3 \ - curs_addch.3 mvwaddch.3 -MLINKS+=curs_addchst.3 addchstr.3 curs_addchst.3 addchnstr.3 \ - curs_addchst.3 waddchstr.3 curs_addchst.3 waddchnstr.3 \ - curs_addchst.3 mvaddchstr.3 curs_addchst.3 mvaddchnstr.3 \ - curs_addchst.3 mvwaddchstr.3 curs_addchst.3 mvwaddchnstr.3 -MLINKS+=curs_addstr.3 addstr.3 curs_addstr.3 addnstr.3 \ - curs_addstr.3 waddstr.3 curs_addstr.3 waddnstr.3 \ - curs_addstr.3 mvaddstr.3 curs_addstr.3 mvaddnstr.3 \ - curs_addstr.3 mvwaddstr.3 curs_addstr.3 mvwaddnstr.3 -MLINKS+=curs_attr.3 attroff.3 curs_attr.3 wattroff.3 \ - curs_attr.3 attron.3 curs_attr.3 wattron.3 \ - curs_attr.3 attrset.3 curs_attr.3 wattrset.3 \ - curs_attr.3 standend.3 curs_attr.3 wstandend.3 \ - curs_attr.3 standout.3 curs_attr.3 wstandout.3 +NCURSES=${.CURDIR}/../../contrib/ncurses + +LIB= ncurses +SHLIB_MAJOR=5 +SHLIB_MINOR=0 + +# Should be elsewhere +AWK?= awk +TERMINFODIR?= ${DESTDIR}/usr/share/misc + +NCURSES_MAJOR!=egrep 'NCURSES_MAJOR[ ]*=' ${NCURSES}/dist.mk | sed -e 's/^[^0-9]*//' +NCURSES_MINOR!=egrep 'NCURSES_MINOR[ ]*=' ${NCURSES}/dist.mk | sed -e 's/^[^0-9]*//' +NCURSES_PATCH!=egrep 'NCURSES_PATCH[ ]*=' ${NCURSES}/dist.mk | sed -e 's/^[^0-9]*//' + +# From autoconf (!) +NCURSES_CONST= +NCURSES_XNAMES= 0 +OSPEED_INCLUDES=\#include <termios.h> +OSPEED_TYPE= speed_t +BUILTIN_BOOL= 1 +BOOL_TYPE= 0 +TYPE_OF_BOOL= char +TYPEOF_CHTYPE= long +WIDEC_SHIFT= 8 +SHIFT_LIMIT= 32 +ONEUL= 1UL + +.PATH: ${NCURSES}/ncurses +.PATH: ${NCURSES}/ncurses/base +.PATH: ${NCURSES}/ncurses/tinfo +.PATH: ${NCURSES}/ncurses/tty +.PATH: ${NCURSES}/ncurses/trace +.PATH: ${NCURSES}/include +.PATH: ${NCURSES}/man + +INCS= -I. -I${.CURDIR} -I${NCURSES}/ncurses -I${NCURSES}/include +CFLAGS+=${INCS} -Wall -DFREEBSD_NATIVE -DNDEBUG -DHAVE_CONFIG_H + +GENSRC= \ + codes.c \ + expanded.c \ + fallback.c \ + lib_gen.c \ + lib_keyname.c \ + names.c \ + unctrl.c + +GENHDR= \ + curses.h \ + hashsize.h \ + init_keytry.h \ + nomacros.h \ + parametrized.h \ + term.h \ + termcap.h \ + unctrl.h + +# Installed +HEADERS=curses.h term.h termcap.h unctrl.h + +# Components of names.c and codes.c +NAMESRC=boolnames boolfnames numnames numfnames strnames strfnames +CODESRC=boolcodes numcodes strcodes + +SRCS= ${GENHDR} ${GENSRC} \ + access.c \ + add_tries.c \ + alloc_entry.c \ + alloc_ttype.c \ + captoinfo.c \ + comp_captab.c \ + comp_error.c \ + comp_expand.c \ + comp_hash.c \ + comp_parse.c \ + comp_scan.c \ + define_key.c \ + doalloc.c \ + free_ttype.c \ + getenv_num.c \ + hardscroll.c \ + hashmap.c \ + home_terminfo.c \ + init_keytry.c \ + keybound.c \ + keyok.c \ + lib_acs.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_echo.c \ + lib_endwin.c \ + lib_erase.c \ + lib_flash.c \ + lib_freeall.c \ + lib_getch.c \ + lib_getstr.c \ + lib_has_cap.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_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_termname.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_ttyflags.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 \ + memmove.c \ + name_match.c \ + nc_panel.c \ + parse_entry.c \ + read_entry.c \ + resizeterm.c \ + safe_sprintf.c \ + setbuf.c \ + sigaction.c \ + trace_buf.c \ + trace_tries.c \ + trace_xnames.c \ + tries.c \ + tty_update.c \ + vsscanf.c \ + wresize.c \ + write_entry.c \ + +# From our old libtermcap. +# Used instead of the hideous read_termcap.c abomination. +SRCS+= termcap.c + +CLEANFILES+= ${GENSRC} ${GENHDR} keys.tries make_hash term.h.new \ + make_keys MKterm.h.awk comp_captab.c \ + namehdr nameftr codeftr ${NAMESRC} ${CODESRC} + +SYMLINKS+=${LIBDIR}/libncurses.a ${LIBDIR}/libcurses.a +SYMLINKS+=${LIBDIR}/libncurses.a ${LIBDIR}/libtermcap.a +SYMLINKS+=${LIBDIR}/libncurses.a ${LIBDIR}/libtermlib.a +SYMLINKS+=${LIBDIR}/libncurses.a ${LIBDIR}/libmytinfo.a +SYMLINKS+=${LIBDIR}/libncurses.a ${LIBDIR}/libtinfo.a +.if !defined(NOPIC) +.if ${OBJFORMAT} == aout +SYMLINKS+=${SHLIBDIR}/libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ${SHLIBDIR}/libcurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +SYMLINKS+=${SHLIBDIR}/libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ${SHLIBDIR}/libtermcap.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +SYMLINKS+=${SHLIBDIR}/libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ${SHLIBDIR}/libtermlib.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +SYMLINKS+=${SHLIBDIR}/libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ${SHLIBDIR}/libmytinfo.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +SYMLINKS+=${SHLIBDIR}/libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ${SHLIBDIR}/libtinfo.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +.else +# no need for major at all, it's an ld-time redirection only +SYMLINKS+=${SHLIBDIR}/libncurses.so ${SHLIBDIR}/libcurses.so +SYMLINKS+=${SHLIBDIR}/libncurses.so ${SHLIBDIR}/libtermcap.so +SYMLINKS+=${SHLIBDIR}/libncurses.so ${SHLIBDIR}/libtermlib.so +SYMLINKS+=${SHLIBDIR}/libncurses.so ${SHLIBDIR}/libmytinfo.so +SYMLINKS+=${SHLIBDIR}/libncurses.so ${SHLIBDIR}/libtinfo.so +.endif +.endif +.if !defined(NOPROFILE) +SYMLINKS+=${LIBDIR}/libncurses_p.a ${LIBDIR}/libcurses_p.a +SYMLINKS+=${LIBDIR}/libncurses_p.a ${LIBDIR}/libtermcap_p.a +SYMLINKS+=${LIBDIR}/libncurses_p.a ${LIBDIR}/libtermlib_p.a +SYMLINKS+=${LIBDIR}/libncurses_p.a ${LIBDIR}/libmytinfo_p.a +SYMLINKS+=${LIBDIR}/libncurses_p.a ${LIBDIR}/libtinfo_p.a +.endif + +beforeinstall: ${HEADERS} + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${HEADERS} \ + ${DESTDIR}/usr/include + rm -f ${DESTDIR}/usr/include/ncurses.h + ln -s curses.h ${DESTDIR}/usr/include/ncurses.h + +# Generated source +namehdr nameftr codeftr ${NAMESRC} ${CODESRC}: MKnames.awk Caps + ${AWK} -f ${NCURSES}/ncurses/tinfo/MKnames.awk ${NCURSES}/include/Caps + +names.c: namehdr ${NAMESRC} nameftr + cat namehdr ${NAMESRC} nameftr > $@ + +codes.c: namehdr ${CODESRC} codeftr + cat namehdr ${CODESRC} codeftr > $@ + +lib_gen.c: MKlib_gen.sh curses.h + sh ${NCURSES}/ncurses/base/MKlib_gen.sh "${CC} -E ${INCS}" \ + "${AWK}" < curses.h >$@ + +lib_keyname.c: keys.list MKkeyname.awk + ${AWK} -f ${NCURSES}/ncurses/base/MKkeyname.awk \ + ${NCURSES}/ncurses/tinfo/keys.list > lib_keyname.c + +unctrl.c: MKunctrl.awk + echo | ${AWK} -f ${NCURSES}/ncurses/base/MKunctrl.awk > unctrl.c + +comp_captab.c: MKcaptab.awk Caps make_hash + sh ${NCURSES}/ncurses/tinfo/MKcaptab.awk "${AWK}" \ + ${NCURSES}/include/Caps > comp_captab.c + +expanded.c: MKexpanded.sh + sh ${NCURSES}/ncurses/tty/MKexpanded.sh "${CC} -E" ${CFLAGS} >expanded.c + +fallback.c: MKfallback.sh + sh ${NCURSES}/ncurses/tinfo/MKfallback.sh > fallback.c + +# Generated headers +nomacros.h: MKlib_gen.sh curses.h + sh ${NCURSES}/ncurses/base/MKlib_gen.sh "${CC} -E ${INCS}" \ + "${AWK}" < curses.h | fgrep undef > $@ + +init_keytry.h: keys.list make_keys + ./make_keys ${NCURSES}/ncurses/tinfo/keys.list > init_keytry.h + +hashsize.h: MKhashsize.sh Caps + sh ${NCURSES}/include/MKhashsize.sh ${NCURSES}/include/Caps > $@ + +parametrized.h: MKparametrized.sh Caps + AWK=${AWK} sh ${NCURSES}/include/MKparametrized.sh \ + ${NCURSES}/include/Caps > $@ + +term.h: MKterm.h.awk edit_cfg.sh Caps + ${AWK} -f MKterm.h.awk ${NCURSES}/include/Caps > $@.new + sh ${NCURSES}/include/edit_cfg.sh ${.CURDIR}/ncurses_cfg.h $@.new + mv -f $@.new $@ + +# Build tools +make_keys: make_keys.c names.c + ${CC} -o $@ ${CFLAGS} ${NCURSES}/ncurses/tinfo/make_keys.c + +make_hash: comp_hash.c + ${CC} -o $@ ${CFLAGS} -DMAIN_PROGRAM \ + ${NCURSES}/ncurses/tinfo/comp_hash.c + +# ./configure generated +MKterm.h.awk: MKterm.h.awk.in + sed <${NCURSES}/include/$@.in >$@ \ + -e "/@NCURSES_MAJOR@/s//${NCURSES_MAJOR}/" \ + -e "/@NCURSES_MINOR@/s//${NCURSES_MINOR}/" \ + -e "/@NCURSES_CONST@/s//${NCURSES_CONST}/" \ + -e "/@NCURSES_XNAMES@/s//${NCURSES_XNAMES}/" + +termcap.h: termcap.h.in + sed <${NCURSES}/include/$@.in >$@ \ + -e "/@NCURSES_MAJOR@/s//${NCURSES_MAJOR}/" \ + -e "/@NCURSES_MINOR@/s//${NCURSES_MINOR}/" \ + -e "/@NCURSES_CONST@/s//${NCURSES_CONST}/" \ + -e "/@OSPEED_INCLUDES@/s//${OSPEED_INCLUDES}/" \ + -e "/@OSPEED_TYPE@/s//${OSPEED_TYPE}/" + +curses.h: curses.h.in + sed <${NCURSES}/include/$@.in >$@ \ + -e "/@NCURSES_MAJOR@/s//${NCURSES_MAJOR}/" \ + -e "/@NCURSES_MINOR@/s//${NCURSES_MINOR}/" \ + -e "/@NCURSES_PATCH@/s//${NCURSES_PATCH}/" \ + -e "/@NCURSES_CONST@/s//${NCURSES_CONST}/" \ + -e "s/@cf_cv_builtin_bool@/${BUILTIN_BOOL}/g" \ + -e "s/@cf_cv_cc_bool_type@/${BOOL_TYPE}/g" \ + -e "s/@cf_cv_type_of_bool@/${TYPE_OF_BOOL}/g" \ + -e "s/@cf_cv_typeof_chtype@/${TYPEOF_CHTYPE}/g" \ + -e "s/@cf_cv_widec_shift@/${WIDEC_SHIFT}/g" \ + -e "s/@cf_cv_shift_limit@/${SHIFT_LIMIT}/g" \ + -e "s/@cf_cv_1UL@/${ONEUL}/g" + +unctrl.h: unctrl.h.in + sed <${NCURSES}/include/$@.in >$@ \ + -e "/@NCURSES_MAJOR@/s//${NCURSES_MAJOR}/" \ + -e "/@NCURSES_MINOR@/s//${NCURSES_MINOR}/" + +# MAN page gunk +terminfo.5: MKterminfo.sh terminfo.head Caps + sh ${NCURSES}/man/MKterminfo.sh ${NCURSES}/man/terminfo.head \ + ${NCURSES}/include/Caps ${NCURSES}/man/terminfo.tail >$@ + +CLEANFILES+= terminfo.5 +MANFILTER= sed -e 's\#@DATADIR@\#${TERMINFODIR}/terminfo\#g' + +MAN3x= curs_addch.3x curs_addchstr.3x curs_addstr.3x curs_attr.3x \ + curs_beep.3x curs_bkgd.3x curs_border.3x curs_clear.3x curs_color.3x \ + curs_delch.3x curs_deleteln.3x curs_getch.3x curs_getstr.3x \ + curs_getyx.3x curs_inch.3x curs_inchstr.3x curs_initscr.3x \ + curs_inopts.3x curs_insch.3x curs_insstr.3x curs_instr.3x \ + curs_kernel.3x curs_mouse.3x curs_move.3x curs_outopts.3x \ + curs_overlay.3x curs_pad.3x curs_print.3x curs_printw.3x \ + curs_refresh.3x curs_scanw.3x curs_scr_dump.3x curs_scroll.3x \ + curs_slk.3x curs_termattrs.3x curs_termcap.3x curs_terminfo.3x \ + curs_touch.3x curs_util.3x curs_window.3x define_key.3x \ + dft_fgbg.3x keybound.3x keyok.3x ncurses.3x resizeterm.3x wresize.3x +MAN5= term.5 terminfo.5 +MAN7= term.7 + +# Generate the MAN3 list from MAN3x +.for page in ${MAN3x} +CLEANFILES+=${page:T:S/3x$/3/g} +MAN3+=${page:T:S/3x$/3/g} +all-man: ${page:T:S/3x$/3/g} +${page:T:S/3x$/3/g}: ${page} + ln -s ${.ALLSRC} ${.TARGET} +.endfor + +MLINKS+=curs_addch.3 addch.3 curs_addch.3 echochar.3 curs_addch.3 mvaddch.3 \ + curs_addch.3 mvwaddch.3 curs_addch.3 waddch.3 curs_addch.3 wechochar.3 +MLINKS+=curs_addchstr.3 addchnstr.3 curs_addchstr.3 addchstr.3 \ + curs_addchstr.3 mvaddchnstr.3 curs_addchstr.3 mvaddchstr.3 \ + curs_addchstr.3 mvwaddchnstr.3 curs_addchstr.3 mvwaddchstr.3 \ + curs_addchstr.3 waddchnstr.3 curs_addchstr.3 waddchstr.3 +MLINKS+=curs_addstr.3 addnstr.3 curs_addstr.3 addstr.3 \ + curs_addstr.3 mvaddnstr.3 curs_addstr.3 mvaddstr.3 \ + curs_addstr.3 mvwaddnstr.3 curs_addstr.3 mvwaddstr.3 \ + curs_addstr.3 waddnstr.3 curs_addstr.3 waddstr.3 +MLINKS+=curs_attr.3 attr_get.3 curs_attr.3 attr_off.3 curs_attr.3 attr_on.3 \ + curs_attr.3 attr_set.3 curs_attr.3 attroff.3 curs_attr.3 attron.3 \ + curs_attr.3 attrset.3 curs_attr.3 chgat.3 curs_attr.3 color_set.3 \ + curs_attr.3 mvchgat.3 curs_attr.3 mvwchgat.3 curs_attr.3 standend.3 \ + curs_attr.3 standout.3 curs_attr.3 wattr_get.3 curs_attr.3 wattr_off.3 \ + curs_attr.3 wattr_on.3 curs_attr.3 wattr_set.3 curs_attr.3 wattroff.3 \ + curs_attr.3 wattron.3 curs_attr.3 wattrset.3 curs_attr.3 wchgat.3 \ + curs_attr.3 wcolor_set.3 curs_attr.3 wstandend.3 \ + curs_attr.3 wstandout.3 MLINKS+=curs_beep.3 beep.3 curs_beep.3 flash.3 -MLINKS+=curs_bkgd.3 bkgdset.3 curs_bkgd.3 wbkgdset.3 \ - curs_bkgd.3 bkgd.3 curs_bkgd.3 wbkgd.3 -MLINKS+=curs_border.3 border.3 curs_border.3 wborder.3 curs_border.3 box.3 \ - curs_border.3 hline.3 curs_border.3 whline.3 \ - curs_border.3 vline.3 curs_border.3 wvline.3 -MLINKS+=curs_clear.3 erase.3 curs_clear.3 werase.3 curs_clear.3 clear.3 \ - curs_clear.3 wclear.3 curs_clear.3 clrtobot.3 \ - curs_clear.3 wclrtobot.3 curs_clear.3 clrtoeol.3 \ - curs_clear.3 wclrtoeol.3 -MLINKS+=curs_color.3 start_color.3 curs_color.3 init_pair.3 \ - curs_color.3 init_color.3 curs_color.3 has_colors.3 \ - curs_color.3 can_change_color.3 curs_color.3 color_content.3 \ - curs_color.3 pair_content.3 -MLINKS+=curs_delch.3 delch.3 curs_delch.3 wdelch.3 curs_delch.3 mvdelch.3 \ - curs_delch.3 mvwdelch.3 -MLINKS+=curs_delln.3 deleteln.3 curs_delln.3 wdeleteln.3 \ - curs_delln.3 insdelln.3 curs_delln.3 winsdelln.3 \ - curs_delln.3 insertln.3 curs_delln.3 winsertln.3 -MLINKS+=curs_getch.3 getch.3 curs_getch.3 wgetch.3 curs_getch.3 mvgetch.3 \ - curs_getch.3 mvwgetch.3 curs_getch.3 ungetch.3 -MLINKS+=curs_getstr.3 getstr.3 curs_getstr.3 wgetstr.3 \ - curs_getstr.3 mvgetstr.3 curs_getstr.3 mvwgetstr.3 \ - curs_getstr.3 wgetnstr.3 -MLINKS+=curs_getyx.3 getyx.3 curs_getyx.3 pgetparyx.3 curs_getyx.3 getbegyx.3 \ - curs_getyx.3 getmaxyx.3 -MLINKS+=curs_inch.3 inch.3 curs_inch.3 winch.3 curs_inch.3 mvinch.3 \ - curs_inch.3 mvwinch.3 -MLINKS+=curs_inchstr.3 inchstr.3 curs_inchstr.3 inchnstr.3 \ - curs_inchstr.3 winchstr.3 curs_inchstr.3 winchnstr.3 \ - curs_inchstr.3 mvinchstr.3 curs_inchstr.3 mvinchnstr.3 \ - curs_inchstr.3 mvwinchstr.3 curs_inchstr.3 mvwinchnstr.3 -MLINKS+=curs_initscr.3 initscr.3 curs_initscr.3 newterm.3 \ - curs_initscr.3 endwin.3 curs_initscr.3 isendwin.3 \ - curs_initscr.3 set_term.3 curs_initscr.3 delscreen.3 -MLINKS+=curs_inopts.3 cbreak.3 curs_inopts.3 nocbreak.3 curs_inopts.3 echo.3 \ - curs_inopts.3 noecho.3 curs_inopts.3 halfdelay.3 \ +MLINKS+=curs_bkgd.3 bkgd.3 curs_bkgd.3 bkgdset.3 curs_bkgd.3 getbkgd.3 \ + curs_bkgd.3 wbkgd.3 curs_bkgd.3 wbkgdset.3 +MLINKS+=curs_border.3 border.3 curs_border.3 box.3 curs_border.3 hline.3 \ + curs_border.3 mvhline.3 curs_border.3 mvwhline.3 \ + curs_border.3 mvwvline.3 curs_border.3 vline.3 curs_border.3 wborder.3 \ + curs_border.3 whline.3 curs_border.3 wvline.3 +MLINKS+=curs_clear.3 clear.3 curs_clear.3 clrtobot.3 curs_clear.3 clrtoeol.3 \ + curs_clear.3 erase.3 curs_clear.3 wclear.3 curs_clear.3 wclrtobot.3 \ + curs_clear.3 wclrtoeol.3 curs_clear.3 werase.3 +MLINKS+=curs_color.3 can_change_color.3 curs_color.3 color_content.3 \ + curs_color.3 has_colors.3 curs_color.3 init_color.3 \ + curs_color.3 init_pair.3 curs_color.3 pair_content.3 \ + curs_color.3 start_color.3 +MLINKS+=curs_delch.3 delch.3 curs_delch.3 mvdelch.3 curs_delch.3 mvwdelch.3 \ + curs_delch.3 wdelch.3 +MLINKS+=curs_deleteln.3 deleteln.3 curs_deleteln.3 insdelln.3 \ + curs_deleteln.3 insertln.3 curs_deleteln.3 wdeleteln.3 \ + curs_deleteln.3 winsdelln.3 curs_deleteln.3 winsertln.3 +MLINKS+=curs_getch.3 getch.3 curs_getch.3 has_key.3 curs_getch.3 mvgetch.3 \ + curs_getch.3 mvwgetch.3 curs_getch.3 ungetch.3 curs_getch.3 wgetch.3 +MLINKS+=curs_getstr.3 getnstr.3 curs_getstr.3 getstr.3 \ + curs_getstr.3 mvgetnstr.3 curs_getstr.3 mvgetstr.3 \ + curs_getstr.3 mvwgetnstr.3 curs_getstr.3 mvwgetstr.3 \ + curs_getstr.3 wgetnstr.3 curs_getstr.3 wgetstr.3 +MLINKS+=curs_getyx.3 getbegyx.3 curs_getyx.3 getmaxyx.3 \ + curs_getyx.3 getparyx.3 curs_getyx.3 getyx.3 +MLINKS+=curs_inch.3 inch.3 curs_inch.3 mvinch.3 curs_inch.3 mvwinch.3 \ + curs_inch.3 winch.3 +MLINKS+=curs_inchstr.3 inchnstr.3 curs_inchstr.3 inchstr.3 \ + curs_inchstr.3 mvinchnstr.3 curs_inchstr.3 mvinchstr.3 \ + curs_inchstr.3 mvwinchnstr.3 curs_inchstr.3 mvwinchstr.3 \ + curs_inchstr.3 winchnstr.3 curs_inchstr.3 winchstr.3 +MLINKS+=curs_initscr.3 delscreen.3 curs_initscr.3 endwin.3 \ + curs_initscr.3 initscr.3 curs_initscr.3 isendwin.3 \ + curs_initscr.3 newterm.3 curs_initscr.3 set_term.3 +MLINKS+=curs_inopts.3 cbreak.3 curs_inopts.3 echo.3 curs_inopts.3 halfdelay.3 \ curs_inopts.3 intrflush.3 curs_inopts.3 keypad.3 curs_inopts.3 meta.3 \ - curs_inopts.3 nodelay.3 curs_inopts.3 notimeout.3 curs_inopts.3 raw.3 \ - curs_inopts.3 noraw.3 curs_inopts.3 noqiflush.3 \ - curs_inopts.3 qiflush.3 curs_inopts.3 timeout.3 \ - curs_inopts.3 wtimeout.3 curs_inopts.3 typeahead.3 -MLINKS+=curs_insch.3 insch.3 curs_insch.3 winsch.3 curs_insch.3 mvinsch.3 \ - curs_insch.3 mvwinsch.3 -MLINKS+=curs_insstr.3 insstr.3 curs_insstr.3 insnstr.3 \ - curs_insstr.3 winsstr.3 curs_insstr.3 winsnstr.3 \ - curs_insstr.3 mvinsstr.3 curs_insstr.3 mvinsnstr.3 \ - curs_insstr.3 mvwinsstr.3 curs_insstr.3 mvwinsnstr.3 -MLINKS+=curs_instr.3 instr.3 curs_instr.3 innstr.3 curs_instr.3 winstr.3 \ - curs_instr.3 winnstr.3 curs_instr.3 mvinstr.3 curs_instr.3 mvinnstr.3 \ - curs_instr.3 mvwinstr.3 curs_instr.3 mvwinnstr.3 -MLINKS+=curs_kernel.3 def_prog_mode.3 curs_kernel.3 def_shell_mode.3 \ - curs_kernel.3 reset_prog_mode.3 curs_kernel.3 reset_shell_mode.3 \ - curs_kernel.3 resetty.3 curs_kernel.3 savetty.3 \ - curs_kernel.3 getsyx.3 curs_kernel.3 setsyx.3 \ - curs_kernel.3 ripoffline.3 curs_kernel.3 curs_set.3 \ - curs_kernel.3 napms.3 + curs_inopts.3 nocbreak.3 curs_inopts.3 nodelay.3 \ + curs_inopts.3 noecho.3 curs_inopts.3 noqiflush.3 curs_inopts.3 noraw.3 \ + curs_inopts.3 notimeout.3 curs_inopts.3 qiflush.3 curs_inopts.3 raw.3 \ + curs_inopts.3 timeout.3 curs_inopts.3 typeahead.3 \ + curs_inopts.3 wtimeout.3 +MLINKS+=curs_insch.3 insch.3 curs_insch.3 mvinsch.3 curs_insch.3 mvwinsch.3 \ + curs_insch.3 winsch.3 +MLINKS+=curs_insstr.3 insnstr.3 curs_insstr.3 insstr.3 \ + curs_insstr.3 mvinsnstr.3 curs_insstr.3 mvinsstr.3 \ + curs_insstr.3 mvwinsnstr.3 curs_insstr.3 mvwinsstr.3 \ + curs_insstr.3 winsnstr.3 curs_insstr.3 winsstr.3 +MLINKS+=curs_instr.3 innstr.3 curs_instr.3 instr.3 curs_instr.3 mvinnstr.3 \ + curs_instr.3 mvinstr.3 curs_instr.3 mvwinnstr.3 \ + curs_instr.3 mvwinstr.3 curs_instr.3 winnstr.3 curs_instr.3 winstr.3 +MLINKS+=curs_kernel.3 curs_set.3 curs_kernel.3 def_prog_mode.3 \ + curs_kernel.3 def_shell_mode.3 curs_kernel.3 getsyx.3 \ + curs_kernel.3 napms.3 curs_kernel.3 reset_prog_mode.3 \ + curs_kernel.3 reset_shell_mode.3 curs_kernel.3 resetty.3 \ + curs_kernel.3 ripoffline.3 curs_kernel.3 savetty.3 \ + curs_kernel.3 setsyx.3 +MLINKS+=curs_mouse.3 getmouse.3 curs_mouse.3 mouseinterval.3 \ + curs_mouse.3 mousemask.3 curs_mouse.3 ungetmouse.3 \ + curs_mouse.3 wenclose.3 curs_mouse.3 wmouse_trafo.3 MLINKS+=curs_move.3 move.3 curs_move.3 wmove.3 -MLINKS+=curs_outopts.3 clearok.3 curs_outopts.3 idlok.3 \ - curs_outopts.3 idcok.3 curs_outopts.3 immedok.3 \ - curs_outopts.3 leaveok.3 curs_outopts.3 setscrreg.3 \ - curs_outopts.3 wsetscrreg.3 curs_outopts.3 scrollok.3 \ - curs_outopts.3 nl.3 curs_outopts.3 nonl.3 -MLINKS+=curs_overlay.3 overlay.3 curs_overlay.3 overwrite.3 \ - curs_overlay.3 copywin.3 -MLINKS+=curs_pad.3 newpad.3 curs_pad.3 subpad.3 curs_pad.3 prefresh.3 \ - curs_pad.3 pnoutrefresh.3 curs_pad.3 pechochar.3 -MLINKS+=curs_printw.3 printw.3 curs_printw.3 wprintw.3 \ - curs_printw.3 mvprintw.3 curs_printw.3 mvwprintw.3 \ - curs_printw.3 vwprintw.3 -MLINKS+=curs_refresh.3 refresh.3 curs_refresh.3 wrefresh.3 \ - curs_refresh.3 wnoutrefresh.3 curs_refresh.3 doupdate.3 \ - curs_refresh.3 redrawwin.3 curs_refresh.3 wredrawln.3 -MLINKS+=curs_scanw.3 scanw.3 curs_scanw.3 wscanw.3 curs_scanw.3 mvscanw.3 \ - curs_scanw.3 mvwscanw.3 curs_scanw.3 vwscanw.3 -MLINKS+=curs_scr_dmp.3 scr_dump.3 curs_scr_dmp.3 scr_restore.3 \ - curs_scr_dmp.3 scr_init.3 curs_scr_dmp.3 scr_set.3 -MLINKS+=curs_scroll.3 scroll.3 curs_scroll.3 scrl.3 curs_scroll.3 wscrl.3 -MLINKS+=curs_slk.3 slk_init.3 curs_slk.3 slk_set.3 curs_slk.3 slk_refresh.3 \ - curs_slk.3 slk_noutrefresh.3 curs_slk.3 slk_label.3 \ - curs_slk.3 slk_clear.3 curs_slk.3 slk_restore.3 \ - curs_slk.3 slk_touch.3 curs_slk.3 slk_attron.3 \ - curs_slk.3 slk_attrset.3 curs_slk.3 slk_attroff.3 -MLINKS+=curs_termatt.3 baudrate.3 curs_termatt.3 erasechar.3 \ - curs_termatt.3 has_ic.3 curs_termatt.3 has_il.3 \ - curs_termatt.3 killchar.3 curs_termatt.3 longname.3 \ - curs_termatt.3 termattrs.3 curs_termatt.3 termname.3 - -# XXX name clash with termcap(3) -# MLINKS+= curs_termin.3 tparm.3 -MLINKS+=curs_termin.3 setupterm.3 curs_termin.3 setterm.3 \ - curs_termin.3 set_curterm.3 curs_termin.3 del_curterm.3 \ - curs_termin.3 restartterm.3 \ - curs_termin.3 putp.3 curs_termin.3 vidputs.3 \ - curs_termin.3 vidattr.3 curs_termin.3 mvcur.3 \ - curs_termin.3 tigetflag.3 curs_termin.3 tigetnum.3 \ - curs_termin.3 tigetstr.3 -MLINKS+=curs_touch.3 touchwin.3 curs_touch.3 touchline.3 \ - curs_touch.3 untouchwin.3 curs_touch.3 wtouchln.3 \ - curs_touch.3 is_linetouched.3 curs_touch.3 is_wintouched.3 -MLINKS+=curs_util.3 unctrl.3 curs_util.3 keyname.3 \ - curs_util.3 filter.3 curs_util.3 use_env.3 \ - curs_util.3 putwin.3 curs_util.3 getwin.3 \ - curs_util.3 delay_output.3 curs_util.3 flushinp.3 -MLINKS+=curs_window.3 newwin.3 curs_window.3 delwin.3 \ - curs_window.3 mvwin.3 curs_window.3 subwin.3 \ - curs_window.3 derwin.3 curs_window.3 mvderwin.3 \ - curs_window.3 dupwin.3 curs_window.3 wsyncup.3 \ - curs_window.3 syncok.3 curs_window.3 wcursyncup.3 \ - curs_window.3 wsyncdown.3 +MLINKS+=curs_outopts.3 clearok.3 curs_outopts.3 idcok.3 curs_outopts.3 idlok.3 \ + curs_outopts.3 immedok.3 curs_outopts.3 leaveok.3 curs_outopts.3 nl.3 \ + curs_outopts.3 nonl.3 curs_outopts.3 scrollok.3 \ + curs_outopts.3 setscrreg.3 curs_outopts.3 wsetscrreg.3 +MLINKS+=curs_overlay.3 copywin.3 curs_overlay.3 overlay.3 \ + curs_overlay.3 overwrite.3 +MLINKS+=curs_pad.3 newpad.3 curs_pad.3 pechochar.3 curs_pad.3 pnoutrefresh.3 \ + curs_pad.3 prefresh.3 curs_pad.3 subpad.3 +MLINKS+=curs_print.3 mcprint.3 +MLINKS+=curs_printw.3 mvprintw.3 curs_printw.3 mvwprintw.3 \ + curs_printw.3 printw.3 curs_printw.3 vw_printw.3 \ + curs_printw.3 vwprintw.3 curs_printw.3 wprintw.3 +MLINKS+=curs_refresh.3 doupdate.3 curs_refresh.3 redrawwin.3 \ + curs_refresh.3 refresh.3 curs_refresh.3 wnoutrefresh.3 \ + curs_refresh.3 wredrawln.3 curs_refresh.3 wrefresh.3 +MLINKS+=curs_scanw.3 mvscanw.3 curs_scanw.3 mvwscanw.3 curs_scanw.3 scanw.3 \ + curs_scanw.3 vw_scanw.3 curs_scanw.3 vwscanw.3 curs_scanw.3 wscanw.3 +MLINKS+=curs_scr_dump.3 scr_dump.3 curs_scr_dump.3 scr_init.3 \ + curs_scr_dump.3 scr_restore.3 curs_scr_dump.3 scr_set.3 +MLINKS+=curs_scroll.3 scrl.3 curs_scroll.3 scroll.3 curs_scroll.3 wscrl.3 +MLINKS+=curs_slk.3 slk_attr.3 curs_slk.3 slk_attr_off.3 \ + curs_slk.3 slk_attr_on.3 curs_slk.3 slk_attr_set.3 \ + curs_slk.3 slk_attroff.3 curs_slk.3 slk_attron.3 \ + curs_slk.3 slk_attrset.3 curs_slk.3 slk_clear.3 \ + curs_slk.3 slk_color.3 curs_slk.3 slk_init.3 curs_slk.3 slk_label.3 \ + curs_slk.3 slk_noutrefresh.3 curs_slk.3 slk_refresh.3 \ + curs_slk.3 slk_restore.3 curs_slk.3 slk_set.3 curs_slk.3 slk_touch.3 +MLINKS+=curs_termattrs.3 baudrate.3 curs_termattrs.3 erasechar.3 \ + curs_termattrs.3 has_ic.3 curs_termattrs.3 has_il.3 \ + curs_termattrs.3 killchar.3 curs_termattrs.3 longname.3 \ + curs_termattrs.3 termattrs.3 curs_termattrs.3 termname.3 +MLINKS+=curs_termcap.3 tgetent.3 curs_termcap.3 tgetflag.3 \ + curs_termcap.3 tgetnum.3 curs_termcap.3 tgetstr.3 \ + curs_termcap.3 tgoto.3 curs_termcap.3 tputs.3 +MLINKS+=curs_terminfo.3 del_curterm.3 curs_terminfo.3 mvcur.3 \ + curs_terminfo.3 putp.3 curs_terminfo.3 restartterm.3 \ + curs_terminfo.3 set_curterm.3 curs_terminfo.3 setterm.3 \ + curs_terminfo.3 setupterm.3 curs_terminfo.3 tigetflag.3 \ + curs_terminfo.3 tigetnum.3 curs_terminfo.3 tigetstr.3 \ + curs_terminfo.3 tparm.3 curs_terminfo.3 tputs.3 \ + curs_terminfo.3 vidattr.3 curs_terminfo.3 vidputs.3 +MLINKS+=curs_touch.3 is_linetouched.3 curs_touch.3 is_wintouched.3 \ + curs_touch.3 touchline.3 curs_touch.3 touchwin.3 \ + curs_touch.3 untouchwin.3 curs_touch.3 wtouchln.3 +MLINKS+=curs_util.3 delay_output.3 curs_util.3 filter.3 \ + curs_util.3 flushinp.3 curs_util.3 getwin.3 \ + curs_util.3 keyname.3 curs_util.3 putwin.3 \ + curs_util.3 unctrl.3 curs_util.3 use_env.3 +MLINKS+=curs_window.3 delwin.3 curs_window.3 derwin.3 curs_window.3 dupwin.3 \ + curs_window.3 mvderwin.3 curs_window.3 mvwin.3 curs_window.3 newwin.3 \ + curs_window.3 subwin.3 curs_window.3 syncok.3 \ + curs_window.3 wcursyncup.3 curs_window.3 wsyncdown.3 \ + curs_window.3 wsyncup.3 +MLINKS+=dft_fgbg.3 use_default_colors.3 .include <bsd.lib.mk> + +.SUFFIXES: .3x .3 diff --git a/lib/libncurses/README b/lib/libncurses/README deleted file mode 100644 index d1f93bb7d0e3..000000000000 --- a/lib/libncurses/README +++ /dev/null @@ -1,42 +0,0 @@ -NCURSES 1.8.6 - July 24, 1994 ------------------------------ -This file is intended to help people interested in working -on fixing ncurses, enhancing it, or porting it to other -platforms. - -PORTABILITY: -The file matrix is an attempt at centralizing all portability -information. The top line lists the different options, down -the leftside are the operating systems supported. If an option -is not needed then it should have an entry of NONE. Note the -use of ':' to terminate each field. If somebody knows awk better -than me, get in touch. - -OS: name of operating system -ISPOSIX: -DNONPOSIX if <unistd.h> is missing -POSIX: -DSTRICTPOSIX if _POSIX_SOURCE turns off non-POSIX features. - -DSVR4_ACTION if like svr4 you need _POSIX_SOURCE to have sigaction -TERMINAL: -DNOTERMIOS if you don't have <termios.h> but have <sgtty.h> -HEADERS: -DBRAINDEAD if system headers don't declare external variables -TABS: -DBSDTABS if you don't have TABS3 but have OXTABS -OPT: -DOPT_MVCUR if you want mvcur() to cost its actions or you have a - terminal that doesn't have direct cursor addressing. -SRCDIR: the directory where the terminfo database lives -CC: ANSI C compiler -FLAGS: standard compiler flags -EXTRA: extra flags needed by individual systems - Sun: -DSUNIOCTL <sys/ioctl.h> conflicts with <termios.h> - HP-UX: -D_HPUX_SOURCE so that we get POSIX and XOPEN features. - SVR4: -DBROKEN_TIOCGETWINSZ guess what? - AIX: -DSYS_SELECT if you need <sys/select.h> -BASE: The directory under which headers and libraries will - be installed. -INSTALL: The name of an install program similar to BSD's (ie. understands - -m, -g, -o, etc.) GNU install works. - -The awk script in script.src reads matrix and generates all the Config.* -files. - -There are several problems with strict POSIX systems so extra flags -or #define's maybe needed. - diff --git a/lib/libncurses/TESTS/Makefile b/lib/libncurses/TESTS/Makefile deleted file mode 100644 index ef6cb997a54c..000000000000 --- a/lib/libncurses/TESTS/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -TESTS = test corner ensor getch ncurses hanoi knight rain worm \ - over scroll2 battle newdemo scroll3 xmas copy firework testcurs \ - scroll - -CLEANFILES += $(TESTS) - -LIBS += -lncurses -lmytinfo - -all: $(TESTS) - -$(TESTS): - $(CC) $(CFLAGS) $(LDFLAGS) ${.CURDIR}/${.TARGET}.c -o ${.TARGET} $(LIBS) - -test: test.c -corner: corner.c -ensor: ensor.c -getch: getch.c -ncurses: ncurses.c -hanoi: hanoi.c -knight: knight.c -rain: rain.c -worm: worm.c -over: over.c -scroll2: scroll2.c -battle: battle.c -newdemo: newdemo.c -scroll3: scroll3.c -xmas: xmas.c -copy: copy.c -firework: firework.c -testcurs: testcurs.c -scroll: scroll.c - -.include <bsd.prog.mk> - diff --git a/lib/libncurses/TESTS/README b/lib/libncurses/TESTS/README deleted file mode 100644 index 279c6d8479ba..000000000000 --- a/lib/libncurses/TESTS/README +++ /dev/null @@ -1,21 +0,0 @@ -The programs in this directory are designed to test your newest toy :-) -Check the sources for any further details. - -asc.c - tests the line drawing functions -attr.c - display attributes available on the terminal -bs.c - the game of battleship -battle.c - older version of battleship with different interface -caps.c - output a list of all capabilites to stderr (redirect to a file - or it will screw up the terminal) -copy.c - test overlay -gdc.c - Great Digital Clock, gives an example of usng color -getch.c - tests ketpad() and getch() -hanoi.c - the game of hanoi, also an example of using color -knight.c - the game of Knight's Tour -rain.c - rain drops are falling on my head.. -scroll.c - test scrolling region -slk.c - test soft labels -worm.c - worms run all over your screen -firework.c - multi-colored fireworks -newdemo.c - a demo from the PDCurses people -testcurs.c - a test from the PDCurses people diff --git a/lib/libncurses/TESTS/battle.c b/lib/libncurses/TESTS/battle.c deleted file mode 100644 index 5b5a9610def5..000000000000 --- a/lib/libncurses/TESTS/battle.c +++ /dev/null @@ -1,705 +0,0 @@ -/* - * battle.c - original author: Bruce Holloway - * mods by: Chuck A DeGaul - */ - -#include <unistd.h> -#include <stdlib.h> -#include <ctype.h> -#include <time.h> -#include <signal.h> -#include <ncurses.h> - -#define OTHER 1-turn - -char numbers[] = " 0 1 2 3 4 5 6 7 8 9"; - -char carrier[] = "Aircraft Carrier"; -char battle[] = "Battleship"; -char sub[] = "Submarine"; -char destroy[] = "Destroyer"; -char ptboat[] = "PT Boat"; - -char name[40]; -char dftname[] = "Stranger"; - -struct _ships { - char *name; - char symbol; - char length; - char start; /* Coordinates - 0,0=0; 10,10=100. */ - char dir; /* Direction - 0 = right; 1 = down. */ - char hits; /* How many times has this ship been hit? (-1==sunk) */ -}; - -struct _ships plyship[] = { - { carrier,'A',5,0,0,0 }, - { battle,'B',4,0,0,0 }, - { destroy,'D',3,0,0,0 }, - { sub,'S',3,0,0,0 }, - { ptboat,'P',2,0,0,0 }, -}; - -struct _ships cpuship[] = { - { carrier,'A',5,0,0,0 }, - { battle,'B',4,0,0,0 }, - { destroy,'D',3,0,0,0 }, - { sub,'S',3,0,0,0 }, - { ptboat,'P',2,0,0,0 }, -}; - -char hits[2][100], board[2][100]; /* "Hits" board, and main board. */ - -int srchstep; -int cpuhits; -int cstart, cdir; -int plywon=0, cpuwon=0; /* How many games has each won? */ -int turn; /* 0=player, 1=computer */ -int huntoffs; /* Offset on search strategy */ - -int salvo, blitz, ask, seemiss; /* options */ - -void intro(void); -void initgame(void); -int rnd(int); -void plyplace(struct _ships *); -int getdir(void); -void placeship(struct _ships *, int, int); -int checkplace(struct _ships *, int, int); -void error(char *); -void prompt(void); -char getcoord(void); -void cpuplace(struct _ships *); -int awinna(void); -int plyturn(void); -int hitship(int); -int cputurn(void); -int playagain(void); -void uninitgame(); -int sgetc(char *); -int do_options(int, char *[]); -int scount(int); - -int -main(int argc, char **argv) -{ - do_options(argc, argv); - - intro(); - do { - initgame(); - while(awinna() == -1) { - if (!blitz) { - if (!salvo) { - if (turn) - cputurn(); - else plyturn(); - } else { - register int i; - - i = scount(turn); - while (i--) { - if (turn) - if (cputurn()) - if (awinna() != -1) - i = 0; - else - if(plyturn()) - if (awinna() != -1) - i = 0; - } - } - } else { - while((turn) ? cputurn() : plyturn()); - } - turn = OTHER; - } - } while(playagain()); - uninitgame(); - exit(0); -} - -#define PR addstr - -void -intro() -{ -char *tmpname; - - srand(time(0L)); /* Kick the random number generator */ - - signal(SIGINT,uninitgame); - if(signal(SIGQUIT,SIG_IGN) != SIG_IGN) signal(SIGQUIT,uninitgame); -#if 1 - /* for some bizzare reason, getlogin or cuserid cause havoc with the terminal */ - if ((tmpname = getlogin()) != NULL) { - strcpy(name, tmpname); - } else -#endif - strcpy(name,dftname); - name[0] = toupper(name[0]); - - initscr(); - savetty(); - nonl(); - cbreak(); - noecho(); - clear(); - mvaddstr(4,29,"Welcome to Battleship!"); - move(8,0); -PR(" \\\n"); -PR(" \\ \\ \\\n"); -PR(" \\ \\ \\ \\ \\_____________\n"); -PR(" \\ \\ \\_____________ \\ \\/ |\n"); -PR(" \\ \\/ \\ \\/ |\n"); -PR(" \\/ \\_____/ |__\n"); -PR(" ________________/ |\n"); -PR(" \\ S.S. Penguin |\n"); -PR(" \\ /\n"); -PR(" \\___________________________________________________/\n"); - mvaddstr(20,27,"Hit any key to continue..."); refresh(); - getch(); -} - -void -initgame() -{ -int i; - - clear(); - mvaddstr(0,35,"BATTLESHIP"); - mvaddstr(4,12,"Main Board"); - mvaddstr(6,0,numbers); - move(7,0); - for(i=0; i<10; ++i){ - printw("%c . . . . . . . . . . %c\n",i+'A',i+'A'); - } - mvaddstr(17,0,numbers); - mvaddstr(4,55,"Hit/Miss Board"); - mvaddstr(6,45,numbers); - for(i=0; i<10; ++i){ - mvprintw(7+i,45,"%c . . . . . . . . . . %c",i+'A',i+'A'); - } - mvaddstr(17,45,numbers); - for(turn=0; turn<2; ++turn) - for(i=0; i<100; ++i){ - hits[turn][i] = board[turn][i] = 0; - } - for(turn=0; turn<2; ++turn){ - for(i=0; i<5; ++i) - if (!turn) - plyplace(&plyship[i]); - else - cpuplace(&cpuship[i]); - } - turn = rnd(2); - cstart = cdir = -1; - cpuhits = 0; - srchstep = 3; - huntoffs = rnd(srchstep); -} - -int -rnd(int n) -{ - return(((rand() & 0x7FFF) % n)); -} - -void -plyplace(ss) -struct _ships *ss; -{ -int c, d; - - do { - prompt(); - printw("Place your %s (ex.%c%d) ? ",ss->name,rnd(10)+'A',rnd(10)); - c = getcoord(); - d = getdir(); - } while(!checkplace(ss,c,d)); - placeship(ss,c,d); -} - -int -getdir() -{ - - prompt(); - addstr("What direction (0=right, 1=down) ? "); - return(sgetc("01")-'0'); -} - -void -placeship(ss,c,d) -struct _ships *ss; -int c, d; -{ -int x, y, l, i; - - for(l=0; l<ss->length; ++l){ - i = c + l * ((d) ? 10 : 1); - board[turn][i] = ss->symbol; - x = (i % 10) * 3 + 3; - y = (i / 10) + 7; - if(!turn) mvaddch(y,x,ss->symbol); - } - ss->start = c; - ss->dir = d; - ss->hits = 0; -} - -int -checkplace(ss,c,d) -struct _ships *ss; -int c, d; -{ -int x, y, l; - - x = c%10; y = c/10; - if(((x+ss->length) > 10 && !d) || ((y+ss->length) > 10 && d==1)){ - if(!turn) - switch(rnd(3)){ - case 0: - error("Ship is hanging from the edge of the world"); - break; - case 1: - error("Try fitting it on the board"); - break; - case 2: - error("Figure I won't find it if you put it there?"); - break; - } - return(0); - } - for(l=0; l<ss->length; ++l){ - x = c + l * ((d) ? 10 : 1); - if(board[turn][x]){ - if(!turn) - switch(rnd(3)){ - case 0: - error("There's already a ship there"); - break; - case 1: - error("Collision alert! Aaaaaagh!"); - break; - case 2: - error("Er, Admiral, what about the other ship?"); - break; - } - return(0); - } - } - return(1); -} - -void -error(s) -char *s; -{ - prompt(); - beep(); - printw("%s -- hit any key to continue --",s); - refresh(); - getch(); -} - -void -prompt(){ - move(22,0); - clrtoeol(); -} - -char -getcoord() -{ -int ch, x, y; - -redo: - y = sgetc("ABCDEFGHIJ"); - do { - ch = getch(); - if (ch == 0x7F || ch == 8) { - addstr("\b \b"); - refresh(); - goto redo; - } - } while(ch < '0' || ch > '9'); - addch(x = ch); - refresh(); - return((y-'A')*10+x-'0'); -} - -void -cpuplace(ss) -struct _ships *ss; -{ -int c, d; - - do{ - c = rnd(100); - d = rnd(2); - } while(!checkplace(ss,c,d)); - placeship(ss,c,d); -} - -int -awinna() -{ -int i, j; -struct _ships *ss; - - for (i = 0; i < 2; ++i) { - ss = (i) ? cpuship : plyship; - for(j=0; j<5; ++j, ++ss) - if(ss->length != ss->hits) - break; - if(j == 5) return(OTHER); - } - return(-1); -} - -int -plyturn() -{ -int c, res; -char *m; - - prompt(); - addstr("Where do you want to shoot? "); - c = getcoord(); - if(!(res = hits[turn][c])){ - hits[turn][c] = res = (board[OTHER][c]) ? 'H' : 'M'; - mvaddch(7+c/10,48+3*(c%10),(res=='H') ? 'H' : 'o'); - if(c = hitship(c)){ - prompt(); - switch(rnd(3)){ - case 0: - m = "You sank my %s!"; - break; - case 1: - m = "I have this sinking feeling about my %s...."; - break; - case 2: - m = "Have some mercy for my %s!"; - break; - } - move(23,0); - clrtoeol(); - beep(); - printw(m,cpuship[c-1].name); refresh(); - return(awinna() == -1); - } - } - prompt(); - move(23,0); clrtoeol(); - printw("You %s.",(res=='M')?"missed":"scored a hit"); refresh(); - return(res == 'H'); -} - -int -hitship(c) -int c; -{ -struct _ships *ss; -int sym, i, j; - - ss = (turn) ? plyship : cpuship; - if (!(sym = board[OTHER][c])) return(0); - for (i = 0; i < 5; ++i, ++ss) - if (ss->symbol == sym) { - j = ss->hits; - ++j; - ss->hits = j; - if (j == ss->length) - return(i+1); - return(0); - } -} - -int -cputurn() -{ -int c, res, x, y, i, d; - -redo: - if (cstart == -1){ - if (cpuhits){ - for(i=0, c=rnd(100); i<100; ++i, c = (c+1) % 100) - if(hits[turn][c] == 'H') - break; - if(i != 100){ - cstart = c; - cdir = -1; - goto fndir; - } - } - do { - i = 0; - do{ - while(hits[turn][c=rnd(100)]); - x = c % 10; y = c / 10; - if(++i == 1000) break; - } while(((x+huntoffs) % srchstep) != (y % srchstep)); - if(i == 1000) --srchstep; - } while(i == 1000); - } - else if(cdir == -1){ -fndir: for(i=0, d=rnd(4); i++ < 4; d = (d+1) % 4){ - x = cstart%10; y = cstart/10; - switch(d){ - case 0: ++x; break; - case 1: ++y; break; - case 2: --x; break; - case 3: --y; break; - } - if(x<0 || x>9 || y<0 || y>9) continue; - if(hits[turn][c=y*10+x]) continue; - cdir = -2; - break; - } - if(i == 4){ - cstart = -1; - goto redo; - } - } - else{ - x = cstart%10; y = cstart/10; - switch(cdir){ - case 0: ++x; break; - case 1: ++y; break; - case 2: --x; break; - case 3: --y; break; - } - if(x<0 || x>9 || y<0 || y>9 || hits[turn][y*10+x]){ - cdir = (cdir+2) % 4; - for(;;){ - switch(cdir){ - case 0: ++x; break; - case 1: ++y; break; - case 2: --x; break; - case 3: --y; break; - } - if(x<0 || x>9 || y<0 || y>9){ cstart = -1; - goto redo; - } - if(!hits[turn][y*10+x]) break; - } - } - c = y*10 + x; - } - - if (!ask) { - res = (board[OTHER][c]) ? 'H' : 'M'; - move(21,0); clrtoeol(); - printw("I shoot at %c%d. I %s!",c/10+'A',c%10,(res=='H')?"hit":"miss"); - } else { - for(;;){ - prompt(); - printw("I shoot at %c%d. Do I (H)it or (M)iss? ",c/10+'A',c%10); - res = sgetc("HM"); - if((res=='H' && !board[OTHER][c]) || (res=='M' && board[OTHER][c])){ - error("You lie!"); - continue; - } - break; - } - addch(res); - } - hits[turn][c] = res; - if(res == 'H') { - ++cpuhits; - if(cstart == -1) cdir = -1; - cstart = c; - if(cdir == -2) cdir = d; - mvaddch(7+(c/10),3+3*(c%10),'*'); - if (blitz && !ask) { - refresh(); - sleep(1); - } - } - else { - if (seemiss) { - mvaddch(7+(c/10),3+3*(c%10),' '); - } else { - if(cdir == -2) cdir = -1; - } - } - if(c=hitship(c)){ - cstart = -1; - cpuhits -= plyship[c-1].length; - x = plyship[c-1].start; - d = plyship[c-1].dir; - y = plyship[c-1].length; - for(i=0; i<y; ++i){ - hits[turn][x] = '*'; - x += (d) ? 10 : 1; - } - } - if (salvo && !ask) { - refresh(); - sleep(1); - } - if(awinna() != -1) return(0); - return(res == 'H'); -} - -int -playagain() -{ -int i, x, y, dx, dy, j; - - for(i=0; i<5; ++i){ - x = cpuship[i].start; y = x/10+7; x = (x % 10) * 3 + 48; - dx = (cpuship[i].dir) ? 0 : 3; - dy = (cpuship[i].dir) ? 1 : 0; - for(j=0; j < cpuship[i].length; ++j){ - mvaddch(y,x,cpuship[i].symbol); - x += dx; y += dy; - } - } - - if(awinna()) ++cpuwon; else ++plywon; - i = 18 + strlen(name); - if(plywon >= 10) ++i; - if(cpuwon >= 10) ++i; - mvprintw(2,(80-i)/2,"%s: %d Computer: %d",name,plywon,cpuwon); - - prompt(); - printw((awinna()) ? "Want to be humiliated again, %s? " - : "Going to give me a chance for revenge, %s? ",name); - return(sgetc("YN") == 'Y'); -} - -void -uninitgame(int sig) -{ - refresh(); - endwin(); - exit(0); -} - -int -sgetc(s) -char *s; -{ -char *s1; -int ch; - - refresh(); - for (;;) { - ch = toupper(getch()); - for (s1 = s; *s1 && ch != *s1; ++s1); - if (*s1) { - addch(ch); - refresh(); - return(ch); - } - } -} - -/* - * I should use getopts() from libc.a, but I'm leary that other UNIX - * systems might not have it, although I'd love to use it. - */ - -int -do_options(c,op) -int c; -char *op[]; -{ -register int i; - - if (c > 1) { - for (i=1; i<c; i++) { - switch(op[i][0]) { - default: - case '?': - fprintf(stderr, "Usage: battle [ -s | -b ] [ -a ] [ -m ]\n"); - fprintf(stderr, "\tWhere the options are:\n"); - fprintf(stderr, "\t-s : play a salvo game (mutex with -b)\n"); - fprintf(stderr, "\t-b : play a blitz game (mutex with -s)\n"); - fprintf(stderr, "\t-a : computer asks you for hit/miss\n"); - fprintf(stderr, "\t-m : computer misses are displayed\n"); - exit(1); - break; - case '-': - switch(op[i][1]) { - case 'b': - blitz = 1; - if (salvo == 1) { - fprintf(stderr, - "Bad Arg: -b and -s are mutually exclusive\n"); - exit(1); - } - break; - case 's': - salvo = 1; - if (blitz == 1) { - fprintf(stderr, - "Bad Arg: -s and -b are mutually exclusive\n"); - exit(1); - } - break; - case 'a': - ask = 1; - break; - case 'm': - seemiss = 1; - break; - default: - fprintf(stderr, - "Bad Arg: type \"%s ?\" for usage message\n", op[0]); - exit(1); - } - } - } - fprintf(stdout, "Playing optional game ("); - if (salvo) - fprintf(stdout, "salvo, noblitz, "); - else if (blitz) - fprintf(stdout, "blitz, nosalvo, "); - else - fprintf(stdout, "noblitz, nosalvo, "); - - if (ask) - fprintf(stdout, "ask, "); - else - fprintf(stdout, "noask, "); - - if (seemiss) - fprintf(stdout, "seemiss)\n"); - else - fprintf(stdout, "noseemiss)\n"); - } - else - fprintf(stdout, - "Playing standard game (no blitz, no slavo, no ask, no seemiss)\n"); - sleep(2); - return(0); -} - -int -scount(who) -int who; -{ -int i, shots; -struct _ships *sp; - - if (who) { - /* count cpu shots */ - sp = cpuship; - } else { - /* count player shots */ - sp = plyship; - } - for (i=0, shots = 0; i<5; i++, sp++) { - /* extra test for machines with unsigned chars! */ - if (sp->hits == (char) -1 || sp->hits >= sp->length) { - continue; /* dead ship */ - } else { - shots++; - } - } - return(shots); -} - diff --git a/lib/libncurses/TESTS/copy.c b/lib/libncurses/TESTS/copy.c deleted file mode 100644 index 013f9dbe4237..000000000000 --- a/lib/libncurses/TESTS/copy.c +++ /dev/null @@ -1,39 +0,0 @@ -#include <ncurses.h> - -main() -{ -WINDOW *win1, *win2; -int h, i; - - initscr(); - cbreak(); - noecho(); - win1 = newwin(20, 50, 0, 20); - for (h = 0; h < 20; h++) - for (i = 0; i < 50; i++) - mvwaddch(win1, h, i, 'X'); - wrefresh(win1); - getch(); - - win2 = newwin(20, 50, 3, 30); - for (h = 0; h < 20; h++) - for (i = 0; i < 50; i++) - mvwaddch(win2, h, i, 'Y'); - wnoutrefresh(win1); - wnoutrefresh(win2); - doupdate(); - getch(); - - /* now, remove window 2 and restore the contents of window 1 */ - i = copywin(win1, win2, 5, 10, 0, 0, 14, 39, 0); - wnoutrefresh(win1); - wnoutrefresh(win2); - printw("copywin returns %d\n", i); - wnoutrefresh(stdscr); - doupdate(); - - getch(); - - endwin(); -} - diff --git a/lib/libncurses/TESTS/corner.c b/lib/libncurses/TESTS/corner.c deleted file mode 100644 index 2ab38a982af8..000000000000 --- a/lib/libncurses/TESTS/corner.c +++ /dev/null @@ -1,16 +0,0 @@ -#include <ncurses.h> - -int main() -{ -int i, j; - - initscr(); - - for (i = 0; i < LINES; i++) { - j = mvaddch(i, COLS - 1, 'A' + i); - } - refresh(); - endwin(); - exit(0); -} - diff --git a/lib/libncurses/TESTS/ensor.c b/lib/libncurses/TESTS/ensor.c deleted file mode 100644 index 4eca9cb463c4..000000000000 --- a/lib/libncurses/TESTS/ensor.c +++ /dev/null @@ -1,52 +0,0 @@ -#include <ncurses.h> - -main() -{ - int i; - WINDOW *win; - - initscr(); - noecho(); - nonl(); - cbreak(); - - scrollok(stdscr, TRUE); - - for (i=0; i<25; i++) - printw("This is in the background, this should be left alone!\n"); - - refresh(); - win=newwin(10,50,6,20); - scrollok(win,TRUE); - wmove(win,0,0); - whline(win,0,49); - wmove(win,9,0); - whline(win,0,49); - wrefresh(win); - wattrset(win,A_STANDOUT); - mvwprintw(win, 0, 14, " Scrolling Demo! "); - mvwprintw(win, 9, 14, " Scrolling Demo! "); - wattroff(win,A_STANDOUT); - wsetscrreg(win, 1,8); - - mvwprintw(win, 0, 5, " DOWN "); - wmove(win,1,0); - wrefresh(win); - - getch(); - for (i=0; i<25; i++){ wprintw(win, "This is window line test (%d).\n", i); - if (i%2) wattrset(win,A_BOLD); else wattroff(win,A_BOLD); - wrefresh(win); } - - mvwprintw(win, 0, 5, " UP "); - wrefresh(win); - getch(); - for (i=0; i<25; i++) { wmove(win,1,0); winsertln(win); - if (i%2) wattrset(win,A_BOLD); else wattroff(win,A_BOLD); - wprintw(win, "Scrolling backwards! (%d)\n", i); wrefresh(win); } - - mvwprintw(win, 0, 5, " DONE "); wrefresh(win); - - endwin(); -} - diff --git a/lib/libncurses/TESTS/firework.c b/lib/libncurses/TESTS/firework.c deleted file mode 100644 index b4975849b593..000000000000 --- a/lib/libncurses/TESTS/firework.c +++ /dev/null @@ -1,113 +0,0 @@ -#include <stdio.h> -#include <signal.h> -#include <ncurses.h> -#include <ctype.h> -#include <sys/types.h> -#include <time.h> - -void explode(); - -int main() -{ -int start,end,row,diff,flag,direction,seed; - - initscr(); - if (has_colors()) - start_color(); - seed = time((time_t *)0); - srand(seed); - cbreak(); - for (;;) { - do { - start = rand() % (COLS -3); - end = rand() % (COLS - 3); - start = (start < 2) ? 2 : start; - end = (end < 2) ? 2 : end; - direction = (start > end) ? -1 : 1; - diff = abs(start-end); - } while (diff<2 || diff>=LINES-2); - attrset(A_NORMAL); - for (row=0;row<diff;row++) { - mvprintw(LINES - row,start + (row * direction), - (direction < 0) ? "\\" : "/"); - if (flag++) { - refresh(); - erase(); - flag = 0; - } - } - if (flag++) { - refresh(); - flag = 0; - } - seed = time((time_t *)0); - srand(seed); - explode(LINES-row,start+(diff*direction)); - erase(); - refresh(); - } - endwin(); - exit(0); -} - -void explode(int row, int col) -{ - erase(); - mvprintw(row,col,"-"); - refresh(); - - init_pair(1,get_colour(),COLOR_BLACK); - attrset(COLOR_PAIR(1)); - mvprintw(row-1,col-1," - "); - mvprintw(row,col-1,"-+-"); - mvprintw(row+1,col-1," - "); - refresh(); - - init_pair(1,get_colour(),COLOR_BLACK); - attrset(COLOR_PAIR(1)); - mvprintw(row-2,col-2," --- "); - mvprintw(row-1,col-2,"-+++-"); - mvprintw(row, col-2,"-+#+-"); - mvprintw(row+1,col-2,"-+++-"); - mvprintw(row+2,col-2," --- "); - refresh(); - - init_pair(1,get_colour(),COLOR_BLACK); - attrset(COLOR_PAIR(1)); - mvprintw(row-2,col-2," +++ "); - mvprintw(row-1,col-2,"++#++"); - mvprintw(row, col-2,"+# #+"); - mvprintw(row+1,col-2,"++#++"); - mvprintw(row+2,col-2," +++ "); - refresh(); - - init_pair(1,get_colour(),COLOR_BLACK); - attrset(COLOR_PAIR(1)); - mvprintw(row-2,col-2," # "); - mvprintw(row-1,col-2,"## ##"); - mvprintw(row, col-2,"# #"); - mvprintw(row+1,col-2,"## ##"); - mvprintw(row+2,col-2," # "); - refresh(); - - init_pair(1,get_colour(),COLOR_BLACK); - attrset(COLOR_PAIR(1)); - mvprintw(row-2,col-2," # # "); - mvprintw(row-1,col-2,"# #"); - mvprintw(row, col-2," "); - mvprintw(row+1,col-2,"# #"); - mvprintw(row+2,col-2," # # "); - refresh(); - return; -} - -int get_colour() -{ - int attr; - attr = (rand() % 16)+1; - if (attr == 1 || attr == 9) - attr = COLOR_RED; - if (attr > 8) - attr |= A_BOLD; - return(attr); -} diff --git a/lib/libncurses/TESTS/getch.c b/lib/libncurses/TESTS/getch.c deleted file mode 100644 index 90a0ee42178c..000000000000 --- a/lib/libncurses/TESTS/getch.c +++ /dev/null @@ -1,29 +0,0 @@ -#include <ncurses.h> - -main() - { - int c,i; - initscr(); - cbreak(); - noecho(); -#if 1 - wtimeout(stdscr,1000); -#endif - scrollok(stdscr,TRUE); - for (c='A';c<='Z';c++) - for (i=0;i<25;i++) - { - move(i,i); - addch(c); - refresh(); - } - move (0,0); - while ((c=wgetch(stdscr))!='A') - { - if (c == EOF) printw(">>wait for keypress<<"); - else printw(">>%c<<\n",c); - refresh(); - } - endwin(); - } - diff --git a/lib/libncurses/TESTS/hanoi.c b/lib/libncurses/TESTS/hanoi.c deleted file mode 100644 index 8a482d5655c9..000000000000 --- a/lib/libncurses/TESTS/hanoi.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Name: Towers of Hanoi. - * - * Desc: - * This is a playable copy of towers of hanoi. - * Its sole purpose is to demonstrate my Amiga Curses package. - * This program should compile on any system that has Curses. - * 'hanoi' will give a manual game with 7 playing pieces. - * 'hanoi n' will give a manual game with n playing pieces. - * 'hanoi n a' will give an auto solved game with n playing pieces. - * - * Author: Simon J Raybould (sie@fulcrum.bt.co.uk). - * - * Date: 05.Nov.90 - * - */ - -#include <ncurses.h> - -#define NPEGS 3 /* This is not configurable !! */ -#define MINTILES 3 -#define MAXTILES 9 -#define DEFAULTTILES 7 -#define TOPLINE 6 -#define BASELINE 16 -#define STATUSLINE (LINES-3) -#define LEFTPEG 19 -#define MIDPEG 39 -#define RIGHTPEG 59 - -#define LENTOIND(x) (((x)-1)/2) -#define OTHER(a,b) (3-((a)+(b))) - -struct Peg { - int Length[MAXTILES]; - int Count; -}; - -struct Peg Pegs[NPEGS]; -int PegPos[] = { LEFTPEG, MIDPEG, RIGHTPEG }; -int TileColour[] = { - COLOR_GREEN, /* Length 3 */ - COLOR_MAGENTA, /* Length 5 */ - COLOR_RED, /* Length 7 */ - COLOR_BLUE, /* Length 9 */ - COLOR_CYAN, /* Length 11 */ - COLOR_YELLOW, /* Length 13 */ - COLOR_GREEN, /* Length 15 */ - COLOR_MAGENTA, /* Length 17 */ - COLOR_RED, /* Length 19 */ -}; -int NMoves = 0; - -static unsigned char AutoFlag; - -void InitTiles(), DisplayTiles(), MakeMove(), AutoMove(), Usage(); - -int -main(int argc, char **argv) -{ -int NTiles, FromCol, ToCol; - - switch(argc) { - case 1: - NTiles = DEFAULTTILES; - break; - case 2: - NTiles = atoi(argv[1]); - if (NTiles > MAXTILES || NTiles < MINTILES) { - fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES); - exit(1); - } - break; - case 3: - if (strcmp(argv[2], "a")) { - Usage(); - exit(1); - } - NTiles = atoi(argv[1]); - if (NTiles > MAXTILES || NTiles < MINTILES) { - fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES); - exit(1); - } - AutoFlag = TRUE; - break; - default: - Usage(); - exit(1); - } - initscr(); - if (!has_colors()) { - puts("terminal doesn't support color."); - exit(1); - } - start_color(); - { - int i; - for (i = 0; i < 9; i++) - init_pair(i+1, COLOR_BLACK, TileColour[i]); - } - cbreak(); - if (LINES < 24) { - fprintf(stderr, "Min screen length 24 lines\n"); - endwin(); - exit(1); - } - if(AutoFlag) - leaveok(stdscr, TRUE); /* Attempt to remove cursor */ - InitTiles(NTiles); - DisplayTiles(); - if(AutoFlag) { - do { - noecho(); - AutoMove(0, 2, NTiles); - } while(!Solved(NTiles)); - sleep(2); - } else { - for(;;) { - if(GetMove(&FromCol, &ToCol)) - break; - if (AutoFlag) { - AutoMove(0, 2, NTiles); - break; - } - if(InvalidMove(FromCol, ToCol)) { - mvaddstr(STATUSLINE, 0, "Invalid Move !!"); - refresh(); - beep(); - continue; - } - MakeMove(FromCol, ToCol); - if(Solved(NTiles)) { - mvprintw(STATUSLINE, 0, "Well Done !! You did it in %d moves", NMoves); - refresh(); - sleep(5); - break; - } - } - } - endwin(); -} - -int -InvalidMove(int From, int To) -{ - if(From == To) - return TRUE; - if(!Pegs[From].Count) - return TRUE; - if(Pegs[To].Count && - Pegs[From].Length[Pegs[From].Count-1] > - Pegs[To].Length[Pegs[To].Count-1]) - return TRUE; - return FALSE; -} - -void -InitTiles(int NTiles) -{ -int Size, SlotNo; - - for(Size=NTiles*2+1, SlotNo=0; Size>=3; Size-=2) - Pegs[0].Length[SlotNo++] = Size; - - Pegs[0].Count = NTiles; - Pegs[1].Count = 0; - Pegs[2].Count = 0; -} - -#define gc() {noecho();getch();echo();} - -void -DisplayTiles() -{ - int Line, Peg, SlotNo; - char TileBuf[BUFSIZ]; - - erase(); - mvaddstr(1, 24, "T O W E R S O F H A N O I"); - mvaddstr(3, 34, "SJR 1990"); - mvprintw(19, 5, "Moves : %d", NMoves); - standout(); - mvaddstr(BASELINE, 8, " "); - - for(Line=TOPLINE; Line<BASELINE; Line++) { - mvaddch(Line, LEFTPEG, ' '); - mvaddch(Line, MIDPEG, ' '); - mvaddch(Line, RIGHTPEG, ' '); - } - mvaddch(BASELINE, LEFTPEG, '1'); - mvaddch(BASELINE, MIDPEG, '2'); - mvaddch(BASELINE, RIGHTPEG, '3'); - standend(); - - /* Draw tiles */ - for(Peg=0; Peg<NPEGS; Peg++) { - for(SlotNo=0; SlotNo<Pegs[Peg].Count; SlotNo++) { - memset(TileBuf, ' ', Pegs[Peg].Length[SlotNo]); - TileBuf[Pegs[Peg].Length[SlotNo]] = '\0'; - attrset(COLOR_PAIR(LENTOIND(Pegs[Peg].Length[SlotNo]))); - mvaddstr(BASELINE-(SlotNo+1), - PegPos[Peg]-Pegs[Peg].Length[SlotNo]/2, TileBuf); - } - } - attrset(A_NORMAL); - refresh(); -} - -int -GetMove(int *From, int *To) -{ - mvaddstr(STATUSLINE, 0, "Next move ('q' to quit) from "); - clrtoeol(); - refresh(); - if((*From = getch()) == 'q') - return TRUE; - else if (*From == 'a') { - AutoFlag = TRUE; - return FALSE; - } - *From -= ('0'+1); - addstr(" to "); - clrtoeol(); - refresh(); - if((*To = getch()) == 'q') - return TRUE; - *To -= ('0'+1); - move(STATUSLINE, 0); - clrtoeol(); - refresh(); - return FALSE; -} - -void -MakeMove(int From, int To) -{ - - Pegs[From].Count--; - Pegs[To].Length[Pegs[To].Count] = Pegs[From].Length[Pegs[From].Count]; - Pegs[To].Count++; - NMoves++; - DisplayTiles(); -} - -void -AutoMove(int From, int To, int Num) -{ - - if(Num == 1) { - MakeMove(From, To); - return; - } - AutoMove(From, OTHER(From, To), Num-1); - MakeMove(From, To); - AutoMove(OTHER(From, To), To, Num-1); -} - -int -Solved(int NumTiles) -{ -int i; - - for(i = 1; i < NPEGS; i++) - if (Pegs[i].Count == NumTiles) - return TRUE; - return FALSE; -} - -void -Usage() -{ - fprintf(stderr, "Usage: hanoi [<No Of Tiles>] [a]\n"); - fprintf(stderr, "The 'a' option causes the tower to be solved automatically\n"); -} - diff --git a/lib/libncurses/TESTS/knight.c b/lib/libncurses/TESTS/knight.c deleted file mode 100644 index 73f7b42f9d93..000000000000 --- a/lib/libncurses/TESTS/knight.c +++ /dev/null @@ -1,320 +0,0 @@ -/* Knights Tour - a brain game */ - -#include <ncurses.h> -#include <signal.h> -#include <ctype.h> -#include <stdlib.h> - -#ifdef __FreeBSD__ -#define srand48 srandom -#define lrand48 random -#endif - -short board [64]; /* the squares */ -char row, column; /* input characters */ -int rw,col; /* numeric equivalent of row and column */ -int curow,curcol; /* current row and column integers */ -int rdif, cdif; /* difference between input and current */ -int j; /* index into board */ - -char script[]={"'_)//,/(-)/__/__(_<_(__),|/|/_///_/_<//_/_)__o__o'______///_(--_(_)___,(_/,_/__(_\0"}; - -int ypos[] ={1,0,1,2,3,0,1,2,2,3,3,2,2,3,2,2,3,3,3,3,3,2,3,3,2,4,5,5, - 4,3,3,2,1,2,3,3,3,2,1,3,3,2,3,3,3,2,1,1,0,1,4,4,4,4,4,4,5,6,7,7, - 7,6,6,6,7,7,7,6,6,6,6,7,7,7,6,7,7,6,6,7,7}; - -int xpos[]={0,1,2,1,0,5,4,3,2,4,6,7,8,8,9,10,10,11,12,13,14,15,15,16, - 16,16,15,14,15,17,18,19,20,20,20,21,22,23,24,23,25,26,27,26,28, - 13,23,25,27,27,2,3,4,5,6,7,4,3,2,1,0,1,2,5,4,5,6,6,7,8,9,8,9,10, - 11,11,12,13,14,14,15}; - -static char *instructions[] = -{ -" Knight's Tour is a board game for one player. It is played on", -"an eight by eight board and is based on the allowable moves that a knight", -"can make in the game of chess. For those who are unfamiliar with the", -"game, a knight may move either on a row or a column but not diagonally.", -"He may move one square in any direction and two squares in a perpendicular", -"direction >or< two squares in any direction and one square in a", -"perpendicular direction. He may not, of course, move off the board.", -"", -" At the beginning of a game you will be asked to either choose a", -"starting square or allow the computer to select a random location.", -"Squares are designated by a letter-number combination where the row is", -"specified by a letter A-H and the numbers 1-8 define a column. Invalid", -"entries are ignored and illegal moves produce a beep at the terminal.", -"", -" The objective is to visit every square on the board. When you claim", -"a square a marker is placed on it to show where you've been. You may", -"not revisit a square that you've landed on before.", -"", -" After each move the program checks to see if you have any legal", -"moves left. If not, the game ends and your squares are counted. If", -"you've made all the squares you win the game. Otherwise, you are told", -"the number of squares you did make.", -"END" -}; - -void init(void); -int play(void); -void drawboard(void); -void dosquares(void); -void getfirst(void); -void getrc(void); -void putstars(void); -int evalmove(void); -int chkmoves(void); -int endgame(void); -int chksqr(int, int); -void instruct(void); -void title(int, int); - -int -main () -{ - init (); - for (;;) - if (!play ()) { - endwin (); - exit (0); - } -} - -void -init () -{ - - srand48 (getpid()); - initscr (); - cbreak (); /* immediate char return */ - noecho (); /* no immediate echo */ - title (1,23); - mvaddstr (23, 25, "Would you like instructions? "); - refresh(); - if ((toupper(getch())) == 'Y') - instruct(); - clear (); -} - -int -play () -{ - drawboard (); /* clear screen and drawboard */ - for (j = 0; j < 64; j++) board[j]=0; - getfirst (); /* get the starting square */ - for (;;) { - getrc(); - if (evalmove()) { - putstars (); - if (!chkmoves()) - return (endgame ()); - } - else beep(); - } -} - -void -drawboard () -{ - erase (); - dosquares (); - refresh (); - mvaddstr (0, 7, "1 2 3 4 5 6 7 8"); - for (j = 0; j < 8; j++) mvaddch (2*j+2, 3, j + 'A'); - refresh (); - mvaddstr (20, 5, "ROW:"); - mvaddstr (20, 27, "COLUMN:"); - mvaddstr (14, 49, "CURRENT ROW"); - mvaddstr (16, 49, "CURRENT COL"); - mvaddstr (22, 5, "A - H or Q to quit"); - mvaddstr (22, 27, "1 - 8 or ESC to cancel row"); - refresh (); - title (1,40); -} - -void -dosquares () -{ - mvaddstr (1, 6, "-------------------------------"); - for (j = 1; j < 9; j++){ - mvaddstr (2*j, 5, "| | | | | | | | |"); - mvaddstr (2*j+1, 6, "-------------------------------"); - } -} - -void -getfirst () /* get first square */ -{ - mvaddstr (23, 25, "(S)elect or (R)andom "); refresh (); - do { - row = toupper(getch()); - } while ((row != 'S') && (row != 'R')); - if (row == 'R') { - rw = lrand48() % 8; - col = lrand48() % 8; - j = 8* rw + col; - row = rw + 'A'; - column = col + '1'; - } - else { - mvaddstr (23, 25, "Enter starting row and column"); - refresh (); - getrc(); /* get row and column */ - } - putstars (); - move (23, 0); - clrtobot(); -} - -void -getrc () /* get row and column */ -{ - noecho (); - do { - mvaddstr (20, 35, " "); - refresh (); - do { - mvaddch (20, 11, ' '); - move (20, 11); - refresh (); - row=toupper(getch()); - if (row == 'Q') { - endwin (); - exit (1); - } - } while ((row < 'A') || (row > 'H')); - addch (row); - move (20, 35); - refresh (); - do { - column=getch(); - if (column == '\033') break; - } while ((column < '1') || (column > '8')); - if (column != '\033') addch (column); - } while (column == '\033'); - refresh(); - rw = row - 'A'; - col= column - '1'; - j = 8 * rw + col; -} - -void -putstars () /* place the stars, update board & currents */ -{ - mvaddch (2*curow+2, 38, ' '); - mvaddch (2*rw+2, 38, '<'); - mvaddch (18, curcol*4+7, ' '); - mvaddch (18, col*4+7, '^'); - curow = rw; - curcol= col; - mvaddstr (2 * rw + 2, 4*col+6, "***"); - mvaddch (14, 61, row); - mvaddch (16, 61, column); - refresh (); - board[j] = 1; -} - -int -evalmove() /* convert row and column to integers */ - /* and evaluate move */ -{ - rdif = rw - curow; - cdif = col - curcol; - rdif = abs(rw - curow); - cdif = abs(col - curcol); - refresh (); - if ((rdif == 1) && (cdif == 2)) if (board [j] == 0) return (1); - if ((rdif == 2) && (cdif == 1)) if (board [j] == 0) return (1); - return (0); -} - -int -chkmoves () /* check to see if valid moves are available */ -{ - if (chksqr(2,1)) return (1); - if (chksqr(2,-1)) return (1); - if (chksqr(-2,1)) return (1); - if (chksqr(-2,-1)) return (1); - if (chksqr(1,2)) return (1); - if (chksqr(1,-2)) return (1); - if (chksqr(-1,2)) return (1); - if (chksqr(-1,-2)) return (1); - return (0); -} - -int -endgame () /* check for filled board or not */ -{ - rw = 0; - for (j = 0; j < 64; j++) if (board[j] != 0) rw+=1; - if (rw == 64) mvaddstr (20, 20, "Congratulations !! You got 'em all"); - else mvprintw (20, 20, "You have ended up with %2d squares",rw); - mvaddstr (21, 25, "Play again ? (y/n) "); - refresh (); - if ((row=tolower(getch())) == 'y') return (1); - else return (0); -} - -#ifndef abs -abs(num) -int num; -{ - if (num < 0) return (-num); - else return (num); -} -#endif - -int -chksqr (int n1, int n2) -{ -int r1, c1; - - r1 = rw + n1; - c1 = col + n2; - if ((r1<0) || (r1>7)) return (0); - if ((c1<0) || (c1>7)) return (0); - if (board[r1*8+c1] == 0) return (1); - else return (0); -} - -void -instruct() -{ -int i; - - clear (); - for (i=0;;i++) { - if ((strcmp(instructions[i],"END"))) mvaddstr (i, 0, instructions[i]); - else { - mvaddstr (23, 25, "Ready to play ? (y/n) "); - refresh(); - if (toupper(getch()) == 'Y') { - clear (); - return; - } else { - clear (); - refresh (); - endwin (); - exit (0); - } - } - } -} - -void -title (y,x) -int y,x; -{ -char c; - - j = 0; - do { - c = script[j]; - if (c == 0) break ; - mvaddch (ypos[j]+y, xpos[j]+x, c); - j++; - } while (c != 0); - refresh (); -} - - diff --git a/lib/libncurses/TESTS/ncurses.c b/lib/libncurses/TESTS/ncurses.c deleted file mode 100644 index 91512360a9da..000000000000 --- a/lib/libncurses/TESTS/ncurses.c +++ /dev/null @@ -1,1121 +0,0 @@ -/**************************************************************************** - -NAME - ncurses.c --- ncurses library exerciser - -SYNOPSIS - ncurses - -DESCRIPTION - An interactive test module for the ncurses library. - -AUTHOR - This software is Copyright (C) 1993 by Eric S. Raymond, all rights reserved. -It is issued with ncurses under the same terms and conditions as the ncurses -library source. - -***************************************************************************/ -/*LINTLIBRARY */ -#include <stdio.h> -#include <ctype.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <assert.h> -#include <ncurses.h> - -#define P(s) printw("%s\n", s) -#ifndef CTRL -#define CTRL(x) ((x) & 0x1f) -#endif - -/**************************************************************************** - * - * Character input test - * - ****************************************************************************/ - -static void getch_test(void) -/* test the keypad feature */ -{ -char buf[BUFSIZ]; -unsigned int c; -int incount = 0, firsttime = 0; -bool blocking = TRUE; - - refresh(); - - (void) printw("Delay in 10ths of a second (<CR> for blocking input)? "); - echo(); - getstr(buf); - noecho(); - - if (isdigit(buf[0])) - { - timeout(atoi(buf) * 100); - blocking = FALSE; - } - - c = '?'; - for (;;) - { - if (firsttime++) - { - printw("Key pressed: %04o ", c); - if (c >= KEY_MIN) - { - (void) addstr(keyname(c)); - addch('\n'); - } - else if (c > 0x80) - { - if (isprint(c & ~0x80)) - (void) printw("M-%c", c); - else - (void) printw("M-%s", unctrl(c)); - addstr(" (high-half character)\n"); - } - else - { - if (isprint(c)) - (void) printw("%c (ASCII printable character)\n", c); - else - (void) printw("%s (ASCII control character)\n", unctrl(c)); - } - } - if (c == 'x' || c == 'q') - break; - if (c == '?') - addstr("Type any key to see its keypad value, `q' to quit, `?' for help.\n"); - - while ((c = getch()) == ERR) - if (!blocking) - (void) printw("%05d: input timed out\n", incount++); - } - - timeout(-1); - erase(); - endwin(); -} - -static void attr_test(void) -/* test text attributes */ -{ - refresh(); - - mvaddstr(0, 20, "Character attribute test display"); - - mvaddstr(2,8,"This is STANDOUT mode: "); - attron(A_STANDOUT); - addstr("abcde fghij klmno pqrst uvwxy x"); - attroff(A_STANDOUT); - - mvaddstr(4,8,"This is REVERSE mode: "); - attron(A_REVERSE); - addstr("abcde fghij klmno pqrst uvwxy x"); - attroff(A_REVERSE); - - mvaddstr(6,8,"This is BOLD mode: "); - attron(A_BOLD); - addstr("abcde fghij klmno pqrst uvwxy x"); - attroff(A_BOLD); - - mvaddstr(8,8,"This is UNDERLINE mode: "); - attron(A_UNDERLINE); - addstr("abcde fghij klmno pqrst uvwxy x"); - attroff(A_UNDERLINE); - - mvaddstr(10,8,"This is DIM mode: "); - attron(A_DIM); - addstr("abcde fghij klmno pqrst uvwxy x"); - attroff(A_DIM); - - mvaddstr(12,8,"This is BLINK mode: "); - attron(A_BLINK); - addstr("abcde fghij klmno pqrst uvwxy x"); - attroff(A_BLINK); - - mvaddstr(14,8,"This is BOLD UNDERLINE BLINK mode: "); - attron(A_BOLD|A_BLINK|A_UNDERLINE); - addstr("abcde fghij klmno pqrst uvwxy x"); - attroff(A_BOLD|A_BLINK|A_UNDERLINE); - - attrset(A_NORMAL); - mvaddstr(16,8,"This is NORMAL mode: "); - addstr("abcde fghij klmno pqrst uvwxy x"); - - refresh(); - - move(LINES - 1, 0); - addstr("Press any key to continue... "); - (void) getch(); - - erase(); - endwin(); -} - -/**************************************************************************** - * - * Color support tests - * - ****************************************************************************/ - -static char *colors[] = -{ - "black", - "red", - "green", - "yellow", - "blue", - "magenta", - "cyan", - "white" -}; - -static void color_test(void) -/* generate a color test pattern */ -{ - int i; - - refresh(); - (void) printw("There are %d color pairs\n", COLOR_PAIRS); - - (void) mvprintw(1, 0, - "%dx%d matrix of foreground/background colors, bright *off*\n", - COLORS, COLORS); - for (i = 0; i < COLORS; i++) - mvaddstr(2, (i+1) * 8, colors[i]); - for (i = 0; i < COLORS; i++) - mvaddstr(3 + i, 0, colors[i]); - for (i = 1; i < COLOR_PAIRS; i++) - { - init_pair(i, i % COLORS, i / COLORS); - attron(COLOR_PAIR(i)); - mvaddstr(3 + (i / COLORS), (i % COLORS + 1) * 8, "Hello"); - attrset(A_NORMAL); - } - - (void) mvprintw(COLORS + 4, 0, - "%dx%d matrix of foreground/background colors, bright *on*\n", - COLORS, COLORS); - for (i = 0; i < COLORS; i++) - mvaddstr(5 + COLORS, (i+1) * 8, colors[i]); - for (i = 0; i < COLORS; i++) - mvaddstr(6 + COLORS + i, 0, colors[i]); - for (i = 1; i < COLOR_PAIRS; i++) - { - init_pair(i, i % COLORS, i / COLORS); - attron(COLOR_PAIR(i) | A_BOLD); - mvaddstr(6 + COLORS + (i / COLORS), (i % COLORS + 1) * 8, "Hello"); - attrset(A_NORMAL); - } - - move(LINES - 1, 0); - addstr("Press any key to continue... "); - (void) getch(); - - erase(); - endwin(); -} - -static void color_edit(void) -/* display the color test pattern, without trying to edit colors */ -{ - int i, c, value = 0, current = 0, field = 0, usebase = 0; - - refresh(); - - for (i = 0; i < COLORS; i++) - init_pair(i, COLOR_WHITE, i); - - do { - short red, green, blue; - - attron(A_BOLD); - mvaddstr(0, 20, "Color RGB Value Editing"); - attroff(A_BOLD); - - for (i = 0; i < COLORS; i++) - { - mvprintw(2 + i, 0, "%c %-8s:", - (i == current ? '>' : ' '), - (i < sizeof(colors)/sizeof(colors[0]) ? colors[i] : "")); - attrset(COLOR_PAIR(i)); - addstr(" "); - attrset(A_NORMAL); - - /* - * Note: this refresh should *not* be necessary! It works around - * a bug in attribute handling that apparently causes the A_NORMAL - * attribute sets to interfere with the actual emission of the - * color setting somehow. This needs to be fixed. - */ - refresh(); - - color_content(i, &red, &green, &blue); - addstr(" R = "); - if (current == i && field == 0) attron(A_STANDOUT); - printw("%04d", red); - if (current == i && field == 0) attrset(A_NORMAL); - addstr(", G = "); - if (current == i && field == 1) attron(A_STANDOUT); - printw("%04d", green); - if (current == i && field == 1) attrset(A_NORMAL); - addstr(", B = "); - if (current == i && field == 2) attron(A_STANDOUT); - printw("%04d", blue); - if (current == i && field == 2) attrset(A_NORMAL); - attrset(A_NORMAL); - addstr(")"); - } - - mvaddstr(COLORS + 3, 0, - "Use up/down to select a color, left/right to change fields."); - mvaddstr(COLORS + 4, 0, - "Modify field by typing nnn=, nnn-, or nnn+. ? for help."); - - move(2 + current, 0); - - switch (c = getch()) - { - case KEY_UP: - current = (current == 0 ? (COLORS - 1) : current - 1); - value = 0; - break; - - case KEY_DOWN: - current = (current == (COLORS - 1) ? 0 : current + 1); - value = 0; - break; - - case KEY_RIGHT: - field = (field == 2 ? 0 : field + 1); - value = 0; - break; - - case KEY_LEFT: - field = (field == 0 ? 2 : field - 1); - value = 0; - break; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - do { - value = value * 10 + (c - '0'); - c = getch(); - } while - (isdigit(c)); - if (c != '+' && c != '-' && c != '=') - beep(); - else - ungetch(c); - break; - - case '+': - usebase = 1; - goto changeit; - - case '-': - value = -value; - usebase = 1; - goto changeit; - - case '=': - usebase = 0; - changeit: - color_content(current, &red, &green, &blue); - if (field == 0) - red = red * usebase + value; - else if (field == 1) - green = green * usebase + value; - else if (field == 2) - blue = blue * usebase + value; - init_color(current, red, green, blue); - break; - - case '?': - erase(); - P(" RGB Value Editing Help"); - P(""); - P("You are in the RGB value editor. Use the arrow keys to select one of"); - P("the fields in one of the RGB triples of the current colors; the one"); - P("currently selected will be reverse-video highlighted."); - P(""); - P("To change a field, enter the digits of the new value; they won't be"); - P("echoed. Finish by typing `='; the change will take effect instantly."); - P("To increment or decrement a value, use the same procedure, but finish"); - P("with a `+' or `-'."); - P(""); - P("To quit, do `x' or 'q'"); - - move(LINES - 1, 0); - addstr("Press any key to continue... "); - (void) getch(); - erase(); - break; - - case 'x': - case 'q': - break; - - default: - beep(); - break; - } - } while - (c != 'x' && c != 'q'); - - erase(); - endwin(); -} - -/**************************************************************************** - * - * Soft-key label test - * - ****************************************************************************/ - -static void slk_test(void) -/* exercise the soft keys */ -{ - int c, fmt = 1; - char buf[9]; - - c = CTRL('l'); - do { - switch(c) - { - case CTRL('l'): - erase(); - attron(A_BOLD); - mvaddstr(0, 20, "Soft Key Exerciser"); - attroff(A_BOLD); - - move(2, 0); - P("Available commands are:"); - P(""); - P("^L -- refresh screen"); - P("a -- activate or restore soft keys"); - P("d -- disable soft keys"); - P("c -- set centered format for labels"); - P("l -- set left-justified format for labels"); - P("r -- set right-justified format for labels"); - P("[12345678] -- set label; labels are numbered 1 through 8"); - P("e -- erase stdscr (should not erase labels)"); - P("s -- test scrolling of shortened screen"); - P("x, q -- return to main menu"); - P(""); - P("Note: if activating the soft keys causes your terminal to"); - P("scroll up one line, your terminal auto-scrolls when anything"); - P("is written to the last screen position. The ncurses code"); - P("does not yet handle this gracefully."); - refresh(); - /* fall through */ - - case 'a': - slk_restore(); - break; - - case 'e': - wclear(stdscr); - break; - - case 's': - move(20, 0); - while ((c = getch()) != 'Q') - addch(c); - break; - - case 'd': - slk_clear(); - break; - - case 'l': - fmt = 0; - break; - - case 'c': - fmt = 1; - break; - - case 'r': - fmt = 2; - break; - - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': - (void) mvaddstr(20, 0, "Please enter the label value: "); - wgetnstr(stdscr, buf, 8); - slk_set((c - '0'), buf, fmt); - slk_refresh(); - break; - - case 'x': - case 'q': - goto done; - - default: - beep(); - } - } while - ((c = getch()) != EOF); - - done: - erase(); - endwin(); -} - -/**************************************************************************** - * - * Alternate character-set stuff - * - ****************************************************************************/ - -static void acs_display() -/* display the ACS character set */ -{ - int i, j; - - erase(); - attron(A_BOLD); - mvaddstr(0, 20, "Display of the ACS Character Set"); - attroff(A_BOLD); - refresh(); - -#define ACSY 2 - mvaddstr(ACSY + 0, 0, "ACS_ULCORNER: "); addch(ACS_ULCORNER); - mvaddstr(ACSY + 1, 0, "ACS_LLCORNER: "); addch(ACS_LLCORNER); - mvaddstr(ACSY + 2, 0, "ACS_URCORNER: "); addch(ACS_URCORNER); - mvaddstr(ACSY + 3, 0, "ACS_LRCORNER: "); addch(ACS_LRCORNER); - mvaddstr(ACSY + 4, 0, "ACS_RTEE: "); addch(ACS_RTEE); - mvaddstr(ACSY + 5, 0, "ACS_LTEE: "); addch(ACS_LTEE); - mvaddstr(ACSY + 6, 0, "ACS_BTEE: "); addch(ACS_BTEE); - mvaddstr(ACSY + 7, 0, "ACS_TTEE: "); addch(ACS_TTEE); - mvaddstr(ACSY + 8, 0, "ACS_HLINE: "); addch(ACS_HLINE); - mvaddstr(ACSY + 9, 0, "ACS_VLINE: "); addch(ACS_VLINE); - mvaddstr(ACSY + 10,0, "ACS_PLUS: "); addch(ACS_PLUS); - mvaddstr(ACSY + 11,0, "ACS_S1: "); addch(ACS_S1); - mvaddstr(ACSY + 12,0, "ACS_S9: "); addch(ACS_S9); - - mvaddstr(ACSY + 0, 40, "ACS_DIAMOND: "); addch(ACS_DIAMOND); - mvaddstr(ACSY + 1, 40, "ACS_CKBOARD: "); addch(ACS_CKBOARD); - mvaddstr(ACSY + 2, 40, "ACS_DEGREE: "); addch(ACS_DEGREE); - mvaddstr(ACSY + 3, 40, "ACS_PLMINUS: "); addch(ACS_PLMINUS); - mvaddstr(ACSY + 4, 40, "ACS_BULLET: "); addch(ACS_BULLET); - mvaddstr(ACSY + 5, 40, "ACS_LARROW: "); addch(ACS_LARROW); - mvaddstr(ACSY + 6, 40, "ACS_RARROW: "); addch(ACS_RARROW); - mvaddstr(ACSY + 7, 40, "ACS_DARROW: "); addch(ACS_DARROW); - mvaddstr(ACSY + 8, 40, "ACS_UARROW: "); addch(ACS_UARROW); - mvaddstr(ACSY + 9, 40, "ACS_BOARD: "); addch(ACS_BOARD); - mvaddstr(ACSY + 10,40, "ACS_LANTERN: "); addch(ACS_LANTERN); - mvaddstr(ACSY + 11,40, "ACS_BLOCK: "); addch(ACS_BLOCK); - -#define HYBASE (ACSY + 13) - mvprintw(HYBASE + 1, 0, "High-half characters via echochar:\n"); - for (i = 0; i < 4; i++) - { - move(HYBASE + i + 3, 24); - for (j = 0; j < 32; j++) - echochar(128 + 32 * i + j); - } - - move(LINES - 1, 0); - addstr("Press any key to continue... "); - (void) getch(); - - erase(); - endwin(); -} - -/**************************************************************************** - * - * Windows and scrolling tester. - * - ****************************************************************************/ - -typedef struct -{ - int y, x; -} -pair; - -static void report(void) -/* report on the cursor's current position, then restore it */ -{ - int y, x; - - getyx(stdscr, y, x); - move(LINES - 1, COLS - 17); - printw("Y = %2d X = %2d", y, x); - move(y, x); -} - -static pair *selectcell(uli, ulj, lri, lrj) -/* arrows keys move cursor, return location at current on non-arrow key */ -int uli, ulj, lri, lrj; /* co-ordinates of corners */ -{ - static pair res; /* result cell */ - int si = lri - uli + 1; /* depth of the select area */ - int sj = lrj - ulj + 1; /* width of the select area */ - int i = 0, j = 0; /* offsets into the select area */ - - for (;;) - { - move(LINES - 1, COLS - 17); - printw("Y = %2d X = %2d", uli + i, ulj + j); - move(uli + i, ulj + j); - - switch(getch()) - { - case KEY_UP: i += si - 1; break; - case KEY_DOWN: i++; break; - case KEY_LEFT: j += sj - 1; break; - case KEY_RIGHT: j++; break; - case '\004': return((pair *)NULL); - default: res.y = uli + i; res.x = ulj + j; return(&res); - } - i %= si; - j %= sj; - } -} - -static WINDOW *getwindow(void) -/* Ask user for a window definition */ -{ - WINDOW *rwindow, *bwindow; - pair ul, lr, *tmp; - - move(0, 0); clrtoeol(); - addstr("Use arrows to move cursor, anything else to mark corner 1"); - refresh(); - if ((tmp = selectcell(1, 0, LINES-1, COLS-1)) == (pair *)NULL) - return((WINDOW *)NULL); - memcpy(&ul, tmp, sizeof(pair)); - addch(ACS_ULCORNER); - move(0, 0); clrtoeol(); - addstr("Use arrows to move cursor, anything else to mark corner 2"); - refresh(); - if ((tmp = selectcell(ul.y, ul.x, LINES-1, COLS-1)) == (pair *)NULL) - return((WINDOW *)NULL); - memcpy(&lr, tmp, sizeof(pair)); - - rwindow = newwin(lr.y - ul.y + 1, lr.x - ul.x + 1, ul.y, ul.x); - - bwindow = newwin(lr.y - ul.y + 3, lr.x - ul.x + 3, ul.y - 1, ul.x - 1); - wborder(bwindow, ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE, - 0, 0, 0, 0); - wrefresh(bwindow); - delwin(bwindow); - - scrollok(rwindow, TRUE); -/* immedok(rwindow); */ - wrefresh(rwindow); - - return(rwindow); -} - -static void acs_and_scroll() -/* Demonstrate windows */ -{ - int c; - struct frame - { - struct frame *next, *last; - WINDOW *wind; - } - *oldw = (struct frame *)NULL, *current = (struct frame *)NULL, *neww; - - refresh(); - mvaddstr(LINES - 2, 0, - "F1 = make new window, F2 = next window, F3 = previous window, Ctrl-D = exit"); - mvaddstr(LINES - 1, 0, - "All other characters are echoed, windows should scroll."); - - c = KEY_F(1); - do { - report(); - if (current) - wrefresh(current->wind); - - switch(c) - { - case KEY_F(1): - neww = (struct frame *) malloc(sizeof(struct frame)); - if ((neww->wind = getwindow()) == (WINDOW *)NULL) - goto breakout; - if (oldw == NULL) /* First element, */ - { - neww->next = neww; /* so point it at itself */ - neww->last = neww; - current = neww; - } - else - { - neww->last = oldw; oldw->next = neww; - neww->next = current; current->last = neww; - } - oldw = neww; - keypad(neww->wind, TRUE); - break; - - case KEY_F(2): - current = current->next; - break; - - case KEY_F(3): - current = current->last; - break; - - case KEY_F(4): /* undocumented --- use this to test area clears */ - selectcell(0, 0, LINES - 1, COLS - 1); - clrtobot(); - refresh(); - break; - - case '\r': - c = '\n'; - /* FALLTHROUGH */ - - default: - waddch(current->wind, c); - break; - } - report(); - wrefresh(current->wind); - } while - ((c = wgetch(current->wind)) != '\004'); - - breakout: - erase(); - endwin(); -} - -#define GRIDSIZE 5 - -static void panner(WINDOW *pad, int iy, int ix, int (*pgetc)(void)) -{ - static int porty, portx, basex = 0, basey = 0; - int pxmax, pymax, c; - WINDOW *vscroll = (WINDOW *)NULL, *hscroll = (WINDOW *)NULL; - - porty = iy; portx = ix; - - getmaxyx(pad, pymax, pxmax); - - if (pymax > porty) - vscroll = newwin(porty - (pxmax > ix), 1, 0, portx - (pymax > iy)); - if (pxmax > portx) - hscroll = newwin(1, portx - (pymax > iy), porty - (pxmax > ix), 0); - - c = KEY_REFRESH; - do { - switch(c) - { - case KEY_REFRESH: - /* do nothing */ - break; - - case KEY_IC: - if (portx >= pxmax || portx >= ix) - beep(); - else - { - mvwin(vscroll, 0, ++portx - 1); - delwin(hscroll); - hscroll = newwin(1, portx - (pymax > porty), - porty - (pxmax > portx), 0); - } - break; - - case KEY_IL: - if (porty >= pymax || porty >= iy) - beep(); - else - { - mvwin(hscroll, ++porty - 1, 0); - delwin(vscroll); - vscroll = newwin(porty - (pxmax > portx), 1, - 0, portx - (pymax > porty)); - } - break; - - case KEY_DC: - if (portx <= 0) - beep(); - else - { - mvwin(vscroll, 0, --portx - 1); - delwin(hscroll); - hscroll = newwin(1, portx - (pymax > porty), - porty - (pxmax > portx), 0); - } - break; - - case KEY_DL: - if (porty <= 0) - beep(); - else - { - mvwin(hscroll, --porty - 1, 0); - delwin(vscroll); - vscroll = newwin(porty - (pxmax > portx), 1, - 0, portx - (pymax > porty)); - } - break; - - case KEY_LEFT: - if (basex > 0) - basex--; - else - beep(); - break; - - case KEY_RIGHT: - if (basex + portx < pxmax) - basex++; - else - beep(); - break; - - case KEY_UP: - if (basey > 0) - basey--; - else - beep(); - break; - - case KEY_DOWN: - if (basey + porty < pymax) - basey++; - else - beep(); - break; - } - - prefresh(pad, - basey, basex, - 0, 0, - porty - (hscroll != (WINDOW *)NULL) - 1, - portx - (vscroll != (WINDOW *)NULL) - 1); - if (vscroll) - { - int lowend, i, highend; - - lowend = basey * ((float)porty / (float)pymax); - highend = (basey + porty) * ((float)porty / (float)pymax); - - touchwin(vscroll); - for (i = 0; i < lowend; i++) - mvwaddch(vscroll, i, 0, ACS_VLINE); - wattron(vscroll, A_REVERSE); - for (i = lowend; i <= highend; i++) - mvwaddch(vscroll, i, 0, ' '); - wattroff(vscroll, A_REVERSE); - for (i = highend + 1; i < porty; i++) - mvwaddch(vscroll, i, 0, ACS_VLINE); - wrefresh(vscroll); - } - if (hscroll) - { - int lowend, j, highend; - - lowend = basex * ((float)portx / (float)pxmax); - highend = (basex + portx) * ((float)portx / (float)pxmax); - - touchwin(hscroll); - for (j = 0; j < lowend; j++) - mvwaddch(hscroll, 0, j, ACS_HLINE); - wattron(hscroll, A_REVERSE); - for (j = lowend; j <= highend; j++) - mvwaddch(hscroll, 0, j, ' '); - wattroff(hscroll, A_REVERSE); - for (j = highend + 1; j < portx; j++) - mvwaddch(hscroll, 0, j, ACS_HLINE); - wrefresh(hscroll); - } - mvaddch(porty - 1, portx - 1, ACS_LRCORNER); - - } while - ((c = pgetc()) != KEY_EXIT); -} - -int padgetch(void) -{ - int c; - - switch(c = getch()) - { - case 'u': return(KEY_UP); - case 'd': return(KEY_DOWN); - case 'r': return(KEY_RIGHT); - case 'l': return(KEY_LEFT); - case '+': return(KEY_IL); - case '-': return(KEY_DL); - case '>': return(KEY_IC); - case '<': return(KEY_DC); - default: return(c); - } -} - -static void demo_pad(void) -/* Demonstrate pads. */ -{ - int i, j, gridcount = 0; - WINDOW *panpad = newpad(200, 200); - - for (i = 0; i < 200; i++) - { - for (j = 0; j < 200; j++) - if (i % GRIDSIZE == 0 && j % GRIDSIZE == 0) - { - if (i == 0 || j == 0) - waddch(panpad, '+'); - else - waddch(panpad, 'A' + (gridcount++ % 26)); - } - else if (i % GRIDSIZE == 0) - waddch(panpad, '-'); - else if (j % GRIDSIZE == 0) - waddch(panpad, '|'); - else - waddch(panpad, ' '); - } - mvprintw(LINES - 3, 0, "Use arrow keys to pan over the test pattern"); - mvprintw(LINES - 2, 0, "Use +,- to grow/shrink the panner vertically."); - mvprintw(LINES - 1, 0, "Use <,> to grow/shrink the panner horizontally."); - panner(panpad, LINES - 4, COLS, padgetch); - - endwin(); - erase(); -} - -/**************************************************************************** - * - * Tests from John Burnell's PDCurses tester - * - ****************************************************************************/ - -static void Continue (WINDOW *win) -{ - wmove(win, 10, 1); - mvwaddstr(win, 10, 1, " Press any key to continue"); - wrefresh(win); - wgetch(win); -} - -static void input_test(WINDOW *win) -/* Input test, adapted from John Burnell's PDCurses tester */ -{ - int w, h, bx, by, sw, sh, i; - WINDOW *subWin; - wclear (win); -#ifdef FOO - char buffer [80]; - int num; -#endif /* FOO */ - - w = win->_maxx; - h = win->_maxy; - bx = win->_begx; - by = win->_begy; - sw = w / 3; - sh = h / 3; - if((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == NULL) - return; - -#ifdef A_COLOR - if (has_colors()) - { - init_pair(2,COLOR_CYAN,COLOR_BLUE); - wattrset(subWin, COLOR_PAIR(2) | A_BOLD); - } - else - wattrset(subWin, A_BOLD); -#else - wattrset(subWin, A_BOLD); -#endif - box(subWin, ACS_VLINE, ACS_HLINE); -#ifdef FOO - mvwaddstr(subWin, 2, 1, "This is a subwindow"); -#endif /* FOO */ - wrefresh(win); - - nocbreak(); - mvwaddstr(win, 1, 1, "Type random keys for 5 seconds."); - mvwaddstr(win, 2, 1, - "These should be discarded (not echoed) after the subwindow goes away."); - wrefresh(win); - - for (i = 0; i < 5; i++) - { - mvwprintw (subWin, 1, 1, "Time = %d", i); - wrefresh(subWin); - sleep(1); - flushinp(); - } - - delwin (subWin); - werase(win); - flash(); - wrefresh(win); - sleep(1); - - mvwaddstr(win, 2, 1, "Press a key"); - wmove(win, 9, 10); - wrefresh(win); - echo(); - wgetch(win); - flushinp(); - mvwaddstr(win, 12, 0, - "If you see any key other than what you typed, flushinp() is broken."); - Continue(win); - - wmove(win, 9, 10); - wdelch(win); - wrefresh(win); - wmove(win, 12, 0); - clrtoeol(); - waddstr(win, - "What you typed should now have been deleted; if not, wdelch() failed."); - Continue(win); - -#ifdef FOO - /* - * This test won't be portable until vsscanf() is - */ - mvwaddstr(win, 6, 2, "Enter a number then a string separated by space"); - echo(); - mvwscanw(win, 7, 6, "%d %s", &num,buffer); - mvwprintw(win, 8, 6, "String: %s Number: %d", buffer,num); -#endif /* FOO */ - - Continue(win); -} - -/**************************************************************************** - * - * Main sequence - * - ****************************************************************************/ - -bool do_single_test(const char c) -/* perform a single specified test */ -{ - switch (c) - { - case 'a': - getch_test(); - return(TRUE); - - case 'b': - attr_test(); - return(TRUE); - - case 'c': - if (!has_colors()) - (void) printf("This %s terminal does not support color.\n", - getenv("TERM")); - else - color_test(); - return(TRUE); - - case 'd': - if (!has_colors()) - (void) printf("This %s terminal does not support color.\n", - getenv("TERM")); - else if (!can_change_color()) - (void) printf("This %s terminal has hardwired color values.\n", - getenv("TERM")); - else - color_edit(); - return(TRUE); - - case 'e': - slk_test(); - return(TRUE); - - case 'f': - acs_display(); - return(TRUE); - - case 'g': - acs_and_scroll(); - return(TRUE); - - case 'p': - demo_pad(); - return(TRUE); - - case 'i': - input_test(stdscr); - return(TRUE); - - case '?': - (void) puts("This is the ncurses capability tester."); - (void) puts("You may select a test from the main menu by typing the"); - (void) puts("key letter of the choice (the letter to left of the =)"); - (void) puts("at the > prompt. The commands `x' or `q' will exit."); - return(TRUE); - } - - return(FALSE); -} - -int main(const int argc, const char *argv[]) -{ - char buf[BUFSIZ]; - - /* enable debugging */ - trace(TRACE_ORDINARY); - - /* tell it we're going to play with soft keys */ - slk_init(1); - - /* we must initialize the curses data structure only once */ - initscr(); - - /* tests, in general, will want these modes */ - start_color(); - cbreak(); - noecho(); - scrollok(stdscr, TRUE); - keypad(stdscr, TRUE); - - /* - * Return to terminal mode, so we're guaranteed of being able to - * select terminal commands even if the capabilities are wrong. - */ - endwin(); - - (void) puts("Welcome to ncurses. Press ? for help."); - - do { - (void) puts("This is the ncurses main menu"); - (void) puts("a = character input test"); - (void) puts("b = character attribute test"); - (void) puts("c = color test pattern"); - (void) puts("d = edit RGB color values"); - (void) puts("e = exercise soft keys"); - (void) puts("f = display ACS characters"); - (void) puts("g = display windows and scrolling"); - (void) puts("p = exercise pad features"); - (void) puts("i = subwindow input test"); - (void) puts("? = get help"); - - (void) fputs("> ", stdout); - (void) fflush(stdout); /* necessary under SVr4 curses */ - (void) fgets(buf, BUFSIZ, stdin); - - if (do_single_test(buf[0])) { - clear(); - refresh(); - endwin(); - continue; - } - } while - (buf[0] != 'q' && buf[0] != 'x'); - - exit(0); -} - -/* ncurses.c ends here */ diff --git a/lib/libncurses/TESTS/newdemo.c b/lib/libncurses/TESTS/newdemo.c deleted file mode 100644 index 6c98c762327a..000000000000 --- a/lib/libncurses/TESTS/newdemo.c +++ /dev/null @@ -1,350 +0,0 @@ -/* $FreeBSD$ - * - * newdemo.c - A demo program using PDCurses. The program illustrate - * the use of colours for text output. - */ - -#include <stdio.h> -#include <signal.h> -#include <time.h> -#include <ncurses.h> - -#define delay_output(x) - -/* - * The Australian map - */ -char *AusMap[16] = -{ - " A A ", - " N.T. AAAAA AAAA ", - " AAAAAAAAAAA AAAAAAAA ", - " AAAAAAAAAAAAAAAAAAAAAAAAA Qld.", - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA ", - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ", - " AAAAAAAAAAAAAAAAAAAAAAAAAAAA ", - " AAAAAAAAAAAAAAAAAAAAAAAAA N.S.W.", - "W.A. AAAAAAAAA AAAAAA Vic.", - " AAA S.A. AA", - " A Tas.", - "" -}; - -/* - * Funny messages - */ -#define NMESSAGES 6 - -char *messages[] = -{ - "Hello from the Land Down Under", - "The Land of crocs. and a big Red Rock", - "Where the sunflower runs along the highways", - "the dusty red roads lead one to loneliness", - "Blue sky in the morning and", - "freezing nights and twinkling stars", - "" -}; - -/* - * Main driver - */ -main() -{ -WINDOW *win; -int w, x, y, i, j, c, len; -time_t t; -char buffer[80], *message; -int width, height; -chtype save[80]; -void trap(); - - initscr(); - start_color(); - cbreak(); - signal(SIGINT, trap); - width = 48; - height = 14; /* Create a drawing window */ - win = newwin(height, width, (LINES-height)/2, (COLS-width)/2); - if(win == NULL) - { endwin(); - return 1; - } - - while(1) - { init_pair(1,COLOR_WHITE,COLOR_BLUE); - wattrset(win, COLOR_PAIR(1)); - werase(win); - - init_pair(2,COLOR_RED,COLOR_RED); - wattrset(win, COLOR_PAIR(2)); - box(win, ACS_VLINE, ACS_HLINE); - wrefresh(win); - /* Do ramdom output of a character */ - wattrset(win, COLOR_PAIR(1)); - c = 'a'; - for(i=0; i < 5000; ++i) - { x = rand() % (width-2) + 1; - y = rand() % (height-2) + 1; - mvwaddch(win, y, x, c); - wrefresh(win); - nodelay(win,TRUE); - if (wgetch(win) != ERR) - break; - if(i == 2000) - { c = 'b'; - init_pair(3,COLOR_CYAN,COLOR_YELLOW); - wattron(win, COLOR_PAIR(3)); - } - } - - SubWinTest(win); - /* Erase and draw green window */ - init_pair(4,COLOR_YELLOW,COLOR_GREEN); - wattrset(win, COLOR_PAIR(4) | A_BOLD); - werase(win); - wrefresh(win); - /* Draw RED bounding box */ - wattrset(win, COLOR_PAIR(2)); - box(win, ' ', ' '); - wrefresh(win); - /* Display Australia map */ - wattrset(win, COLOR_PAIR(4) | A_BOLD); - i = 0; - while(*AusMap[i]) - { mvwaddstr(win, i+1, 8, AusMap[i]); - wrefresh(win); - delay_output(100); - ++i; - } - - init_pair(5,COLOR_BLUE,COLOR_WHITE); - wattrset(win, COLOR_PAIR(5) | A_BLINK); - mvwaddstr(win, height-2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix"); - wrefresh(win); - - /* Draw running messages */ - init_pair(6,COLOR_YELLOW,COLOR_WHITE); - wattrset(win, COLOR_PAIR(6)); - message = messages[0]; - len = strlen(message); - j = 0; - i = 2; - w = width-2; - while(j < NMESSAGES) - { strncpy(buffer, message, w - i); - buffer[w-i] = 0; - mvwaddstr(win, height/2, i, buffer); - if(w - i < len) - { memset(buffer, ' ', i); - strcpy(buffer, message + (w - i)); - buffer[strlen(buffer)] = ' '; - buffer[i-2] = '\0'; - mvwaddstr(win, height/2, 2, buffer); - } - wrefresh(win); - nodelay(win,TRUE); - if (wgetch(win) != ERR) - { flushinp(); - break; - } - mvwaddch(win, height/2, i, ' '); - i = ++i % w; - if(i < 2) - { message = messages[++j%NMESSAGES]; - memset(buffer, ' ', w-2); - buffer[w-2] = 0; - mvwaddstr(win, height/2, 2, buffer); - i = 2; - } - delay_output(300); - } - - j = 0; - /* Draw running As across in RED */ - init_pair(7,COLOR_RED,COLOR_GREEN); - wattron(win, COLOR_PAIR(7)); - for(i=2; i < width - 4; ++i) - { c = mvwinch(win, 4, i); - save[j++] = c; - c = c & 0x7f; - mvwaddch(win, 4, i, c); - } - wrefresh(win); - - /* Put a message up wait for a key */ - i = height-2; - wattrset(win, COLOR_PAIR(5)); - mvwaddstr(win, i, 5, " Type a key to continue or 'Q' to quit "); - wrefresh(win); - - if(WaitForUser() == 1) - break; - - j = 0; /* Restore the old line */ - for(i=2; i < width - 4; ++i) - mvwaddch(win, 4, i, save[j++]); - wrefresh(win); - - BouncingBalls(win); - /* Put a message up wait for a key */ - i = height-2; - wattrset(win, COLOR_PAIR(5)); - mvwaddstr(win, i, 5, " Type a key to continue or 'Q' to quit "); - wrefresh(win); - if(WaitForUser() == 1) - break; - } -exit: - endwin(); - return 0; -} - -/* - * Test sub windows - */ -SubWinTest(WINDOW *win) -{ -int w, h, sw, sh, bx, by; -WINDOW *swin1, *swin2, *swin3; - - w = win->_maxx; - h = win->_maxy; - bx = win->_begx; - by = win->_begy; - sw = w / 3; - sh = h / 3; - if((swin1 = subwin(win, sh, sw, by+3, bx+5)) == NULL) - return 1; - if((swin2 = subwin(win, sh, sw, by+4, bx+8)) == NULL) - return 1; - if((swin3 = subwin(win, sh, sw, by+5, bx+11)) == NULL) - return 1; - - init_pair(8,COLOR_RED,COLOR_BLUE); - wattrset(swin1, COLOR_PAIR(8)); - werase(swin1); - mvwaddstr(swin1, 0, 3, "Sub-window 1"); - wrefresh(swin1); - - init_pair(8,COLOR_CYAN,COLOR_MAGENTA); - wattrset(swin2, COLOR_PAIR(8)); - werase(swin2); - mvwaddstr(swin2, 0, 3, "Sub-window 2"); - wrefresh(swin2); - - init_pair(8,COLOR_YELLOW,COLOR_GREEN); - wattrset(swin3, COLOR_PAIR(8)); - werase(swin3); - mvwaddstr(swin3, 0, 3, "Sub-window 3"); - wrefresh(swin3); - - delwin(swin1); - delwin(swin2); - delwin(swin3); - WaitForUser(); - return 0; -} - -/* - * Bouncing balls - */ -BouncingBalls(WINDOW *win) -{ -chtype c1, c2, c3; -int w, h; -int x1, y1, xd1, yd1; -int x2, y2, xd2, yd2; -int x3, y3, xd3, yd3; - - w = win->_maxx; - h = win->_maxy; - x1 = 2 + rand() % (w - 4); - y1 = 2 + rand() % (h - 4); - x2 = 2 + rand() % (w - 4); - y2 = 2 + rand() % (h - 4); - x3 = 2 + rand() % (w - 4); - y3 = 2 + rand() % (h - 4); - xd1 = 1; yd1 = 1; - xd2 = 1; yd2 = 0; - xd3 = 0; yd3 = 1; - nodelay(win,TRUE); - while(wgetch(win) == ERR) - { x1 = xd1 > 0 ? ++x1 : --x1; - if(x1 <= 1 || x1 >= w - 2) - xd1 = xd1 ? 0 : 1; - y1 = yd1 > 0 ? ++y1 : --y1; - if(y1 <= 1 || y1 >= h - 2) - yd1 = yd1 ? 0 : 1; - - x2 = xd2 > 0 ? ++x2 : --x2; - if(x2 <= 1 || x2 >= w - 2) - xd2 = xd2 ? 0 : 1; - y2 = yd2 > 0 ? ++y2 : --y2; - if(y2 <= 1 || y2 >= h - 2) - yd2 = yd2 ? 0 : 1; - - x3 = xd3 > 0 ? ++x3 : --x3; - if(x3 <= 1 || x3 >= w - 2) - xd3 = xd3 ? 0 : 1; - y3 = yd3 > 0 ? ++y3 : --y3; - if(y3 <= 1 || y3 >= h - 2) - yd3 = yd3 ? 0 : 1; - - c1 = mvwinch(win, y1, x1); - c2 = mvwinch(win, y2, x2); - c3 = mvwinch(win, y3, x3); - - init_pair(8,COLOR_RED,COLOR_BLUE); - wattrset(win, COLOR_PAIR(8)); - mvwaddch(win, y1, x1, 'O'); - init_pair(8,COLOR_BLUE,COLOR_RED); - wattrset(win, COLOR_PAIR(8)); - mvwaddch(win, y2, x2, '*'); - init_pair(8,COLOR_YELLOW,COLOR_WHITE); - wattrset(win, COLOR_PAIR(8)); - mvwaddch(win, y3, x3, '@'); - wmove(win, 0, 0); - wrefresh(win); - mvwaddch(win, y1, x1, c1); - mvwaddch(win, y2, x2, c2); - mvwaddch(win, y3, x3, c3); - delay_output(150); - } - return 0; -} - -/* - * Wait for user - */ -int WaitForUser() -{ - time_t t; - chtype key; - - nodelay(stdscr,TRUE); - t = time((time_t *)0); - while(1) - { - if ((key = getch()) != ERR) - { - if (key == 'q' || key == 'Q') - return 1; - else - return 0; - } - if (time((time_t *)0) - t > 5) - return 0; - } -} - -/* - * Trap interrupt - */ -void trap() -{ - endwin(); - exit(0); -} - -/* End of DEMO.C */ diff --git a/lib/libncurses/TESTS/over.c b/lib/libncurses/TESTS/over.c deleted file mode 100644 index 5681916ee4d8..000000000000 --- a/lib/libncurses/TESTS/over.c +++ /dev/null @@ -1,120 +0,0 @@ -/********************************************************************* - * [program] overwrite() - Play with overwrite() function to * - * attempt pop-up windows. * - * ----------------------------------------------------------------- * - * [written] 1-Feb-1993 by Neal Ensor (ensor@cs.utk.edu) * - * ----------------------------------------------------------------- * - * [notes] Originally written on SVR4 UNIX, then recompiled on * - * Linux (Slackware 1.1.1, ncurses 1.8.1) * - * ----------------------------------------------------------------- * - * [problem] On ncurses, the overwrite() function doesn't seem to * - * overwrite. Maybe I'm missing something, but this * - * program in SVR4 displays three windows, waits for a * - * keypress, then removes the top window. With ncurses, * - * nothing changes on the display. * - *********************************************************************/ - -# include <ncurses.h> /* ncurses include lives here */ - -main() -{ - /**************************************************************** - * Declare three little window pointers... * - ****************************************************************/ - WINDOW *win, *win1, *win2; - - /**************************************************************** - * Set up the screen... * - ****************************************************************/ - initscr(); - /* traceon(); */ - noecho(); - nonl(); - cbreak(); - refresh(); - - /**************************************************************** - * Draw three overlapping windows. * - ****************************************************************/ - win=newwin(6,45, 6,6); - win1=newwin(10,20,5,5); - win2=newwin(10,30,7,7); - - /**************************************************************** - * Box them, and print a hidden message... * - ****************************************************************/ - box(win, 0, 0); - box(win1, 0, 0); - box(win2, 0, 0); - mvwprintw(win1, 6,6, "Hey!"); - mvwaddch(win, 1, 1, '0'); - mvwaddch(win1, 1, 1, '1'); - mvwaddch(win2, 1, 1, '2'); - wnoutrefresh(win); - wnoutrefresh(win1); - wnoutrefresh(win2); - doupdate(); - - /**************************************************************** - * Await a keypress to show what we've done so far. * - ****************************************************************/ - getch(); - - /**************************************************************** - * Now, overwrite win2 with contents of all lower windows IN * - * ORDER from the stdscr up... * - ****************************************************************/ - if (overwrite(stdscr, win2) == ERR) - fprintf(stderr, "overwrite(stdscr, win2) failed!\n"); - - touchwin(stdscr); wnoutrefresh(stdscr); - touchwin(win); wnoutrefresh(win); - touchwin(win1); wnoutrefresh(win1); - touchwin(win2); wnoutrefresh(win2); - doupdate(); - - getch(); - if (overwrite(win, win2) == ERR) - fprintf(stderr, "overwrite(win, win2) failed!\n"); - - touchwin(stdscr); wnoutrefresh(stdscr); - touchwin(win); wnoutrefresh(win); - touchwin(win1); wnoutrefresh(win1); - touchwin(win2); wnoutrefresh(win2); - doupdate(); - - getch(); - if (overwrite(win1, win2) == ERR) - fprintf(stderr, "overwrite(win1, win2) failed!\n"); - - /**************************************************************** - * Perform touches, and hidden refreshes on each window. * - * ------------------------------------------------------------ * - * NOTE: If you replace the wnoutrefresh() call with wrefresh()* - * you can see all windows being redrawn untouched. * - ****************************************************************/ - touchwin(stdscr); wnoutrefresh(stdscr); - touchwin(win); wnoutrefresh(win); - touchwin(win1); wnoutrefresh(win1); - touchwin(win2); wnoutrefresh(win2); - doupdate(); - - /**************************************************************** - * At this point, win2 should be "destroyed"; having all other * - * window contents overwritten onto it. The doupdate() should * - * effectively remove it from the screen, leaving the others * - * untouched. On SVR4, this happens, but not with ncurses. * - * I'd suspect something in overwrite() causes this, as nothing * - * appears to be overwritten after the calls, with no errors * - * being reported. This was compiled on my Linux from Slackware* - * 1.1.1, with ncurses1.8.1 recompiled on it, using the console * - * entry from the "new" terminfo from ncurses1.8.1. * - ****************************************************************/ - getch(); - - /**************************************************************** - * Clean up our act and exit. * - ****************************************************************/ - endwin(); -} - diff --git a/lib/libncurses/TESTS/rain.c b/lib/libncurses/TESTS/rain.c deleted file mode 100644 index 9779d0219998..000000000000 --- a/lib/libncurses/TESTS/rain.c +++ /dev/null @@ -1,96 +0,0 @@ -#include <ncurses.h> -#include <signal.h> -/* rain 11/3/1980 EPS/CITHEP */ - -#define cursor(col,row) move(row,col) - -float ranf(); -void onsig(); - -main(argc,argv) -int argc; -char *argv[]; -{ -int x, y, j; -static int xpos[5], ypos[5]; -float r; -float c; - - for (j=SIGHUP;j<=SIGTERM;j++) - if (signal(j,SIG_IGN)!=SIG_IGN) signal(j,onsig); - - initscr(); - nl(); - noecho(); - r = (float)(LINES - 4); - c = (float)(COLS - 4); - for (j=5;--j>=0;) { - xpos[j]=(int)(c* ranf())+2; - ypos[j]=(int)(r* ranf())+2; - } - for (j=0;;) { - x=(int)(c*ranf())+2; - y=(int)(r*ranf())+2; - - cursor(x,y); addch('.'); - - cursor(xpos[j],ypos[j]); addch('o'); - - if (j==0) j=4; else --j; - cursor(xpos[j],ypos[j]); addch('O'); - - if (j==0) j=4; else --j; - cursor(xpos[j],ypos[j]-1); - addch('-'); - cursor(xpos[j]-1,ypos[j]); - addstr("|.|"); - cursor(xpos[j],ypos[j]+1); - addch('-'); - - if (j==0) j=4; else --j; - cursor(xpos[j],ypos[j]-2); - addch('-'); - cursor(xpos[j]-1,ypos[j]-1); - addstr("/ \\"); - cursor(xpos[j]-2,ypos[j]); - addstr("| O |"); - cursor(xpos[j]-1,ypos[j]+1); - addstr("\\ /"); - cursor(xpos[j],ypos[j]+2); - addch('-'); - - if (j==0) j=4; else --j; - cursor(xpos[j],ypos[j]-2); - addch(' '); - cursor(xpos[j]-1,ypos[j]-1); - addstr(" "); - cursor(xpos[j]-2,ypos[j]); - addstr(" "); - cursor(xpos[j]-1,ypos[j]+1); - addstr(" "); - cursor(xpos[j],ypos[j]+2); - addch(' '); - xpos[j]=x; ypos[j]=y; - refresh(); - } -} - -void -onsig(n) -int n; -{ - endwin(); - exit(0); -} - -float -ranf() -{ - float rv; - long r = rand(); - - r &= 077777; - rv =((float)r/32767.); - return rv; -} - diff --git a/lib/libncurses/TESTS/scroll.c b/lib/libncurses/TESTS/scroll.c deleted file mode 100644 index 428a064b43b8..000000000000 --- a/lib/libncurses/TESTS/scroll.c +++ /dev/null @@ -1,30 +0,0 @@ -#include <ncurses.h> - -main() -{ -int i; - - initscr(); - noecho(); - scrollok(stdscr, TRUE); - setscrreg(0, 9); - mvaddstr(0,0,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - mvaddstr(1,0,"bbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); - mvaddstr(2,0,"ccccccccccccccccccccccccccccc"); - mvaddstr(3,0,"ddddddddddddddddddddddddddddd"); - mvaddstr(4,0,"eeeeeeeeeeeeeeeeeeeeeeeeeeeee"); - mvaddstr(5,0,"fffffffffffffffffffffffffffff"); - mvaddstr(6,0,"ggggggggggggggggggggggggggggg"); - mvaddstr(7,0,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhh"); - mvaddstr(8,0,"iiiiiiiiiiiiiiiiiiiiiiiiiiiii"); - mvaddstr(9,0,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjj"); - refresh(); - for (i = 0; i < 4; i++) { - getch(); - scrl(-1); - refresh(); - } - getch(); - endwin(); - -} diff --git a/lib/libncurses/TESTS/scroll2.c b/lib/libncurses/TESTS/scroll2.c deleted file mode 100644 index e7b2e3093993..000000000000 --- a/lib/libncurses/TESTS/scroll2.c +++ /dev/null @@ -1,91 +0,0 @@ -#include <ncurses.h> -#define ROWS 20 -#define scroll_window wscrl - -main() -{ - int i; - WINDOW * w; - - - initscr(); - cbreak(); - noecho(); - w = newwin (ROWS, 35, 2, 25); - scrollok(w, TRUE); - wsetscrreg(w, 0, ROWS-1); - -#ifdef LELE - mvaddstr (0, 0, "With my function"); -#else - mvaddstr (0, 0, "With the original wscrl"); -#endif - refresh(); - - - for (i=0; i<ROWS-1; i++) - { - mvwprintw (w, i, 0, "Line number %d", i); - } - mvwaddstr (w, ROWS-1, 0, "Moving one line at a time"); - wrefresh(w); - for (i = 0; i < 4; i++) { - getch(); - scroll_window (w, 1); - wrefresh(w); - } - for (i = 0; i < 4; i++) { - getch(); - scroll_window (w, -1); - wrefresh(w); - } - getch(); - wclear (w); - - - for (i=0; i<ROWS-1; i++) - { - mvwprintw (w, i, 0, "Line number %d", i); - } - mvwaddstr (w, ROWS-1, 0, "Moving two line at a time"); -#ifndef LELE - mvaddstr (0, 30, "** THIS FAILS ON MY MACHINE WITH A BUS ERROR -**"); -#endif - - - wrefresh(w); - for (i = 0; i < 4; i++) { - getch(); - scroll_window (w, 2); - wrefresh(w); - } - for (i = 0; i < 4; i++) { - getch(); - scroll_window (w, -2); - wrefresh(w); - } - getch(); - wclear (w); - for (i=0; i<ROWS-1; i++) - { - mvwprintw (w, i, 0, "Line number %d", i); - } - mvwaddstr (w, ROWS-1, 0, "Moving three line at a time"); - wrefresh(w); - for (i = 0; i < 4; i++) { - getch(); - scroll_window (w, 3); - wrefresh(w); - } - for (i = 0; i < 4; i++) { - getch(); - scroll_window (w, -3); - wrefresh(w); - } - getch(); - - - endwin(); -} - diff --git a/lib/libncurses/TESTS/scroll3.c b/lib/libncurses/TESTS/scroll3.c deleted file mode 100644 index b2a10c3e213a..000000000000 --- a/lib/libncurses/TESTS/scroll3.c +++ /dev/null @@ -1,51 +0,0 @@ -#include <ncurses.h> - -main(int argc, char **argv) -{ - WINDOW *w, *x; - - initscr(); - w = newwin(0, 0, 0, 0); - if (argc > 2) - x = newwin(0, 0, 0, 0); - scrollok(w, TRUE); - if (argc > 2) - scrollok(x, TRUE); - idlok(w, TRUE); - if (argc > 2) - idlok(x, TRUE); - wmove(w, LINES - 1, 0); - waddstr(w, "test 1 in w"); - wrefresh(w); - sleep(1); - if (argc == 2 || argc == 4) - { - waddch(w, '\n'); - sleep(1); - waddch(w, '\n'); - sleep(1); - waddch(w, '\n'); - sleep(1); - beep(); - wrefresh(w); - } - sleep(1); - if (argc > 2) - { - wmove(x, LINES - 1, 0); - waddstr(x, "test 2 in x"); - sleep(1); - waddch(x, '\n'); - sleep(1); - waddch(x, '\n'); - sleep(1); - waddch(x, '\n'); - sleep(1); - beep(); - wrefresh(w); - sleep(1); - } - endwin(); - return 0; -} - diff --git a/lib/libncurses/TESTS/test.c b/lib/libncurses/TESTS/test.c deleted file mode 100644 index f77f3a1e751e..000000000000 --- a/lib/libncurses/TESTS/test.c +++ /dev/null @@ -1,27 +0,0 @@ - -#include <ncurses.h> - -main() -{ -int x, y; - - initscr(); - cbreak(); - nodelay(stdscr, TRUE); - - for (y = 0; y < 43; y++) - for (x =0; x < 132; x++) { - move(y,x); - printw("X"); - refresh(); - if (!getch()) { - beep(); - sleep(1); - } - } - - nocbreak(); - endwin(); -} - - diff --git a/lib/libncurses/TESTS/testcurs.c b/lib/libncurses/TESTS/testcurs.c deleted file mode 100644 index df2468a87e34..000000000000 --- a/lib/libncurses/TESTS/testcurs.c +++ /dev/null @@ -1,532 +0,0 @@ -/* - * - * This is a test program for the PDCurses screen package for IBM PC type - * machines. - * This program was written by John Burnell (johnb@kea.am.dsir.govt.nz) - * - */ - -#include <stdio.h> -#include <ncurses.h> - -#ifdef __STDC__ -void inputTest (WINDOW *); -void scrollTest (WINDOW *); -void introTest (WINDOW *); -int initTest (WINDOW **); -void outputTest (WINDOW *); -void padTest (WINDOW *); -void resizeTest (WINDOW *); -void display_menu(int,int); -#else -void inputTest (); -void scrollTest (); -void introTest (); -int initTest (); -void outputTest (); -void padTest (); -void resizeTest (); -void display_menu(); -#endif - -struct commands -{ - char *text; -#ifdef __STDC__ - void (*function)(WINDOW *); -#else - void (*function)(); -#endif -}; -typedef struct commands COMMAND; -#define MAX_OPTIONS 6 -COMMAND command[MAX_OPTIONS] = -{ - {"Intro Test",introTest}, - {"Pad Test",padTest}, - {"Resize Test",resizeTest}, - {"Scroll Test",scrollTest}, - {"Input Test",inputTest}, - {"Output Test",outputTest} -}; - -int width, height; - -main() -{ -WINDOW *win; -int key,old_option=(-1),new_option=0; -bool quit=FALSE; - -#ifdef PDCDEBUG - PDC_debug("testcurs started\n"); -#endif - if (!initTest (&win)) {return 1;} - -#ifdef A_COLOR - if (has_colors()) - { - init_pair(1,COLOR_WHITE,COLOR_BLUE); - wattrset(win, COLOR_PAIR(1)); - } - else - wattrset(win, A_REVERSE); -#else - wattrset(win, A_REVERSE); -#endif - - erase(); - display_menu(old_option,new_option); - while(1) - { - noecho(); - keypad(stdscr,TRUE); - raw(); - key = getch(); - switch(key) - { - case 10: - case 13: - case KEY_ENTER: - erase(); - refresh(); - (*command[new_option].function)(win); - erase(); - display_menu(old_option,new_option); - break; - case KEY_UP: - new_option = (new_option == 0) ? new_option : new_option-1; - display_menu(old_option,new_option); - break; - case KEY_DOWN: - new_option = (new_option == MAX_OPTIONS-1) ? new_option : new_option+1; - display_menu(old_option,new_option); - break; - case 'Q': - case 'q': - quit = TRUE; - break; - default: break; - } - if (quit == TRUE) - break; - } - - delwin (win); - - endwin(); - return 0; -} -#ifdef __STDC__ -void Continue (WINDOW *win) -#else -void Continue (win) -WINDOW *win; -#endif -{ - wmove(win, 10, 1); -/* wclrtoeol(win); -*/ mvwaddstr(win, 10, 1, " Press any key to continue"); - wrefresh(win); - raw(); - wgetch(win); -} -#ifdef __STDC_ -int initTest (WINDOW **win) -#else -int initTest (win) -WINDOW **win; -#endif -{ -#ifdef PDCDEBUG - PDC_debug("initTest called\n"); -#endif - initscr(); -#ifdef PDCDEBUG - PDC_debug("after initscr()\n"); -#endif -#ifdef A_COLOR - if (has_colors()) - start_color(); -#endif - width = 60; - height = 13; /* Create a drawing window */ - *win = newwin(height, width, (LINES-height)/2, (COLS-width)/2); - if(*win == NULL) - { endwin(); - return 1; - } -} -#ifdef __STDC__ -void introTest (WINDOW *win) -#else -void introTest (win) -WINDOW *win; -#endif -{ - beep (); - werase(win); - - box(win, ACS_VLINE, ACS_HLINE); - wrefresh(win); - cbreak (); - mvwaddstr(win, 1, 1, "You should have rectangle in the middle of the screen"); - mvwaddstr(win, 2, 1, "You should have heard a beep"); - Continue(win); - return; -} -#ifdef __STDC__ -void scrollTest (WINDOW *win) -#else -void scrollTest (win) -WINDOW *win; -#endif -{ - int i; - int OldX, OldY; - char *Message = "The window will now scroll slowly"; - - mvwprintw (win, height - 2, 1, Message); - wrefresh (win); - scrollok(win, TRUE); - for (i = 1; i <= height; i++) { - usleep (250); - scroll(win); - wrefresh (win); - }; - - getmaxyx (win, OldY, OldX); - mvwprintw (win, 6, 1, "The top of the window will scroll"); - wmove (win, 1, 1); - wsetscrreg (win, 0, 4); - box(win, ACS_VLINE, ACS_HLINE); - wrefresh (win); - for (i = 1; i <= 5; i++) { - usleep (500); - scroll(win); - wrefresh (win); - }; - wsetscrreg (win, 0, --OldY); - -} -#ifdef __STDC__ -void inputTest (WINDOW *win) -#else -void inputTest (win) -WINDOW *win; -#endif -{ - int w, h, bx, by, sw, sh, i, c,num; - char buffer [80]; - WINDOW *subWin; - wclear (win); - - w = win->_maxx; - h = win->_maxy; - bx = win->_begx; - by = win->_begy; - sw = w / 3; - sh = h / 3; - if((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == NULL) - return; - -#ifdef A_COLOR - if (has_colors()) - { - init_pair(2,COLOR_CYAN,COLOR_BLUE); - wattrset(subWin, COLOR_PAIR(2) | A_BOLD); - } - else - wattrset(subWin, A_BOLD); -#else - wattrset(subWin, A_BOLD); -#endif - box(subWin, ACS_VLINE, ACS_HLINE); - wrefresh(win); - - nocbreak(); - mvwaddstr(win, 2, 1, "Press some keys for 5 seconds"); - mvwaddstr(win, 1, 1, "Pressing ^C should do nothing"); - wrefresh(win); - - for (i = 0; i < 5; i++) { - werase (subWin); - box(subWin, ACS_VLINE, ACS_HLINE); - mvwprintw (subWin, 1, 1, "Time = %d", i); - wrefresh(subWin); - usleep(1000); - flushinp(); - } - - delwin (subWin); - werase(win); - flash(); - wrefresh(win); - usleep(500); - - mvwaddstr(win, 2, 1, "Press a key, followed by ENTER"); - wmove(win, 9, 10); - wrefresh(win); - echo(); - noraw(); - wgetch(win); - flushinp(); - - wmove(win, 9, 10); - wdelch(win); - mvwaddstr(win, 4, 1, "The character should now have been deleted"); - Continue(win); - - wclear (win); - mvwaddstr(win, 2, 1, "Press a function key or an arrow key"); - wrefresh(win); - keypad(win, TRUE); - raw(); - c = wgetch(win); - - nodelay(win, TRUE); - wgetch(win); - nodelay(win, FALSE); - - refresh(); - wclear (win); - mvwaddstr(win, 3, 2, "The window should have moved"); - mvwaddstr(win, 4, 2, "This text should have appeared without you pressing a key"); - mvwprintw(win, 2, 2, "Keycode = %d", c); - mvwaddstr(win, 6, 2, "Enter a number then a string seperated by space"); - echo(); - noraw(); - mvwscanw(win, 7, 6, "%d %s", &num,buffer); - mvwprintw(win, 8, 6, "String: %s Number: %d", buffer,num); - Continue(win); -} -#ifdef __STDC__ -void outputTest (WINDOW *win) -#else -void outputTest (win) -WINDOW *win; -#endif -{ - WINDOW *win1; - char Buffer [80]; - chtype ch; - - /* traceon(); */ - nl (); - wclear (win); - mvwaddstr(win, 1, 1, "You should now have a screen in the upper left corner, and this text should have wrapped"); - mvwin(win, 2, 1); - Continue(win); - - wclear(win); - mvwaddstr(win, 1, 1, "A new window will appear with this text in it"); - mvwaddstr(win, 8, 1, "Press any key to continue"); - wrefresh(win); - wgetch(win); - - win1 = newwin(10, 50, 15, 25); - if(win1 == NULL) - { endwin(); - return; - } -#ifdef A_COLOR - if (has_colors()) - { - init_pair(3,COLOR_BLUE,COLOR_WHITE); - wattrset(win1, COLOR_PAIR(3)); - } - else - wattrset(win1, A_NORMAL); -#else - wattrset(win1, A_NORMAL); -#endif - wclear (win1); - mvwaddstr(win1, 5, 1, "This text should appear; using overlay option"); - copywin(win, win1,0,0,0,0,10,50,TRUE); - -#ifdef UNIX - box(win1,ACS_VLINE,ACS_HLINE); -#else - box(win1,0xb3,0xc4); -#endif - wmove(win1, 8, 26); - wrefresh(win1); - wgetch(win1); - - wclear(win1); - wattron(win1, A_BLINK); - mvwaddstr(win1, 4, 1, "This blinking text should appear in only the second window"); - wattroff(win1, A_BLINK); - wrefresh(win1); - wgetch(win1); - delwin(win1); - - wclear(win); - wrefresh(win); - mvwaddstr(win, 6, 2, "This line shouldn't appear"); - mvwaddstr(win, 4, 2, "Only half of the next line is visible"); - mvwaddstr(win, 5, 2, "Only half of the next line is visible"); - wmove(win, 6, 1); - wclrtobot (win); - wmove(win, 5, 20); - wclrtoeol (win); - mvwaddstr(win, 8, 2, "This line also shouldn't appear"); - wmove(win, 8, 1); - wdeleteln(win); - Continue(win); - /* traceoff(); */ - - wmove (win, 5, 9); - ch = winch (win); - - wclear(win); - wmove (win, 6, 2); - waddstr (win, "The next char should be l: "); - winsch (win, ch); - Continue(win); - - wmove(win, 5, 1); - winsertln (win); - mvwaddstr(win, 5, 2, "The lines below should have moved down"); - Continue(win); - - wclear(win); - wmove(win, 2, 2); - wprintw(win, "This is a formatted string in a window: %d %s\n", 42, "is it"); - mvwaddstr(win, 10, 1, "Enter a string: "); - wrefresh(win); - noraw(); - echo(); - wscanw (win, "%s", Buffer); - - wclear(win); - mvwaddstr(win, 10, 1, "Enter a string"); - wrefresh(win); - clear(); - move(0,0); - printw("This is a formatted string in stdscr: %d %s\n", 42, "is it"); - mvaddstr(10, 1, "Enter a string: "); - refresh(); - noraw(); - echo(); - scanw ("%s", Buffer); - - wclear(win); - curs_set(2); - mvwaddstr(win, 1, 1, "The cursor should appear as a block"); - Continue(win); - - wclear(win); - curs_set(0); - mvwaddstr(win, 1, 1, "The cursor should have disappeared"); - Continue(win); - - wclear(win); - curs_set(1); - mvwaddstr(win, 1, 1, "The cursor should be an underline"); - Continue(win); -} - -#ifdef __STDC__ -void resizeTest(WINDOW *dummy) -#else -void resizeTest(dummy) -WINDOW *dummy; -#endif -{ - WINDOW *win1; - char Buffer [80]; - chtype ch; - - savetty (); - - clear(); - refresh(); -#ifdef __PDCURSES__ - resize(50); -#endif - - - win1 = newwin(11, 50, 14, 25); - if(win1 == NULL) - { endwin(); - return; - } -#ifdef A_COLOR - if (has_colors()) - { - init_pair(3,COLOR_BLUE,COLOR_WHITE); - wattrset(win1, COLOR_PAIR(3)); - } -#endif - wclear (win1); - - mvwaddstr(win1, 1, 1, "The screen may now have 50 lines"); - Continue(win1); - - resetty (); - - wclear (win1); - mvwaddstr(win1, 1, 1, "The screen should now be reset"); - Continue(win1); - - delwin(win1); - - clear(); - refresh(); - -} -#ifdef __STDC__ -void padTest(WINDOW *dummy) -#else -void padTest(dummy) -WINDOW *dummy; -#endif -{ -WINDOW *pad; - - pad = newpad(50,100); - mvwaddstr(pad, 5, 2, "This is a new pad"); - mvwaddstr(pad, 8, 0, "The end of this line should be truncated here:abcd"); - mvwaddstr(pad,11, 1, "This line should not appear."); - wmove(pad, 10, 1); - wclrtoeol(pad); - mvwaddstr(pad, 10, 1, " Press any key to continue"); - prefresh(pad,0,0,0,0,10,45); - keypad(pad, TRUE); - raw(); - wgetch(pad); - - mvwaddstr(pad, 35, 2, "This is displayed at line 35 in the pad"); - mvwaddstr(pad, 40, 1, " Press any key to continue"); - prefresh(pad,30,0,0,0,10,45); - keypad(pad, TRUE); - raw(); - wgetch(pad); - - delwin(pad); -} - -#ifdef __STDC__ -void display_menu(int old_option,int new_option) -#else -void display_menu(old_option,new_option) -int old_option,new_option; -#endif -{ - register int i; - - attrset(A_NORMAL); - mvaddstr(3,20,"PDCurses Test Program"); - - for (i=0;i<MAX_OPTIONS;i++) - mvaddstr(5+i,25,command[i].text); - if (old_option != (-1)) - mvaddstr(5+old_option,25,command[old_option].text); - attrset(A_REVERSE); - mvaddstr(5+new_option,25,command[new_option].text); - attrset(A_NORMAL); - mvaddstr(13,3,"Use Up and Down Arrows to select - Enter to run - Q to quit"); - refresh(); -} - diff --git a/lib/libncurses/TESTS/worm.c b/lib/libncurses/TESTS/worm.c deleted file mode 100644 index abbe2413487e..000000000000 --- a/lib/libncurses/TESTS/worm.c +++ /dev/null @@ -1,268 +0,0 @@ -/* - - @@@ @@@ @@@@@@@@@@ @@@@@@@@@@@ @@@@@@@@@@@@ - @@@ @@@ @@@@@@@@@@@@ @@@@@@@@@@@@ @@@@@@@@@@@@@ - @@@ @@@ @@@@ @@@@ @@@@ @@@@ @@@ @@@@ - @@@ @@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ - @@@ @@@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ - @@@@ @@@@ @@@@ @@@ @@@ @@@ @@@ @@@ @@@ - @@@@@@@@@@@@ @@@@ @@@@ @@@ @@@ @@@ @@@ - @@@@ @@@@ @@@@@@@@@@@@ @@@ @@@ @@@ @@@ - @@ @@ @@@@@@@@@@ @@@ @@@ @@@ @@@ - - Eric P. Scott - Caltech High Energy Physics - October, 1980 - -*/ - -#include <ncurses.h> -#include <signal.h> - -#define cursor(col,row) move(row,col) - -int Wrap; -short *ref[128]; -static char flavor[]={ - 'O', '*', '#', '$', '%', '0' -}; -static short xinc[]={ - 1, 1, 1, 0, -1, -1, -1, 0 -}, yinc[]={ - -1, 0, 1, 1, 1, 0, -1, -1 -}; -static struct worm { - int orientation, head; - short *xpos, *ypos; -} worm[40]; -static char *field; -static int length=16, number=3, trail=' '; -static struct options { - int nopts; - int opts[3]; -} normal[8]={ - { 3, { 7, 0, 1 } }, - { 3, { 0, 1, 2 } }, - { 3, { 1, 2, 3 } }, - { 3, { 2, 3, 4 } }, - { 3, { 3, 4, 5 } }, - { 3, { 4, 5, 6 } }, - { 3, { 5, 6, 7 } }, - { 3, { 6, 7, 0 } } -}, upper[8]={ - { 1, { 1, 0, 0 } }, - { 2, { 1, 2, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 2, { 4, 5, 0 } }, - { 1, { 5, 0, 0 } }, - { 2, { 1, 5, 0 } } -}, left[8]={ - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 2, { 2, 3, 0 } }, - { 1, { 3, 0, 0 } }, - { 2, { 3, 7, 0 } }, - { 1, { 7, 0, 0 } }, - { 2, { 7, 0, 0 } } -}, right[8]={ - { 1, { 7, 0, 0 } }, - { 2, { 3, 7, 0 } }, - { 1, { 3, 0, 0 } }, - { 2, { 3, 4, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 2, { 6, 7, 0 } } -}, lower[8]={ - { 0, { 0, 0, 0 } }, - { 2, { 0, 1, 0 } }, - { 1, { 1, 0, 0 } }, - { 2, { 1, 5, 0 } }, - { 1, { 5, 0, 0 } }, - { 2, { 5, 6, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } } -}, upleft[8]={ - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 1, { 3, 0, 0 } }, - { 2, { 1, 3, 0 } }, - { 1, { 1, 0, 0 } } -}, upright[8]={ - { 2, { 3, 5, 0 } }, - { 1, { 3, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 1, { 5, 0, 0 } } -}, lowleft[8]={ - { 3, { 7, 0, 1 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 1, { 1, 0, 0 } }, - { 2, { 1, 7, 0 } }, - { 1, { 7, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } } -}, lowright[8]={ - { 0, { 0, 0, 0 } }, - { 1, { 7, 0, 0 } }, - { 2, { 5, 7, 0 } }, - { 1, { 5, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } } -}; - -void onsig(); -float ranf(); - -main(argc,argv) -int argc; -char *argv[]; -{ -int x, y; -int n; -struct worm *w; -struct options *op; -int h; -short *ip; -int last, bottom; - - for (x=1;x<argc;x++) { - register char *p; - p=argv[x]; - if (*p=='-') p++; - switch (*p) { - case 'f': - field="WORM"; - break; - case 'l': - if (++x==argc) goto usage; - if ((length=atoi(argv[x]))<2||length>1024) { - fprintf(stderr,"%s: Invalid length\n",*argv); - exit(1); - } - break; - case 'n': - if (++x==argc) goto usage; - if ((number=atoi(argv[x]))<1||number>40) { - fprintf(stderr,"%s: Invalid number of worms\n",*argv); - exit(1); - } - break; - case 't': - trail='.'; - break; - default: - usage: - fprintf(stderr, "usage: %s [-field] [-length #] [-number #] [-trail]\n",*argv); - exit(1); - break; - } - } - - signal(SIGINT, onsig); - initscr(); - bottom = LINES-1; - last = COLS-1; - - ip=(short *)malloc(LINES*COLS*sizeof (short)); - - for (n=0;n<LINES;) { - ref[n++]=ip; ip+=COLS; - } - for (ip=ref[0],n=LINES*COLS;--n>=0;) *ip++=0; - ref[bottom][last]=1; - for (n=number, w= &worm[0];--n>=0;w++) { - w->orientation=w->head=0; - if (!(ip=(short *)malloc(length*sizeof (short)))) { - fprintf(stderr,"%s: out of memory\n",*argv); - exit(1); - } - w->xpos=ip; - for (x=length;--x>=0;) *ip++ = -1; - if (!(ip=(short *)malloc(length*sizeof (short)))) { - fprintf(stderr,"%s: out of memory\n",*argv); - exit(1); - } - w->ypos=ip; - for (y=length;--y>=0;) *ip++ = -1; - } - if (field) { - register char *p; - p=field; - for (y=bottom;--y>=0;) { - for (x=COLS;--x>=0;) { - addch(*p++); - if (!*p) p=field; - } - addch('\n'); - } - } - refresh(); - - for (;;) { - for (n=0,w= &worm[0];n<number;n++,w++) { - if ((x=w->xpos[h=w->head])<0) { - cursor(x=w->xpos[h]=0,y=w->ypos[h]=bottom); - addch(flavor[n%6]); - ref[y][x]++; - } - else y=w->ypos[h]; - if (++h==length) h=0; - if (w->xpos[w->head=h]>=0) { - register int x1, y1; - x1=w->xpos[h]; y1=w->ypos[h]; - if (--ref[y1][x1]==0) { - cursor(x1,y1); addch(trail); - } - } - op= &(x==0 ? (y==0 ? upleft : (y==bottom ? lowleft : left)) : - (x==last ? (y==0 ? upright : (y==bottom ? lowright : right)) : - (y==0 ? upper : (y==bottom ? lower : normal))))[w->orientation]; - switch (op->nopts) { - case 0: - refresh(); - endwin(); - exit(0); - case 1: - w->orientation=op->opts[0]; - break; - default: - w->orientation=op->opts[(int)(ranf()*(float)op->nopts)]; - } - cursor(x+=xinc[w->orientation], y+=yinc[w->orientation]); - if (!Wrap||x!=last||y!=bottom) addch(flavor[n%6]); - ref[w->ypos[h]=y][w->xpos[h]=x]++; - } - refresh(); - } -} - -void -onsig() -{ - endwin(); - exit(0); -} - -float -ranf() -{ -float rv; -long r = rand(); - - r &= 077777; - rv =((float)r/32767.); - return rv; -} diff --git a/lib/libncurses/TESTS/xmas.c b/lib/libncurses/TESTS/xmas.c deleted file mode 100644 index 57cc0ea6bb42..000000000000 --- a/lib/libncurses/TESTS/xmas.c +++ /dev/null @@ -1,1192 +0,0 @@ -/******************************************************************************/ -/* asciixmas */ -/* December 1989 Larry Bartz Indianapolis, IN */ -/* */ -/* */ -/* I'm dreaming of an ascii character-based monochrome Christmas, */ -/* Just like the one's I used to know! */ -/* Via a full duplex communications channel, */ -/* At 9600 bits per second, */ -/* Even though it's kinda slow. */ -/* */ -/* I'm dreaming of an ascii character-based monochrome Christmas, */ -/* With ev'ry C program I write! */ -/* May your screen be merry and bright! */ -/* And may all your Christmases be amber or green, */ -/* (for reduced eyestrain and improved visibility)! */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* IMPLEMENTATION */ -/* */ -/* Feel free to modify the defined string FROMWHO to reflect you, your */ -/* organization, your site, whatever. */ -/* */ -/* This really looks a lot better if you can turn off your cursor before */ -/* execution. I wanted to do that here but very few termcap entries or */ -/* terminfo definitions have the appropriate string defined. If you know */ -/* the string(s) for the terminal(s) you use or which your site supports, */ -/* you could call asciixmas from within a shell in which you issue the */ -/* string to the terminal. The cursor is distracting but it doesn't really */ -/* ruin the show. */ -/* */ -/* At our site, we invoke this for our users just after login and the */ -/* determination of terminal type. */ -/* */ -/* */ -/* PORTABILITY */ -/* */ -/* I wrote this using only the very simplest curses functions so that it */ -/* might be the most portable. I was personally able to test on five */ -/* different cpu/UNIX combinations. */ -/* */ -/* */ -/* COMPILE */ -/* */ -/* usually this: */ -/* */ -/* cc -O asciixmas.c -lcurses -o asciixmas -s */ -/* */ -/* */ -/* Zilog S8000 models 11, 21, 31, etc with ZEUS variant of SYSTEM III */ -/* maybe other SYSTEM III also: */ -/* */ -/* cc asciixmas.c -lcurses -ltermlib -o asciixmas -s */ -/* */ -/* as above with optional "peephole optimizer" installed: */ -/* */ -/* cc -O asciixmas.c -lcurses -ltermlib -o asciixmas -s */ -/* */ -/* */ -/* Zilog S8000 models 32, 130 with WE32100 chip and SYS V, REL2 */ -/* maybe 3B2 also? */ -/* */ -/* cc -f -O -K sd asciixmas.c -lcurses -o asciixmas -s */ -/* */ -/* */ -/* Pyramid, Sequent, any other "dual universe" types compile and execute */ -/* under either universe. The compile line for the ucb universe (as you */ -/* might expect) is the same as for SYS III UNIX: */ -/* */ -/* cc -O asciixmas.c -lcurses -ltermlib -o asciixmas -s */ -/* */ -/* The above compile will also hold true for other BSD systems. (I hope) */ -/* */ -/* */ -/* */ -/* */ -/* For the Scrooges out there among you who don't want this thing to loop */ -/* forever (or until the user hits a key), insert this into your compile */ -/* line just after "cc" : */ -/* */ -/* -DNOLOOP */ -/* */ -/* like so: */ -/* */ -/* cc -DNOLOOP -O asciixmas.c -lcurses -o asciixmas -s */ -/* */ -/* */ -/* */ -/******************************************************************************/ - -#include <ncurses.h> -#include <signal.h> - -#define FROMWHO "Mark Hessling - (M.Hessling@gu.edu.au)" - -int y_pos, x_pos; - -WINDOW - *treescrn, *treescrn2,*treescrn3, *treescrn4,*treescrn5, *treescrn6, - *treescrn7, *treescrn8, - *dotdeer0, - *stardeer0, - *lildeer0, *lildeer1, *lildeer2, *lildeer3, - *middeer0, *middeer1, *middeer2, *middeer3, - *bigdeer0, *bigdeer1, *bigdeer2, *bigdeer3, *bigdeer4, - *lookdeer0, *lookdeer1, *lookdeer2, *lookdeer3, *lookdeer4, - *w_holiday, - *w_del_msg; - -void main() -{ - void done(); - int loopy; - - initscr(); - noecho(); - nonl(); - refresh(); - signal(SIGINT,done); - signal(SIGTERM,done); -#if !defined DOS && !defined OS2 - signal(SIGHUP,done); - signal(SIGQUIT,done); -#endif - - - - treescrn = newwin(16,27,3,53); - treescrn2 = newwin(16,27,3,53); - treescrn3 = newwin(16,27,3,53); - treescrn4 = newwin(16,27,3,53); - treescrn5 = newwin(16,27,3,53); - treescrn6 = newwin(16,27,3,53); - treescrn7 = newwin(16,27,3,53); - treescrn8 = newwin(16,27,3,53); - - dotdeer0 = newwin(3,71,0,8); - - stardeer0 = newwin(4,56,0,8); - - lildeer0 = newwin(7,53,0,8); - lildeer1 = newwin(2,4,0,0); - lildeer2 = newwin(2,4,0,0); - lildeer3 = newwin(2,4,0,0); - - middeer0 = newwin(15,42,0,8); - middeer1 = newwin(3,7,0,0); - middeer2 = newwin(3,7,0,0); - middeer3 = newwin(3,7,0,0); - - bigdeer0 = newwin(10,23,0,0); - bigdeer1 = newwin(10,23,0,0); - bigdeer2 = newwin(10,23,0,0); - bigdeer3 = newwin(10,23,0,0); - bigdeer4 = newwin(10,23,0,0); - - lookdeer0 = newwin(10,25,0,0); - lookdeer1 = newwin(10,25,0,0); - lookdeer2 = newwin(10,25,0,0); - lookdeer3 = newwin(10,25,0,0); - lookdeer4 = newwin(10,25,0,0); - - w_holiday = newwin(1,26,3,27); - - w_del_msg = newwin(1,12,23,60); - - mvwaddstr(w_del_msg,0,0,"Hit any key to quit"); - - mvwaddstr(w_holiday,0,0,"H A P P Y H O L I D A Y S"); - - /* set up the windows for our various reindeer */ - - /* lildeer1 */ - mvwaddch(lildeer1,0,0,(chtype)'V'); - mvwaddch(lildeer1,1,0,(chtype)'@'); - mvwaddch(lildeer1,1,1,(chtype)'<'); - mvwaddch(lildeer1,1,2,(chtype)'>'); - mvwaddch(lildeer1,1,3,(chtype)'~'); - - /* lildeer2 */ - mvwaddch(lildeer2,0,0,(chtype)'V'); - mvwaddch(lildeer2,1,0,(chtype)'@'); - mvwaddch(lildeer2,1,1,(chtype)'|'); - mvwaddch(lildeer2,1,2,(chtype)'|'); - mvwaddch(lildeer2,1,3,(chtype)'~'); - - /* lildeer3 */ - mvwaddch(lildeer3,0,0,(chtype)'V'); - mvwaddch(lildeer3,1,0,(chtype)'@'); - mvwaddch(lildeer3,1,1,(chtype)'>'); - mvwaddch(lildeer3,1,2,(chtype)'<'); - mvwaddch(lildeer2,1,3,(chtype)'~'); - - - /* middeer1 */ - mvwaddch(middeer1,0,2,(chtype)'y'); - mvwaddch(middeer1,0,3,(chtype)'y'); - mvwaddch(middeer1,1,2,(chtype)'0'); - mvwaddch(middeer1,1,3,(chtype)'('); - mvwaddch(middeer1,1,4,(chtype)'='); - mvwaddch(middeer1,1,5,(chtype)')'); - mvwaddch(middeer1,1,6,(chtype)'~'); - mvwaddch(middeer1,2,3,(chtype)'\\'); - mvwaddch(middeer1,2,4,(chtype)'/'); - - /* middeer2 */ - mvwaddch(middeer2,0,2,(chtype)'y'); - mvwaddch(middeer2,0,3,(chtype)'y'); - mvwaddch(middeer2,1,2,(chtype)'0'); - mvwaddch(middeer2,1,3,(chtype)'('); - mvwaddch(middeer2,1,4,(chtype)'='); - mvwaddch(middeer2,1,5,(chtype)')'); - mvwaddch(middeer2,1,6,(chtype)'~'); - mvwaddch(middeer2,2,3,(chtype)'|'); - mvwaddch(middeer2,2,5,(chtype)'|'); - - /* middeer3 */ - mvwaddch(middeer3,0,2,(chtype)'y'); - mvwaddch(middeer3,0,3,(chtype)'y'); - mvwaddch(middeer3,1,2,(chtype)'0'); - mvwaddch(middeer3,1,3,(chtype)'('); - mvwaddch(middeer3,1,4,(chtype)'='); - mvwaddch(middeer3,1,5,(chtype)')'); - mvwaddch(middeer3,1,6,(chtype)'~'); - mvwaddch(middeer3,2,2,(chtype)'/'); - mvwaddch(middeer3,2,6,(chtype)'\\'); - - - /* bigdeer1 */ - mvwaddch(bigdeer1,0,17,(chtype)'\\'); - mvwaddch(bigdeer1,0,18,(chtype)'/'); - mvwaddch(bigdeer1,0,20,(chtype)'\\'); - mvwaddch(bigdeer1,0,21,(chtype)'/'); - mvwaddch(bigdeer1,1,18,(chtype)'\\'); - mvwaddch(bigdeer1,1,20,(chtype)'/'); - mvwaddch(bigdeer1,2,19,(chtype)'|'); - mvwaddch(bigdeer1,2,20,(chtype)'_'); - mvwaddch(bigdeer1,3,18,(chtype)'/'); - mvwaddch(bigdeer1,3,19,(chtype)'^'); - mvwaddch(bigdeer1,3,20,(chtype)'0'); - mvwaddch(bigdeer1,3,21,(chtype)'\\'); - mvwaddch(bigdeer1,4,17,(chtype)'/'); - mvwaddch(bigdeer1,4,18,(chtype)'/'); - mvwaddch(bigdeer1,4,19,(chtype)'\\'); - mvwaddch(bigdeer1,4,22,(chtype)'\\'); - mvwaddstr(bigdeer1,5,7,"^~~~~~~~~// ~~U"); - mvwaddstr(bigdeer1,6,7,"( \\_____( /"); - mvwaddstr(bigdeer1,7,8,"( ) /"); - mvwaddstr(bigdeer1,8,9,"\\\\ /"); - mvwaddstr(bigdeer1,9,11,"\\>/>"); - - /* bigdeer2 */ - mvwaddch(bigdeer2,0,17,(chtype)'\\'); - mvwaddch(bigdeer2,0,18,(chtype)'/'); - mvwaddch(bigdeer2,0,20,(chtype)'\\'); - mvwaddch(bigdeer2,0,21,(chtype)'/'); - mvwaddch(bigdeer2,1,18,(chtype)'\\'); - mvwaddch(bigdeer2,1,20,(chtype)'/'); - mvwaddch(bigdeer2,2,19,(chtype)'|'); - mvwaddch(bigdeer2,2,20,(chtype)'_'); - mvwaddch(bigdeer2,3,18,(chtype)'/'); - mvwaddch(bigdeer2,3,19,(chtype)'^'); - mvwaddch(bigdeer2,3,20,(chtype)'0'); - mvwaddch(bigdeer2,3,21,(chtype)'\\'); - mvwaddch(bigdeer2,4,17,(chtype)'/'); - mvwaddch(bigdeer2,4,18,(chtype)'/'); - mvwaddch(bigdeer2,4,19,(chtype)'\\'); - mvwaddch(bigdeer2,4,22,(chtype)'\\'); - mvwaddstr(bigdeer2,5,7,"^~~~~~~~~// ~~U"); - mvwaddstr(bigdeer2,6,7,"(( )____( /"); - mvwaddstr(bigdeer2,7,7,"( / |"); - mvwaddstr(bigdeer2,8,8,"\\/ |"); - mvwaddstr(bigdeer2,9,9,"|> |>"); - - /* bigdeer3 */ - mvwaddch(bigdeer3,0,17,(chtype)'\\'); - mvwaddch(bigdeer3,0,18,(chtype)'/'); - mvwaddch(bigdeer3,0,20,(chtype)'\\'); - mvwaddch(bigdeer3,0,21,(chtype)'/'); - mvwaddch(bigdeer3,1,18,(chtype)'\\'); - mvwaddch(bigdeer3,1,20,(chtype)'/'); - mvwaddch(bigdeer3,2,19,(chtype)'|'); - mvwaddch(bigdeer3,2,20,(chtype)'_'); - mvwaddch(bigdeer3,3,18,(chtype)'/'); - mvwaddch(bigdeer3,3,19,(chtype)'^'); - mvwaddch(bigdeer3,3,20,(chtype)'0'); - mvwaddch(bigdeer3,3,21,(chtype)'\\'); - mvwaddch(bigdeer3,4,17,(chtype)'/'); - mvwaddch(bigdeer3,4,18,(chtype)'/'); - mvwaddch(bigdeer3,4,19,(chtype)'\\'); - mvwaddch(bigdeer3,4,22,(chtype)'\\'); - mvwaddstr(bigdeer3,5,7,"^~~~~~~~~// ~~U"); - mvwaddstr(bigdeer3,6,6,"( ()_____( /"); - mvwaddstr(bigdeer3,7,6,"/ / /"); - mvwaddstr(bigdeer3,8,5,"|/ \\"); - mvwaddstr(bigdeer3,9,5,"/> \\>"); - - /* bigdeer4 */ - mvwaddch(bigdeer4,0,17,(chtype)'\\'); - mvwaddch(bigdeer4,0,18,(chtype)'/'); - mvwaddch(bigdeer4,0,20,(chtype)'\\'); - mvwaddch(bigdeer4,0,21,(chtype)'/'); - mvwaddch(bigdeer4,1,18,(chtype)'\\'); - mvwaddch(bigdeer4,1,20,(chtype)'/'); - mvwaddch(bigdeer4,2,19,(chtype)'|'); - mvwaddch(bigdeer4,2,20,(chtype)'_'); - mvwaddch(bigdeer4,3,18,(chtype)'/'); - mvwaddch(bigdeer4,3,19,(chtype)'^'); - mvwaddch(bigdeer4,3,20,(chtype)'0'); - mvwaddch(bigdeer4,3,21,(chtype)'\\'); - mvwaddch(bigdeer4,4,17,(chtype)'/'); - mvwaddch(bigdeer4,4,18,(chtype)'/'); - mvwaddch(bigdeer4,4,19,(chtype)'\\'); - mvwaddch(bigdeer4,4,22,(chtype)'\\'); - mvwaddstr(bigdeer4,5,7,"^~~~~~~~~// ~~U"); - mvwaddstr(bigdeer4,6,6,"( )______( /"); - mvwaddstr(bigdeer4,7,5,"(/ \\"); - mvwaddstr(bigdeer4,8,0,"v___= ----^"); - - - /* lookdeer1 */ - mvwaddstr(lookdeer1,0,16,"\\/ \\/"); - mvwaddstr(lookdeer1,1,17,"\\Y/ \\Y/"); - mvwaddstr(lookdeer1,2,19,"\\=/"); - mvwaddstr(lookdeer1,3,17,"^\\o o/^"); - mvwaddstr(lookdeer1,4,17,"//( )"); - mvwaddstr(lookdeer1,5,7,"^~~~~~~~~// \\O/"); - mvwaddstr(lookdeer1,6,7,"( \\_____( /"); - mvwaddstr(lookdeer1,7,8,"( ) /"); - mvwaddstr(lookdeer1,8,9,"\\\\ /"); - mvwaddstr(lookdeer1,9,11,"\\>/>"); - - /* lookdeer2 */ - mvwaddstr(lookdeer2,0,16,"\\/ \\/"); - mvwaddstr(lookdeer2,1,17,"\\Y/ \\Y/"); - mvwaddstr(lookdeer2,2,19,"\\=/"); - mvwaddstr(lookdeer2,3,17,"^\\o o/^"); - mvwaddstr(lookdeer2,4,17,"//( )"); - mvwaddstr(lookdeer2,5,7,"^~~~~~~~~// \\O/"); - mvwaddstr(lookdeer2,6,7,"(( )____( /"); - mvwaddstr(lookdeer2,7,7,"( / |"); - mvwaddstr(lookdeer2,8,8,"\\/ |"); - mvwaddstr(lookdeer2,9,9,"|> |>"); - - /* lookdeer3 */ - mvwaddstr(lookdeer3,0,16,"\\/ \\/"); - mvwaddstr(lookdeer3,1,17,"\\Y/ \\Y/"); - mvwaddstr(lookdeer3,2,19,"\\=/"); - mvwaddstr(lookdeer3,3,17,"^\\o o/^"); - mvwaddstr(lookdeer3,4,17,"//( )"); - mvwaddstr(lookdeer3,5,7,"^~~~~~~~~// \\O/"); - mvwaddstr(lookdeer3,6,6,"( ()_____( /"); - mvwaddstr(lookdeer3,7,6,"/ / /"); - mvwaddstr(lookdeer3,8,5,"|/ \\"); - mvwaddstr(lookdeer3,9,5,"/> \\>"); - - /* lookdeer4 */ - mvwaddstr(lookdeer4,0,16,"\\/ \\/"); - mvwaddstr(lookdeer4,1,17,"\\Y/ \\Y/"); - mvwaddstr(lookdeer4,2,19,"\\=/"); - mvwaddstr(lookdeer4,3,17,"^\\o o/^"); - mvwaddstr(lookdeer4,4,17,"//( )"); - mvwaddstr(lookdeer4,5,7,"^~~~~~~~~// \\O/"); - mvwaddstr(lookdeer4,6,6,"( )______( /"); - mvwaddstr(lookdeer4,7,5,"(/ \\"); - mvwaddstr(lookdeer4,8,0,"v___= ----^"); - - - - /***********************************************/ - cbreak(); - nodelay(stdscr,TRUE); - do - { - clear(); - werase(treescrn); - touchwin(treescrn); - werase(treescrn2); - touchwin(treescrn2); - werase(treescrn8); - touchwin(treescrn8); - refresh(); - usleep(1000); - boxit(); - refresh(); - usleep(1000); - seas(); - refresh(); - usleep(1000); - greet(); - refresh(); - usleep(1000); - fromwho(); - refresh(); - usleep(1000); - tree(); - usleep(1000); - balls(); - usleep(1000); - star(); - usleep(1000); - strng1(); - strng2(); - strng3(); - strng4(); - strng5(); - - - /* set up the windows for our blinking trees */ - /* **************************************** */ - /* treescrn3 */ - - overlay(treescrn, treescrn3); - - /*balls*/ - mvwaddch(treescrn3, 4, 18, ' '); - mvwaddch(treescrn3, 7, 6, ' '); - mvwaddch(treescrn3, 8, 19, ' '); - mvwaddch(treescrn3, 11, 22, ' '); - - /*star*/ - mvwaddch(treescrn3, 0, 12, '*'); - - /*strng1*/ - mvwaddch(treescrn3, 3, 11, ' '); - - /*strng2*/ - mvwaddch(treescrn3, 5, 13, ' '); - mvwaddch(treescrn3, 6, 10, ' '); - - /*strng3*/ - mvwaddch(treescrn3, 7, 16, ' '); - mvwaddch(treescrn3, 7, 14, ' '); - - /*strng4*/ - mvwaddch(treescrn3, 10, 13, ' '); - mvwaddch(treescrn3, 10, 10, ' '); - mvwaddch(treescrn3, 11, 8, ' '); - - /*strng5*/ - mvwaddch(treescrn3, 11, 18, ' '); - mvwaddch(treescrn3, 12, 13, ' '); - - - /* treescrn4 */ - - overlay(treescrn, treescrn4); - - /*balls*/ - mvwaddch(treescrn4, 3, 9, ' '); - mvwaddch(treescrn4, 4, 16, ' '); - mvwaddch(treescrn4, 7, 6, ' '); - mvwaddch(treescrn4, 8, 19, ' '); - mvwaddch(treescrn4, 11, 2, ' '); - mvwaddch(treescrn4, 12, 23, ' '); - - /*star*/ - wstandout(treescrn4); - mvwaddch(treescrn4, 0, 12, '*'); - wstandend(treescrn4); - - /*strng1*/ - mvwaddch(treescrn4, 3, 13, ' '); - - /*strng2*/ - - /*strng3*/ - mvwaddch(treescrn4, 7, 15, ' '); - mvwaddch(treescrn4, 8, 11, ' '); - - /*strng4*/ - mvwaddch(treescrn4, 9, 16, ' '); - mvwaddch(treescrn4, 10, 12, ' '); - mvwaddch(treescrn4, 11, 8, ' '); - - /*strng5*/ - mvwaddch(treescrn4, 11, 18, ' '); - mvwaddch(treescrn4, 12, 14, ' '); - - - /* treescrn5 */ - - overlay(treescrn, treescrn5); - - /*balls*/ - mvwaddch(treescrn5, 3, 15, ' '); - mvwaddch(treescrn5, 10, 20, ' '); - mvwaddch(treescrn5, 12, 1, ' '); - - /*star*/ - mvwaddch(treescrn5, 0, 12, '*'); - - /*strng1*/ - mvwaddch(treescrn5, 3, 11, ' '); - - /*strng2*/ - mvwaddch(treescrn5, 5, 12, ' '); - - /*strng3*/ - mvwaddch(treescrn5, 7, 14, ' '); - mvwaddch(treescrn5, 8, 10, ' '); - - /*strng4*/ - mvwaddch(treescrn5, 9, 15, ' '); - mvwaddch(treescrn5, 10, 11, ' '); - mvwaddch(treescrn5, 11, 7, ' '); - - /*strng5*/ - mvwaddch(treescrn5, 11, 17, ' '); - mvwaddch(treescrn5, 12, 13, ' '); - - /* treescrn6 */ - - overlay(treescrn, treescrn6); - - /*balls*/ - mvwaddch(treescrn6, 6, 7, ' '); - mvwaddch(treescrn6, 7, 18, ' '); - mvwaddch(treescrn6, 10, 4, ' '); - mvwaddch(treescrn6, 11, 23, ' '); - - /*star*/ - wstandout(treescrn6); - mvwaddch(treescrn6, 0, 12, '*'); - wstandend(treescrn6); - - /*strng1*/ - - /*strng2*/ - mvwaddch(treescrn6, 5, 11, ' '); - - /*strng3*/ - mvwaddch(treescrn6, 7, 13, ' '); - mvwaddch(treescrn6, 8, 9, ' '); - - /*strng4*/ - mvwaddch(treescrn6, 9, 14, ' '); - mvwaddch(treescrn6, 10, 10, ' '); - mvwaddch(treescrn6, 11, 6, ' '); - - /*strng5*/ - mvwaddch(treescrn6, 11, 16, ' '); - mvwaddch(treescrn6, 12, 12, ' '); - - /* treescrn7 */ - - overlay(treescrn, treescrn7); - - /*balls*/ - mvwaddch(treescrn7, 3, 15, ' '); - mvwaddch(treescrn7, 6, 7, ' '); - mvwaddch(treescrn7, 7, 18, ' '); - mvwaddch(treescrn7, 10, 4, ' '); - mvwaddch(treescrn7, 11, 22, ' '); - - /*star*/ - mvwaddch(treescrn7, 0, 12, '*'); - - /*strng1*/ - mvwaddch(treescrn7, 3, 12, ' '); - - /*strng2*/ - mvwaddch(treescrn7, 5, 13, ' '); - mvwaddch(treescrn7, 6, 9, ' '); - - /*strng3*/ - mvwaddch(treescrn7, 7, 15, ' '); - mvwaddch(treescrn7, 8, 11, ' '); - - /*strng4*/ - mvwaddch(treescrn7, 9, 16, ' '); - mvwaddch(treescrn7, 10, 12, ' '); - mvwaddch(treescrn7, 11, 8, ' '); - - /*strng5*/ - mvwaddch(treescrn7, 11, 18, ' '); - mvwaddch(treescrn7, 12, 14, ' '); - - - usleep(1000); - reindeer(); - - touchwin(w_holiday); - wrefresh(w_holiday); - wrefresh(w_del_msg); - - usleep(1000); - for(loopy = 0;loopy < 100;loopy++) - { - blinkit(); - } - -#ifdef NOLOOP - done(); -#endif - - } - while(getch() == (ERR)); -/* while(!typeahead(stdin));*/ - done(); -} - -boxit() -{ - int x = 0; - - while(x < 20) - { - mvaddch(x, 7, '|'); - ++x; - } - - x = 8; - - while(x < 80) - { - mvaddch(19, x, '_'); - ++x; - } - - x = 0; - - while(x < 80) - { - mvaddch(22, x, '_'); - ++x; - } - - return( 0 ); -} - -seas() -{ - mvaddch(4, 1, 'S'); - mvaddch(6, 1, 'E'); - mvaddch(8, 1, 'A'); - mvaddch(10, 1, 'S'); - mvaddch(12, 1, 'O'); - mvaddch(14, 1, 'N'); - mvaddch(16, 1, '`'); - mvaddch(18, 1, 'S'); - - return( 0 ); -} - - -greet() -{ - mvaddch(3, 5, 'G'); - mvaddch(5, 5, 'R'); - mvaddch(7, 5, 'E'); - mvaddch(9, 5, 'E'); - mvaddch(11, 5, 'T'); - mvaddch(13, 5, 'I'); - mvaddch(15, 5, 'N'); - mvaddch(17, 5, 'G'); - mvaddch(19, 5, 'S'); - - return( 0 ); -} - - -fromwho() -{ - mvaddstr(21, 13, FROMWHO); - return( 0 ); -} - - -del_msg() -{ - mvwaddstr(w_del_msg, 0, 0, "Hit any key to quit"); - wrefresh(w_del_msg); - - refresh(); - - return( 0 ); -} - - -tree() -{ - mvwaddch(treescrn, 1, 11, (chtype)'/'); - mvwaddch(treescrn, 2, 11, (chtype)'/'); - mvwaddch(treescrn, 3, 10, (chtype)'/'); - mvwaddch(treescrn, 4, 9, (chtype)'/'); - mvwaddch(treescrn, 5, 9, (chtype)'/'); - mvwaddch(treescrn, 6, 8, (chtype)'/'); - mvwaddch(treescrn, 7, 7, (chtype)'/'); - mvwaddch(treescrn, 8, 6, (chtype)'/'); - mvwaddch(treescrn, 9, 6, (chtype)'/'); - mvwaddch(treescrn, 10, 5, (chtype)'/'); - mvwaddch(treescrn, 11, 3, (chtype)'/'); - mvwaddch(treescrn, 12, 2, (chtype)'/'); - - mvwaddch(treescrn, 1, 13, (chtype)'\\'); - mvwaddch(treescrn, 2, 13, (chtype)'\\'); - mvwaddch(treescrn, 3, 14, (chtype)'\\'); - mvwaddch(treescrn, 4, 15, (chtype)'\\'); - mvwaddch(treescrn, 5, 15, (chtype)'\\'); - mvwaddch(treescrn, 6, 16, (chtype)'\\'); - mvwaddch(treescrn, 7, 17, (chtype)'\\'); - mvwaddch(treescrn, 8, 18, (chtype)'\\'); - mvwaddch(treescrn, 9, 18, (chtype)'\\'); - mvwaddch(treescrn, 10, 19, (chtype)'\\'); - mvwaddch(treescrn, 11, 21, (chtype)'\\'); - mvwaddch(treescrn, 12, 22, (chtype)'\\'); - - mvwaddch(treescrn, 4, 10, (chtype)'_'); - mvwaddch(treescrn, 4, 14, (chtype)'_'); - mvwaddch(treescrn, 8, 7, (chtype)'_'); - mvwaddch(treescrn, 8, 17, (chtype)'_'); - - mvwaddstr(treescrn, 13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\"); - - mvwaddstr(treescrn, 14, 11, "| |"); - mvwaddstr(treescrn, 15, 11, "|_|"); - - wrefresh(treescrn); - wrefresh(w_del_msg); - - return( 0 ); -} - - -balls() -{ - - overlay(treescrn, treescrn2); - - mvwaddch(treescrn2, 3, 9, (chtype)'@'); - mvwaddch(treescrn2, 3, 15, (chtype)'@'); - mvwaddch(treescrn2, 4, 8, (chtype)'@'); - mvwaddch(treescrn2, 4, 16, (chtype)'@'); - mvwaddch(treescrn2, 5, 7, (chtype)'@'); - mvwaddch(treescrn2, 5, 17, (chtype)'@'); - mvwaddch(treescrn2, 7, 6, (chtype)'@'); - mvwaddch(treescrn2, 7, 18, (chtype)'@'); - mvwaddch(treescrn2, 8, 5, (chtype)'@'); - mvwaddch(treescrn2, 8, 19, (chtype)'@'); - mvwaddch(treescrn2, 10, 4, (chtype)'@'); - mvwaddch(treescrn2, 10, 20, (chtype)'@'); - mvwaddch(treescrn2, 11, 2, (chtype)'@'); - mvwaddch(treescrn2, 11, 22, (chtype)'@'); - mvwaddch(treescrn2, 12, 1, (chtype)'@'); - mvwaddch(treescrn2, 12, 23, (chtype)'@'); - - wrefresh(treescrn2); - wrefresh(w_del_msg); - return( 0 ); -} - - -star() -{ - wstandout(treescrn2); - mvwaddch(treescrn2, 0, 12, (chtype)'*'); - wstandend(treescrn2); - - wrefresh(treescrn2); - wrefresh(w_del_msg); - return( 0 ); -} - - -strng1() -{ - mvwaddch(treescrn2, 3, 13, (chtype)'\''); - mvwaddch(treescrn2, 3, 12, (chtype)':'); - mvwaddch(treescrn2, 3, 11, (chtype)'.'); - - wrefresh(treescrn2); - wrefresh(w_del_msg); - return( 0 ); -} - - -strng2() -{ - mvwaddch(treescrn2, 5, 14, (chtype)'\''); - mvwaddch(treescrn2, 5, 13, (chtype)':'); - mvwaddch(treescrn2, 5, 12, (chtype)'.'); - mvwaddch(treescrn2, 5, 11, (chtype)','); - mvwaddch(treescrn2, 6, 10, (chtype)'\''); - mvwaddch(treescrn2, 6, 9, (chtype)':'); - - wrefresh(treescrn2); - wrefresh(w_del_msg); - return( 0 ); -} - - -strng3() -{ - mvwaddch(treescrn2, 7, 16, (chtype)'\''); - mvwaddch(treescrn2, 7, 15, (chtype)':'); - mvwaddch(treescrn2, 7, 14, (chtype)'.'); - mvwaddch(treescrn2, 7, 13, (chtype)','); - mvwaddch(treescrn2, 8, 12, (chtype)'\''); - mvwaddch(treescrn2, 8, 11, (chtype)':'); - mvwaddch(treescrn2, 8, 10, (chtype)'.'); - mvwaddch(treescrn2, 8, 9, (chtype)','); - - wrefresh(treescrn2); - wrefresh(w_del_msg); - return( 0 ); -} - - -strng4() -{ - mvwaddch(treescrn2, 9, 17, (chtype)'\''); - mvwaddch(treescrn2, 9, 16, (chtype)':'); - mvwaddch(treescrn2, 9, 15, (chtype)'.'); - mvwaddch(treescrn2, 9, 14, (chtype)','); - mvwaddch(treescrn2, 10, 13, (chtype)'\''); - mvwaddch(treescrn2, 10, 12, (chtype)':'); - mvwaddch(treescrn2, 10, 11, (chtype)'.'); - mvwaddch(treescrn2, 10, 10, (chtype)','); - mvwaddch(treescrn2, 11, 9, (chtype)'\''); - mvwaddch(treescrn2, 11, 8, (chtype)':'); - mvwaddch(treescrn2, 11, 7, (chtype)'.'); - mvwaddch(treescrn2, 11, 6, (chtype)','); - mvwaddch(treescrn2, 12, 5, (chtype)'\''); - - wrefresh(treescrn2); - wrefresh(w_del_msg); - return( 0 ); -} - - -strng5() -{ - mvwaddch(treescrn2, 11, 19, (chtype)'\''); - mvwaddch(treescrn2, 11, 18, (chtype)':'); - mvwaddch(treescrn2, 11, 17, (chtype)'.'); - mvwaddch(treescrn2, 11, 16, (chtype)','); - mvwaddch(treescrn2, 12, 15, (chtype)'\''); - mvwaddch(treescrn2, 12, 14, (chtype)':'); - mvwaddch(treescrn2, 12, 13, (chtype)'.'); - mvwaddch(treescrn2, 12, 12, (chtype)','); - - /* save a fully lit tree */ - overlay(treescrn2, treescrn); - - wrefresh(treescrn2); - wrefresh(w_del_msg); - return( 0 ); -} - - - -blinkit() -{ - static int cycle; - - if(cycle > 4) - { - cycle = 0; - } - - - touchwin(treescrn8); - - switch(cycle) - { - - case 0: - overlay(treescrn3, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); - - break; - case 1: - overlay(treescrn4, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); - - break; - case 2: - overlay(treescrn5, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); - - break; - case 3: - overlay(treescrn6, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); - - break; - case 4: - overlay(treescrn7, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); - - break; - } - - touchwin(treescrn8); - - - - /*ALL ON***************************************************/ - - - overlay(treescrn, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); - - - ++cycle; - return( 0 ); -} - - -reindeer() -{ - int looper; - - y_pos = 0; - - - for(x_pos = 70; x_pos > 62; x_pos--) - { - if(x_pos < 62) - { - y_pos = 1; - } - for(looper = 0; looper < 4; looper++) - { - mvwaddch(dotdeer0, y_pos, x_pos, (chtype)'.'); - wrefresh(dotdeer0); - wrefresh(w_del_msg); - werase(dotdeer0); - wrefresh(dotdeer0); - wrefresh(w_del_msg); - } - } - - y_pos = 2; - - for(; x_pos > 50; x_pos--) - { - - for(looper = 0; looper < 4; looper++) - { - - if(x_pos < 56) - { - y_pos = 3; - - mvwaddch(stardeer0, y_pos, x_pos, (chtype)'*'); - wrefresh(stardeer0); - wrefresh(w_del_msg); - werase(stardeer0); - wrefresh(stardeer0); - wrefresh(w_del_msg); - } - else - { - mvwaddch(dotdeer0, y_pos, x_pos, (chtype)'*'); - wrefresh(dotdeer0); - wrefresh(w_del_msg); - werase(dotdeer0); - wrefresh(dotdeer0); - wrefresh(w_del_msg); - } - } - } - - x_pos = 58; - - for(y_pos = 2; y_pos < 5; y_pos++) - { - - touchwin(lildeer0); - wrefresh(lildeer0); - wrefresh(w_del_msg); - - for(looper = 0; looper < 4; looper++) - { - mvwin(lildeer3, y_pos, x_pos); - wrefresh(lildeer3); - wrefresh(w_del_msg); - - mvwin(lildeer2, y_pos, x_pos); - wrefresh(lildeer2); - wrefresh(w_del_msg); - - mvwin(lildeer1, y_pos, x_pos); - wrefresh(lildeer1); - wrefresh(w_del_msg); - - mvwin(lildeer2, y_pos, x_pos); - wrefresh(lildeer2); - wrefresh(w_del_msg); - - mvwin(lildeer3, y_pos, x_pos); - wrefresh(lildeer3); - wrefresh(w_del_msg); - - touchwin(lildeer0); - wrefresh(lildeer0); - wrefresh(w_del_msg); - - x_pos -= 2; - } - } - - - x_pos = 35; - - for(y_pos = 5; y_pos < 10; y_pos++) - { - - touchwin(middeer0); - wrefresh(middeer0); - wrefresh(w_del_msg); - - for(looper = 0; looper < 2; looper++) - { - mvwin(middeer3, y_pos, x_pos); - wrefresh(middeer3); - wrefresh(w_del_msg); - - mvwin(middeer2, y_pos, x_pos); - wrefresh(middeer2); - wrefresh(w_del_msg); - - mvwin(middeer1, y_pos, x_pos); - wrefresh(middeer1); - wrefresh(w_del_msg); - - mvwin(middeer2, y_pos, x_pos); - wrefresh(middeer2); - wrefresh(w_del_msg); - - mvwin(middeer3, y_pos, x_pos); - wrefresh(middeer3); - wrefresh(w_del_msg); - - touchwin(middeer0); - wrefresh(middeer0); - wrefresh(w_del_msg); - - x_pos -= 3; - } - } - - usleep(2000); - - y_pos = 1; - - for(x_pos = 8; x_pos < 16; x_pos++) - { - - mvwin(bigdeer4, y_pos, x_pos); - wrefresh(bigdeer4); - wrefresh(w_del_msg); - - mvwin(bigdeer3, y_pos, x_pos); - wrefresh(bigdeer3); - wrefresh(w_del_msg); - - mvwin(bigdeer2, y_pos, x_pos); - wrefresh(bigdeer2); - wrefresh(w_del_msg); - - mvwin(bigdeer1, y_pos, x_pos); - wrefresh(bigdeer1); - wrefresh(w_del_msg); - - mvwin(bigdeer2, y_pos, x_pos); - wrefresh(bigdeer2); - wrefresh(w_del_msg); - - mvwin(bigdeer3, y_pos, x_pos); - wrefresh(bigdeer3); - wrefresh(w_del_msg); - - mvwin(bigdeer4, y_pos, x_pos); - wrefresh(bigdeer4); - wrefresh(w_del_msg); - - mvwin(bigdeer0, y_pos, x_pos); - wrefresh(bigdeer0); - wrefresh(w_del_msg); - } - - --x_pos; - - for(looper = 0; looper < 6; looper++) - { - mvwin(lookdeer4, y_pos, x_pos); - wrefresh(lookdeer4); - wrefresh(w_del_msg); - - mvwin(lookdeer3, y_pos, x_pos); - wrefresh(lookdeer3); - wrefresh(w_del_msg); - - mvwin(lookdeer2, y_pos, x_pos); - wrefresh(lookdeer2); - wrefresh(w_del_msg); - - mvwin(lookdeer1, y_pos, x_pos); - wrefresh(lookdeer1); - wrefresh(w_del_msg); - - mvwin(lookdeer2, y_pos, x_pos); - wrefresh(lookdeer2); - wrefresh(w_del_msg); - - mvwin(lookdeer3, y_pos, x_pos); - wrefresh(lookdeer3); - wrefresh(w_del_msg); - - mvwin(lookdeer4, y_pos, x_pos); - wrefresh(lookdeer4); - wrefresh(w_del_msg); - - } - - mvwin(lookdeer0, y_pos, x_pos); - wrefresh(lookdeer0); - wrefresh(w_del_msg); - - for(; y_pos < 10; y_pos++) - { - - for(looper = 0; looper < 2; looper++) - { - mvwin(bigdeer4, y_pos, x_pos); - wrefresh(bigdeer4); - wrefresh(w_del_msg); - - mvwin(bigdeer3, y_pos, x_pos); - wrefresh(bigdeer3); - wrefresh(w_del_msg); - - mvwin(bigdeer2, y_pos, x_pos); - wrefresh(bigdeer2); - wrefresh(w_del_msg); - - mvwin(bigdeer1, y_pos, x_pos); - wrefresh(bigdeer1); - wrefresh(w_del_msg); - - mvwin(bigdeer2, y_pos, x_pos); - wrefresh(bigdeer2); - wrefresh(w_del_msg); - - mvwin(bigdeer3, y_pos, x_pos); - wrefresh(bigdeer3); - wrefresh(w_del_msg); - - mvwin(bigdeer4, y_pos, x_pos); - wrefresh(bigdeer4); - wrefresh(w_del_msg); - } - mvwin(bigdeer0, y_pos, x_pos); - wrefresh(bigdeer0); - wrefresh(w_del_msg); - } - - --y_pos; - - mvwin(lookdeer3, y_pos, x_pos); - wrefresh(lookdeer3); - wrefresh(w_del_msg); - return( 0 ); -} - - - -void done() -{ - signal(SIGINT,done); - signal(SIGTERM,done); -#if !defined DOS && !defined OS2 - signal(SIGHUP,done); - signal(SIGQUIT,done); -#endif - clear(); - refresh(); - endwin(); - exit(0); -} diff --git a/lib/libncurses/copyright.c b/lib/libncurses/copyright.c deleted file mode 100644 index 5964afc79c5a..000000000000 --- a/lib/libncurses/copyright.c +++ /dev/null @@ -1,19 +0,0 @@ -char _ncurses_copyright[] = "\n\ -/*************************************************************************** -* COPYRIGHT NOTICE * -**************************************************************************** -* ncurses is copyright (C) 1992, 1993, 1994 * -* by Zeyd M. Ben-Halim * -* zmbenhal@netcom.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, not removed * -* from header files, and is reproduced in any documentation * -* accompanying it or the applications linked with it. * -* * -* ncurses comes AS IS with no warranty, implied or expressed. * -* * -***************************************************************************/ -\n"; diff --git a/lib/libncurses/curs_addch.3 b/lib/libncurses/curs_addch.3 deleted file mode 100644 index f0e72a141c5b..000000000000 --- a/lib/libncurses/curs_addch.3 +++ /dev/null @@ -1,115 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_addch 3 "" -.SH NAME -\fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR, -\fBechochar\fR, -\fBwechochar\fR - add a character (with attributes) to a \fBncurses\fR window, then advance the cursor -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBaddch(chtype ch);\fR -.br -\fBwaddch(WINDOW *win, chtype ch);\fR -.br -\fBmvaddch(int y, int x, chtype ch);\fR -.br -\fBmvwaddch(WINDOW *win, int y, int x, chtype ch);\fR -.br -\fBechochar(chtype ch);\fR -.br -\fBwechochar(WINDOW *win, chtype ch);\fR -.br -.SH DESCRIPTION -The \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR and \fBmvwaddch\fR routines put -the character \fIch\fR into the given window at its current window position, -which is then advanced. They are analogous to \fBputchar\fR in \fBstdio\fR(3). -If the advance is at the right margin, the cursor automatically wraps to the -beginning of the next line. At the bottom of the scrolling region, if -\fBscrollok\fR is enabled, the scrolling region is scrolled up one line. - -If \fIch\fR is a tab, newline, or backspace, the cursor is moved appropriately -within the window. A newline also does a \fBclrtoeol\fR before moving. Tabs -are considered to be at every eighth column. - -If \fIch\fR is any control character other than tab, newline, or backspace, it -is drawn in \fB^\fR\fIX\fR notation. Calling \fBwinch\fR after adding a -control character does not return the control character, but instead returns -the representation of the control character. (To emit control characters -literally, use \fBechochar\fR.) - -Video attributes can be combined with a character by OR-ing them into the -parameter. This results in these attributes also being set. (The intent here -is that text, including attributes, can be copied from one place to another -using \fBinch\fR and \fBaddch\fR.) [see \fBstandout\fR, predefined video -attribute constants, on the curs_attr(3) page]. - -The \fBechochar\fR and \fBwechochar\fR routines are functionally equivalent to -a call to \fBaddch\fR followed by a call to \fBrefresh\fR, or a call to -\fBwaddch\fR followed by a call to \fBwrefresh\fR. The knowledge that only a -single character is being output is taken into consideration and, for -non-control characters, a considerable performance gain might be seen by using -these routines instead of their equivalents. -.SS Line Graphics -The following variables may be used to add line drawing characters to the -screen with routines of the \fBaddch\fR family. The default character listed -below is used if the \fBacsc\fR capability doesn't define a terminal-specific -replacement for it. The names are taken from the VT100 nomenclature. - -.TS -l l l -_ _ _ -l l l. -\fIName\fR \fIDefault\fR \fIDescription\fR -ACS_ULCORNER + upper left-hand corner -ACS_LLCORNER + lower left-hand corner -ACS_URCORNER + upper right-hand corner -ACS_LRCORNER + lower right-hand corner -ACS_RTEE + right tee -ACS_LTEE + left tee -ACS_BTEE + bottom tee -ACS_TTEE + top tee -ACS_HLINE - horizontal line -ACS_VLINE | vertical line -ACS_PLUS + plus -ACS_S1 - scan line 1 -ACS_S9 \&_ scan line 9 -ACS_DIAMOND + diamond -ACS_CKBOARD : checker board (stipple) -ACS_DEGREE ' degree symbol -ACS_PLMINUS # plus/minus -ACS_BULLET o bullet -ACS_LARROW < arrow pointing left -ACS_RARROW > arrow pointing right -ACS_DARROW v arrow pointing down -ACS_UARROW ^ arrow pointing up -ACS_BOARD # board of squares -ACS_LANTERN # lantern symbol -ACS_BLOCK # solid square block -.TE - -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion, unless otherwise noted in the -preceding routine descriptions. -.SH BUGS -.SH NOTES -Note that \fBaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR, and -\fBechochar\fR may be macros. - -On 386 and 486 consoles, giving \fBwechochar\fR an argument with its high -bit set will produce the corresponding high-half ASCIIZ graphic (SVr4 curses -also has this feature but does not document it). A control-character argument, -however, will not typically produce the corresponding graphic; -characters such as CR, NL, FF and TAB are typically interpreted by the console -driver itself, and ESC will be interpreted as the leader of a control sequence. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_attr\fR(3), \fBcurs_clear\fR(3), -\fBcurs_inch\fR(3), \fBcurs_outopts\fR(3), \fBcurs_refresh\fR(3), -\fBputc\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_addchst.3 b/lib/libncurses/curs_addchst.3 deleted file mode 100644 index c21d6748d711..000000000000 --- a/lib/libncurses/curs_addchst.3 +++ /dev/null @@ -1,51 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_addchstr 3 "" -.SH NAME -\fBaddchstr\fR, \fBaddchnstr\fR, \fBwaddchstr\fR, -\fBwaddchnstr\fR, \fBmvaddchstr\fR, \fBmvaddchnstr\fR, \fBmvwaddchstr\fR, -\fBmvwaddchnstr\fR - add string of characters (and attributes) to a \fBncurses\fR window -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint addchstr(chtype *chstr);\fR -.br -\fBint addchnstr(chtype *chstr, int n);\fR -.br -\fBint waddchstr(WINDOW *win, chtype *chstr);\fR -.br -\fBint waddchnstr(WINDOW *win, chtype *chstr, int n);\fR -.br -\fBint mvaddchstr(int y, int x, chtype *chstr);\fR -.br -\fBint mvaddchnstr(int y, int x, chtype *chstr, int n);\fR -.br -\fBint mvwaddchstr(WINDOW *win, int y, int x, chtype *chstr);\fR -.br -\fBint mvwaddchnstr(WINDOW *win, int y, int x, chtype *chstr, int n);\fR -.SH DESCRIPTION -These routines copy \fIchstr\fR into the window image structure at and after -the current cursor position. The four routines with \fIn\fR as the last -argument copy at most \fIn\fR elements, but no more than will fit on the line. -If \fBn\fR=\fB-1\fR then the whole string is copied, to the maximum number of -characters that will fit on the line. - -The window cursor is \fINOT\fR advanced, and these routines work faster than -\fBwaddnstr\fR. On the other hand, care must be taken when using them because -they don't perform any kind of checking (such as for the newline character), -they don't advance the current cursor position, and they truncate the string if -it crosses the right margin, rather then wrapping it around to the new line. -.SH RETURN VALUES -All these routines return the integer \fBERR\fR upon failure and an integer -value other than \fBERR\fR upon successful completion, unless -otherwise noted in the preceding routine descriptions. -.SH NOTES -Note that all routines except \fBwaddchnstr\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_addstr.3 b/lib/libncurses/curs_addstr.3 deleted file mode 100644 index a4c11bbd90a5..000000000000 --- a/lib/libncurses/curs_addstr.3 +++ /dev/null @@ -1,46 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_addstr 3 "" -.SH NAME -\fBaddstr\fR, \fBaddnstr\fR, \fBwaddstr\fR, \fBwaddnstr\fR, -\fBmvaddstr\fR, \fBmvaddnstr\fR, \fBmvwaddstr\fR, -\fBmvwaddnstr\fR - add a string of characters to a \fBncurses\fR window and advance cursor -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint addstr(char *str);\fR -.br -\fBint addnstr(char *str, int n);\fR -.br -\fBint waddstr(WINDOW *win, char *str);\fR -.br -\fBint waddnstr(WINDOW *win, char *str, int n);\fR -.br -\fBint mvaddstr(int y, int x, char *str);\fR -.br -\fBint mvaddnstr(int y, int x, char *str, int n);\fR -.br -\fBint mvwaddstr(WINDOW *win, int y, int x, char *str);\fR -.br -\fBint mvwaddnstr(WINDOW *win, int y, int x, char *str, - int n);\fR -.SH DESCRIPTION -These routines write the characters of the null terminated character string -\fIstr\fR on the given window. It is similar to calling \fBwaddch\fR once for -each character in the string. The four routines with \fIn\fR as the last -argument write at most \fIn\fR characters. If \fIn\fR is negative, then the -entire string will be added. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH NOTES -Note that all of these routines except \fBwaddstr\fR and \fBwaddnstr\fR may be -macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_addch\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_attr.3 b/lib/libncurses/curs_attr.3 deleted file mode 100644 index 0fb284b04b7e..000000000000 --- a/lib/libncurses/curs_attr.3 +++ /dev/null @@ -1,86 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_attr 3 "" -.SH NAME -\fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR, -\fBattrset\fR, \fBwattrset\fR, \fBstandend\fR, \fBwstandend\fR, \fBstandout\fR, -\fBwstandout\fR - \fBncurses\fR character and window attribute control routines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR -.br -\fBint attroff(int attrs);\fR -.br -\fBint wattroff(WINDOW *win, int attrs);\fR -.br -\fBint attron(int attrs);\fR -.br -\fBint wattron(WINDOW *win, int attrs);\fR -.br -\fBint attrset(int attrs);\fR -.br -\fBint wattrset(WINDOW *win, int attrs);\fR -.br -\fBint standend(void);\fR -.br -\fBint wstandend(WINDOW *win);\fR -.br -\fBint standout(void);\fR -.br -\fBint wstandout(WINDOW *win);\fR -.br -.SH DESCRIPTION -These routines manipulate the current attributes of the named window. The -current attributes of a window apply to all characters that are written into -the window with \fBwaddch\fR, \fBwaddstr\fR and \fBwprintw\fR. Attributes are -a property of the character, and move with the character through any scrolling -and insert/delete line/character operations. To the extent possible, they are -displayed as appropriate modifications to the graphic rendition of characters -put on the screen. - -The routine \fBattrset\fR sets the current attributes of the given window to -\fIattrs\fR. The routine \fBattroff\fR turns off the named attributes without -turning any other attributes on or off. The routine \fBattron\fR turns on the -named attributes without affecting any others. The routine \fBstandout\fR is -the same as \fBattron(A_STANDOUT)\fR. The routine \fBstandend\fR is the same -as \fBattrset(A_NORMAL)\fR or \fBattrset(0)\fR, that is, it turns off all -attributes. -.SS Attributes -The following video attributes, defined in \fB<ncurses.h>\fR, can be passed to -the routines \fBattron\fR, \fBattroff\fR, and \fBattrset\fR, or OR-ed with the -characters passed to \fBaddch\fR. - -.nf -\fBA_NORMAL\fR Normal display (no highlight) -\fBA_STANDOUT\fR Best highlighting mode of the terminal. -\fBA_UNDERLINE\fR Underlining -\fBA_REVERSE\fR Reverse video -\fBA_BLINK\fR Blinking -\fBA_DIM\fR Half bright -\fBA_BOLD\fR Extra bright or bold -\fBA_ALTCHARSET\fR Alternate character set -\fBA_CHARTEXT\fR Bit-mask to extract a character -\fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR Color-pair number \fIn\fR -.fi - -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 - with the \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR attribute. -.DE - -The return values of these routines are not meaningful (many are implemented -as macro-expanded assignments and simply return their argument). The SVr4 -manual page claims (falsely) that these routines always return \fB1\fR. -.SH NOTES -Note that \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR, -\fBattrset\fR, \fBwattrset\fR, \fBstandend\fR and \fBstandout\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_addch\fR(3), \fBcurs_addstr\fR(3), -\fBcurs_printw\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_beep.3 b/lib/libncurses/curs_beep.3 deleted file mode 100644 index dfcb94ea5ade..000000000000 --- a/lib/libncurses/curs_beep.3 +++ /dev/null @@ -1,31 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_beep 3 "" -.SH NAME -\fBbeep\fR, \fBflash\fR - \fBncurses\fR bell and screen flash routines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint beep(void);\fR -.br -\fBint flash(void);\fR -.br -.SH DESCRIPTION -The \fBbeep\fR and \fBflash\fR routines are used to alert the terminal user. -The routine \fBbeep\fR sounds an audible alarm on the terminal, if possible; -otherwise it flashes the screen (visible bell). The routine \fBflash\fR -flashes the screen, and if that is not possible, sounds the alert. If neither -alert is possible, nothing happens. Nearly all terminals have an audible alert -(bell or beep), but only some can flash the screen. -.SH RETURN VALUE -These routines always return \fBOK\fR. -.SH CAPABILITIES -\fBbell\fR, \fBflash_screen\fR. -.SH SEE ALSO -\fBncurses\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_bkgd.3 b/lib/libncurses/curs_bkgd.3 deleted file mode 100644 index 378535e40966..000000000000 --- a/lib/libncurses/curs_bkgd.3 +++ /dev/null @@ -1,52 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_bkgd 3 "" -.SH NAME -\fBbkgdset\fR, \fBwbkgdset\fR, \fBbkgd\fR, -\fBwbkgd\fR - \fBncurses\fR window background manipulation routines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBvoid bkgdset(chtype ch);\fR -.br -\fBvoid wbkgdset(WINDOW *win, chtype ch);\fR -.br -\fBint bkgd(chtype ch);\fR -.br -\fBint wbkgd(WINDOW *win, chtype ch);\fR -.br -.SH DESCRIPTION -The \fBbkgdset\fR and \fBwbkgdset\fR routines manipulate the -background of the named window. Background is a \fBchtype\fR -consisting of any combination of attributes and a character. The -attribute part of the background is combined (ORed) with all non-blank -characters that are written into the window with \fBwaddch\fR. Both -the character and attribute parts of the background are combined with -the blank characters. The background becomes a property of the -character and moves with the character through any scrolling and -insert/delete line/character operations. To the extent possible on a -particular terminal, the attribute part of the background is displayed -as the graphic rendition of the character put on the screen. - -The \fBbkgd\fR and \fBwbkgd\fR routines combine the new background -with every position in the window. Background is any combination of -attributes and a character. Only the attribute part is used to set -the background of non-blank characters, while both character and -attributes are used for blank positions. To the extent possible on a -particular terminal, the attribute part of the background is displayed -as the graphic rendition of the character put on the screen. -.SH RETURN VALUE -\fBbkgd\fR and \fBwbkgd\fR return the integer \fBOK\fR, or a -non-negative integer, if \fBimmedok\fR is set. -.SH NOTES -Note that \fBbkgdset\fR and \fBbkgd\fR may be macros. -.SH BUGS -\fBimmedok\fR is not yet implemented in ncurses 1.8.6. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_addch\fR(3), \fBcurs_outopts\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_border.3 b/lib/libncurses/curs_border.3 deleted file mode 100644 index 732a1d71ad2c..000000000000 --- a/lib/libncurses/curs_border.3 +++ /dev/null @@ -1,69 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_border 3 "" -.SH NAME -\fBborder\fR, \fBwborder\fR, \fBbox\fR, -\fBhline\fR, \fBwhline\fR, \fBvline\fR, -\fBwvline\fR - create \fBncurses\fR borders, horizontal and vertical lines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR -.br -\fBint border(chtype ls, chtype rs, chtype ts, chtype bs, - chtype 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 -.br -\fBint box(WINDOW *win, chtype verch, chtype horch);\fR -.br -\fBint hline(chtype ch, int n);\fR -.br -\fBint whline(WINDOW *win, chtype ch, int n);\fR -.br -\fBint vline(chtype ch, int n);\fR -.br -\fBint wvline(WINDOW *win, chtype ch, int n);\fR -.br -.SH DESCRIPTION -The \fBborder\fR, \fBwborder\fR and \fBbox\fR routines draw a box around the -edges of a window. The argument \fIls\fR is a character and attributes used -for the left side of the border, \fIrs\fR - right side, \fIts\fR - top side, -\fIbs\fR - bottom side, \fItl\fR - top left-hand corner, \fItr\fR - top -right-hand corner, \fIbl\fR - bottom left-hand corner, and \fIbr\fR - bottom -right-hand corner. If any of these arguments is zero, then the following -default values (defined in \fBncurses.h\fR) are used instead: \fBACS_VLINE, -ACS_VLINE, ACS_HLINE, ACS_HLINE, \fBACS_ULCORNER, ACS_URCORNER, ACS_LLCORNER, -ACS_LRCORNER.\fR - -\fBbox(\fR\fIwin\fR\gB, \fR\fIverch\fR\fB, \fR\fIhorch\fR\fB)\fR is a shorthand -for the following call: \fBwborder(\fR\fIwin\fR\fB,\fR \fIverch\fR\fB,\fR -\fIverch\fR\fB,\fR \fIhorch\fR\fB,\fR \fIhorch\fR\fB, 0, 0, 0, 0)\fR. - -The \fBhline\fR and \fBwhline\fR functions draw a horizontal (left to right) -line using \fIch\fR starting at the current cursor position in the window. The -current cursor position is not changed. The line is at most \fIn\fR characters -long, or as many as fit into the window. - -The \fBvline\fR and \fBwvline\fR functions draw a vertical (top to bottom) line -using \fIch\fR starting at the current cursor position in the window. The -current cursor position is not changed. The line is at most \fIn\fR characters -long, or as many as fit into the window. -.SH RETURN VALUE -All routines return the integer \fBOK\fR. The SVr4.0 manual says "or a -non-negative integer if \fBimmedok\fR is set", but this appears to be an error. -.SH NOTES -The borders generated by these functions are \fIinside\fR borders (this -is also true of SVr4 curses, though the fact is not documented). - -Note that \fBborder\fR and \fBbox\fR may be macros. -.SH BUGS -The \fBimmedok\fR function is not yet implemented in ncurses 1.8.6. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_outopts\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_clear.3 b/lib/libncurses/curs_clear.3 deleted file mode 100644 index 5e7515524474..000000000000 --- a/lib/libncurses/curs_clear.3 +++ /dev/null @@ -1,55 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_clear 3 "" -.SH NAME -\fBerase\fR, \fBwerase\fR, \fBclear\fR, -\fBwclear\fR, \fBclrtobot\fR, \fBwclrtobot\fR, \fBclrtoeol\fR, -\fBwclrtoeol\fR - clear all or part of a \fBncurses\fR window -.SH SYNOPSIS -\fB# include <ncurses.h>\fR - -\fBint erase(void);\fR -.br -\fBint werase(WINDOW *win);\fR -.br -\fBint clear(void);\fR -.br -\fBint wclear(WINDOW *win);\fR -.br -\fBint clrtobot(void);\fR -.br -\fBint wclrtobot(WINDOW *win);\fR -.br -\fBint clrtoeol(void);\fR -.br -\fBint wclrtoeol(WINDOW *win);\fR -.br -.SH DESCRIPTION -The \fBerase\fR and \fBwerase\fR routines copy blanks to every -position in the window, clearing the screen. - -The \fBclear\fR and \fBwclear\fR routines are like \fBerase\fR and -\fBwerase\fR, but they also call \fBclearok\fR, so that the screen is -cleared completely on the next call to \fBwrefresh\fR for that window -and repainted from scratch. - -The \fBclrtobot\fR and \fBwclrtobot\fR routines erase from the cursor to the -end of screen. That is, they erase all lines below the cursor in the window. -Also, the current line to the right of the cursor, inclusive, is erased. - -The \fBclrtoeol\fR and \fBwclrtoeol\fR routines erase the current line -to the right of the cursor, inclusive. -.SH RETURN VALUE -All routines return the integer \fBOK\fR, or a non-negative integer if -\fBimmedok\fR is set. -.SH NOTES -Note that \fBerase\fR, \fBwerase\fR, \fBclear\fR, \fBwclear\fR, -\fBclrtobot\fR, and \fBclrtoeol\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_outopts\fR(3), \fBcurs_refresh\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_color.3 b/lib/libncurses/curs_color.3 deleted file mode 100644 index 67a7c5195e91..000000000000 --- a/lib/libncurses/curs_color.3 +++ /dev/null @@ -1,140 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_color 3 "" -.SH NAME -\fBstart_color\fR, \fBinit_pair\fR, -\fBinit_color\fR, \fBhas_colors\fR, \fBcan_change_color\fR, -\fBcolor_content\fR, -\fBpair_content\fR - \fBncurses\fR color manipulation routines -.SH SYNOPSIS -\fB# include <ncurses.h>\fR -.br -\fBint start_color(void);\fR -.br -\fBint init_pair(short pair, short f, short b);\fR -.br -\fBint init_color(short color, short r, short g, short b);\fR -.br -\fBbool has_colors(void);\fR -.br -\fBbool can_change_color(void);\fR -.br -\fBint color_content(short color, short *r, short *g, short *b);\fR -.br -\fBint pair_content(short pair, short *f, short *b);\fR -.br -.SH DESCRIPTION -.SS Overview -\fBncurses\fR support color attributes on terminals with that capability. To -use these routines \fBstart_color\fR must be called, usually right after -\fBinitscr\fR. Colors are always used in pairs (referred to as color-pairs). -A color-pair consists of a foreground color (for characters) and a background -color (for the blank field on which the characters are displayed). A -programmer initializes a color-pair with the routine \fBinit_pair\fR. After it -has been initialized, \fBCOLOR_PAIR\fR(\fIn\fR), a macro defined in -\fB<ncurses.h>\fR, can be used as a new video attribute. - -If a terminal is capable of redefining colors, the programmer can use the -routine \fBinit_color\fR to change the definition of a color. The routines -\fBhas_colors\fR and \fBcan_change_color\fR return \fBTRUE\fR or \fBFALSE\fR, -depending on whether the terminal has color capabilities and whether the -programmer can change the colors. The routine \fBcolor_content\fR allows a -programmer to extract the amounts of red, green, and blue components in an -initialized color. The routine \fBpair_content\fR allows a programmer to find -out how a given color-pair is currently defined. -.SS Routine Descriptions -The \fBstart_color\fR routine requires no arguments. It must be -called if the programmer wants to use colors, and before any other -color manipulation routine is called. It is good practice to call -this routine right after \fBinitscr\fR. \fBstart_color\fR initializes -eight basic colors (black, red, green, yellow, blue, magenta, cyan, -and white), and two global variables, \fBCOLORS\fR and -\fBCOLOR_PAIRS\fR (respectively defining the maximum number of colors -and color-pairs the terminal can support). It also restores the -colors on the terminal to the values they had when the terminal was -just turned on. - -The \fBinit_pair\fR routine changes the definition of a color-pair. It takes -three arguments: the number of the color-pair to be changed, the foreground -color number, and the background color number. The value of the first argument -must be between \fB1\fR and \fBCOLOR_PAIRS-1\fR. The value of the second and -third arguments must be between 0 and \fBCOLORS\fR (the 0 color pair is wired -to white on black and cannot be changed). If the color-pair was previously -initialized, the screen is refreshed and all occurrences of that color-pair is -changed to the new definition. - -The \fBinit_color\fR routine changes the definition of a color. It takes four -arguments: the number of the color to be changed followed by three RGB values -(for the amounts of red, green, and blue components). The value of the first -argument must be between \fB0\fR and \fBCOLORS\fR. (See the section -\fBColors\fR for the default color index.) Each of the last three arguments -must be a value between 0 and 1000. When \fBinit_color\fR is used, all -occurrences of that color on the screen immediately change to the new -definition. - -The \fBhas_colors\fR routine requires no arguments. It returns \fBTRUE\fR if -the terminal can manipulate colors; otherwise, it returns \fBFALSE\fR. This -routine facilitates writing terminal-independent programs. For example, a -programmer can use it to decide whether to use color or some other video -attribute. - -The \fBcan_change_color\fR routine requires no arguments. It returns -\fBTRUE\fR if the terminal supports colors and can change their definitions; -other, it returns \fBFALSE\fR. This routine facilitates writing -terminal-independent programs. - -The \fBcolor_content\fR routine gives programmers a way to find the intensity -of the red, green, and blue (RGB) components in a color. It requires four -arguments: the color number, and three addresses of \fBshort\fRs for storing -the information about the amounts of red, green, and blue components in the -given color. The value of the first argument must be between 0 and -\fBCOLORS\fR. The values that are stored at the addresses pointed to by the -last three arguments are between 0 (no component) and 1000 (maximum amount of -component). - -The \fBpair_content\fR routine allows programmers to find out what colors a -given color-pair consists of. It requires three arguments: the color-pair -number, and two addresses of \fBshort\fRs for storing the foreground and the -background color numbers. The value of the first argument must be between 1 -and \fBCOLOR_PAIRS-1\fR. The values that are stored at the addresses pointed -to by the second and third arguments are between 0 and \fBCOLORS\fR. -.SS Colors -In \fB<ncurses.h>\fR the following macros are defined. These are the default -colors. \fBncurses\fR also assumes that \fBCOLOR_BLACK\fR is the default -background color for all terminals. - -.nf - \fBCOLOR_BLACK\fR - \fBCOLOR_RED\fR - \fBCOLOR_GREEN\fR - \fBCOLOR_YELLOW\fR - \fBCOLOR_BLUE\fR - \fBCOLOR_MAGENTA\fR - \fBCOLOR_CYAN\fR - \fBCOLOR_WHITE\fR -.fi -.SH RETURN VALUE -All routines that return an integer return \fBERR\fR upon failure and \fBOK\fR -upon successful completion. -.SH NOTES -Several caveats apply onn 386 and 486 machines with VGA-compatible graphics: - -COLOR_YELLOW is actually brown. To get yellow, use COLOR_YELLOW combined with -the \fBA_BOLD\fR attribute. - -The A_BLINK attribute should in theory cause the background to go bright. This -often fails to work, and even some cards for which it mostly works (such as the -Paradise and compatibles) do the wrong thing when you try to set a bright -"yellow" background (you get a blinking yellow foreground instead). - -Color RGB values are not settable. -.SH CAPABILITIES -\fBsetf\fR, \fBsetb\fR, \fBsetaf\fR, \fBsetab\fR. The ncurses library uses -the second pair by preference, falling back to the first. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_initscr\fR(3), \fBcurs_attr\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 diff --git a/lib/libncurses/curs_delch.3 b/lib/libncurses/curs_delch.3 deleted file mode 100644 index d9f10594385b..000000000000 --- a/lib/libncurses/curs_delch.3 +++ /dev/null @@ -1,36 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_delch 3 "" -.SH NAME -\fBdelch\fR, \fBwdelch\fR, \fBmvdelch\fR, -\fBmvwdelch\fR - delete character under the cursor in a \fBncurses\fR window -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint delch(void);\fR -.br -\fBint wdelch(WINDOW *win);\fR -.br -\fBint mvdelch(int y, int x);\fR -.br -\fBint mvwdelch(WINDOW *win, int y, int x);\fR -.br -.SH DESCRIPTION -These routines delete the character under the cursor; all characters to the -right of the cursor on the same line are moved to the left one position and the -last character on the line is filled with a blank. The cursor position does -not change (after moving to \fIy\fR, \fIx\fR, if specified). (This does not -imply use of the hardware delete character feature.) -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH NOTES -Note that \fBdelch\fR, \fBmvdelch\fR, and \fBmvwdelch\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_delln.3 b/lib/libncurses/curs_delln.3 deleted file mode 100644 index b95fe807beee..000000000000 --- a/lib/libncurses/curs_delln.3 +++ /dev/null @@ -1,52 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_deleteln 3 "" -.SH NAME -\fBdeleteln\fR, \fBwdeleteln\fR, \fBinsdelln\fR, -\fBwinsdelln\fR, \fBinsertln\fR, -\fBwinsertln\fR - delete and insert lines in a \fBncurses\fR window -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint deleteln(void);\fR -.br -\fBint wdeleteln(WINDOW *win);\fR -.br -\fBint insdelln(int n);\fR -.br -\fBint winsdelln(WINDOW *win, int n);\fR -.br -\fBint insertln(void);\fR -.br -\fBint winsertln(WINDOW *win);\fR -.br -.SH DESCRIPTION -The \fBdeleteln\fR and \fBwdeleteln\fR routines delete the line under the -cursor in the window; all lines below the current line are moved up one line. -The bottom line of the window is cleared. The cursor position does not change. - -The \fBinsdelln\fR and \fBwinsdelln\fR routines, for positive \fIn\fR, insert -\fIn\fR lines into the specified window above the current line. The \fIn\fR -bottom lines are lost. For negative \fIn\fR, delete \fIn\fR lines (starting -with the one under the cursor), and move the remaining lines up. The bottom -\fIn\fR lines are cleared. The current cursor position remains the same. - -The \fBinsertln\fR and \fBinsertln\fR routines, insert a blank line above the -current line and the bottom line is lost. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer -value other than \fBERR\fR upon successful completion. -.SH NOTES -Note that all but \fBwinsdelln\fR may be a macros. - -These routines do not require a hardware line delete or insert feature in the -terminal. In fact, they won't use hardware line delete/insert unless -\fBidlok(..., TRUE)\fR has been set on the current window. -.SH SEE ALSO -\fBncurses\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_getch.3 b/lib/libncurses/curs_getch.3 deleted file mode 100644 index a80242462437..000000000000 --- a/lib/libncurses/curs_getch.3 +++ /dev/null @@ -1,190 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_getch 3 "" -.SH NAME -\fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR, -\fBmvwgetch\fR, -\fBungetch\fR - get (or push back) characters from \fBncurses\fR terminal keyboard -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint getch(void);\fR -.br -\fBint wgetch(WINDOW *win);\fR -.br -\fBint mvgetch(int y, int x);\fR -.br -\fBint mvwgetch(WINDOW *win, int y, int x);\fR -.br -\fBint ungetch(int ch);\fR -.br -.SH DESCRIPTION -The \fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR and \fBmvwgetch\fR, routines read -a character from the window. In no-delay mode, if no input is waiting, the -value \fBERR\fR is returned. In delay mode, the program waits until the system -passes text through to the program. Depending on the setting of \fBcbreak\fR, -this is after one character (cbreak mode), or after the first newline (nocbreak -mode). In half-delay mode, the program waits until a character is typed or the -specified timeout has been reached. Unless \fBnoecho\fR has been set, the -character will also be echoed into the designated window. - -If the window is not a pad, and it has been moved or modified since the last -call to \fBwrefresh\fR, \fBwrefresh\fR will be called before another character -is read. - -If \fBkeypad\fR is \fBTRUE\fR, and a function key is pressed, the token for -that function key is returned instead of the raw characters. Possible function -keys are defined in \fB<ncurses.h>\fR as macros with values outside the range -of 8-bit characters whose names begin with \fBKEY_.\fR Thus, a variable -intended to hold the return value of a function key must be of short size or -larger. - -When a character that could be the beginning of a function key is received -(which, on modern terminals, means an escape character), \fBncurses\fR sets a -timer. If the remainder of the sequence does not come in within the designated -time, the character is passed through; otherwise, the function key value is -returned. For this reason, many terminals experience a delay between the time -a user presses the escape key and the escape is returned to the program. - -The \fBungetch\fR routine places \fIch\fR back onto the input queue to be -returned by the next call to \fBwgetch\fR. Note that there is, in effect, -just one input queue for all windows. - -.SS Function Keys -The following function keys, defined in \fB<ncurses.h>\fR, might be returned by -\fBgetch\fR if \fBkeypad\fR has been enabled. Note that not all of these are -necessarily supported on any particular terminal. -.nf -__________________________________________________________________ -\fIName\fR \fIKey\fR \fIname\fR -__________________________________________________________________ -KEY_BREAK Break key -KEY_DOWN The four arrow keys ... -KEY_UP -KEY_LEFT -KEY_RIGHT -KEY_HOME Home key (upward+left arrow) -KEY_BACKSPACE Backspace -KEY_F0 Function keys; space for 64 keys is reserved. -KEY_F(\fIn\fR) For 0 \fI<\fR \fIn\fR \fI<\fR 63 -KEY_DL Delete line -KEY_IL Insert line -KEY_DC Delete character -KEY_IC Insert char or enter insert mode -KEY_EIC Exit insert char mode -KEY_CLEAR Clear screen -KEY_EOS Clear to end of screen -KEY_EOL Clear to end of line -KEY_SF Scroll 1 line forward -KEY_SR Scroll 1 line backward (reverse) -KEY_NPAGE Next page -KEY_PPAGE Previous page -KEY_STAB Set tab -KEY_CTAB Clear tab -KEY_CATAB Clear all tabs -KEY_ENTER Enter or send -KEY_SRESET Soft (partial) reset -KEY_RESET Reset or hard reset -KEY_PRINT Print or copy -KEY_LL Home down or bottom (lower left). Keypad is - arranged like this: - \fBA1\fR \fBup\fR \fBA3\fR - \fBleft\fR \fBB2\fR \fBright\fR - \fBC1\fR \fBdown\fR \fBC3\fR -KEY_A1 Upper left of keypad -KEY_A3 Upper right of keypad -KEY_B2 Center of keypad -KEY_C1 Lower left of keypad -KEY_C3 Lower right of keypad -KEY_BTAB Back tab key -KEY_BEG Beg(inning) key -KEY_CANCEL Cancel key -KEY_CLOSE Close key -KEY_COMMAND Cmd (command) key -KEY_COPY Copy key -KEY_CREATE Create key -KEY_END End key -KEY_EXIT Exit key -KEY_FIND Find key -KEY_HELP Help key -KEY_MARK Mark key -KEY_MESSAGE Message key -KEY_MOVE Move key -KEY_NEXT Next object key -KEY_OPEN Open key -KEY_OPTIONS Options key -KEY_PREVIOUS Previous object key -KEY_REDO Redo key -KEY_REFERENCE Ref(erence) key -KEY_REFRESH Refresh key -KEY_REPLACE Replace key -KEY_RESTART Restart key -KEY_RESUME Resume key -KEY_SAVE Save key -KEY_SBEG Shifted beginning key -KEY_SCANCEL Shifted cancel key -KEY_SCOMMAND Shifted command key -KEY_SCOPY Shifted copy key -KEY_SCREATE Shifted create key -KEY_SDC Shifted delete char key -KEY_SDL Shifted delete line key -KEY_SELECT Select key -KEY_SEND Shifted end key -KEY_SEOL Shifted clear line key -KEY_SEXIT Shifted exit key -KEY_SFIND Shifted find key -KEY_SHELP Shifted help key -KEY_SHOME Shifted home key -KEY_SIC Shifted input key -KEY_SLEFT Shifted left arrow key -KEY_SMESSAGE Shifted message key -KEY_SMOVE Shifted move key -KEY_SNEXT Shifted next key -KEY_SOPTIONS Shifted options key -KEY_SPREVIOUS Shifted prev key -KEY_SPRINT Shifted print key -KEY_SREDO Shifted redo key -KEY_SREPLACE Shifted replace key -KEY_SRIGHT Shifted right arrow -KEY_SRSUME Shifted resume key -KEY_SSAVE Shifted save key -KEY_SSUSPEND Shifted suspend key -KEY_SUNDO Shifted undo key -KEY_SUSPEND Suspend key -KEY_UNDO Undo key -.fi - -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer -value other than \fBERR\fR upon successful completion. -.SH NOTES -Use of the escape key by a programmer for a single character function is -discouraged, as it will cause a delay of up to one second while the -keypad code looks for a following function-key sequence. - -When using \fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR, or -\fBmvwgetch\fR, nocbreak mode (\fBnocbreak\fR) and echo mode -(\fBecho\fR) should not be used at the same time. Depending on the -state of the tty driver when each character is typed, the program may -produce undesirable results. - -Note that \fBgetch\fR, \fBmvgetch\fR, and \fBmvwgetch\fR may be macros. - -Historically, the set of keypad macros was largely defined by the extremely -function-key-rich keyboard of the AT&T 7300, aka 3B1, aka Safari 4. Modern -personal computers usually have only a small subset of these. IBM PC-style -consoles typically support little more than \fBKEY_UP\fR, \fBKEY_DOWN\fR, -\fBKEY_LEFT\fR, \fBKEY_RIGHT\fR, \fBKEY_HOME\fR, \fBKEY_END\fR, -\fBKEY_NPAGE\fR, \fBKEY_PPAGE\fR, and function keys 1 through 12. The Ins key -is usually mapped to \fBKEY_IC\fR. -.SH CAPABILITIES -All of the key_* capabilities; also \fBkeypad_local\fR and \fBkeypad_xmit\fR. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_inopts\fR(3), \fBcurs_move\fR(3), -\fBcurs_refresh\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_getstr.3 b/lib/libncurses/curs_getstr.3 deleted file mode 100644 index 4ca3813152c0..000000000000 --- a/lib/libncurses/curs_getstr.3 +++ /dev/null @@ -1,55 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_getstr 3 "" -.SH NAME -\fBgetstr\fR, \fBwgetstr\fR, \fBmvgetstr\fR, -\fBmvwgetstr\fR, -\fBwgetnstr\fR - accept character strings from \fBncurses\fR terminal keyboard -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint getstr(char *str);\fR -.br -\fBint wgetstr(WINDOW *win, char *str);\fR -.br -\fBint mvgetstr(int y, int x, char *str);\fR -.br -\fBint mvwgetstr(WINDOW *win, int y, int x, char *str);\fR -.br -\fBint wgetnstr(WINDOW *win, char *str, int n);\fR -.br -.SH DESCRIPTION -The function \fBgetstr\fR is equivalent to a series of calls to \fBgetch\fR, -until a newline or carriage return is received (the terminating character is -not included in the returned string). The resulting value is placed in the -area pointed to by the character pointer \fIstr\fR. - -\fBwgetnstr\fR reads at most \fIn\fR characters, thus preventing a possible -overflow of the input buffer. Any attempt to enter more characters (other -than the terminating newline or carriage return) causes a beep. - -The user's erase and kill characters are interpreted. If keypad -mode is on for the window, \fBKEY_LEFT\fR and \fBKEY_BACKSPACE\fR -are both considered equivalent to the user's kill character. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH BUGS -When the window is in keypad mode and the user types any special key -other than those named above, the `character' value appended to the -string by the ncurses implementation is predictable but not useful -(being, in fact, the low-order eight bits of the key's KEY_ value). - -The SVr4.0 documentation claims that "special keys (such as function -keys, "home" key, "clear" key, \fIetc\fR.) are interpreted" without -giving details. It lies. The actual behavior is like that of ncurses. -.SH NOTES -Note that \fBgetstr\fR, \fBmvgetstr\fR, and \fBmvwgetstr\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_getch\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_getyx.3 b/lib/libncurses/curs_getyx.3 deleted file mode 100644 index 89593ad9691b..000000000000 --- a/lib/libncurses/curs_getyx.3 +++ /dev/null @@ -1,43 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_getyx 3 "" -.SH NAME -\fBgetyx\fR, \fBgetparyx\fR, \fBgetbegyx\fR, -\fBgetmaxyx\fR - get \fBncurses\fR cursor and window coordinates -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBvoid getyx(WINDOW *win, int y, int x);\fR -.br -\fBvoid getparyx(WINDOW *win, int y, int x);\fR -.br -\fBvoid getbegyx(WINDOW *win, int y, int x);\fR -.br -\fBvoid getmaxyx(WINDOW *win, int y, int x);\fR -.br -.SH DESCRIPTION -The \fBgetyx\fR macro places the cursor position of the window in the two -integer variables \fIy\fR and \fIx\fR. - -If \fIwin\fR is a subwindow, the \fBgetparyx\fR macro places the beginning -coordinates of the subwindow relative to the parent window into two integer -variables \fIy\fR and \fIx\fR. Otherwise, \fB-1\fR is placed into \fIy\fR and -\fIx\fR. - -Like \fBgetyx\fR, the \fBgetbegyx\fR and \fBgetmaxyx\fR macros store -the current beginning coordinates and size of the specified window. -.SH RETURN VALUE -The return values of these macros are undefined (\fIi\fR.\fIe\fR., -they should not be used as the right-hand side of assignment -statements). -.SH NOTES -All of these interfaces are macros and that "\fB&\fR" is not -necessary before the variables \fIy\fR and \fIx\fR. -.SH SEE ALSO -\fBncurses\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_inch.3 b/lib/libncurses/curs_inch.3 deleted file mode 100644 index e4abcc88c3b8..000000000000 --- a/lib/libncurses/curs_inch.3 +++ /dev/null @@ -1,42 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_inch 3 "" -.SH NAME -\fBinch\fR, \fBwinch\fR, \fBmvinch\fR, -\fBmvwinch\fR - get a character and attributes from a \fBncurses\fR window -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBchtype inch(void);\fR -.br -\fBchtype winch(WINDOW *win);\fR -.br -\fBchtype mvinch(int y, int x);\fR -.br -\fBchtype mvwinch(WINDOW *win, int y, int x);\fR -.br -.SH DESCRIPTION -These routines return the character, of type \fBchtype\fR, at the current -position in the named window. If any attributes are set for that position, -their values are OR-ed into the value returned. Constants defined in -\fB<ncurses.h>\fR can be used with the \fB&\fR (logical AND) operator to -extract the character or attributes alone. - -.SS Attributes -The following bit-masks may be AND-ed with characters returned by \fBwinch\fR. - -.nf -\fBA_CHARTEXT\fR Bit-mask to extract character -\fBA_ATTRIBUTES\fR Bit-mask to extract attributes -\fBA_COLOR\fR Bit-mask to extract color-pair field information -.fi -.SH NOTES -Note that all of these routines may be macros. -.SH SEE ALSO -\fBncurses\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_inchstr.3 b/lib/libncurses/curs_inchstr.3 deleted file mode 100644 index a925434b34d8..000000000000 --- a/lib/libncurses/curs_inchstr.3 +++ /dev/null @@ -1,47 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_inchstr 3 "" -.SH NAME -\fBinchstr\fR, \fBinchnstr\fR, \fBwinchstr\fR, -\fBwinchnstr\fR, \fBmvinchstr\fR, \fBmvinchnstr\fR, \fBmvwinchstr\fR, -\fBmvwinchnstr\fR - get a string of characters (and attributes) from a \fBncurses\fR window -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint inchstr(chtype *chstr);\fR -.br -\fBint inchnstr(chtype *chstr, int n);\fR -.br -\fBint winchstr(WINDOW *win, chtype *chstr);\fR -.br -\fBint winchnstr(WINDOW *win, chtype *chstr, int n);\fR -.br -\fBint mvinchstr(int y, int x, chtype *chstr);\fR -.br -\fBint mvinchnstr(int y, int x, chtype *chstr, int n);\fR -.br -\fBint mvwinchstr(WINDOW *win, int y, int x, chtype *chstr);\fR -.br -\fBint mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr, int n);\fR -.br -.SH DESCRIPTION -These routines return a NULL-terminated array of \fBchtype\fR quantities, -starting at the current cursor position in the named window and ending at the -right margin of the window. The four functions with \fIn\fR as -the last argument, return a leading substring at most \fIn\fR characters long. -Constants defined in \fB<ncurses.h>\fR can be used with the \fB&\fR (logical -AND) operator to extract the character or the attribute alone from any position -in the \fIchstr\fR [see curs_inch(3)]. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH NOTES -Note that all routines except \fBwinchnstr\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_inch\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_initscr.3 b/lib/libncurses/curs_initscr.3 deleted file mode 100644 index 04b8001abe86..000000000000 --- a/lib/libncurses/curs_initscr.3 +++ /dev/null @@ -1,86 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_initscr 3 "" -.SH NAME -\fBinitscr\fR, \fBnewterm\fR, \fBendwin\fR, -\fBisendwin\fR, \fBset_term\fR, -\fBdelscreen\fR - \fBncurses\fR screen initialization and manipulation routines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBWINDOW *initscr(void);\fR -.br -\fBint endwin(void);\fR -.br -\fBint isendwin(void);\fR -.br -\fBSCREEN *newterm(char *type, FILE *outfd, FILE *infd);\fR -.br -\fBSCREEN *set_term(SCREEN *new);\fR -.br -\fBvoid delscreen(SCREEN* sp);\fR -.br -.SH DESCRIPTION -\fBinitscr\fR is normally the first \fBncurses\fR routine to call when -initializing a program. A few special routines sometimes need to be -called before it; these are \fBslk_init\fR, \fBfilter\fR, \fBripoffline\fR, -\fBuse_env\fR. For multiple-terminal applications, or in order to test -for the presence of given capabilities, \fBnewterm\fR may be called before -\fBinitscr\fR. - -The initscr code determines the terminal type and initializes all \fBncurses\fR -data structures. \fBinitscr\fR also causes the first call to \fBrefresh\fR to -clear the screen. If errors occur, \fBinitscr\fR writes an appropriate error -message to standard error and exits; otherwise, a pointer is returned to -\fBstdscr\fR. - -A program that outputs to more than one terminal should use the \fBnewterm\fR -routine for each terminal instead of \fBinitscr\fR. A program that needs to -inspect capabilities, so it can continue to run in a line-oriented mode if the -terminal cannot support a screen-oriented program, would also use -\fBnewterm\fR. The routine \fBnewterm\fR should be called once for each -terminal. It returns a variable of type \fBSCREEN *\fR which should be saved -as a reference to that terminal. The arguments are the \fItype\fR of the -terminal to be used in place of \fB$TERM\fR, a file pointer for output to the -terminal, and another file pointer for input from the terminal (if \fItype\fR -is \fBNULL\fR, \fB$TERM\fR will be used). The program must also call -\fBendwin\fR for each terminal being used before exiting from ncurses. If -\fBnewterm\fR is called more than once for the same terminal, the first -terminal referred to must be the last one for which \fBendwin\fR is called. - -A program should always call \fBendwin\fR before exiting or escaping from -\fBncurses\fR mode temporarily. This routine restores tty modes, moves the -cursor to the lower left-hand corner of the screen and resets the terminal into -the proper non-visual mode. Calling \fBrefresh\fR or \fBdoupdate\fR after a -temporary escape causes the program to resume visual mode. - -The \fBisendwin\fR routine returns \fBTRUE\fR if \fBendwin\fR has been -called without any subsequent calls to \fBwrefresh\fR, and \fBFALSE\fR -otherwise. - -The \fBset_term\fR routine is used to switch between different -terminals. The screen reference \fBnew\fR becomes the new current -terminal. The previous terminal is returned by the routine. This is -the only routine which manipulates \fBSCREEN\fR pointers; all other -routines affect only the current terminal. - -The \fBdelscreen\fR routine frees storage associated with the -\fBSCREEN\fR data structure. The \fBendwin\fR routine does not do -this, so \fBdelscreen\fR should be called after \fBendwin\fR if a -particular \fBSCREEN\fR is no longer needed. -.SH RETURN VALUE -\fBendwin\fR returns the integer \fBERR\fR upon failure and \fBOK\fR -upon successful completion. - -Routines that return pointers always return \fBNULL\fR on error. -.SH NOTES -Note that \fBinitscr\fR and \fBnewterm\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_kernel\fR(3), \fBcurs_refresh\fR(3), -\fBcurs_slk\fR(3), \fBcurs_util\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_inopts.3 b/lib/libncurses/curs_inopts.3 deleted file mode 100644 index acd30ca703f4..000000000000 --- a/lib/libncurses/curs_inopts.3 +++ /dev/null @@ -1,172 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_inopts 3 "" -.SH NAME -\fBcbreak\fR, \fBnocbreak\fR, \fBecho\fR, -\fBnoecho\fR, \fBhalfdelay\fR, \fBintrflush\fR, \fBkeypad\fR, -\fBmeta\fR, \fBnodelay\fR, \fBnotimeout\fR, \fBraw\fR, \fBnoraw\fR, -\fBnoqiflush\fR, \fBqiflush\fR, \fBtimeout\fR, \fBwtimeout\fR, -\fBtypeahead\fR - \fBncurses\fR input options -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint cbreak(void);\fR -.br -\fBint nocbreak(void);\fR -.br -\fBint echo(void);\fR -.br -\fBint noecho(void);\fR -.br -\fBint halfdelay(int tenths);\fR -.br -\fBint intrflush(WINDOW *win, bool bf);\fR -.br -\fBint keypad(WINDOW *win, bool bf);\fR -.br -\fBint meta(WINDOW *win, bool bf);\fR -.br -\fBint nodelay(WINDOW *win, bool bf);\fR -.br -\fBint notimeout(WINDOW *win, bool bf);\fR -.br -\fBint raw(void);\fR -.br -\fBint noraw(void);\fR -.br -\fBvoid noqiflush(void);\fR -.br -\fBvoid qiflush(void);\fR -.br -\fBvoid timeout(int delay);\fR -.br -\fBvoid wtimeout(WINDOW *win, int delay);\fR -.br -\fBint typeahead(int fd);\fR -.br -.SH DESCRIPTION -Normally, the tty driver buffers typed characters until a newline or carriage -return is typed. The \fBcbreak\fR routine disables line buffering and -erase/kill character-processing (interrupt and flow control characters are -unaffected), making characters typed by the user immediately available to the -program. The \fBnocbreak\fR routine returns the terminal to normal (cooked) -mode. - -Initially the terminal may or may not be in \fBcbreak\fR mode, as the mode is -inherited; therefore, a program should call \fBcbreak\fR or \fBnocbreak\fR -explicitly. Most interactive programs using \fBncurses\fR set the \fBcbreak\fR -mode. Note that \fBcbreak\fR overrides \fBraw\fR. [See curs_getch(3) for a -discussion of how these routines interact with \fBecho\fR and \fBnoecho\fR.] - -The \fBecho\fR and \fBnoecho\fR routines control whether characters typed by -the user are echoed by \fBgetch\fR as they are typed. Echoing by the tty -driver is always disabled, but initially \fBgetch\fR is in echo mode, so -characters typed are echoed. Authors of most interactive programs prefer to do -their own echoing in a controlled area of the screen, or not to echo at all, so -they disable echoing by calling \fBnoecho\fR. [See curs_getch(3) for a -discussion of how these routines interact with \fBcbreak\fR and -\fBnocbreak\fR.] - -The \fBhalfdelay\fR routine is used for half-delay mode, which is similar to -\fBcbreak\fR mode in that characters typed by the user are immediately -available to the program. However, after blocking for \fItenths\fR tenths of -seconds, ERR is returned if nothing has been typed. The value of \fBtenths\fR -must be a number between 1 and 255. Use \fBnocbreak\fR to leave half-delay -mode. - -If the \fBintrflush\fR option is enabled, (\fIbf\fR is \fBTRUE\fR), when an -interrupt key is pressed on the keyboard (interrupt, break, quit) all output in -the tty driver queue will be flushed, giving the effect of faster response to -the interrupt, but causing \fBncurses\fR to have the wrong idea of what is on -the screen. Disabling (\fIbf\fR is \fBFALSE\fR), the option prevents the -flush. The default for the option is inherited from the tty driver settings. -The window argument is ignored. - -The \fBkeypad\fR option enables the keypad of the user's terminal. If -enabled (\fIbf\fR is \fBTRUE\fR), the user can press a function key -(such as an arrow key) and \fBwgetch\fR returns a single value -representing the function key, as in \fBKEY_LEFT\fR. If disabled -(\fIbf\fR is \fBFALSE\fR), \fBncurses\fR does not treat function keys -specially and the program has to interpret the escape sequences -itself. If the keypad in the terminal can be turned on (made to -transmit) and off (made to work locally), turning on this option -causes the terminal keypad to be turned on when \fBwgetch\fR is -called. The default value for keypad is false. - -Initially, whether the terminal returns 7 or 8 significant bits on -input depends on the control mode of the tty driver [see termios(4)]. -To force 8 bits to be returned, invoke \fBmeta\fR(\fIwin\fR, -\fBTRUE\fR). To force 7 bits to be returned, invoke -\fBmeta\fR(\fIwin\fR, \fBFALSE\fR). The window argument, \fIwin\fR, -is always ignored. If the terminfo capabilities \fBsmm\fR (meta_on) -and \fBrmm\fR (meta_off) are defined for the terminal, \fBsmm\fR is -sent to the terminal when \fBmeta\fR(\fIwin\fR, \fBTRUE\fR) is called -and \fBrmm\fR is sent when \fBmeta\fR(\fIwin\fR, \fBFALSE\fR) is -called. - -The \fBnodelay\fR option causes \fBgetch\fR to be a non-blocking call. -If no input is ready, \fBgetch\fR returns \fBERR\fR. If disabled -(\fIbf\fR is \fBFALSE\fR), \fBgetch\fR waits until a key is pressed. - -While interpreting an input escape sequence, \fBwgetch\fR sets a timer -while waiting for the next character. If \fBnotimeout(\fR\fIwin\fR, -\fBTRUE\fR) is called, then \fBwgetch\fR does not set a timer. The -purpose of the timeout is to differentiate between sequences received -from a function key and those typed by a user. - -With the \fBraw\fR and \fBnoraw\fR routines, the terminal is placed -into or out of raw mode. Raw mode is similar to \fBcbreak\fR mode, in -that characters typed are immediately passed through to the user -program. The differences are that in raw mode, the interrupt, quit, -suspend, and flow control characters are all passed through -uninterpreted, instead of generating a signal. The behavior of the -BREAK key depends on other bits in the tty driver that are not set by -\fBncurses\fR. - -When the \fBnoqiflush\fR routine is used, normal flush of input and -output queues associated with the \fBINTR\fR, \fBQUIT\fR and -\fBSUSP\fR characters will not be done [see termios(4)]. When -\fBqiflush\fR is called, the queues will be flushed when these control -characters are read. - -The \fBtimeout\fR and \fBwtimeout\fR routines set blocking or -non-blocking read for a given window. If \fIdelay\fR is negative, -blocking read is used (\fIi\fR.\fIe\fR., waits indefinitely for -input). If \fIdelay\fR is zero, then non-blocking read is used -(\fIi\fR.\fIe\fR., read returns \fBERR\fR if no input is waiting). If -\fIdelay\fR is positive, then read blocks for \fIdelay\fR -milliseconds, and returns \fBERR\fR if there is still no input. -Hence, these routines provide the same functionality as \fBnodelay\fR, -plus the additional capability of being able to block for only -\fIdelay\fR milliseconds (where \fIdelay\fR is positive). - -\fBncurses\fR does ``line-breakout optimization'' by looking for -typeahead periodically while updating the screen. If input is found, -and it is coming from a tty, the current update is postponed until -\fBrefresh\fR or \fBdoupdate\fR is called again. This allows faster -response to commands typed in advance. Normally, the input FILE -pointer passed to \fBnewterm\fR, or \fBstdin\fR in the case that -\fBinitscr\fR was used, will be used to do this typeahead checking. -The \fBtypeahead\fR routine specifies that the file descriptor -\fIfd\fR is to be used to check for typeahead instead. If \fIfd\fR is --1, then no typeahead checking is done. -.SH RETURN VALUE -All routines that return an integer return \fBERR\fR upon failure and an -integer value other than \fBERR\fR upon successful completion, unless otherwise -noted in the preceding routine descriptions. -.SH NOTES -Note that \fBecho\fR, \fBnoecho\fR, \fBhalfdelay\fR, \fBintrflush\fR, -\fBmeta\fR, \fBnodelay\fR, \fBnotimeout\fR, \fBnoqiflush\fR, -\fBqiflush\fR, \fBtimeout\fR, and \fBwtimeout\fR may be macros. -.SH BUGS -The entry points \fBintrflush\fR, \fBqiflush\fR, \fBnoqiflush\fR, and -\fBtypeahead\fR are not yet implemented in ncurses 1.8.6. The ncurses -code does not do typeahead checking during input as SVr4 curses does. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_getch\fR(3), \fBcurs_initscr\fR(3), \fBtermios\fR(4) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_insch.3 b/lib/libncurses/curs_insch.3 deleted file mode 100644 index ab193a6791cb..000000000000 --- a/lib/libncurses/curs_insch.3 +++ /dev/null @@ -1,38 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_insch 3 "" -.SH NAME -\fBinsch\fR, \fBwinsch\fR, \fBmvinsch\fR, -\fBmvwinsch\fR - insert a character before cursor in a \fBncurses\fR window -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint insch(chtype ch);\fR -.br -\fBint winsch(WINDOW *win, chtype ch);\fR -.br -\fBint mvinsch(int y, int x, chtype ch);\fR -.br -\fBint mvwinsch(WINDOW *win, int y, int x, chtype ch);\fR -.br -.SH DESCRIPTION -These routines, insert the character \fIch\fR before the character under the -cursor. All characters to the right of the cursor are moved one space to the -right, with the possibility of the rightmost character on the line being lost. -The insertion operation does not change the cursor position. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH NOTES -These routines do not necessarily imply use of a hardware insert character -feature. - -Note that \fBinsch\fR, \fBmvinsch\fR, and \fBmvwinsch\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_insstr.3 b/lib/libncurses/curs_insstr.3 deleted file mode 100644 index 37faf3c28098..000000000000 --- a/lib/libncurses/curs_insstr.3 +++ /dev/null @@ -1,59 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_insstr 3 "" -.SH NAME -\fBinsstr\fR, \fBinsnstr\fR, \fBwinsstr\fR, \fBwinsnstr\fR, -\fBmvinsstr\fR, \fBmvinsnstr\fR, \fBmvwinsstr\fR, -\fBmvwinsnstr\fR - insert string before cursor a \fBncurses\fR window -.SH SYNOPSIS -\fB#include <ncurses.h>\fR -.br -\fBint insstr(char *str);\fR -.br -\fBint insnstr(char *str, int n);\fR -.br -\fBint winsstr(WINDOW *win, char *str);\fR -.br -\fBint winsnstr(WINDOW *win, char *str, int n);\fR -.br -\fBint mvinsstr(int y, int x, char *str);\fR -.br -\fBint mvinsnstr(int y, int x, char *str, int n);\fR -.br -\fBint mvwinsstr(WINDOW *win, int y, int x, char *str);\fR -.br -\fBint mvwinsnstr(WINDOW *win, int y, int x, char *str, int n);\fR -.br -.SH DESCRIPTION -These routines insert a character string (as many characters as will fit on the -line) before the character under the cursor. All characters to the right of -the cursor are shifted right, with the possibility of the rightmost characters -on the line being lost. The cursor position does not change (after moving to -\fIy\fR, \fIx\fR, if specified). The four routines with \fIn\fR as the last -argument insert a leading substring of at most \fIn\fR characters. If -\fIn\fR<=0, then the entire string is inserted. - -If a character in \fIstr\fR is a tab, newline, carriage return or -backspace, the cursor is moved appropriately within the window. A -newline also does a \fBclrtoeol\fR before moving. Tabs are considered -to be at every eighth column. If a character in \fIstr\fR is another -control character, it is drawn in the \fB^\fR\fIX\fR notation. -Calling \fBwinch\fR after adding a control character (and moving to -it, if necessary) does not return the control character, but instead -returns a character in the ^-representation of the control character. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH BUGS -Entry points for these functions are in ncurses.h but they are not -implemented as of ncurses 1.8.6. -.SH NOTES -Note that all but \fBwinsnstr\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_clear\fR(3), \fBcurs_inch\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_instr.3 b/lib/libncurses/curs_instr.3 deleted file mode 100644 index c03f6c3c4a7c..000000000000 --- a/lib/libncurses/curs_instr.3 +++ /dev/null @@ -1,48 +0,0 @@ -.\" -.\" $FreeBSD$ -.\" -.TH curs_instr 3 "" -.SH NAME -\fBinstr\fR, \fBinnstr\fR, \fBwinstr\fR, \fBwinnstr\fR, -\fBmvinstr\fR, \fBmvinnstr\fR, \fBmvwinstr\fR, -\fBmvwinnstr\fR - get a string of characters from a \fBncurses\fR window -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint instr(char *str);\fR -.br -\fBint innstr(char *str, int n);\fR -.br -\fBint winstr(WINDOW *win, char *str);\fR -.br -\fBint winnstr(WINDOW *win, char *str, int n);\fR -.br -\fBint mvinstr(int y, int x, char *str);\fR -.br -\fBint mvinnstr(int y, int x, char *str, int n);\fR -.br -\fBint mvwinstr(WINDOW *win, int y, int x, char *str);\fR -.br -\fBint mvwinnstr(WINDOW *win, int y, int x, char *str, int n);\fR -.br -.SH DESCRIPTION -These routines return a string of characters in \fIstr\fR, extracted starting -at the current cursor position in the named window and ending at the right -margin of the window. Attributes are stripped from the characters. The four -functions with \fIn\fR as the last argument return a leading substring at most -\fIn\fR characters long. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH NOTES -Note that all routines except \fBwinnstr\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\" -.\"# End: - diff --git a/lib/libncurses/curs_kernel.3 b/lib/libncurses/curs_kernel.3 deleted file mode 100644 index c1161c355324..000000000000 --- a/lib/libncurses/curs_kernel.3 +++ /dev/null @@ -1,117 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_kernel 3 "" -.SH NAME -\fBdef_prog_mode\fR, \fBdef_shell_mode\fR, -\fBreset_prog_mode\fR, \fBreset_shell_mode\fR, \fBresetty\fR, -\fBsavetty\fR, \fBgetsyx\fR, \fBsetsyx\fR, \fBripoffline\fR, -\fBcurs_set\fR, \fBnapms\fR - low-level \fBncurses\fR routines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint def_prog_mode(void);\fR -.br -\fBint def_shell_mode(void);\fR -.br -\fBint reset_prog_mode(void);\fR -.br -\fBint reset_shell_mode(void);\fR -.br -\fBint resetty(void);\fR -.br -\fBint savetty(void);\fR -.br -\fBint getsyx(int y, int x);\fR -.br -\fBint setsyx(int y, int x);\fR -.br -\fBint ripoffline(int line, int (*init)(WINDOW *, int));\fR -.br -\fBint curs_set(int visibility);\fR -.br -\fBint napms(int ms);\fR -.br -.SH DESCRIPTION -The following routines give low-level access to various \fBncurses\fR -capabilities. Theses routines typically are used inside library -routines. - -The \fBdef_prog_mode\fR and \fBdef_shell_mode\fR routines save the -current terminal modes as the "program" (in \fBncurses\fR) or "shell" -(not in \fBncurses\fR) state for use by the \fBreset_prog_mode\fR and -\fBreset_shell_mode\fR routines. This is done automatically by -\fBinitscr\fR. - -The \fBreset_prog_mode\fR and \fBreset_shell_mode\fR routines restore -the terminal to "program" (in \fBncurses\fR) or "shell" (out of -\fBncurses\fR) state. These are done automatically by \fBendwin\fR -and, after an \fBendwin\fR, by \fBdoupdate\fR, so they normally are -not called. - -The \fBresetty\fR and \fBsavetty\fR routines save and restore the -state of the terminal modes. \fBsavetty\fR saves the current state in -a buffer and \fBresetty\fR restores the state to what it was at the -last call to \fBsavetty\fR. - -With the \fBgetsyx\fR routine, the current coordinates of the virtual -screen cursor are returned in \fIy\fR and \fIx\fR. If \fBleaveok\fR -is currently \fBTRUE\fR, then \fB-1\fR,\fB-1\fR is returned. If lines -have been removed from the top of the screen, using \fBripoffline\fR, -\fIy\fR and \fIx\fR include these lines; therefore, \fIy\fR and -\fIx\fR should be used only as arguments for \fBsetsyx\fR. - -With the \fBsetsyx\fR routine, the virtual screen cursor is set to -\fIy\fR, \fIx\fR. If \fIy\fR and \fIx\fR are both \fB-1\fR, then -\fBleaveok\fR is set. The two routines \fBgetsyx\fR and \fBsetsyx\fR -are designed to be used by a library routine, which manipulates -\fBncurses\fR windows but does not want to change the current position -of the program's cursor. The library routine would call \fBgetsyx\fR -at the beginning, do its manipulation of its own windows, do a -\fBwnoutrefresh\fR on its windows, call \fBsetsyx\fR, and then call -\fBdoupdate\fR. - -The \fBripoffline\fR routine provides access to the same facility that -\fBslk_init\fR [see curs_slk(3)] uses to reduce the size of the -screen. \fBripoffline\fR must be called before \fBinitscr\fR or -\fBnewterm\fR is called. If \fIline\fR is positive, a line is removed -from the top of \fBstdscr\fR; if \fIline\fR is negative, a line is -removed from the bottom. When this is done inside \fBinitscr\fR, the -routine \fBinit\fR (supplied by the user) is called with two -arguments: a window pointer to the one-line window that has been -allocated and an integer with the number of columns in the window. -Inside this initialization routine, the integer variables \fBLINES\fR -and \fBCOLS\fR (defined in \fB<ncurses.h>\fR) are not guaranteed to be -accurate and \fBwrefresh\fR or \fBdoupdate\fR must not be called. It -is allowable to call \fBwnoutrefresh\fR during the initialization -routine. - -\fBripoffline\fR can be called up to five times before calling \fBinitscr\fR or -\fBnewterm\fR. - -The \fBcurs_set\fR routine sets the cursor state is set to invisible, -normal, or very visible for \fBvisibility\fR equal to \fB0\fR, -\fB1\fR, or \fB2\fR respectively. If the terminal supports the -\fIvisibility\fR requested, the previous \fIcursor\fR state is -returned; otherwise, \fBERR\fR is returned. - -The \fBnapms\fR routine is used to sleep for \fIms\fR milliseconds. -.SH RETURN VALUE -Except for \fBcurs_set\fR, these routines always return \fBOK\fR. -\fBcurs_set\fR returns the previous cursor state, or \fBERR\fR if the -requested \fIvisibility\fR is not supported. -.SH NOTES -Note that \fBgetsyx\fR is a macro, so \fB&\fR is not necessary before -the variables \fIy\fR and \fIx\fR. - -The SVr4 man pages warn that the return value of \fBcurs_set\fR "is currently -incorrect". This implementation gets it right, but it may be unwise to count -on the correctness of the return value anywhere else. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_initscr\fR(3), \fBcurs_outopts\fR(3), \fBcurs_refresh\fR(3), -\fBcurs_scr_dmp\fR(3), \fBcurs_slk\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_move.3 b/lib/libncurses/curs_move.3 deleted file mode 100644 index 0daa402440c1..000000000000 --- a/lib/libncurses/curs_move.3 +++ /dev/null @@ -1,30 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_move 3 "" -.SH NAME -\fBmove\fR, \fBwmove\fR - move \fBncurses\fR window cursor -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint move(int y, int x);\fR -.br -\fBint wmove(WINDOW *win, int y, int x);\fR -.br -.SH DESCRIPTION -These routines move the cursor associated with the window to line \fIy\fR and -column \fIx\fR. This routine does not move the physical cursor of the terminal -until \fBrefresh\fR is called. The position specified is relative to the upper -left-hand corner of the window, which is (0,0). -.SH RETURN VALUE -These routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH NOTES -Note that \fBmove\fR may be a macro. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_refresh\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_outopts.3 b/lib/libncurses/curs_outopts.3 deleted file mode 100644 index 727003da31cb..000000000000 --- a/lib/libncurses/curs_outopts.3 +++ /dev/null @@ -1,117 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_outopts 3 "" -.SH NAME -\fBclearok\fR, \fBidlok\fR, \fBidcok immedok\fR, -\fBleaveok\fR, \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBscrollok\fR, -\fBnl\fR, \fBnonl\fR - \fBncurses\fR output options -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint clearok(WINDOW *win, bool bf);\fR -.br -\fBint idlok(WINDOW *win, bool bf);\fR -.br -\fBvoid idcok(WINDOW *win, bool bf);\fR -.br -\fBvoid immedok(WINDOW *win, bool bf);\fR -.br -\fBint leaveok(WINDOW *win, bool bf);\fR -.br -\fBint setscrreg(int top, int bot);\fR -.br -\fBint wsetscrreg(WINDOW *win, int top, int bot);\fR -.br -\fBint scrollok(WINDOW *win, bool bf);\fR -.br -\fBint nl(void);\fR -.br -\fBint nonl(void);\fR -.br -.SH DESCRIPTION -These routines set options that change the style of output within -\fBncurses\fR. All options are initially \fBFALSE\fR, unless otherwise stated. -It is not necessary to turn these options off before calling \fBendwin\fR. - -With the \fBclearok\fR routine, if enabled (\fIbf\fR is \fBTRUE\fR), the next -call to \fBwrefresh\fR with this window will clear the screen completely and -redraw the entire screen from scratch. This is useful when the contents of the -screen are uncertain, or in some cases for a more pleasing visual effect. If -the \fIwin\fR argument to \fBclearok\fR is the global variable \fBcurscr\fR, -the next call to \fBwrefresh\fR with any window causes the screen to be cleared -and repainted from scratch. - -With the \fBidlok\fR routine, if enabled (\fIbf\fR is \fBTRUE\fR), -\fBncurses\fR considers using the hardware insert/delete line feature of -terminals so equipped. If disabled (\fIbf\fR is \fBFALSE\fR), \fBncurses\fR -very seldom uses this feature. (The insert/delete character feature is always -considered.) This option should be enabled only if the application needs -insert/delete line, for example, for a screen editor. It is disabled by -default because insert/delete line tends to be visually annoying when used in -applications where it isn't really needed. If insert/delete line cannot be -used, \fBncurses\fR redraws the changed portions of all lines. - -With the \fBidcok\fR routine, if enabled (\fIbf\fR is \fBTRUE\fR), -\fBncurses\fR considers using the hardware insert/delete character feature of -terminals so equipped. This is enabled by default. - -With the \fBimmedok\fR routine, if enabled (\fIbf\fR is \fBTRUE)\fR, any change -in the window image, such as the ones caused by \fBwaddch, wclrtobot, wscrl\fR, -\fIetc\fR., automatically cause a call to \fBwrefresh\fR. However, it may -degrade the performance considerably, due to repeated calls to \fBwrefresh\fR. -It is disabled by default. - -Normally, the hardware cursor is left at the location of the window cursor -being refreshed. The \fBleaveok\fR option allows the cursor to be left -wherever the update happens to leave it. It is useful for applications where -the cursor is not used, since it reduces the need for cursor motions. If -possible, the cursor is made invisible when this option is enabled. - -The \fBsetscrreg\fR and \fBwsetscrreg\fR routines allow the application -programmer to set a software scrolling region in a window. \fItop\fR and -\fIbot\fR are the line numbers of the top and bottom margin of the scrolling -region. (Line 0 is the top line of the window.) If this option and -\fBscrollok\fR are enabled, an attempt to move off the bottom margin line -causes all lines in the scrolling region to scroll up one line. Only the text -of the window is scrolled. (Note that this has nothing to do with the use of a -physical scrolling region capability in the terminal, like that in the VT100. -If \fBidlok\fR is enabled and the terminal has either a scrolling region or -insert/delete line capability, they will probably be used by the output -routines.) - -The \fBscrollok\fR option controls what happens when the cursor of a window is -moved off the edge of the window or scrolling region, either as a result of a -newline action on the bottom line, or typing the last character of the last -line. If disabled, (\fIbf\fR is \fBFALSE\fR), the cursor is left on the bottom -line. If enabled, (\fIbf\fR is \fBTRUE\fR), \fBwrefresh\fR is called on the -window, and the physical terminal and window are scrolled up one line. [Note -that in order to get the physical scrolling effect on the terminal, it is also -necessary to call \fBidlok\fR.] - -The \fBnl\fR and \fBnonl\fR routines control whether newline is translated into -carriage return and linefeed on output, and whether return is translated into -newline on input. Initially, the translations do occur. By disabling these -translations using \fBnonl\fR, \fBncurses\fR is able to make better use of the -linefeed capability, resulting in faster cursor motion. -.SH RETURN VALUE -\fBsetscrreg\fR and \fBwsetscrreg\fR return \fBOK\fR upon success and \fBERR\fR upon failure. -All other routines that return an integer always return \fBOK\fR. -.SH BUGS -The entry points \fBidcok\fR, \fBimmedok\fR are not yet implemented in -ncurses 1.8.6. Setting \fIidlok\fR has unfortunate effects on scrolling -windows. -.SH NOTES -Note that \fBclearok\fR, \fBleaveok\fR, \fBscrollok\fR, \fBidcok\fR, \fBnl\fR, -\fBnonl\fR and \fBsetscrreg\fR may be macros. - -The \fBimmedok\fR routine is useful for windows that are used as terminal -emulators. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_addch\fR(3), \fBcurs_clear\fR(3), -\fBcurs_initscr\fR(3), \fBcurs_scroll\fR(3), \fBcurs_refresh\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_overlay.3 b/lib/libncurses/curs_overlay.3 deleted file mode 100644 index 6c1cd750b037..000000000000 --- a/lib/libncurses/curs_overlay.3 +++ /dev/null @@ -1,43 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_overlay 3 "" -.SH NAME -\fBoverlay\fR, \fBoverwrite\fR, -\fBcopywin\fR - overlay and manipulate overlapped \fBncurses\fR windows -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint overlay(WINDOW *srcwin, WINDOW *dstwin);\fR -.br -\fBint overwrite(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 -.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 -to be the same size; only text where the two windows overlap is -copied. The difference is that \fBoverlay\fR is non-destructive -(blanks are not copied) whereas \fBoverwrite\fR is destructive. - -The \fBcopywin\fR routine provides a finer granularity of control over the -\fBoverlay\fR and \fBoverwrite\fR routines. Like in the \fBprefresh\fR -routine, a rectangle is specified in the destination window, (\fIdminrow\fR, -\fIdmincol\fR) and (\fIdmaxrow\fR, \fIdmaxcol\fR), and the upper-left-corner -coordinates of the source window, (\fIsminrow\fR, \fIsmincol\fR). If the -argument \fIoverlay\fR is \fBtrue\fR, then copying is non-destructive, as in -\fBoverlay\fR. -.SH RETURN VALUE -Routines that return an integer return \fBERR\fR upon failure and an integer -value other than \fBERR\fR upon successful completion. -.SH NOTES -Note that \fBoverlay\fR and \fBoverwrite\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_pad\fR(3), \fBcurs_refresh\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_pad.3 b/lib/libncurses/curs_pad.3 deleted file mode 100644 index 9316cb39a90c..000000000000 --- a/lib/libncurses/curs_pad.3 +++ /dev/null @@ -1,76 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_pad 3 "" -.SH NAME -\fBnewpad\fR, \fBsubpad\fR, \fBprefresh\fR, -\fBpnoutrefresh\fR, \fBpechochar\fR - create and display \fBncurses\fR pads -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBWINDOW *newpad(int nlines, int ncols);\fR -.br -\fBWINDOW *subpad(WINDOW *orig, int nlines, int ncols, - int begin_y, int begin_x);\fR -\fBint prefresh(WINDOW *pad, int pminrow, int pmincol, - int sminrow, int smincol, int smaxrow, int smaxcol);\fR -\fBint pnoutrefresh(WINDOW *pad, int pminrow, int pmincol, - int sminrow, int smincol, int smaxrow, int smaxcol);\fR -\fBint pechochar(WINDOW *pad, chtype ch);\fR -.SH DESCRIPTION -The \fBnewpad\fR routine creates and returns a pointer to a new pad data -structure with the given number of lines, \fInlines\fR, and columns, -\fIncols\fR. A pad is like a window, except that it is not restricted by the -screen size, and is not necessarily associated with a particular part of the -screen. Pads can be used when a large window is needed, and only a part of the -window will be on the screen at one time. Automatic refreshes of pads -(\fIe\fR.\fIg\fR., from scrolling or echoing of input) do not occur. It is not -legal to call \fBwrefresh\fR with a \fIpad\fR as an argument; the routines -\fBprefresh\fR or \fBpnoutrefresh\fR should be called instead. Note that these -routines require additional parameters to specify the part of the pad to be -displayed and the location on the screen to be used for the display. - -The \fBsubpad\fR routine creates and returns a pointer to a subwindow within a -pad with the given number of lines, \fInlines\fR, and columns, \fIncols\fR. -Unlike \fBsubwin\fR, which uses screen coordinates, the window is at position -(\fIbegin\fR_\fIx\fR\fB,\fR \fIbegin\fR_\fIy\fR) on the pad. The window is -made in the middle of the window \fIorig\fR, so that changes made to one window -affect both windows. During the use of this routine, it will often be -necessary to call \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before -calling \fBprefresh\fR. - -The \fBprefresh\fR and \fBpnoutrefresh\fR routines are analogous to -\fBwrefresh\fR and \fBwnoutrefresh\fR except that they relate to pads instead -of windows. The additional parameters are needed to indicate what part of the -pad and screen are involved. \fIpminrow\fR and \fIpmincol\fR specify the upper -left-hand corner of the rectangle to be displayed in the pad. \fIsminrow\fR, -\fIsmincol\fR, \fIsmaxrow\fR, and \fIsmaxcol\fR specify the edges of the -rectangle to be displayed on the screen. The lower right-hand corner of the -rectangle to be displayed in the pad is calculated from the screen coordinates, -since the rectangles must be the same size. Both rectangles must be entirely -contained within their respective structures. Negative values of -\fIpminrow\fR, \fIpmincol\fR, \fIsminrow\fR, or \fIsmincol\fR are treated as if -they were zero. - -The \fBpechochar\fR routine is functionally equivalent to a call to \fBaddch\fR -followed by a call to \fBrefresh\fR, a call to \fBwaddch\fR followed by a call -to \fBwrefresh\fR, or a call to \fBwaddch\fR followed by a call to -\fBprefresh.\fR The knowledge that only a single character is being output is -taken into consideration and, for non-control characters, a considerable -performance gain might be seen by using these routines instead of their -equivalents. In the case of \fBpechochar\fR, the last location of the pad on -the screen is reused for the arguments to \fBprefresh\fR. -.SH RETURN VALUE -Routines that return an integer return \fBERR\fR upon failure and an integer -value other than \fBERR\fR upon successful completion. - -Routines that return pointers return \fBNULL\fR on error. -.SH NOTES -Note that \fBpechochar\fR may be a macro. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_refresh\fR(3), \fBcurs_touch\fR(3), \fBcurs_addch\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_printw.3 b/lib/libncurses/curs_printw.3 deleted file mode 100644 index d86bbd191aa1..000000000000 --- a/lib/libncurses/curs_printw.3 +++ /dev/null @@ -1,43 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_printw 3 "" -.SH NAME -\fBprintw\fR, \fBwprintw\fR, \fBmvprintw\fR, -\fBmvwprintw\fR, \fBvwprintw\fR - print formatted output in \fBncurses\fR windows -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint printw(char *fmt\fR [\fB, arg\fR] \fB...);\fR -.br -\fBint wprintw(WINDOW *win, char *fmt\fR [\fB, arg\fR] \fB...);\fR -.br -\fBint mvprintw(int y, int x, char *fmt\fR [\fB, arg\fR] \fB...);\fR -.br -\fBint mvwprintw(WINDOW *win, int y, int x, - \fBchar *fmt\fR [\fB, arg]\fR ...); - -\fB#include <varargs.h>\fR -.br -\fBint vwprintw(WINDOW *win, char *fmt, varglist);\fR -.br -.SH DESCRIPTION -The \fBprintw\fR, \fBwprintw\fR, \fBmvprintw\fR and \fBmvwprintw\fR -routines are analogous to \fBprintf\fR [see \fBprintf\fR(3)]. In -effect, the string that would be output by \fBprintf\fR is output -instead as though \fBwaddstr\fR were used on the given window. - -The \fBvwprintw\fR routine is analogous to \fBvprintf\fR [see -\fBprintf\fR(3)] and performs a \fBwprintw\fR using a variable -argument list. The third argument is a \fBva_list\fR, a pointer to a -list of arguments, as defined in \fB<varargs.h>\fR. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH SEE ALSO -\fBncurses\fR(3), \fBprintf\fR(3), \fBvprintf(3)\fR -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_refresh.3 b/lib/libncurses/curs_refresh.3 deleted file mode 100644 index a71887aaf74b..000000000000 --- a/lib/libncurses/curs_refresh.3 +++ /dev/null @@ -1,71 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_refresh 3 "" -.SH NAME -\fBrefresh\fR, \fBwrefresh\fR, \fBwnoutrefresh\fR, -\fBdoupdate\fR, \fBredrawwin\fR, -\fBwredrawln\fR - refresh \fBncurses\fR windows and lines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint refresh(void);\fR -.br -\fBint wrefresh(WINDOW *win);\fR -.br -\fBint wnoutrefresh(WINDOW *win);\fR -.br -\fBint doupdate(void);\fR -.br -\fBint redrawwin(WINDOW *win);\fR -.br -\fBint wredrawln(WINDOW *win, int beg_line, int num_lines);\fR -.br -.SH DESCRIPTION -The \fBrefresh\fR and \fBwrefresh\fR routines (or \fBwnoutrefresh\fR and -\fBdoupdate\fR) must be called to get actual output to the terminal, as other -routines merely manipulate data structures. The routine \fBwrefresh\fR copies -the named window to the physical terminal screen, taking into account what is -already there in order to do optimizations. The \fBrefresh\fR routine is the -same, using \fBstdscr\fR as the default window. Unless \fBleaveok\fR has been -enabled, the physical cursor of the terminal is left at the location of the -cursor for that window. - -The \fBwnoutrefresh\fR and \fBdoupdate\fR routines allow multiple updates with -more efficiency than \fBwrefresh\fR alone. In addition to all the window -structures, \fBncurses\fR keeps two data structures representing the terminal -screen: a physical screen, describing what is actually on the screen, and a -virtual screen, describing what the programmer wants to have on the screen. - -The routine \fBwrefresh\fR works by first calling \fBwnoutrefresh\fR, which -copies the named window to the virtual screen, and then calling \fBdoupdate\fR, -which compares the virtual screen to the physical screen and does the actual -update. If the programmer wishes to output several windows at once, a series -of calls to \fBwrefresh\fR results in alternating calls to \fBwnoutrefresh\fR -and \fBdoupdate\fR, causing several bursts of output to the screen. By first -calling \fBwnoutrefresh\fR for each window, it is then possible to call -\fBdoupdate\fR once, resulting in only one burst of output, with fewer total -characters transmitted and less CPU time used. If the \fIwin\fR argument to -\fBwrefresh\fR is the global variable \fBcurscr\fR, the screen is immediately -cleared and repainted from scratch. - -The \fBredrawwin\fR routine indicates to \fBncurses\fR that some screen lines -are corrupted and should be thrown away before anything is written over them. -These routines could be used for programs such as editors, which want a command -to redraw some part of the screen or the entire screen. The routine -\fBredrawln\fR is preferred over \fBredrawwin\fR where a noisy communication -line exists and redrawing the entire window could be subject to even more -communication noise. Just redrawing several lines offers the possibility that -they would show up unblemished. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH NOTES -Note that \fBrefresh\fR and \fBredrawwin\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_outopts\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_scanw.3 b/lib/libncurses/curs_scanw.3 deleted file mode 100644 index 5b701d3c2ec3..000000000000 --- a/lib/libncurses/curs_scanw.3 +++ /dev/null @@ -1,45 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_scanw 3 "" -.SH NAME -\fBscanw\fR, \fBwscanw\fR, \fBmvscanw\fR, -\fBmvwscanw\fR, \fBvwscanw\fR - convert formatted input from a \fBncurses\fR widow -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint scanw(char *fmt\fR [\fB, arg\fR] \fB...);\fR -.br -\fBint wscanw(WINDOW *win, char *fmt\fR [\fB, arg\fR] \fB...);\fR -.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 -.br -\fBint vwscanw(WINDOW *win, char *fmt, va_list varglist);\fR -.SH DESCRIPTION -The \fBscanw\fR, \fBwscanw\fR and \fBmvscanw\fR routines are analogous to -\fBscanf\fR [see \fBscanf\fR(3)]. The effect of these routines is as though -\fBwgetstr\fR were called on the window, and the resulting line used as input -for \fBsscanf\fR(3). Fields which do not map to a variable in the \fIfmt\fR -field are lost. - -The \fBvwscanw\fR routine is similar to \fBvwprintw\fR in that it performs a -\fBwscanw\fR using a variable argument list. The third argument is a -\fIva\fR_\fIlist\fR, a pointer to a list of arguments, as defined in -\fB<varargs.h>\fR. -.SH RETURN VALUE -\fBvwscanw\fR returns \fBERR\fR on failure and an integer equal to the -number of fields scanned on success. - -Applications may use the return value from the \fBscanw\fR, \fBwscanw\fR, -\fBmvscanw\fR and \fBmvwscanw\fR routines to determine the number of fields -which were mapped in the call. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_getstr\fR(3), \fBcurs_printw\fR(3), \fBscanf\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_scr_dmp.3 b/lib/libncurses/curs_scr_dmp.3 deleted file mode 100644 index 8c2270fd0a60..000000000000 --- a/lib/libncurses/curs_scr_dmp.3 +++ /dev/null @@ -1,60 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_scr_dump 3 "" -.SH NAME -\fBscr_dump\fR, \fBscr_restore\fR, -\fBscr_init\fR, -\fBscr_set\fR - read (write) a \fBncurses\fR screen from (to) a file -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint scr_dump(char *filename);\fR -.br -\fBint scr_restore(char *filename);\fR -.br -\fBint scr_init(char *filename);\fR -.br -\fBint scr_set(char *filename);\fR -.br -.SH DESCRIPTION -The \fBscr_dump\fR routine dumps the current contents of the virtual screen -to the file \fIfilename\fR. - -The \fBscr_restore\fR routine sets the virtual screen to the contents -of \fIfilename\fR, which must have been written using \fBscr_dump\fR. The next -call to \fBdoupdate\fR restores the screen to the way it looked in the dump -file. - -The \fBscr_init\fR routine reads in the contents of \fIfilename\fR and uses -them to initialize the \fBncurses\fR data structures about what the terminal -currently has on its screen. If the data is determined to be valid, -\fBncurses\fR bases its next update of the screen on this information rather -than clearing the screen and starting from scratch. \fBscr_init\fR is used -after \fBinitscr\fR or a \fBsystem\fR [see \fBsystem\fR(BA_LIB)] call to share -the screen with another process which has done a \fBscr_dump\fR after its -\fBendwin\fR call. The data is declared invalid if the time-stamp of the tty -is old or the terminfo capabilities \fBrmcup\fR and \fBnrrmc\fR exist. - -The \fBscr_set\fR routine is a combination of \fBscr_restore\fR and -\fBscr_init\fR. It tells the program that the information in \fIfilename\fR is -what is currently on the screen, and also what the program wants on the screen. -This can be thought of as a screen inheritance function. - -To read (write) a window from (to) a file, use the \fBgetwin\fR and -\fBputwin\fR routines [see \fBcurs_util\fR(3)]. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and \fBOK\fR -upon success. -.SH NOTES -Note that \fBscr_init\fR, \fBscr_set\fR, and \fBscr_restore\fR may be macros. -.BUGS -The time-stamp and rmcup/nrrmc checks are not implemented in \fBncurses\fR(3). -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_initscr\fR(3), \fBcurs_refresh\fR(3), -\fBcurs_util\fR(3), \fBsystem\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_scroll.3 b/lib/libncurses/curs_scroll.3 deleted file mode 100644 index fc797357b1ba..000000000000 --- a/lib/libncurses/curs_scroll.3 +++ /dev/null @@ -1,39 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_scroll 3 "" -.SH NAME -\fBscroll\fR, \fBscrl\fR, \fBwscrl\fR - scroll a \fBncurses\fR window -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint scroll(WINDOW *win);\fR -.br -\fBint scrl(int n);\fR -.br -\fBint wscrl(WINDOW *win, int n);\fR -.br -.SH DESCRIPTION -The \fBscroll\fR routine scrolls the window up one line. This involves moving -the lines in the window data structure. As an optimization, if the scrolling -region of the window is the entire screen, the physical screen is scrolled at -the same time. - -With the \fBscrl\fR and \fBwscrl\fR routines, for positive \fIn\fR scroll the -window up \fIn\fR lines (line \fIi\fR+\fIn\fR becomes \fIi\fR); otherwise -scroll the window down \fIn\fR lines. This involves moving the lines in the -window character image structure. The current cursor position is not changed. - -For these functions to work, scrolling must be enabled via \fBscrollok\fR. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion. -.SH NOTES -Note that \fBscrl\fR and \fBscroll\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_outopts\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_slk.3 b/lib/libncurses/curs_slk.3 deleted file mode 100644 index ae846eb4c97c..000000000000 --- a/lib/libncurses/curs_slk.3 +++ /dev/null @@ -1,87 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_slk 3 "" -.SH NAME -\fBslk_init\fR, \fBslk_set\fR, \fBslk_refresh\fR, -\fBslk_noutrefresh\fR, \fBslk_label\fR, \fBslk_clear\fR, \fBslk_restore\fR, -\fBslk_touch\fR, \fBslk_attron\fR, \fBslk_attrset\fR, -\fBslk_attroff\fR - \fBncurses\fR soft label routines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint slk_init(int fmt);\fR -.br -\fBint slk_set(int labnum, char *label, int fmt);\fR -.br -\fBint slk_refresh(void);\fR -.br -\fBint slk_noutrefresh(void);\fR -.br -\fBchar *slk_label(int labnum);\fR -.br -\fBint slk_clear(void);\fR -.br -\fBint slk_restore(void);\fR -.br -\fBint slk_touch(void);\fR -.br -\fBint slk_attron(chtype attrs);\fR -.br -\fBint slk_attrset(chtype attrs);\fR -.br -\fBint slk_attroff(chtype attrs);\fR -.br -.SH DESCRIPTION -The slk* functions manipulate the set of soft function-key labels that exist on -many terminals. For those terminals that do not have soft labels, -\fBncurses\fR takes over the bottom line of \fBstdscr\fR, reducing the size of -\fBstdscr\fR and the variable \fBLINES\fR. \fBncurses\fR standardizes on eight -labels of up to eight characters each. - -The \fBslk_init\fR routine must be called before \fBinitscr\fR or \fBnewterm\fR -is called. If \fBinitscr\fR eventually uses a line from \fBstdscr\fR to -emulate the soft labels, then \fIfmt\fR determines how the labels are arranged -on the screen. Setting \fIfmt\fR to \fB0\fR indicates a 3-2-3 arrangement of -the labels; \fB1\fR indicates a 4-4 arrangement. - -With the \fBslk_set\fR routine, \fIlabnum\fR is the label number, from \fB1\fR -to \fB8\fR. \fIlabel\fR is the string to be put on the label, up to eight -characters in length. A null string or a null pointer sets up a blank label. -\fIfmt\fR is either \fB0\fR, \fB1\fR, or \fB2\fR, indicating whether the label -is to be left-justified, centered, or right-justified, respectively, within the -label. - -The \fBslk_refresh\fR and \fBslk_noutrefresh\fR routines correspond to -the \fBwrefresh\fR and \fBwnoutrefresh\fR routines. - -The \fBslk_label\fR routine returns the current label for label number -\fIlabnum\fR, with leading and trailing blanks stripped. - -The \fBslk_clear\fR routine clears the soft labels from the screen. - -The \fBslk_restore\fR routine, restores the soft labels to the screen -after a \fBslk_clear\fR has been performed. - -The \fBslk_touch\fR routine forces all the soft labels to be output -the next time a \fBslk_noutrefresh\fR is performed. - -The \fBslk_attron\fR, \fBslk_attrset\fR and \fBslk_attroff\fR routines -correspond to \fBattron\fR, \fBattrset\fR, and \fBattroff\fR. They -have an effect only if soft labels are simulated on the bottom line of -the screen. -.SH RETURN VALUE -Routines that return an integer return \fBERR\fR upon failure and an integer -value other than \fBERR\fR upon successful completion. - -\fBslk_label\fR returns \fBNULL\fR on error. -.SH NOTES -Most applications would use \fBslk_noutrefresh\fR because a -\fBwrefresh\fR is likely to follow soon. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_attr\fR(3), \fBcurs_initscr\fR(3), \fBcurs_refresh\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_termatt.3 b/lib/libncurses/curs_termatt.3 deleted file mode 100644 index f41048138a6f..000000000000 --- a/lib/libncurses/curs_termatt.3 +++ /dev/null @@ -1,76 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_termattrs 3 "" -.SH NAME -\fBbaudrate\fR, \fBerasechar\fR, \fBhas_ic\fR, -\fBhas_il\fR, \fBkillchar\fR, \fBlongname\fR, \fBtermattrs\fR, -\fBtermname\fR - \fBncurses\fR environment query routines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBint baudrate(void);\fR -.br -\fBchar erasechar(void);\fR -.br -\fBint has_ic(void);\fR -.br -\fBint has_il(void);\fR -.br -\fBchar killchar(void);\fR -.br -\fBchar *longname(void);\fR -.br -\fBchtype termattrs(void);\fR -.br -\fBchar *termname(void);\fR -.br -.SH DESCRIPTION -The \fBbaudrate\fR routine returns the output speed of the terminal. The -number returned is in bits per second, for example \fB9600\fR, and is an -integer. - -The \fBerasechar\fR routine returns the user's current erase character. - -The \fBhas_ic\fR routine is true if the terminal has insert- and delete- -character capabilities. - -The \fBhas_il\fR routine is true if the terminal has insert- and delete-line -capabilities, or can simulate them using scrolling regions. This might -be used to determine if it would be appropriate to turn on physical -scrolling using \fBscrollok\fR. - -The \fBkillchar\fR routine returns the user's current line kill character. - -The \fBlongname\fR routine returns a pointer to a static area -containing a verbose description of the current terminal. The maximum -length of a verbose description is 128 characters. It is defined only -after the call to \fBinitscr\fR or \fBnewterm\fR. The area is -overwritten by each call to \fBnewterm\fR and is not restored by -\fBset_term\fR, so the value should be saved between calls to -\fBnewterm\fR if \fBlongname\fR is going to be used with multiple -terminals. - -If a given terminal doesn't support a video attribute that an -application program is trying to use, \fBncurses\fR may substitute a -different video attribute for it. The \fBtermattrs\fR function -returns a logical \fBOR\fR of all video attributes supported by the -terminal. This information is useful when a \fBncurses\fR program -needs complete control over the appearance of the screen. - -The \fBtermname\fR routine returns the value of the environment -variable \fBTERM\fR (truncated to 14 characters). -.SH RETURN VALUE -\fBlongname\fR and \fBtermname\fR return \fBNULL\fR on error. - -Routines that return an integer return \fBERR\fR upon failure and an integer -value other than \fBERR\fR upon successful completion. -.SH NOTES -Note that \fBtermattrs\fR may be a macro. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_initscr\fR(3), \fBcurs_outopts\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_termin.3 b/lib/libncurses/curs_termin.3 deleted file mode 100644 index b0c1720dc5eb..000000000000 --- a/lib/libncurses/curs_termin.3 +++ /dev/null @@ -1,193 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_terminfo 3 "" -.ds n 5 -.SH NAME -\fBsetupterm\fR, \fBsetterm\fR, -\fBset_curterm\fR, \fBdel_curterm\fR, \fBrestartterm\fR, \fBtparm\fR, -\fBtputs\fR, \fBputp\fR, \fBvidputs\fR, \fBvidattr\fR, \fBmvcur\fR, -\fBtigetflag\fR, \fBtigetnum\fR, -\fBtigetstr\fR - \fBncurses\fR interfaces to terminfo database -.SH SYNOPSIS -\fB#include <ncurses.h>\fR -.br -\fB#include <term.h>\fR - -\fBint setupterm(char *term, int fildes, int *errret);\fR -.br -\fBint setterm(char *term);\fR -.br -\fBint set_curterm(TERMINAL *nterm);\fR -.br -\fBint del_curterm(TERMINAL *oterm);\fR -.br -\fBint restartterm(char *term, int fildes, int *errret);\fR -.br -\fBchar *tparm(char *str, long int p1, long int p2, - long int p3, long int p4, long int p5, long int p6, - long int p7, long int p8, long int p9);\fR -.br -\fBint tputs(char *str, int affcnt, int (*putc)(char));\fR -.br -\fBint putp(char *str);\fR -.br -\fBint vidputs(chtype attrs, int (*putc)(char));\fR -.br -\fBint vidattr(chtype attrs);\fR -.br -\fBint mvcur(int oldrow, int oldcol, int newrow, int newcol);\fR -.br -\fBint tigetflag(char *capname);\fR -.br -\fBint tigetnum(char *capname);\fR -.br -\fBchar *tigetstr(char *capname);\fR -.br -.SH DESCRIPTION -These low-level routines must be called by programs that have to deal -directly with the \fBterminfo\fR database to handle certain terminal -capabilities, such as programming function keys. For all other -functionality, \fBncurses\fR routines are more suitable and their use is -recommended. - -Initially, \fBsetupterm\fR should be called. Note that -\fBsetupterm\fR is automatically called by \fBinitscr\fR and -\fBnewterm\fR. This defines the set of terminal-dependent variables -[listed in \fBterminfo\fR(5)]. The \fBterminfo\fR variables -\fBlines\fR and \fBcolumns\fR are initialized by \fBsetupterm\fR as -follows: If \fBuse_env(FALSE)\fR has been called, values for -\fBlines\fR and \fBcolumns\fR specified in \fBterminfo\fR are used. -Otherwise, if the environment variables \fBLINES\fR and \fBCOLUMNS\fR -exist, their values are used. If these environment variables do not -exist and the program is running in a window, the current window size -is used. Otherwise, if the environment variables do not exist, the -values for \fBlines\fR and \fBcolumns\fR specified in the -\fBterminfo\fR database are used. - -The header files \fBncurses.h\fR and \fBnterm.h\fR should be included (in this -order) to get the definitions for these strings, numbers, and flags (these -correspond to the SVr4 headers \fBcurses.h\fR and \fBterm.h\fR). Parameterized -strings should be passed through \fBtparm\fR to instantiate them. All -\fBterminfo\fR strings [including the output of \fBtparm\fR] should be printed -with \fBtputs\fR or \fBputp\fR. Call the \fBreset_shell_mode\fR to restore the -tty modes before exiting [see \fBcurs_kernel\fR(3)]. Programs which use -cursor addressing should output \fBenter_ca_mode\fR upon startup and should -output \fBexit_ca_mode\fR before exiting. Programs desiring shell escapes -should call - -\fBreset_shell_mode\fR and output \fBexit_ca_mode\fR before the shell -is called and should output \fBenter_ca_mode\fR and call -\fBreset_prog_mode\fR after returning from the shell. - -The \fBsetupterm\fR routine reads in the \fBterminfo\fR database, -initializing the \fBterminfo\fR structures, but does not set up the -output virtualization structures used by \fBncurses\fR. The terminal -type is the character string \fIterm\fR; if \fIterm\fR is null, the -environment variable \fBTERM\fR is used. All output is to file -descriptor \fBfildes\fR which is initialized for output. If -\fIerrret\fR is not null, then \fBsetupterm\fR returns \fBOK\fR or -\fBERR\fR and stores a status value in the integer pointed to by -\fIerrret\fR. A status of \fB1\fR in \fIerrret\fR is normal, \fB0\fR -means that the terminal could not be found, and \fB-1\fR means that -the \fBterminfo\fR database could not be found. If \fIerrret\fR is -null, \fBsetupterm\fR prints an error message upon finding an error -and exits. Thus, the simplest call is: - - \fBsetupterm((char *)0, 1, (int *)0);\fR, - -which uses all the defaults and sends the output to \fBstdout\fR. - -The \fBsetterm\fR routine is being replaced by \fBsetupterm\fR. The call: - - \fBsetupterm(\fR\fIterm\fR\fB, 1, (int *)0)\fR - -provides the same functionality as \fBsetterm(\fR\fIterm\fR\fB)\fR. -The \fBsetterm\fR routine is included here for BSD compatibility, and -is not recommended for new programs. - -The \fBset_curterm\fR routine sets the variable \fBcur_term\fR to -\fInterm\fR, and makes all of the \fBterminfo\fR boolean, numeric, and -string variables use the values from \fInterm\fR. - -The \fBdel_curterm\fR routine frees the space pointed to by -\fIoterm\fR and makes it available for further use. If \fIoterm\fR is -the same as \fBcur_term\fR, references to any of the \fBterminfo\fR -boolean, numeric, and string variables thereafter may refer to invalid -memory locations until another \fBsetupterm\fR has been called. - -The \fBrestartterm\fR routine is similar to \fBsetupterm\fR and -\fBinitscr\fR, except that it is called after restoring memory to a -previous state. It assumes that the windows and the input and output -options are the same as when memory was saved, but the terminal type -and baud rate may be different. - -The \fBtparm\fR routine instantiates the string \fIstr\fR with -parameters \fIpi\fR. A pointer is returned to the result of \fIstr\fR -with the parameters applied. - -The \fBtputs\fR routine applies padding information to the string -\fIstr\fR and outputs it. The \fIstr\fR must be a terminfo string -variable or the return value from \fBtparm\fR, \fBtgetstr\fR, or -\fBtgoto\fR. \fIaffcnt\fR is the number of lines affected, or 1 if -not applicable. \fIputc\fR is a \fBputchar\fR-like routine to which -the characters are passed, one at a time. - -The \fBputp\fR routine calls \fBtputs(\fR\fIstr\fR\fB, 1, putchar)\fR. -Note that the output of \fBputp\fR always goes to \fBstdout\fR, not to -the \fIfildes\fR specified in \fBsetupterm\fR. - -The \fBvidputs\fR routine displays the string on the terminal in the -video attribute mode \fIattrs\fR, which is any combination of the -attributes listed in \fBncurses\fR(3). The characters are passed to -the \fBputchar\fR-like routine \fIputc\fR. - -The \fBvidattr\fR routine is like the \fBvidputs\fR routine, except -that it outputs through \fBputchar\fR. - -The \fBmvcur\fR routine provides low-level cursor motion. It takes -effect immediately (rather than at the next refresh). - -The \fBtigetflag\fR, \fBtigetnum\fR and \fBtigetstr\fR routines return -the value of the capability corresponding to the \fBterminfo\fR -\fIcapname\fR passed to them, such as \fBxenl\fR. - -With the \fBtigetflag\fR routine, the value \fB-1\fR is returned if -\fIcapname\fR is not a boolean capability. - -With the \fBtigetnum\fR routine, the value \fB-2\fR is returned if -\fIcapname\fR is not a numeric capability. - -With the \fBtigetstr\fR routine, the value \fB(char *)-1\fR is -returned if \fIcapname\fR is not a string capability. - -The \fIcapname\fR for each capability is given in the table column entitled -\fIcapname\fR code in the capabilities section of \fBterminfo\fR(5). - -\fBchar *boolnames\fR, \fB*boolcodes\fR, \fB*boolfnames\fR - -\fBchar *numnames\fR, \fB*numcodes\fR, \fB*numfnames\fR - -\fBchar *strnames\fR, \fB*strcodes\fR, \fB*strfnames\fR - -These null-terminated arrays contain the \fIcapnames\fR, the -\fBtermcap\fR codes, and the full C names, for each of the -\fBterminfo\fR variables. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion, unless otherwise noted in the -preceding routine descriptions. - -Routines that return pointers always return \fBNULL\fR on error. -.SH NOTES -The \fBsetupterm\fR routine should be used in place of \fBsetterm\fR. - -Note that \fBvidattr\fR and \fBvidputs\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_initscr\fR(3), \fBcurs_kernel\fR(3), -\fBputc\fR(3), \fBterminfo\fR(5) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_touch.3 b/lib/libncurses/curs_touch.3 deleted file mode 100644 index 498f4095e3fd..000000000000 --- a/lib/libncurses/curs_touch.3 +++ /dev/null @@ -1,59 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_touch 3 "" -.SH NAME -\fBtouchwin\fR, \fBtouchline\fR, \fBuntouchwin\fR, -\fBwtouchln\fR, \fBis_linetouched\fR, -\fBis_wintouched\fR - \fBncurses\fR refresh control routines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR -.br -\fBint touchwin(WINDOW *win);\fR -.br -\fBint touchline(WINDOW *win, int start, int count);\fR -.br -\fBint untouchwin(WINDOW *win);\fR -.br -\fBint wtouchln(WINDOW *win, int y, int n, int changed);\fR -.br -\fBint is_linetouched(WINDOW *win, int line);\fR -.br -\fBint is_wintouched(WINDOW *win);\fR -.br -.SH DESCRIPTION -The \fBtouchwin\fR and \fBtouchline\fR routines throw away all -optimization information about which parts of the window have been -touched, by pretending that the entire window has been drawn on. This -is sometimes necessary when using overlapping windows, since a change -to one window affects the other window, but the records of which lines -have been changed in the other window do not reflect the change. The -routine \fBtouchline\fR only pretends that \fIcount\fR lines have been -changed, beginning with line \fIstart\fR. - -The \fBuntouchwin\fR routine marks all lines in the window as unchanged since -the last call to \fBwrefresh\fR. - -The \fBwtouchln\fR routine makes \fIn\fR lines in the window, starting -at line \fIy\fR, look as if they have (\fIchanged\fR\fB=1\fR) or have -not (\fIchanged\fR\fB=0\fR) been changed since the last call to -\fBwrefresh\fR. - -The \fBis_linetouched\fR and \fBis_wintouched\fR routines return -\fBTRUE\fR if the specified line/window was modified since the last -call to \fBwrefresh\fR; otherwise they return \fBFALSE\fR. In -addition, \fBis_linetouched\fR returns \fBERR\fR if \fIline\fR is not -valid for the given window. -.SH RETURN VALUE -All routines return the integer \fBERR\fR upon failure and an integer value -other than \fBERR\fR upon successful completion, unless otherwise noted in the -preceding routine descriptions. -.SH NOTES -Note that all routines except \fBwtouchln\fR may be macros. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_refresh\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_util.3 b/lib/libncurses/curs_util.3 deleted file mode 100644 index 0372f2398c37..000000000000 --- a/lib/libncurses/curs_util.3 +++ /dev/null @@ -1,83 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_util 3 "" -.SH NAME -\fBunctrl\fR, \fBkeyname\fR, \fBfilter\fR, -\fBuse_env\fR, \fBputwin\fR, \fBgetwin\fR, \fBdelay_output\fR, -\fBflushinp\fR - miscellaneous \fBncurses\fR utility routines -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBchar *unctrl(chtype c);\fR -.br -\fBchar *keyname(int c);\fR -.br -\fBint filter(void);\fR -.br -\fBvoid use_env(char bool);\fR -.br -\fBint putwin(WINDOW *win, FILE *filep);\fR -.br -\fBWINDOW *getwin(FILE *filep);\fR -.br -\fBint delay_output(int ms);\fR -.br -\fBint flushinp(void);\fR -.br -.SH DESCRIPTION -The \fBunctrl\fR macro expands to a character string which is a printable -representation of the character \fIc\fR. Control characters are displayed in -the \fB^\fR\fIX\fR notation. Printing characters are displayed as is. - -The \fBkeyname\fR routine returns a character string corresponding to -the key \fIc\fR. - -The \fBfilter\fR routine, if used, must be called before \fBinitscr\fR or -\fBnewterm\fR are called. It makes \fBncurses\fR think that there is a -one-line screen. \fBncurses\fR does not use any terminal capabilities -that assume that they know on what line of the screen the cursor is -positioned. - -The \fBuse_env\fR routine, if used, is called before \fBinitscr\fR or -\fBnewterm\fR are called. When called with \fBFALSE\fR as an -argument, the values of \fBlines\fR and \fBcolumns\fR specified in the -\fIterminfo\fR database will be used, even if environment variables -\fBLINES\fR and \fBCOLUMNS\fR (used by default) are set, or if -\fBncurses\fR is running in a window (in which case default behavior -would be to use the window size if \fBLINES\fR and \fBCOLUMNS\fR are -not set). - -The \fBputwin\fR routine writes all data associated with window \fIwin\fR into -the file to which \fIfilep\fR points. This information can be later retrieved -using the \fBgetwin\fR function. - -The \fBgetwin\fR routine reads window related data stored in the file by -\fBputwin\fR. The routine then creates and initializes a new window using that -data. It returns a pointer to the new window. - -The \fBdelay_output\fR routine inserts an \fIms\fR millisecond pause -in output. This routine should not be used extensively because -padding characters are used rather than a CPU pause. - -The \fBflushinp\fR routine throws away any typeahead that has been typed by the -user and has not yet been read by the program. -.SH RETURN VALUE -Except for \fBflushinp\fR, routines that return an integer return -\fBERR\fR upon failure and an integer value other than \fBERR\fR upon -successful completion. - -\fBflushinp\fR always returns \fBOK\fR. - -Routines that return pointers return \fBNULL\fR on error. -.SH BUGS -The \fBfilter\fR entry point is not yet supported. -.SH NOTES -Note that \fBunctrl\fR is a macro, which is defined in <\fBunctrl.h\fR>. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_initscr\fR(3), \fBcurs_scr_dmp\fR(3). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curs_window.3 b/lib/libncurses/curs_window.3 deleted file mode 100644 index ab83a99df2eb..000000000000 --- a/lib/libncurses/curs_window.3 +++ /dev/null @@ -1,125 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH curs_window 3 "" -.SH NAME -\fBnewwin\fR, \fBdelwin\fR, \fBmvwin\fR, -\fBsubwin\fR, \fBderwin\fR, \fBmvderwin\fR, \fBdupwin\fR, -\fBwsyncup\fR, \fBsyncok\fR, \fBwcursyncup\fR, -\fBwsyncdown\fR - create \fBncurses\fR windows -.SH SYNOPSIS -\fB#include <ncurses.h>\fR - -\fBWINDOW *newwin(int nlines, int ncols, int begin_y,\fR - \fBintbegin_x);\fR - -\fBint delwin(WINDOW *win);\fR -.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 *derwin(WINDOW *orig, int nlines, int ncols, - int begin_y, int begin_x);\fR -\fBint mvderwin(WINDOW *win, int par_y, int par_x);\fR -.br -\fBWINDOW *dupwin(WINDOW *win);\fR -.br -\fBvoid wsyncup(WINDOW *win);\fR -.br -\fBint syncok(WINDOW *win, bool bf);\fR -.br -\fBvoid wcursyncup(WINDOW *win);\fR -.br -\fBvoid wsyncdown(WINDOW *win);\fR -.br -.SH DESCRIPTION -The \fBnewwin\fR routine creates and returns a pointer to a new window with the -given number of lines and columns. The upper left-hand corner of the window is -at line \fIbegin\fR_\fIy\fR, column \fIbegin\fR_\fIx\fR. If either -\fInlines\fR or \fIncols\fR is zero, they default to \fBLINES -\fR -\fIbegin\fR_\fIy\fR and \fBCOLS -\fR \fIbegin\fR_\fIx\fR. A new full-screen -window is created by calling \fBnewwin(0,0,0,0)\fR. - -The \fBdelwin\fR routine deletes the named window, freeing all memory -associated with it (it does not actually erase the window's screen -image). Subwindows must be deleted before the main window can be -deleted. - -The \fBmvwin\fR routine moves the window so that the upper left-hand -corner is at position (\fIx\fR, \fIy\fR). If the move would cause the -window to be off the screen, it is an error and the window is not -moved. Moving subwindows is allowed, but should be avoided. - -The \fBsubwin\fR routine creates and returns a pointer to a new window -with the given number of lines, \fInlines\fR, and columns, -\fIncols\fR. The window is at position (\fIbegin\fR_\fIy\fR, -\fIbegin\fR_\fIx\fR) on the screen. (This position is relative to the -screen, and not to the window \fIorig\fR.) The window is made in the -middle of the window \fIorig\fR, so that changes made to one window -will affect both windows. The subwindow shares memory with the window -\fIorig\fR. When using this routine, it is necessary to call -\fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before calling -\fBwrefresh\fR on the subwindow. - -The \fBderwin\fR routine is the same as \fBsubwin,\fR except that -\fIbegin\fR_\fIy\fR and \fIbegin\fR_\fIx\fR are relative to the origin -of the window \fIorig\fR rather than the screen. There is no -difference between the subwindows and the derived windows. - -The \fBmvderwin\fR routine moves a derived window (or subwindow) -inside its parent window. The screen-relative parameters of the -window are not changed. This routine is used to display different -parts of the parent window at the same physical position on the -screen. - -The \fBdupwin\fR routine creates an exact duplicate of the window \fIwin\fR. - -Each \fBncurses\fR window maintains two data structures: the character -image structure and the status structure. The character image -structure is shared among all windows in the window hierarchy -(\fIi\fR.\fIe\fR., the window with all subwindows). The status -structure, which contains information about individual line changes in -the window, is private to each window. The routine \fBwrefresh\fR -uses the status data structure when performing screen updating. Since -status structures are not shared, changes made to one window in the -hierarchy may not be properly reflected on the screen. - -The routine \fBwsyncup\fR causes the changes in the status structure -of a window to be reflected in the status structures of its ancestors. -If \fBsyncok\fR is called with second argument \fBTRUE\fR then -\fBwsyncup\fR is called automatically whenever there is a change in -the window. - -The routine \fBwcursyncup\fR updates the current cursor position of all the -ancestors of the window to reflect the current cursor position of the -window. - -The routine \fBwsyncdown\fR updates the status structure of the window -to reflect the changes in the status structures of its ancestors. -Applications seldom call this routine because it is called -automatically by \fBwrefresh\fR. -.SH RETURN VALUE -Routines that return an integer return the integer \fBERR\fR upon failure and -an integer value other than \fBERR\fR upon successful completion. - -\fBdelwin\fR returns the integer \fBERR\fR upon failure and \fBOK\fR -upon successful completion. - -Routines that return pointers return \fBNULL\fR on error. -.SH NOTES -If many small changes are made to the window, the \fBwsyncup\fR option could -degrade performance. - -Note that \fBsyncok\fR may be a macro. -.SH BUGS -The subwindow functions (\fIsubwin\fR, \fIderwin\fR, etc.) are flaky, -incompletely implemented, and not well tested, especially in their -interaction with scrolling. -.SH SEE ALSO -\fBncurses\fR(3), \fBcurs_refresh\fR(3), \fBcurs_touch\fR(3) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/curses.h b/lib/libncurses/curses.h deleted file mode 100644 index a3874b9cb6b5..000000000000 --- a/lib/libncurses/curses.h +++ /dev/null @@ -1,553 +0,0 @@ - -/*************************************************************************** -* COPYRIGHT NOTICE * -**************************************************************************** -* ncurses is copyright (C) 1992, 1993, 1994 * -* by Zeyd M. Ben-Halim * -* zmbenhal@netcom.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, not removed * -* from header files, and is reproduced in any documentation * -* accompanying it or the applications linked with it. * -* * -* ncurses comes AS IS with no warranty, implied or expressed. * -* * -***************************************************************************/ - -#ifndef __NCURSES_H -#define __NCURSES_H -#define CURSES 1 -#define CURSES_H 1 - -/* This is defined in more than one ncurses header, for identification */ -#undef NCURSES_VERSION -#define NCURSES_VERSION "1.8.6/ache" - -typedef unsigned long chtype; - -#include <stdio.h> -#include <stdarg.h> -#ifndef NOTERMIOS -#include <termios.h> -#ifndef TERMIOS -#define TERMIOS 1 -#endif -#else -#include <sgtty.h> -#include <sys/ioctl.h> -#endif -#include <unctrl.h> - -#define bool char - -/* attributes */ -#define A_ATTRIBUTES 0xffffff00 -#define A_NORMAL 0x00000000 -#define A_STANDOUT 0x00010000 -#define A_UNDERLINE 0x00020000 -#define A_REVERSE 0x00040000 -#define A_BLINK 0x00080000 -#define A_DIM 0x00100000 -#define A_BOLD 0x00200000 -#define A_ALTCHARSET 0x00400000 -#define A_INVIS 0x00800000 -#define A_PROTECT 0x01000000 -#define A_CHARTEXT 0x000000ff -#define A_COLOR 0x0000ff00 -#define COLOR_PAIR(n) (n << 8) -#define PAIR_NUMBER(a) ((a & A_COLOR) >> 8) - -/* colors */ -extern int COLORS; -extern int COLOR_PAIRS; -extern unsigned char *color_pairs; - -#define COLOR_BLACK 0 -#define COLOR_RED 1 -#define COLOR_GREEN 2 -#define COLOR_YELLOW 3 -#define COLOR_BLUE 4 -#define COLOR_MAGENTA 5 -#define COLOR_CYAN 6 -#define COLOR_WHITE 7 - -/* line graphics */ - -extern chtype acs_map[]; - - -#define ACS_ULCORNER (acs_map['l']) -#define ACS_LLCORNER (acs_map['m']) -#define ACS_URCORNER (acs_map['k']) -#define ACS_LRCORNER (acs_map['j']) -#define ACS_RTEE (acs_map['u']) -#define ACS_LTEE (acs_map['t']) -#define ACS_BTEE (acs_map['v']) -#define ACS_TTEE (acs_map['w']) -#define ACS_HLINE (acs_map['q']) -#define ACS_VLINE (acs_map['x']) -#define ACS_PLUS (acs_map['n']) -#define ACS_S1 (acs_map['o']) /* scan line 1 */ -#define ACS_S9 (acs_map['s']) /* scan line 9 */ -#define ACS_DIAMOND (acs_map['`']) /* diamond */ -#define ACS_CKBOARD (acs_map['a']) /* checker board (stipple) */ -#define ACS_DEGREE (acs_map['f']) /* degree symbol */ -#define ACS_PLMINUS (acs_map['g']) /* plus/minus */ -#define ACS_BULLET (acs_map['~']) /* bullet */ -#define ACS_LARROW (acs_map[',']) /* arrow pointing left */ -#define ACS_RARROW (acs_map['+']) /* arrow pointing right */ -#define ACS_DARROW (acs_map['.']) /* arrow pointing down */ -#define ACS_UARROW (acs_map['-']) /* arrow pointing up */ -#define ACS_BOARD (acs_map['h']) /* board of squares */ -#define ACS_LANTERN (acs_map['I']) /* lantern symbol */ -#define ACS_BLOCK (acs_map['0']) /* solid square block */ - -#ifndef TRUE -# define TRUE (1) -# define FALSE (0) -#endif - -#define ERR (-1) -#define OK (0) - -#define _SUBWIN 0x01 -#define _ENDLINE 0x02 -#define _FULLWIN 0x04 -#define _SCROLLWIN 0x08 -#define _ISPAD 0x10 -#define _HASMOVED 0x20 - -#define _NOCHANGE -1 - -typedef struct screen SCREEN; -typedef struct _win_st WINDOW; - -struct _win_st { - short _cury, _curx; /* current cursor position */ - short _maxy, _maxx; /* maximum values of x and y NOT the screen dimensions */ - short _begy, _begx; - short _flags; - chtype _attrs; - chtype _bkgd; - - /* The following should be consolidated into one bitset */ - bool _notimeout; - bool _use_idc; - bool _clear; - bool _leave; - bool _scroll; - bool _idlok; - bool _immed; - bool _sync; - bool _use_keypad; /* 0=no, 1=yes */ - bool _use_meta; /* T=use the meta key */ - - int _delay; /* 0 = nodelay - <0 = blocking - >0 = delay */ - chtype **_line; - short *_firstchar; /* First changed character in the line */ - short *_lastchar; /* Last changed character in the line */ - short _regtop; /* Top and bottom of scrolling region */ - short _regbottom; - int _parx; - int _pary; - WINDOW *_parent; /* parent if a sub-window */ -}; - -extern WINDOW *stdscr, *curscr, *newscr; - -extern int LINES, COLS; - -#ifdef __cplusplus -extern "C" { -#endif - -extern int resizeterm (int, int); - -#if 0 /* MYTINFO not have it */ -extern char ttytype[]; /* needed for backward compatibility */ -#endif - -extern int tigetflag(char *); -extern int tigetnum(char *); -extern char *tigetstr(char *); - -/* Debugging : use with libdcurses.a */ - -extern void _init_trace(void); -extern void _tracef(char *, ...); -extern char *_traceattr(int mode); -extern char *_tracechar(const unsigned char mode); -extern void trace(const unsigned int tracelevel); - -/* trace masks */ -#define TRACE_DISABLE 0x00 /* turn off tracing */ -#define TRACE_ORDINARY 0x01 /* ordinary trace mode */ -#define TRACE_CHARPUT 0x02 /* also trace all character outputs */ -#define TRACE_MAXIMUM 0x0f /* maximum trace level */ - -/* function prototypes */ - -extern int baudrate(void); -extern int beep(void); -extern int cbreak(void); -extern int clearok(WINDOW *,int); -extern int copywin(WINDOW *,WINDOW *,int,int,int,int,int,int,int); -extern int curs_set(int); -extern int def_prog_mode(void); -extern int def_shell_mode(void); -extern int delwin(WINDOW *); -extern WINDOW *derwin(WINDOW *,int,int,int,int); -extern int doupdate(void); -extern WINDOW *dupwin(WINDOW *); -extern int echo(void); -extern int endwin(void); -extern char erasechar(void); -extern int flash(void); -extern int flushinp(void); -extern int halfdelay(int); -extern int idlok(WINDOW *,int); -extern int intrflush(WINDOW *,bool); -extern int is_linetouched(WINDOW *,int); -extern int is_wintouched(WINDOW *); -extern WINDOW *initscr(void); -extern int isendwin(void); -extern char *keyname(int); -extern int keypad(WINDOW *,int); -extern char killchar(void); -extern int leaveok(WINDOW *,int); -extern char *longname(void); -extern int meta(WINDOW *,int); -extern int mvcur(int,int,int,int); -extern int mvprintw(int,int,char *,...); -extern int mvscanw(int,int,char *,...); -extern int mvwin(WINDOW *,int,int); -extern int mvwprintw(WINDOW *,int,int,char *,...); -extern int mvwscanw(WINDOW *,int,int,char *,...); -extern WINDOW *newpad(int,int); -extern SCREEN *newterm(char *,FILE *,FILE *); -extern WINDOW *newwin(int,int,int,int); -extern int nl(void); -extern int nocbreak(void); -extern int nodelay(WINDOW *,int); -extern int noecho(void); -extern int nonl(void); -extern int noraw(void); -extern int notimeout(WINDOW *,bool); -extern int overlay(WINDOW *,WINDOW *); -extern int overwrite(WINDOW *,WINDOW *); -extern int pnoutrefresh(WINDOW *,int,int,int,int,int,int); -extern int prefresh(WINDOW *,int,int,int,int,int,int); -extern int printw(char *,...); -extern int putp(char *); -extern int raw(void); -extern int reset_prog_mode(void); -extern int reset_shell_mode(void); -extern int resetty(void); -extern int ripoffline(int line, int (*init)(WINDOW *, int)); -extern int savetty(void); -extern int scanw(char *,...); -extern int scrollok(WINDOW *,int); -extern SCREEN *set_term(SCREEN *); -extern int setupterm(char *,int,int *); -extern WINDOW *subwin(WINDOW *,int,int,int,int); -extern int timeout(int); -extern char *tparm(const char *, ...); -extern int tputs(const char *,int,int (*)(int)); -extern int typeahead(int); -extern int ungetch(int); -extern int vidattr(chtype); -extern int vidputs(chtype,int (*)(int)); -extern int vwscanw(WINDOW *,char *,va_list); -extern int vwprintw(WINDOW *,char *,va_list); -extern int waddch(WINDOW *,chtype); -extern int waddchnstr(WINDOW *,chtype *,int); -extern int waddnstr(WINDOW *,char *,int); -extern int wattron(WINDOW *,chtype); -extern int wattroff(WINDOW *,chtype); -extern int wbkgd(WINDOW *,chtype); -extern int wborder(WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); -extern int wclear(WINDOW *); -extern int wclrtobot(WINDOW *); -extern int wclrtoeol(WINDOW *); -extern int wdelch(WINDOW *); -extern int wechochar(WINDOW *, chtype); -extern int werase(WINDOW *); -extern int wgetch(WINDOW *); -extern int wgetnstr(WINDOW *,char *,int maxlen); -extern int whline(WINDOW *,chtype,int); -extern int winnstr(WINDOW *, char *, int); -extern int winsch(WINDOW *,chtype); -extern int winsdelln(WINDOW *,int); -extern int winsnstr(WINDOW *,char *,int); -extern int wmove(WINDOW *,int,int); -extern int wnoutrefresh(WINDOW *); -extern int wprintw(WINDOW *,char *,...); -extern int wredrawln(WINDOW *,int,int); -extern int wrefresh(WINDOW *); -extern int wscanw(WINDOW *,char *,...); -extern int wscrl(WINDOW *,int); -extern int wsetscrreg(WINDOW *,int,int); -extern int wtimeout(WINDOW *,int); -extern int wtouchln(WINDOW *,int,int,int); -extern int wvline(WINDOW *,chtype,int); - -extern bool can_change_color(void); -extern int color_content(short,short *,short *, short *); -extern int has_colors(void); -extern int init_color(short,short,short,short); -extern int init_pair(short,short,short); -extern int pair_content(short,short*,short*); -extern int start_color(void); - -extern int slk_init(int); -extern int slk_set(int,char *,int); -extern int slk_refresh(void); -extern int slk_noutrefresh(void); -extern char *slk_label(int); -extern int slk_clear(void); -extern int slk_restore(void); -extern int slk_touch(void); - -#ifdef __cplusplus -} -#endif - -/* - * pseudo functions - */ -#define wgetstr(w, s) wgetnstr(w, s, -1) - -#define napms(x) usleep(1000*x) -#define setterm(term) setupterm(term, 1, (int *)0) - -#define fixterm() reset_prog_mode() -#define resetterm() reset_shell_mode() -#define saveterm() def_prog_mode() -#define crmode() cbreak() -#define nocrmode() nocbreak() -#define gettmode() - -#define getyx(win,y,x) (y = (win)->_cury, x = (win)->_curx) -#define getbegyx(win,y,x) (y = (win)->_begy, x = (win)->_begx) -#define getmaxyx(win,y,x) (y = (win)->_maxy + 1, x = (win)->_maxx + 1) -#define getsyx(y,x) getyx(stdscr, y, x) -#define setsyx(y,x) (stdscr->_cury = y, stdscr->_curx = x) - -#define wbkgdset(win,ch) ((win)->_bkgd = ch) - -/* It seems older SYSV curses define these */ -#define getattrs(win) (win->_attrs) -#define getmaxx(win) ((win)->_maxx + 1) -#define getmaxy(win) ((win)->_maxy + 1) - -#define winch(win) ((win)->_line[(win)->_cury][(win)->_curx]) -#define wstandout(win) (wattrset(win,A_STANDOUT)) -#define wstandend(win) (wattrset(win,A_NORMAL)) -#define wattrset(win,at) ((win)->_attrs = (at)) - -#define subpad(p,l,c,y,x) derwin(p,l,c,y,x) -#define scroll(win) wscrl(win,1) - -#define touchwin(win) wtouchln((win), 0, (win)->_maxy + 1, 1) -#define touchline(win, s, c) wtouchln((win), s, c, 1) -#define untouchwin(win) wtouchln((win), 0, (win)->_maxy + 1, 0) - -#define box(win, v, h) wborder(win, v, v, h, h, 0, 0, 0, 0) -#define border(ls, rs, ts, bs, tl, tr, bl, br) wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br) -#define hline(ch, n) whline(stdscr, ch, n) -#define vline(ch, n) wvline(stdscr, ch, n) - -#define winsstr(w, s) winsnstr(w, s, 0) -#define winstr(w, s) winnstr(w, s, -1) - -#define redrawwin(w) wredrawln(w, 0, w->_maxy+1) -#define waddstr(win,str) waddnstr(win,str,-1) -#define waddchstr(win,str) waddchnstr(win,str,-1) - -/* - * pseudo functions for standard screen - */ - -#define bkgdset(ch) wbkgdset(stdscr,ch) -#define bkgd(ch) wbkgd(stdscr,ch) -#define inch() winch(stdscr) -#define standout() wstandout(stdscr) -#define standend() wstandend(stdscr) -#define attron(at) wattron(stdscr,at) -#define attroff(at) wattroff(stdscr,at) -#define attrset(at) wattrset(stdscr,at) -#define addch(ch) waddch(stdscr,ch) -#define echochar(c) wechochar(stdscr, c) -#define getch() wgetch(stdscr) -#define addstr(str) waddnstr(stdscr,str,-1) -#define getstr(str) wgetstr(stdscr,str) -#define move(y, x) wmove(stdscr,y,x) -#define clear() wclear(stdscr) -#define erase() werase(stdscr) -#define clrtobot() wclrtobot(stdscr) -#define clrtoeol() wclrtoeol(stdscr) -#define insertln() winsdelln(stdscr, 1) -#define winsertln(w) winsdelln(w, 1) -#define deleteln() winsdelln(stdscr, -1) -#define wdeleteln(w) winsdelln(w, -1) -#define refresh() wrefresh(stdscr) -#define innstr(s,n) winnstr(stdscr,s,n) -#define insch(c) winsch(stdscr,c) -#define delch() wdelch(stdscr) -#define setscrreg(t,b) wsetscrreg(stdscr,t,b) -#define scrl(n) wscrl(stdscr,n) -#define timeout(delay) wtimeout(stdscr, delay) -#define addnstr(str,n) waddnstr(stdscr,str,n) -#define addchstr(str) waddchstr(stdscr,str) -#define addchnstr(str,n) waddchnstr(stdscr,str, n) -#define insdelln(n) winsdelln(stdscr, n) -#define insstr(s) winsstr(stdscr, s) -#define insnstr(s,n) winsnstr(stdscr, s, n) - -/* - * mv functions -*/ - -#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch)) -#define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win)) -#define mvwaddchnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n)) -#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1)) -#define mvwaddnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n)) -#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1)) -#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str)) -#define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? ERR : winch(win)) -#define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win)) -#define mvwinnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n)) -#define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c)) -#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) -#define mvgetch(y,x) mvwgetch(stdscr,y,x) -#define mvaddnstr(y,x,str,n) mvwaddnstr(stdscr,y,x,str,n) -#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) -#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str) -#define mvinch(y,x) mvwinch(stdscr,y,x) -#define mvdelch(y,x) mvwdelch(stdscr,y,x) -#define mvinnstr(y,x,s,n) mvwinnstr(stdscr,y,x,s,n) -#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) -#define mvwinsstr(w, y, x, s) (wmove(w,y,x) == ERR ? ERR : winsstr(w,s)) -#define mvwinsnstr(w, y, x, s, n) (wmove(w,y,x) == ERR ? ERR : winsnstr(w,s,n)) -#define mvinsstr(y,x,s) mvwinsstr(stdscr,y,x,s) -#define mvinsnstr(y,x,s,n) mvwinsnstr(stdscr,y,x,s,n) - -/* - * XSI curses macros for XPG4 conformance. - */ - -#define attr_get() wattr_get(stdscr) -#define getbkgd(win) ((win)->_bkgd) - -#define vid_attr(a) vidattr(a) -#define wattr_get(win) ((win)->_attrs) - -/* Funny "characters" enabled for various special function keys for input */ -/* Whether such a key exists depend if its definition is in the terminfo entry */ - -#define KEY_MIN 0401 /* Minimum curses key */ -#define KEY_BREAK 0401 /* break key (unreliable) */ -#define KEY_DOWN 0402 /* The four arrow keys ... */ -#define KEY_UP 0403 -#define KEY_LEFT 0404 -#define KEY_RIGHT 0405 /* ... */ -#define KEY_HOME 0406 /* Home key (upward+left arrow) */ -#define KEY_BACKSPACE 0407 /* backspace (unreliable) */ -#define KEY_F0 0410 /* Function keys. Space for 64 */ -#define KEY_F(n) (KEY_F0+(n)) /* keys is reserved. */ -#define KEY_DL 0510 /* Delete line */ -#define KEY_IL 0511 /* Insert line */ -#define KEY_DC 0512 /* Delete character */ -#define KEY_IC 0513 /* Insert char or enter insert mode */ -#define KEY_EIC 0514 /* Exit insert char mode */ -#define KEY_CLEAR 0515 /* Clear screen */ -#define KEY_EOS 0516 /* Clear to end of screen */ -#define KEY_EOL 0517 /* Clear to end of line */ -#define KEY_SF 0520 /* Scroll 1 line forward */ -#define KEY_SR 0521 /* Scroll 1 line backwards (reverse) */ -#define KEY_NPAGE 0522 /* Next page */ -#define KEY_PPAGE 0523 /* Previous page */ -#define KEY_STAB 0524 /* Set tab */ -#define KEY_CTAB 0525 /* Clear tab */ -#define KEY_CATAB 0526 /* Clear all tabs */ -#define KEY_ENTER 0527 /* Enter or send (unreliable) */ -#define KEY_SRESET 0530 /* soft (partial) reset (unreliable) */ -#define KEY_RESET 0531 /* reset or hard reset (unreliable) */ -#define KEY_PRINT 0532 /* print or copy */ -#define KEY_LL 0533 /* home down or bottom (lower left) */ - -/* The keypad is arranged like this: */ -/* a1 up a3 */ -/* left b2 right */ -/* c1 down c3 */ - -#define KEY_A1 0534 /* Upper left of keypad */ -#define KEY_A3 0535 /* Upper right of keypad */ -#define KEY_B2 0536 /* Center of keypad */ -#define KEY_C1 0537 /* Lower left of keypad */ -#define KEY_C3 0540 /* Lower right of keypad */ -#define KEY_BTAB 0541 /* Back tab key */ -#define KEY_BEG 0542 /* beg(inning) key */ -#define KEY_CANCEL 0543 /* cancel key */ -#define KEY_CLOSE 0544 /* close key */ -#define KEY_COMMAND 0545 /* cmd (command) key */ -#define KEY_COPY 0546 /* copy key */ -#define KEY_CREATE 0547 /* create key */ -#define KEY_END 0550 /* end key */ -#define KEY_EXIT 0551 /* exit key */ -#define KEY_FIND 0552 /* find key */ -#define KEY_HELP 0553 /* help key */ -#define KEY_MARK 0554 /* mark key */ -#define KEY_MESSAGE 0555 /* message key */ -#define KEY_MOVE 0556 /* move key */ -#define KEY_NEXT 0557 /* next object key */ -#define KEY_OPEN 0560 /* open key */ -#define KEY_OPTIONS 0561 /* options key */ -#define KEY_PREVIOUS 0562 /* previous object key */ -#define KEY_REDO 0563 /* redo key */ -#define KEY_REFERENCE 0564 /* ref(erence) key */ -#define KEY_REFRESH 0565 /* refresh key */ -#define KEY_REPLACE 0566 /* replace key */ -#define KEY_RESTART 0567 /* restart key */ -#define KEY_RESUME 0570 /* resume key */ -#define KEY_SAVE 0571 /* save key */ -#define KEY_SBEG 0572 /* shifted beginning key */ -#define KEY_SCANCEL 0573 /* shifted cancel key */ -#define KEY_SCOMMAND 0574 /* shifted command key */ -#define KEY_SCOPY 0575 /* shifted copy key */ -#define KEY_SCREATE 0576 /* shifted create key */ -#define KEY_SDC 0577 /* shifted delete char key */ -#define KEY_SDL 0600 /* shifted delete line key */ -#define KEY_SELECT 0601 /* select key */ -#define KEY_SEND 0602 /* shifted end key */ -#define KEY_SEOL 0603 /* shifted clear line key */ -#define KEY_SEXIT 0604 /* shifted exit key */ -#define KEY_SFIND 0605 /* shifted find key */ -#define KEY_SHELP 0606 /* shifted help key */ -#define KEY_SHOME 0607 /* shifted home key */ -#define KEY_SIC 0610 /* shifted input key */ -#define KEY_SLEFT 0611 /* shifted left arrow key */ -#define KEY_SMESSAGE 0612 /* shifted message key */ -#define KEY_SMOVE 0613 /* shifted move key */ -#define KEY_SNEXT 0614 /* shifted next key */ -#define KEY_SOPTIONS 0615 /* shifted options key */ -#define KEY_SPREVIOUS 0616 /* shifted prev key */ -#define KEY_SPRINT 0617 /* shifted print key */ -#define KEY_SREDO 0620 /* shifted redo key */ -#define KEY_SREPLACE 0621 /* shifted replace key */ -#define KEY_SRIGHT 0622 /* shifted right arrow */ -#define KEY_SRSUME 0623 /* shifted resume key */ -#define KEY_SSAVE 0624 /* shifted save key */ -#define KEY_SSUSPEND 0625 /* shifted suspend key */ -#define KEY_SUNDO 0626 /* shifted undo key */ -#define KEY_SUSPEND 0627 /* suspend key */ -#define KEY_UNDO 0630 /* undo key */ -#define KEY_MAX 0777 /* Maximum curses key */ - -#endif diff --git a/lib/libncurses/curses.priv.h b/lib/libncurses/curses.priv.h deleted file mode 100644 index 6733ce068acc..000000000000 --- a/lib/libncurses/curses.priv.h +++ /dev/null @@ -1,137 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* - * curses.priv.h - * - * Header file for curses library objects which are private to - * the library. - * - */ - -#ifndef __GNUC__ -#define inline -#endif - -#ifndef NOACTION -#include <unistd.h> -typedef struct sigaction sigaction_t; -#else -#include "SigAction.h" -#endif - -#include "curses.h" - -#define min(a,b) ((a) > (b) ? (b) : (a)) -#define max(a,b) ((a) < (b) ? (b) : (a)) - -#define FG(n) ((n) & 0x0f) -#define BG(n) (((n) & 0xf0) >> 4) - -#define TextOf(c) ((c) & (chtype)A_CHARTEXT) -#define AttrOf(c) ((c) & (chtype)A_ATTRIBUTES) - -#define BLANK (' '|A_NORMAL) - -#define CHANGED -1 - -#define ALL_BUT_COLOR ((chtype)~(A_COLOR)) - -/* Macro to put together character and attribute info and return it. - If colors are in the attribute, they have precedence. */ -#define ch_or_attr(ch,at) \ - ((PAIR_NUMBER(at) > 0) ? \ - ((((chtype)ch) & ALL_BUT_COLOR) | (at)) : ((((chtype)ch) | (at)))) - -extern WINDOW *newscr; - -#ifdef TRACE -#define T(a) if (_tracing & TRACE_ORDINARY) _tracef a -#define TR(n, a) if (_tracing & (n)) _tracef a -extern int _tracing; -extern char *visbuf(const char *); -#else -#define T(a) -#define TR(n, a) -#endif - -extern int _outch(int); -extern void init_acs(void); -extern void tstp(int); -extern WINDOW *makenew(int, int, int, int); -extern int timed_wait(int fd, int wait, int *timeleft); -extern chtype _nc_background(WINDOW *); -extern chtype _nc_render(WINDOW *, chtype); -extern int _nc_keypad(bool); -extern void _nc_scroll_window(WINDOW *, int, short const, short const, chtype); - -struct try { - struct try *child; /* ptr to child. NULL if none */ - struct try *sibling; /* ptr to sibling. NULL if none */ - unsigned char ch; /* character at this node */ - unsigned short value; /* code of string so far. 0 if none. */ -}; - -/* - * Structure for soft labels. - */ - -typedef struct { - char dirty; /* all labels have changed */ - char hidden; /* soft lables are hidden */ - WINDOW *win; - struct slk_ent { - char text[9]; /* text for the label */ - char form_text[9]; /* formatted text (left/center/...) */ - int x; /* x coordinate of this field */ - char dirty; /* this label has changed */ - char visible; /* field is visible */ - } ent[8]; -} SLK; - -#define FIFO_SIZE 32 - -struct screen { - FILE *_ifp; /* input file ptr for this terminal */ - FILE *_ofp; /* output file ptr for this terminal */ - int _checkfd; -#ifdef MYTINFO - struct _terminal *_term; -#else - struct term *_term; /* used by terminfo stuff */ -#endif - WINDOW *_curscr; /* windows specific to a given terminal */ - WINDOW *_newscr; - WINDOW *_stdscr; - struct try *_keytry; /* "Try" for use with keypad mode */ - unsigned int _fifo[FIFO_SIZE]; /* Buffer for pushed back characters */ - signed char _fifohead, - _fifotail, - _fifopeek; - bool _endwin; - chtype _current_attr; - bool _coloron; - int _cursor; /* visibility of the cursor */ - int _cursrow; /* Row and column of physical cursor */ - int _curscol; - bool _nl; /* True if NL -> CR/NL is on */ - bool _raw; /* True if in raw mode */ - int _cbreak; /* 1 if in cbreak mode */ - /* > 1 if in halfdelay mode */ - bool _echo; /* True if echo on */ - bool _nlmapping; /* True if terminal is really doing */ - /* NL mapping (fn of raw and nl) */ - SLK *_slk; /* ptr to soft key struct / NULL */ - int _costs[9]; /* costs of cursor movements for mvcur */ - int _costinit; /* flag wether costs[] is initialized */ -}; - -extern struct screen *SP; - -extern int _slk_format; /* format specified in slk_init() */ - -#define MAXCOLUMNS 135 -#define MAXLINES 66 -#define UNINITIALISED ((struct try * ) -1) diff --git a/lib/libncurses/doc/color.doc b/lib/libncurses/doc/color.doc deleted file mode 100644 index 55f33466a454..000000000000 --- a/lib/libncurses/doc/color.doc +++ /dev/null @@ -1,71 +0,0 @@ - - 5.10. Color Manipulation - - Ncurses provides support for the use of color on terminals - that are capable of display it. Note the BSD and older SYSV - curses don't support color. Color support in the PC version - is not compatible with SYSR4. - - has_colors() - this function returns TRUE if the terminal supports color, - FALSE otherwise. Other color handling funtions will return - ERR if has_colors() is FALSE. You should always check before - using color and use other video attributes to replace color. - - can_change_color() - This function returns TRUE if the terminal is capable of - redefining colors using the init_color function, FALSE if it - can't. Don't use init_color and color_content if it returns - FALSE. - - start_color() - This function must be called before any other color handling - function is called. It initializes the 8 basic colors (see - appendix I) and sets the global variables COLORS and COLOR_ - PAIRS to the maximum number of colors and color-pairs a - terminal can handle. - - init_pair(pair, fg, bg) - This function changes the definition of a color-pair, pair. - Each pair has a foregroung color fg, and a background color - bg. Both values must be between 0 and COLORS-1. pair must be - between 1 and COLOR_PAIRS-1. - [If a pair is changed from a previous definition, the screen - is refreshed and all occurances of the color-pair are - changed to reflect the change.] - - pair_content(pair, f, b) - This function stores the foreground and background colors of - the color-pair pair into the variables pointed to by f, b. - pair should be between 1 and COLOR_PAIRS-1. - - init_color(color, r, g, b) - This function changes the value of a given color. A color is - defined by its red, green, and blue components, r, g, and b. - These values must be between 0 and 1000. color should be - between 0 and COLORS-1. - - color_content(color, r, g, b) - This function puts the red, green, and blue components of - color into the variable pointed to by r, g, b respectively. - color should be between 0 and COLORS-1. - - COLOR_PAIR(n) set color-pair to that stored in n - PAIR_NUMBER(a) get color-pair stored in attribute a - - - Appendix II: COLORS - ------------------- - - Colors are defined in <ncurses.h> are used with init_pair(). - - COLOR_BLACK 0 - COLOR_RED 1 - COLOR_GREEN 2 - COLOR_YELLOW 3 - COLOR_BLUE 4 - COLOR_MAGENTA 5 - COLOR_CYAN 6 - COLOR_WHITE 7 - - diff --git a/lib/libncurses/doc/manual.doc b/lib/libncurses/doc/manual.doc deleted file mode 100644 index 5ae7d39f5023..000000000000 --- a/lib/libncurses/doc/manual.doc +++ /dev/null @@ -1,1361 +0,0 @@ - - - - - - - - - - The Curses Reference Manual - - Pavel Curtis 1982 - Zeyd M. Ben-Halim 1993 - zmbenhal@netcom.com - - - - - - - Caveat Emptor: - I'm slowly but surely updating the documentation of - ncurses to reflect the current status of the code. The text - below may refer to yet to be implemented functions or - missing functionality. Description of functions may be - missing or out of date. ncurses is aimed at being compatible - with AT&T curses as defined in SysVR4. - - There is no ?roff sources for this document. I may one day - go nuts and create one, but don't hold your breath :-) - - 1. Introduction - - Terminfo is a database describing many capabilities of over - 150 different terminals. Curses is a subroutine package - which presents a high level screen model to the programmer, - while dealing with issues such as terminal differences and - optimization of output to change one screenfull of text into - another. - Terminfo is based on Berkeley's termcap database, but con- - tains a number of improvements and extensions. Parameterized - strings are introduced, making it possible to describe such - capabilities as video attributes, and to handle far more - unusual terminals than possible with termcap. - Curses is also based on Berkeley's curses package, with many - improvements. The package makes use of the insert and - delete line and character features of terminals so equipped, - and determines how to optimally use these features with no - help from the programmer. It allows arbitrary combinations - of video attributes to be displayed, even on terminals that - leave ``magic cookies'' on the screen to mark changes in - attributes.+ - - 2. An Overview of the Package - - 2.1. Terminology - - In this document, the following terminology is kept - to with reasonable consistency: - - window An internal representation containing an image of - what a section of the terminal screen may look - like at some point in time. This subsection can - either encompass the entire terminal screen, or - any smaller portion down to a single character - within that screen. - terminal Sometimes called terminal screen. The package's - idea of what the terminal's screen currently looks - like, i.e., what the user sees now. This is a - special screen. - screen This is a subset of windows which are as large as - the terminal screen, i.e., they start at the upper - left hand corner and encompass the lower right - hand corner. One of these, stdscr, is automati- - cally provided for the programmer. - - 2.2. Compiling Programs using the Package - - In order to use the library, it is necessary to have - certain types and variables defined. Therefore, the pro- - grammer must have a line: - #include <ncurses.h> - at the top of the program source. The screen package - uses the Standard I/O library, so <ncurses.h> includes - <stdio.h>. Ncurses also includes <termios.h>, <termio.h>, or - <sgtty.h> depending on your system. It is redundant (but - harmless) for the programmer to do it, too. In linking with - ncurses you need to have `-lncurses' in your LDFLAGS or on - the command line. There is no need for any other libraries. - - 2.3. Updating the Screen - - In order to update the screen optimally, it is - necessary for the routines to know what the screen currently - looks like and what the programmer wants it to look like - next. For this purpose, a data type (structure) named WINDOW - is defined which describes a window image to the routines, - including its starting position on the screen (the (y, x) - coordinates of the upper left hand corner) and its size. - One of these (called curscr, for current screen) is a screen - image of what the terminal currently looks like. Another - screen (called stdscr, for standard screen) is provided by - default to make changes on. - A window is a purely internal representation. It is - used to build and store a potential image of a portion of - the terminal. It doesn't bear any necessary relation to - what is really on the terminal screen. It is more like an - array of characters on which to make changes. - When one has a window which describes what some part of - the terminal screen should look like, the routine refresh() - (or wrefresh() if the window is not stdscr) is called. - Refresh() in the area covered by the window, look like that - window. Note, therefore, that changing something on a win- - dow does not change the terminal. Actual updates to the - terminal screen are made only by calling refresh() or wre- - fresh(). This allows the programmer to maintain several - different ideas of what a portion of the terminal screen - should look like. Also, changes can be made to windows in - any order, without regard to motion efficiency. Then, at - will, the programmer can effectively say ``make it look like - this,'' and let the package worry about the best way to do - this. - - 2.4. Naming Conventions - - As hinted above, the routines can use several windows, - but two are automatically given: curscr, which knows what - the terminal looks like, and stdscr, which is what the pro- - grammer wants the terminal to look like next. The user - should never really access curscr directly. Changes should - be made to the appropriate screen, and then the routine - refresh() (or wrefresh()) should be called. - Many functions are set up to deal with stdscr as a - default screen. For example, to add a character to stdscr, - one calls addch() with the desired character. If a differ- - ent window is to be used, the routine waddch() (for - `w'indow-specific addch()) is provided. This convention of - prepending function names with a ``w'' when they are to be - applied to specific windows is consistent. The only rou- - tines which do not do this are those to which a window must - always be specified. - In order to move the current (y, x) coordinates from - one point to another, the routines move() and wmove() are - provided. However, it is often desirable to first move and - then perform some I/O operation. In order to avoid clumsy- - ness, most I/O routines can be preceded by the prefix 'mv' - and the desired (y, x) coordinates then can be added to the - arguments to the function. For example, the calls - move(y, x); - addch(ch); - can be replaced by - mvaddch(y, x, ch); - and - wmove(win, y, x); - waddch(win, ch); - can be replaced by - mvwaddch(win, y, x, ch); - Note that the window description pointer (win) comes before - the added (y, x) coordinates. If such pointers are need, - they are always the first parameters passed. - - 3. Variables - - Many variables which are used to describe the terminal - environment are available to the programmer. They are: - - type name description - ------------------------------------------------------------------ - WINDOW *curscr current version of the screen (terminal screen). - WINDOW *stdscr standard screen. Most updates are done here. - int LINES number of lines on the terminal - int COLS number of columns on the terminal - - There are also several `#define' constants and types which - are of general usefulness: - - bool boolean type, actually a `char' (e.g., bool doneit;) - TRUE boolean `true' flag (1). - FALSE boolean `false' flag (0). - ERR -1 error flag returned by routines on a fail. - OK 0 error flag returned by routines when things - go right. - - 4. Usage - - This is a description of how to actually use the screen - package. In it, we assume all updating, reading, etc. is - applied to stdscr. All instructions will work on any win- - dow, with changing the function name and parameters as men- - tioned above. - - 4.1. Starting up - - In order to use the screen package, the routines must - know about terminal characteristics, and the space for - curscr and stdscr must be allocated. These functions are - performed by initscr(). Since it must allocate space for the - windows, it can overflow memory when attempting to do so. On - this rather rare occasion, initscr() returns ERR. - initscr() must always be called before any of the routines - which affect windows are used. If it is not, the program - will core dump as soon as either curscr or stdscr are - referenced. However, it is usually best to wait to call it - until after you are sure you will need it, like after - checking for startup errors. Terminal status changing - routines like nl() and cbreak() should be called after - initscr(). - Now that the screen windows have been allocated, you - can set them up for the run. If you want to, say, allow the - window to scroll, use scrollok(). If you want the cursor to - be left after the last change, use leaveok(). If this isn't - done, refresh() will move the cursor to the window's current - (y, x) coordinates after updating it. New windows of your - own can be created, too, by using the functions newwin(), - derwin(), and subwin(). delwin() will allow you to get rid - of old windows. - - 4.2. Output - - Now that we have set things up, we will want to actu- - ally update the terminal. The basic functions used to - change what will go on a window are addch() and move(). - addch() adds a character at the current (y, x) coordinates, - returning ERR if it would cause the window to illegally - scroll, i.e., printing a character in the lower right-hand - corner of a terminal which automatically scrolls if - scrolling is not allowed. move() changes the current (y, x) - coordinates to whatever you want them to be. It returns ERR - if you try to move off the window. As mentioned above, you - can combine the two into mvaddch() to do both things at - once. - The other output functions, such as addstr() and - printw(), all call addch() to add characters to the window. - After you have put on the window what you want there, - when you want the portion of the terminal covered by the - window to be made to look like it, you must call refresh(). - In order to optimize finding changes, refresh() assumes that - any part of the window not changed since the last refresh() - of that window has not been changed on the terminal, i.e., - that you have not refreshed a portion of the terminal with - an overlapping window. If this is not the case, the routine - touchwin() is provided to make it look like the entire win- - dow has been changed, thus making refresh() check the whole - subsection of the terminal for changes. - If you call wrefresh() with curscr(), it will make the - screen look like curscr thinks it looks like. This is use- - ful for implementing a command which would redraw the screen - in case it get messed up. - - 4.3. Input - - Input is essentially a mirror image of output. The - complementary function to addch() is getch() which, if echo - is set, will call addch() to echo the character. Since the - screen package needs to know what is on the terminal at all - times, if characters are to be echoed, the tty must be in - raw or cbreak mode. Since initially the terminal has echo- - ing enable and is in nocreak mode, one or the other has to - changed before calling getch(). The result of not doing this - is unpredictable output. - - 4.4. Miscellaneous - - A plethora of other functions exist for maintaining and - changing information about the windows. For the most part, - the descriptions in section 5 should suffice. - - 4.5. Finishing Up - - In order to do certain optimizations, and, on some ter- - minals, to work at all, some things must be done before the - screen routines start up. In order to clean up after the - routines, the routine endwin() is provided. It restores tty - modes to what they were when initscr() was first called, - moves the cursor down to the lower-left corner, etc. Thus, - anytime after the call to initscr, endwin() should be called - before exiting. - - 5. Descriptions of the Functions - - This section describes all the functions available to the - programmer in the curses package. For an alphabetical list, - see the manual page ncurses(3). - - 5.1. Initialization - - These functions are called when initializing a program. - - initscr() - The first function called should always be initscr. This - will determine the terminal type and initialize curses data - structures. initscr also arranges that the first call to - refresh will clear the screen. If an error occurs a message - is writen to standard error and the program exits. Otherwise - it returns a pointer to stdscr. Some function may be called - before initscr (slk_init, filter, ripofflines, use_env, and - if you are using multiple terminals newterm.) - - endwin() - A program should always call endwin before exiting or - shelling out of the program. This function will restore tty - modes, move the cursor to the lower left corner of the - screen, reset the terminal into the proper nonvisual mode. - Calling refresh() or doupdate() after a temporary escape - from the program will restore the screen to its original - status. - - newterm(type, ofp, ifp) - A program which outputs to more than one terminal should use - newterm instead of initscr. newterm should be called once - for each terminal. It returns a variable of type SCREEN - * which should be saved as a reference to that terminal. The - arguments are the type of the terminal (a string) and FILE - pointers for the output and input of the terminal. If type - is NULL then the environment variable $TERM is used. endwin - must called for each terminal opened using this function. - - set_term(new) - This function is used to switch to a different terminal. - The screen reference for the new terminal is passed as the - parameter. The previous terminal is returned by the func- - tion. All other calls affect only the current terminal. - - delscreen(sp) - - longname() - This function returns a pointer to a static area containing - a verbose description of the current terminal. It is defined - only after a call to initscr or newterm. - - termattrs() - - termname() - - 5.2. Option Setting - - These functions set options within curses. In each case, - win is the window affected, and bf is a boolean flag with - value TRUE or FALSE indicating whether to enable or disable - the option. All options are initially FALSE. It is not - necessary to turn these options off before calling endwin. - - clearok(win,bf) - If set, the next call to wrefresh with this window will - clear the screen and redraw the entire screen. If win is - curscr, the next call to wrefresh with any window will cause - the screen to be cleared. This is useful when the contents - of the screen are uncertain, or in some cases for a more - pleasing visual effect. - - idlok(win,bf) - If enabled, curses will consider using the hardware - insert/delete line feature of terminals so equipped. If - disabled, curses will not use this feature. Enable this - option only if your application needs insert/delete line, - for example, for a screen editor. It is disabled by default - because insert/delete line is visually annoying when used in - applications where it isn't really needed. - - idcok(win,bf) - This option allows curses will use inset/delete character - capabilities if any are defined. This option is on be - default. - - immedok(win,bf) - If this option is enabled any change in the window's image - causes a call to wrefresh. Enabling this option can degrade - performance; it is disabled by default. - - keypad(win,bf) - This option enables the keypad of the users terminal. If - enabled, the user can press a function key (such as an arrow - key) and getch will return a single value representing the - function key. If disabled, curses will not treat function - keys specially. If the keypad in the terminal can be turned - on (made to transmit) and off (made to work locally), turn- - ing on this option will turn on the terminal keypad. All the - possible function keys are defined in ncurses.h as KEY_*. - - leaveok(win,bf) - Normally, the hardware cursor is left at the location of the - window cursor being refreshed. This option allows the cur- - sor to be left wherever the update happens to leave it. It - is useful for applications where the cursor is not used, - since it saves cursor motions. If possible, the cursor is - made invisible when this option is enabled. - - meta(win,bf) - If enabled, characters returned by getch are transmitted - with all 8 bits, instead of stripping the highest bit. It - is useful for extending the non-text command set in applica- - tions where the terminal has a meta shift key, such as - EMACS. NOTE: This function is currently unsupported. - - notimeout(win,bf) - This option controls whether a timer is set when wgetch is - trying to interpret an input sequence. See keypad. - - scrollok(win,bf) - This option controls what happens when the cursor of a win- - dow is moved off the edge of the window, either from a new- - line on the bottom line, or typing the last character of the - last line. If disabled, the cursor is left on the bottom - line. If enabled, wrefresh is called on the window, and then - the physical terminal and window are scrolled up one line. - - setscrreg(t,b) - wsetscrreg(win,t,b) - These functions allow the user to set a software scrolling - region in a window win or stdscr. t and b are the line num- - bers of the top and bottom margin of the scrolling region. - (Line 0 is the top line of the screen.) If this option and - scrollok are enabled, an attempt to move off the bottom mar- - gin line will cause all lines in the scrolling region to - scroll up one line. Note that this has nothing to do with - use of a physical scrolling region capability in the termi- - nal, like that in the VT100. Only the text of the window is - scrolled. - The scrolling region really acts as a sort of barrier, lim- - iting the area of a window over which changes take place. - For this reason, an attempt to create a scrolling region in - an area of the screen which does not contain the current (y, - x) coordinates for that window is an error. Similarly, - attempts to move the (y, x) coordinates out of the region - will also fail with an ERR return. - When a scrolling region is in place, all changes are limited - to the region. For example, erase() will only erase the - area inside the region; insertln() will only shift lines - down to the bottom of the region, etc. It is anticipated - that this method of controlling the area of change will - prove quite handy in a number of applications. - To disable the scrolling region, once defined, simply rede- - fine it to be the whole window. For example, to disable the - scrolling region on stdscr, the following call would be - used: - setscrreg(0, LINES - 1) - For other windows, the height of the window should be used - instead of (LINES - 1). - - 5.3. Terminal Mode Setting - - These functions are used to set modes in the tty driver. The - initial mode usually depends on the setting when the program - was called: the initial modes documented here represenet the - normal situation. - - cbreak() - nocbreak() - crmode() - nocrmode() - These functions put the terminal into and out of CBREAK - mode. In this mode, characters typed by the user are immedi- - ately available to the program. When out of this mode, the - device driver will buffer characters typed until newline is - typed. Interrupt and flow control characters are unaffected - by this mode. Initially the terminal is not in CBREAK mode. - Most interactive programs using curses will set this mode. - The functions crmode() and nocrmode() are the result of an - accident in the first version of curses and are retained - solely for upward compatibility. crmode() is the same as - cbreak() and nocrmode() is the same as nocbreak(). See 4.3 - for a important note on using these functions. - - raw() - noraw() - These functions put the terminal into and out of RAW mode. - RAW mode is just like CBREAK mode except that no special - character processing is done (e.g. the interrupt character - will be passed through to the program, uninterpreted, as - will the kill character, etc.) and all 8 bits of the input - character are retained; in CBREAK mode, the eighth bit is - stripped off before it is given to the program. Because of - the lack of interpretation of special characters, it is not - recommended that programs use this mode. - - echo() - noecho() - These functions control whether characters typed by the user - are echoed as typed. Initially, characters typed are echoed - by the teletype driver. Authors of most interactive pro- - grams prefer to do their own echoing in a controlled area of - the screen, or not to echo at all, so they disable echoing. - - halfdelay(t) - This options is similar to cbreak mode except that if after - blocking for t tenth of a seconds no input is received ERR - is returned. t must between 1 and 255. Use nocbreak to leave - this mode. - - nodelay(win,bf) - This option causes getch to be a non-blocking call. If no - input is ready, getch will return ERR. If disabled, getch - will hang until a key is pressed. - - timeout(t) - wtimeout(win,t) - These functions offer control over the blocking action of a - read. If t is negative, reading will block until there is - input. If t is zero, no blocking will occur, read returns - ERR if no input is available. If t is posistive, the read - will block for t milliseconds and return ERR if there is - still no input. - These routines offer better and finer control than nodelay() - and halfdelay() and their use is recommended. - - nl() - nonl() - These functions control whether newline is translated into - carriage return and linefeed on output, and whether return - is translated into newline on input. Initially, the trans- - lations do occur. By disabling these translations, curses - is able to make better use of the linefeed capability, - resulting in faster cursor motion. - - savetty() - resetty() - These functions save and restore the state of the tty modes. - savetty saves the current state in a buffer, resetty - restores the state to what it was at the last call to save- - tty. - - 5.4. Window Manipulation - - newwin(num_lines, num_cols, begy, begx) - Create a new window with the given number of lines and - columns. The upper left corner of the window is at line - begy column begx. If either num_lines or num_cols is zero, - they will be defaulted to LINES-begy and COLS-begx. A new - full-screen window is created by calling newwin(0,0,0,0). - - subwin(orig, num_lines, num_cols, begy, begx) - Create a new window with the given number of lines and - columns. The window is at position (begy, begx) on the - screen. (It is relative to the screen, not orig.) The win- - dow is made in the middle of the window orig, so that - changes made to one window will affect both windows. When - using this function, often it will be necessary to call - touchwin before calling wrefresh. - - derwin(orig, num_lines, num_cols, begy, begx) - Is similar to subwin only the new window is created relative - to the original window, not the screen. - - delwin(win) - Deletes the named window, freeing up all memory associated - with it. In the case of sub-windows, they should be deleted - before the main window. - - dupwin(win) - - mvderwin(win,y,x) - - syncok(win,bf) - wsyncup(win) - wcursyncup(win) - wsyncdown(win) - - mvwin(win, by, bx) - Move the window so that the upper left corner will be at - position (by, bx). If the move would cause the window to be - off the screen, it is an error and the window is not moved. - - touchline(win,start,count) - touchwin(win) - Throw away all optimization information about which parts of - the window have been touched, by pretending the entire win- - dow has been drawn on. This is sometimes necessary when - using overlapping windows, since a change to one window will - affect the other window, but the optimization records of the - other window will not reflect the change. - - wtouchln(win,y,n,changed) - Throw away optimization information, or mark as unchanged, - n lines starting at y, depending on the value of changed. - - untouchwin(win) - Mark the whole window as unchcnged since the lat wrefresh. - - is_linetouched(win,line) - is_wintouched(win) - These routines are used to check if the given line/window - has been modified since the last wrefresh. They will return - TRUE is that is the case, FALSE otherwise. is_linetouched - will return ERR if there is no such line. - - overlay(win1, win2) - overwrite(win1, win2) - These functions overlay win1 on top of win2, that is, all - text in win1 is copied into win2, after lining up the two - windows' origins. The difference between the functions is - that overlay is nondestructive (blanks are not copied) while - overwrite is destructive. - - copywin(win,win,sminrow,smincol,dminrow,dmincol,dmaxrow, - dmaxcol,overlay) - Low level function used to implement overlay/overwrite. - - 5.5. Causing Output to the Terminal - - refresh() - wrefresh(win) - These functions must be called to actually get any output on - the terminal, as other routines merely manipulate data - structures. wrefresh copies the named window to the physi- - cal terminal screen, taking into account what is already - there in order to do optimizations. refresh is the same, - using stdscr as a default screen. Unless leaveok has been - enabled, the physical cursor of the terminal is left at the - location of the window's cursor. - - doupdate() - wnoutrefresh(win) - These two functions allow multiple updates with more effi- - ciency than wrefresh. To use them, it is important to - understand how curses works. In addition to all the window - structures, curses keeps two data structures representing - the terminal screen: a physical screen, describing what is - actually on the screen, and a virtual screen, describing - what the programmer wants to have on the screen. wrefresh - works by first copying the named window to the virtual - screen (wnoutrefresh), and then calling the routine to - update the screen (doupdate). If the programmer wishes to - output several windows at once, a series of calls to wre- - fresh will result in alternating calls to wnoutrefresh and - doupdate, causing several bursts of output to the screen. - By calling wnoutrefresh for each window, it is then possible - to call doupdate once, resulting in only one burst of out- - put, with probably fewer total characters transmitted. - - redrawwin(win) - wredrawln(win,start,count) - - 5.6. Writing on Window Structures - - These routines are used to ``draw'' text on windows. In all - cases, a missing win is taken to be stdscr. y and x are the - row and column, respectively. The upper left corner is - always (0, 0) not (1, 1). The mv functions imply a call to - move before the call to the other function. - - 5.6.1. Moving the Cursor - - move(y, x) - wmove(win, y, x) - The cursor associated with the window is moved to the given - location. This does not move the physical cursor of the - terminal until refresh is called. - - 5.6.2. Writing One Character - - addch(ch) - waddch(win, ch) - mvaddch(y, x, ch) - mvwaddch(win, y, x, ch) - The character ch is put in the window at the current cursor - position of the window. If ch is a tab, newline, or - backspace, the cursor will be moved appropriately in the - window. If ch is a different control character, it will be - drawn in the ^X notation. The position of the window cursor - is advanced. At the right margin, an automatic newline is - performed. At the bottom of the scrolling region, if scrol- - lok is enabled, the scrolling region will be scrolled up one - line. - - 5.6.3. Writing a String - - addstr(str) - addnstr(str,n) - waddstr(win,str) - waddnstr(win,str,n) - mvaddstr(y,x,str) - mvaddnstr(y,x,str,n) - mvwaddstr(win,y,x,str) - mvwaddnstr(win,y,x,str,n) - These functions write all the characters of the null termi- - nated character string str on the given window. They are - identical to a series of calls to addch. Routines with 'n' - write n characters of str. If n is -1 then the entire string - is written. - - addchstr(chstr) - addchnstr(chstr,n) - waddchstr(win,chstr) - waddchnstr(win,chstr,n) - mvaddchstr(y,x,chstr) - mvaddchnstr(y,x,chstr,n) - mvwaddchstr(win,y,x,chstr) - mvwaddchnstr(win,y,x,chstr,n) - These functions copy chstr onto the window image starting at - the current cursor position. Routines with 'n' write at most - n characters of chstr (as many as will fit on the line). If - n is -1 then the entire string is written. The cursor is not - advanced and no checking for control characters is done. - These routines are faster than the addstr() group. chstr is - a pointer to an array of chtype. - - 5.6.4. Clearing Areas of the Screen - - erase() - werase(win) - These functions copy blanks to every position in the window. - - clear() - wclear(win) - These functions are like erase and werase but they also call - clearok, arranging that the screen will be cleared on the - next refresh. The result can visually annoying. - - clrtobot() - wclrtobot(win) - All lines below the cursor in this window are erased. Also, - the current line to the right of the cursor is erased. - - clrtoeol() - wclrtoeol(win) - The current line to the right of the cursor is erased. - - 5.6.5. Inserting and Deleting Text - - delch() - wdelch(win) - mvdelch(y,x) - mvwdelch(win,y,x) - The character under the cursor in the window is deleted. - All characters to the right on the same line are moved to - the left one position. This does not imply use of the hard- - ware delete character feature. - - deleteln() - wdeleteln(win) - The line under the cursor in the window is deleted. All - lines below the current line are moved up one line. The - bottom line of the window is cleared. This does not imply - use of the hardware delete line feature. - - insch(c) - winsch(win, c) - mvinsch(y,x,c) - mvwinsch(win,y,x,c) - The character c is inserted before the character under the - cursor. All characters to the right are moved one space to - the right, possibly losing the rightmost character on the - line. This does not imply use of the hardware insert char- - acter feature. - - insertln() - winsertln(win) - A blank line is inserted above the current line. The bottom - line is lost. This does not imply use of the hardware - insert line feature. - - 5.6.6. Formatted Output - - printw(fmt, ...) - wprintw(win, fmt, ...) - mvprintw(y, x, fmt, ...) - mvwprintw(win, y, x, fmt, ...) - vwprintw(win, fmt, va_list) - These functions correspond to printf. The characters which - would be output by printf are instead output using waddch on - the given window. vwprintw() acts like vprintf(). - - 5.6.7. Line drawing - - Borders are drawn inside a window and not around it. - - border(ls, rs, ts, bs, tl, tr, bl, br) - wborder(win, ls, rs, ts, bs, tl, tr, bl, br) - box(win, vert, hor) - A border is drawn around the edges of the window. ls, rs, - ts, bs, tl, tr, bl, and br are the character and attribute - to draw the left side, right side, top side, bottom side, - top left, top right, bottom left, and bottom right respec- - tively. - If any of these are 0, the follwing defaults are used: - ACS_VLINE. ACS_VLINE, ACS_HLINE, ACS_HLINE, ACS_ULCORNER, - ACS_URCORNER, ACS_LLCORNER, ACS_LRCORNER. box is shorthand - for wborder(win, vert, vert, hor, hor, 0, 0, 0, 0). - - vline(ch,n) - wvline(win,ch,n) - These functions draw a vertical line starting at the current - cursor position using ch for n characters or as many as will - fit on the window. The cursor position is not advanced. - - hline(ch,n) - whline(win,ch,n) - These functions draw a horizontal line starting at the - current cursor position using ch for n characters or as many - as will fit on the window. The cursor position is not - advanced. - - 5.6.8 Scrolling - - Scrolling only works if enabled via scrollok(). The cursor - position is unchanged by these functions. As an optimization - the physical screen is scrolled if the window in question is - covering the entire screen. - - scroll(win) - The window is scrolled up one line. This involves moving - the lines in the window data structure. - - scrl(n) - wscrl(win,n) - These functions scroll thw window up/down n lines depending - on the sign on n (+ for up, - for down). - - 5.7. Querying the Contents of a Window - - getyx(win,y,x) - The cursor position of the window is placed in the two - integer variables y and x. Since this is a macro, no & is - necessary. - - inch() - winch(win) - mvinch(y,x) - mvwinch(win,y,x) - The character at the current position in the named window is - returned. - - 5.8. Input from the Terminal - - getch() - wgetch(win) - mvgetch(y,x) - mvwgetch(win,y,x) - A character is read from the terminal associated with the - window. In nodelay mode, if there is no input waiting, the - value -1 is returned. In delay mode, the program will hang - until a character is typed. - - If keypad mode is enabled, and a function key is pressed, - the code for that function key will be returned instead of - the raw characters. Possible function keys are defined with - integers beginning with 0401, whose names begin with KEY_, - defined in <ncurses.h>. If a character is received that - could be the beginning of a function key (such as escape), - curses will set a one second timer. If the remainder of the - sequence does not come in within one second, the character - will be passed through, otherwise the function key value - will be returned. For this reason, on many terminals, there - will be a one second delay after a user presses the escape - key. (Use by a programmer of the escape key for a single - character function is discouraged.) The one second delay can - be turned off using the notimeout() function. - - getstr(str) - wgetstr(win,str) - mvgetstr(y,x,str) - mvwgetstr(win,y,x,str) - A series of calls to getch is made, until a newline is - received. The resulting value is placed in the area pointed - at by the character pointer str. The users erase and kill - characters are interpreted, and the string is echoed. - - scanw(fmt, ...) - wscanw(win, fmt, ...) - mvscanw(y, x, fmt, ...) - mvwscanw(win, y, x, fmt, ...) - vwscanw(win,fmt,va_list) - These functions corresponds to scanf. wgetstr is called on - the window, and the resulting line is used as input for the - scan. - - 5.9. Video Attributes - - attroff(at) - wattroff(win, attrs) - attron(at) - wattron(win, attrs) - attrset(at) - wattrset(win, attrs) - standout() - standend() - wstandout(win) - wstandend(win) - These functions set the current attributes of the named win- - dow. These attributes can be any combination of A_STANDOUT, - A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_BLANK, A_UNDERLINE, - A_PROTECT, A_INVIS, and A_ALTCHARSET. These constants are - defined in <ncurses.h> and can be combined with the C | (or) - operator. The current attributes of a window are applied to - all characters that are written into the window. Attributes - are a property of the character, and move with the char- - acter through any scrolling and insert/delete line/character - operations. To the extent possible on the particular - terminal, they will be displayed as the graphic rendition - of characters put on the screen. - attrset(at) sets the current attributes of the given window - to at. attroff(at) turns off the named attributes without - affecting any other attributes. attron(at) turns on the - named attributes without affecting any others. standout is - the same as attrset(A_STANDOUT), standend is the same as - attrset(0), that is, it turns off all attributes. - - 5.10. Color Manipulation - - Ncurses provides support for the use of color on terminals - that are capable of display it. Note the BSD and older SYSV - curses don't support color. Color support in the PC version - is not compatible with SYSR4. - - has_colors() - this function returns TRUE if the terminal supports color, - FALSE otherwise. Other color handling funtions will return - ERR if has_colors() is FALSE. You should always check before - using color and use other video attributes to replace color. - - can_change_color() - This function returns TRUE if the terminal is capable of - redefining colors using the init_color function, FALSE if it - can't. Don't use init_color and color_content if it returns - FALSE. - - start_color() - This function must be called before any other color handling - function is called. It initializes the 8 basic colors (see - appendix I) and sets the global variables COLORS and COLOR_ - PAIRS to the maximum number of colors and color-pairs a - terminal can handle. - - init_pair(pair, fg, bg) - This function changes the definition of a color-pair, pair. - Each pair has a foregroung color fg, and a background color - bg. Both values must be between 0 and COLORS-1. pair must be - between 1 and COLOR_PAIRS-1. - [If a pair is changed from a previous definition, the screen - is refreshed and all occurances of the color-pair are - changed to reflect the change.] - - pair_content(pair, f, b) - This function stores the foreground and background colors of - the color-pair pair into the variables pointed to by f, b. - pair should be between 1 and COLOR_PAIRS-1. - - init_color(color, r, g, b) - This function changes the value of a given color. A color is - defined by its red, green, and blue components, r, g, and b. - These values must be between 0 and 1000. color should be - between 0 and COLORS-1. - - color_content(color, r, g, b) - This function puts the red, green, and blue components of - color into the variable pointed to by r, g, b respectively. - color should be between 0 and COLORS-1. - - 5.11. Pads - - 5.12. Soft Labels - - 5.13. Bells and Flashing Lights - - beep() - flash() - These functions are used to signal the programmer. beep - will sound the audible alarm on the terminal, if possible, - and if not, will flash the screen (visible bell), if that is - possible. flash will flash the screen, and if that is not - possible, will sound the audible signal. If neither signal - is possible, nothing will happen. Nearly all terminals have - an audible signal (bell or beep) but only some can flash the - screen. - - 5.14. Portability Functions - - These functions do not have anything to do with terminal - dependent character output, but tend to be needed by pro- - grams that use curses. Unfortunately, their implemention - varies from one version of UNIX* to another. They have been - included here to enhance the portability of programs using - curses. - - baudrate() - baudrate returns the output speed of the terminal. The num- - ber returned is the integer baud rate, for example, 9600, - rather than a table index such as B9600. - - erasechar() - The erase character chosen by the user is returned. This is - the character typed by the user to erase the character just - typed. - - killchar() - The line kill character chosen by the user is returned. - This is the character typed by the user to forget the entire - line being typed. - - flushinp() - flushinp throws away any typeahead that has been typed by - the user and has not yet been read by the program. - - 5.15. Debugging - - These functions are useful when debugging a program with - curses. - - unctrl(ch) - This macro expands to a character string which is a print- - able representation of the character ch. The program must - include the file <unctrl.h>. Control characters are dis- - played in the ^x notation. Printing characters are displayed - as is. - - traceoff() - traceon() - It is possible to compile a debugging version of curses with - tracing turned on, and with the -g option for gdb. This - library may be available on your system as -ldcurses. When - using this version, the file ``trace'' will be created each - time the program is run, containing verbose information - showing each step done by curses. This output is useful for - finding bugs in curses, and may be useful for finding bugs - in user programs. Since the output is so verbose, with any - bug that cannot be easily and quickly reproduced, it may be - necessary to turn the debugging output off in some parts of - the program. These functions can be used to turn tracing - off and back on. When initscr is first called, tracing is - automatically turned on. - You should use -DTRACE when compiling programs that use - tracing. - - _tracef() - This function can be used to output your own debugging info- - rmation. It is only available only if you compile with the - -DTRACE flag and linking with -ldcurses. It can be used the - same way as printf, only it outputs a newline after the end - of arguments. - - 6. Lower Level Functions - - These functions are provided for programs not needing the - screen optimization capabilities of curses. Programs are - discouraged from working at this level, since they must han- - dle various glitches in certain terminals. However, a pro- - gram can be smaller if it only brings in the low level rou- - tines. - - gettmode() - setterm(type) - These two initialization routines are provided for upward - compatibility with the old curses. gettmode does nothing. - setterm results in a call to setupterm with appropriate - arguments. - - def_prog_mode() - def_shell_mode() - These functions define "program" mode and "shell" mode. The - first describes the status of a terminal while in curses, - the second the status outside curses. - - reset_prog_mode() - reset_shell_mode() - These functions restore a terminal to "program" mode after - shelling out, or to "shell" mode before shelling out. - - fixterm() - resetterm() - These functions are obselete and have been replaced by - reset_prog_mode() and reset_prog_mode() respectively. - - saveterm() - This fucntion is obselete and is replaced by - def_prog_mode(). - - mvcur(oldrow, oldcol, newrow, newcol) - This routine optimally moves the cursor from (oldrow, old- - col) to (newrow, newcol). The user program is expected to - keep track of the current cursor position. Note that unless - a full screen image is kept, curses will have to make pes- - simistic assumptions, sometimes resulting in less than opti- - mal cursor motion. For example, moving the cursor a few - spaces to the right can be done by transmitting the charac- - ters being moved over, but if curses does not have access to - the screen image, it doesn't know what these characters are. - If either of oldcol or oldrow are negative, mvcur() will - refrain from using any relative motions. This is handy for - occasions when a program is unsure as to the current cursor - location. - - 7. Terminfo Level - - These routines are called by low level programs that need - access to specific capabilities of terminfo. A program - working at this level should include both <ncurses.h> and - <term.h>. After a call to setupterm, the capabilities will - be available with macro names defined in <term.h>. See ter- - minfo(5) for a detailed description of the capabilies. If - the program only needs to handle one terminal, the defini- - tion -DSINGLE can be passed to the C compiler, resulting in - static references to capabilities instead of dynamic refer- - ences. This can result in smaller code, but prevents use of - more than one terminal at a time. Very few programs use - more than one terminal, so almost all programs can use this - flag. - - setupterm(term, filenum, errret) - This routine is called to initialize a terminal. term is - the character string representing the name of the terminal - being used. filenum is the UNIX file descriptor of the ter- - minal being used for output. errret is a pointer to an - integer, in which a success or failure indication is - returned. The values returned can be 1 (all is well), 0 (no - such terminal), or -1 (some problem locating the terminfo - database). - The value of term can be given as 0, which will cause the - value of TERM in the environment to be used. The errret - pointer can also be given as 0, meaning no error code is - wanted. If errret is defaulted, and something goes wrong, - setupterm will print an appropriate error message and exit, - rather than returning. Thus, a simple program can call - setupterm(0, 1, 0) and not worry about initialization - errors. - setupterm will check the tty driver mode bits, and change - any that might prevent the correct operation of other low - level routines. Currently, the mode that expands tabs into - spaces is disabled, because the tab character is sometimes - used for different functions by different terminals. (Some - terminals use it to move right one space. Others use it to - address the cursor to row or column 9.) If the system is - expanding tabs, setupterm will remove the definition of the - tab and backtab functions, assuming that since the user is - not using hardware tabs, they may not be properly set in the - terminal. - After the call to setupterm, the global variable cur_term is - set to point to the current structure of terminal capabili- - ties. By calling setupterm for each terminal, and saving - and restoring cur_term, it is possible for a program to use - two or more terminals at once. Setupterm also stores the - names section of the terminal description in the global - character array ttytype[]. Subsequent calls to setupterm - will overwrite this array, so you'll have to save it your- - self if need be. - The mode that turns newlines into CRLF on output is not dis- - abled. Programs that use cud1 or ind should avoid these - capabilities if their value is linefeed unless they disable - this mode. setupterm calls fixterm after any changes it - makes. - - vidattr(newmode) - vidputs(newmode, outc) - newmode is any combination of attributes, defined in - <ncurses.h>. The proper string to put the terminal in the - given video mode is output. The routine vidattr() sends the - output characters to putchar; vidputs sends them to the - given routine outc, one character at a time. That routine - should therefore expect one char parameter. The previous - mode is remembered by this routine. - - tparm(instring, p1, p2, p3, p4, p5, p6, p7, p8, p9) - tparm is used to instantiate a parameterized string. The - character string returned is suitable for tputs. Up to 9 - parameters can be passed, in addition to the parameterized - string. - - tputs(cp, affcnt, outc) - A string capability, possibly containing padding informa- - tion, is processed. Enough padding characters to delay for - the specified time replace the padding specification, and - the resulting string is passed, one character at a time, to - the routine outc, which should expect one character parame- - ter. (This routine often just calls putchar.) cp is the - capability string. affcnt is the number of units affected - by the capability, which varies with the particular capabil- - ity. (For example, the affcnt for insert_line is the number - of lines below the inserted line on the screen, that is, the - number of lines that will have to be moved by the terminal.) - affcnt is used by the padding information of some terminals - as a multiplication factor. If the capability does not have - a factor, the value 1 should be passed. - - putp(str) - This is a convenient function to output a capability with no - affcnt. The string is output to putchar with an affcnt of - 1. It can be used in simple applications that do not need - to process the output of tputs. - - - 8. Termcap Emulation - - Appendix I: Attributes - ---------------------- - - Attributes are used with wattron(), wattroff(), wattrset(), - or or'ed with the character passed to waddch(). They are - defined in <ncurses.h> - - A_ATTRIBUTES mask chtype for attributes - A_NORMAL reset all attributes - A_STANDOUT best highlighting mode - A_UNDERLINE underline - A_REVERSE reverse video, background and foreground reversed - A_BLINK blinking - A_DIM dim or half bright - A_BOLD bold or extra bright - A_ALTCHARSET use alternate character set - A_INVIS invisible, background same as foreground - A_PROTECT I haven't a clue - A_CHARTEXT mask chtype for actual character - A_COLOR mask for color - COLOR_PAIR(n) set color-pair to that stored in n - PAIR_NUMBER(a) get color-pair stored in attribute a - - - Appendix II: COLORS - ------------------- - - Colors are defined in <ncurses.h> are used with init_pair(). - - COLOR_BLACK 0 - COLOR_RED 1 - COLOR_GREEN 2 - COLOR_YELLOW 3 - COLOR_BLUE 4 - COLOR_MAGENTA 5 - COLOR_CYAN 6 - COLOR_WHITE 7 - - Appendix III: Alternative character sets - ---------------------------------------- - - ACS variables are used to add line-drawing capability to - ncurses on terminals that support it. When defined for a - given terminal (using acs) the A_ALTCHARSET attribute is - set for that variable, otherwise the default value is - used. - - ACS_ULCORNER + - ACS_LLCORNER + - ACS_URCORNER + - ACS_LRCORNER + - ACS_RTEE + - ACS_LTEE + - ACS_BTEE + - ACS_TTEE + - ACS_HLINE - - ACS_VLINE | - ACS_PLUS + - ACS_S1 ~ /* scan line 1 */ - ACS_S9 _ /* scan line 9 */ - ACS_DIAMOND + /* diamond */ - ACS_CKBOARD : /* checker board (stipple) */ - ACS_DEGREE ' /* degree symbol */ - ACS_PLMINUS # /* plus/minus */ - ACS_BULLET 0 /* bullet */ - ACS_LARROW < /* arrow pointing left */ - ACS_RARROW > /* arrow pointing right */ - ACS_DARROW v /* arrow pointing down */ - ACS_UARROW ^ /* arrow pointing up */ - ACS_BOARD # /* board of squares */ - ACS_LANTERN # /* lantern symbol */ - ACS_BLOCK # /* solid square block */ - - - Appendix IV: Function keys, their codes, and their definition - ------------------------------------------------------------- - - Function keys can return their respective codes if keypad() - is enabled and they are defined in the terminal's terminfo - description (assuming the terminal transmits unique sequences - for the key. They are defined in <ncurses.h> - - KEY_BREAK 0401 /* break key (unreliable) */ - KEY_DOWN 0402 /* The four arrow keys ... */ - KEY_UP 0403 - KEY_LEFT 0404 - KEY_RIGHT 0405 /* ... */ - KEY_HOME 0406 /* Home key (upward+left arrow) */ - KEY_BACKSPACE 0407 /* backspace (unreliable) */ - KEY_F0 0410 /* Function keys. Space for 64 */ - KEY_F(n) (KEY_F0+(n)) /* keys is reserved. */ - KEY_DL 0510 /* Delete line */ - KEY_IL 0511 /* Insert line */ - KEY_DC 0512 /* Delete character */ - KEY_IC 0513 /* Insert char or enter insert mode */ - KEY_EIC 0514 /* Exit insert char mode */ - KEY_CLEAR 0515 /* Clear screen */ - KEY_EOS 0516 /* Clear to end of screen */ - KEY_EOL 0517 /* Clear to end of line */ - KEY_SF 0520 /* Scroll 1 line forward */ - KEY_SR 0521 /* Scroll 1 line backwards (reverse) */ - KEY_NPAGE 0522 /* Next page */ - KEY_PPAGE 0523 /* Previous page */ - KEY_STAB 0524 /* Set tab */ - KEY_CTAB 0525 /* Clear tab */ - KEY_CATAB 0526 /* Clear all tabs */ - KEY_ENTER 0527 /* Enter or send (unreliable) */ - KEY_SRESET 0530 /* soft (partial) reset (unreliable) */ - KEY_RESET 0531 /* reset or hard reset (unreliable) */ - KEY_PRINT 0532 /* print or copy */ - KEY_LL 0533 /* home down or bottom (lower left) */ - - /* The keypad is arranged like this: */ - /* a1 up a3 */ - /* left b2 right */ - /* c1 down c3 */ - - KEY_A1 0534 /* Upper left of keypad */ - KEY_A3 0535 /* Upper right of keypad */ - KEY_B2 0536 /* Center of keypad */ - KEY_C1 0537 /* Lower left of keypad */ - KEY_C3 0540 /* Lower right of keypad */ - KEY_BTAB 0541 /* Back tab key */ - KEY_BEG 0542 /* beg(inning) key */ - KEY_CANCEL 0543 /* cancel key */ - KEY_CLOSE 0544 /* close key */ - KEY_COMMAND 0545 /* cmd (command) key */ - KEY_COPY 0546 /* copy key */ - KEY_CREATE 0547 /* create key */ - KEY_END 0550 /* end key */ - KEY_EXIT 0551 /* exit key */ - KEY_FIND 0552 /* find key */ - KEY_HELP 0553 /* help key */ - KEY_MARK 0554 /* mark key */ - KEY_MESSAGE 0555 /* message key */ - KEY_MOVE 0556 /* move key */ - KEY_NEXT 0557 /* next object key */ - KEY_OPEN 0560 /* open key */ - KEY_OPTIONS 0561 /* options key */ - KEY_PREVIOUS 0562 /* previous object key */ - KEY_REDO 0563 /* redo key */ - KEY_REFERENCE 0564 /* ref(erence) key */ - KEY_REFRESH 0565 /* refresh key */ - KEY_REPLACE 0566 /* replace key */ - KEY_RESTART 0567 /* restart key */ - KEY_RESUME 0570 /* resume key */ - KEY_SAVE 0571 /* save key */ - KEY_SBEG 0572 /* shifted beginning key */ - KEY_SCANCEL 0573 /* shifted cancel key */ - KEY_SCOMMAND 0574 /* shifted command key */ - KEY_SCOPY 0575 /* shifted copy key */ - KEY_SCREATE 0576 /* shifted create key */ - KEY_SDC 0577 /* shifted delete char key */ - KEY_SDL 0600 /* shifted delete line key */ - KEY_SELECT 0601 /* select key */ - KEY_SEND 0602 /* shifted end key */ - KEY_SEOL 0603 /* shifted clear line key */ - KEY_SEXIT 0604 /* shifted exit key */ - KEY_SFIND 0605 /* shifted find key */ - KEY_SHELP 0606 /* shifted help key */ - KEY_SHOME 0607 /* shifted home key */ - KEY_SIC 0610 /* shifted input key */ - KEY_SLEFT 0611 /* shifted left arrow key */ - KEY_SMESSAGE 0612 /* shifted message key */ - KEY_SMOVE 0613 /* shifted move key */ - KEY_SNEXT 0614 /* shifted next key */ - KEY_SOPTIONS 0615 /* shifted options key */ - KEY_SPREVIOUS 0616 /* shifted prev key */ - KEY_SPRINT 0617 /* shifted print key */ - KEY_SREDO 0620 /* shifted redo key */ - KEY_SREPLACE 0621 /* shifted replace key */ - KEY_SRIGHT 0622 /* shifted right arrow */ - KEY_SRSUME 0623 /* shifted resume key */ - KEY_SSAVE 0624 /* shifted save key */ - KEY_SSUSPEND 0625 /* shifted suspend key */ - KEY_SUNDO 0626 /* shifted undo key */ - KEY_SUSPEND 0627 /* suspend key */ - KEY_UNDO 0630 /* undo key */ - KEY_MAX 0777 /* Maximum curses key */ - diff --git a/lib/libncurses/keys.list b/lib/libncurses/keys.list deleted file mode 100644 index e766f32f03b6..000000000000 --- a/lib/libncurses/keys.list +++ /dev/null @@ -1,149 +0,0 @@ -key_a1 KEY_A1 -key_a3 KEY_A3 -key_b2 KEY_B2 -key_backspace KEY_BACKSPACE -key_beg KEY_BEG -key_btab KEY_BTAB -key_c1 KEY_C1 -key_c3 KEY_C3 -key_cancel KEY_CANCEL -key_catab KEY_CATAB -key_clear KEY_CLEAR -key_close KEY_CLOSE -key_command KEY_COMMAND -key_copy KEY_COPY -key_create KEY_CREATE -key_ctab KEY_CTAB -key_dc KEY_DC -key_dl KEY_DL -key_down KEY_DOWN -key_eic KEY_EIC -key_end KEY_END -key_enter KEY_ENTER -key_eol KEY_EOL -key_eos KEY_EOS -key_exit KEY_EXIT -key_f0 KEY_F(0) -key_f1 KEY_F(1) -key_f2 KEY_F(2) -key_f3 KEY_F(3) -key_f4 KEY_F(4) -key_f5 KEY_F(5) -key_f6 KEY_F(6) -key_f7 KEY_F(7) -key_f8 KEY_F(8) -key_f9 KEY_F(9) -key_f10 KEY_F(10) -key_f11 KEY_F(11) -key_f12 KEY_F(12) -key_f13 KEY_F(13) -key_f14 KEY_F(14) -key_f15 KEY_F(15) -key_f16 KEY_F(16) -key_f17 KEY_F(17) -key_f18 KEY_F(18) -key_f19 KEY_F(19) -key_f20 KEY_F(20) -key_f21 KEY_F(21) -key_f22 KEY_F(22) -key_f23 KEY_F(23) -key_f24 KEY_F(24) -key_f25 KEY_F(25) -key_f26 KEY_F(26) -key_f27 KEY_F(27) -key_f28 KEY_F(28) -key_f29 KEY_F(29) -key_f30 KEY_F(30) -key_f31 KEY_F(31) -key_f32 KEY_F(32) -key_f33 KEY_F(33) -key_f34 KEY_F(34) -key_f35 KEY_F(35) -key_f36 KEY_F(36) -key_f37 KEY_F(37) -key_f38 KEY_F(38) -key_f39 KEY_F(39) -key_f40 KEY_F(40) -key_f41 KEY_F(41) -key_f42 KEY_F(42) -key_f43 KEY_F(43) -key_f44 KEY_F(44) -key_f45 KEY_F(45) -key_f46 KEY_F(46) -key_f47 KEY_F(47) -key_f48 KEY_F(48) -key_f49 KEY_F(49) -key_f50 KEY_F(50) -key_f51 KEY_F(51) -key_f52 KEY_F(52) -key_f53 KEY_F(53) -key_f54 KEY_F(54) -key_f55 KEY_F(55) -key_f56 KEY_F(56) -key_f57 KEY_F(57) -key_f58 KEY_F(58) -key_f59 KEY_F(59) -key_f60 KEY_F(60) -key_f61 KEY_F(61) -key_f62 KEY_F(62) -key_f63 KEY_F(63) -key_find KEY_FIND -key_help KEY_HELP -key_home KEY_HOME -key_ic KEY_IC -key_il KEY_IL -key_left KEY_LEFT -key_ll KEY_LL -key_mark KEY_MARK -key_message KEY_MESSAGE -key_move KEY_MOVE -key_next KEY_NEXT -key_npage KEY_NPAGE -key_open KEY_OPEN -key_options KEY_OPTIONS -key_ppage KEY_PPAGE -key_previous KEY_PREVIOUS -key_print KEY_PRINT -key_redo KEY_REDO -key_reference KEY_REFERENCE -key_refresh KEY_REFRESH -key_replace KEY_REPLACE -key_restart KEY_RESTART -key_resume KEY_RESUME -key_right KEY_RIGHT -key_save KEY_SAVE -key_sbeg KEY_SBEG -key_scancel KEY_SCANCEL -key_scommand KEY_SCOMMAND -key_scopy KEY_SCOPY -key_screate KEY_SCREATE -key_sdc KEY_SDC -key_sdl KEY_SDL -key_select KEY_SELECT -key_send KEY_SEND -key_seol KEY_SEOL -key_sexit KEY_SEXIT -key_sf KEY_SF -key_sfind KEY_SFIND -key_shelp KEY_SHELP -key_shome KEY_SHOME -key_sic KEY_SIC -key_sleft KEY_SLEFT -key_smessage KEY_SMESSAGE -key_smove KEY_SMOVE -key_snext KEY_SNEXT -key_soptions KEY_SOPTIONS -key_sprevious KEY_SPREVIOUS -key_sprint KEY_SPRINT -key_sr KEY_SR -key_sredo KEY_SREDO -key_sreplace KEY_SREPLACE -key_sright KEY_SRIGHT -key_srsume KEY_SRSUME -key_ssave KEY_SSAVE -key_ssuspend KEY_SSUSPEND -key_stab KEY_STAB -key_sundo KEY_SUNDO -key_suspend KEY_SUSPEND -key_undo KEY_UNDO -key_up KEY_UP diff --git a/lib/libncurses/lib_acs.c b/lib/libncurses/lib_acs.c deleted file mode 100644 index 2b6d25b087d1..000000000000 --- a/lib/libncurses/lib_acs.c +++ /dev/null @@ -1,98 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - - -#include "curses.priv.h" -#include "terminfo.h" -#include <string.h> - -/* line graphics */ - - -chtype acs_map[128]; - -void init_acs() -{ - -/* - ACS_ULCORNER (acs_map['l']) - ACS_LLCORNER (acs_map['m']) - ACS_URCORNER (acs_map['k']) - ACS_LRCORNER (acs_map['j']) - ACS_RTEE (acs_map['u']) - ACS_LTEE (acs_map['t']) - ACS_BTEE (acs_map['v']) - ACS_TTEE (acs_map['w']) - ACS_HLINE (acs_map['q']) - ACS_VLINE (acs_map['x']) - ACS_PLUS (acs_map['n']) - ACS_S1 (acs_map['o']) scan line 1 - ACS_S9 (acs_map['s']) scan line 9 - ACS_DIAMOND (acs_map['`']) diamond - ACS_CKBOARD (acs_map['a']) checker board (stipple) - ACS_DEGREE (acs_map['f']) degree symbol - ACS_PLMINUS (acs_map['g']) plus/minus - ACS_BULLET (acs_map['~']) bullet - ACS_LARROW (acs_map[',']) arrow pointing left - ACS_RARROW (acs_map['+']) arrow pointing right - ACS_DARROW (acs_map['.']) arrow pointing down - ACS_UARROW (acs_map['-']) arrow pointing up - ACS_BOARD (acs_map['h']) board of squares - ACS_LANTERN (acs_map['I']) lantern symbol - ACS_BLOCK (acs_map['0']) solid square block -*/ - - T(("initializing ACS map")); - - acs_map['l'] = acs_map['m'] = acs_map['k'] = acs_map['j'] = - acs_map['u'] = acs_map['t'] = acs_map['v'] = acs_map['w'] = (chtype)'+' & A_CHARTEXT; - acs_map['q'] = (chtype)'-' & A_CHARTEXT; - acs_map['x'] = (chtype)'|' & A_CHARTEXT; - acs_map['n'] = (chtype)'+' & A_CHARTEXT; - acs_map['o'] = (chtype)'~' & A_CHARTEXT; - acs_map['s'] = (chtype)'_' & A_CHARTEXT; - acs_map['`'] = (chtype)'+' & A_CHARTEXT; - acs_map['a'] = (chtype)':' & A_CHARTEXT; - acs_map['f'] = (chtype)'\'' & A_CHARTEXT; - acs_map['g'] = (chtype)'#' & A_CHARTEXT; - acs_map['~'] = (chtype)'o' & A_CHARTEXT; - acs_map[','] = (chtype)'<' & A_CHARTEXT; - acs_map['+'] = (chtype)'>' & A_CHARTEXT; - acs_map['.'] = (chtype)'v' & A_CHARTEXT; - acs_map['-'] = (chtype)'^' & A_CHARTEXT; - acs_map['h'] = (chtype)'#' & A_CHARTEXT; - acs_map['I'] = (chtype)'#' & A_CHARTEXT; - acs_map['0'] = (chtype)'#' & A_CHARTEXT; - - if (ena_acs != NULL) - putp(ena_acs); - - if (acs_chars != NULL) { - int i = 0; - int length = strlen(acs_chars); - - while (i < length) - switch (acs_chars[i]) { - case 'l':case 'm':case 'k':case 'j': - case 'u':case 't':case 'v':case 'w': - case 'q':case 'x':case 'n':case 'o': - case 's':case '`':case 'a':case 'f': - case 'g':case '~':case ',':case '+': - case '.':case '-':case 'h':case 'I': - case '0': - acs_map[(unsigned int)(unsigned char)acs_chars[i]] = - (acs_chars[++i] & A_CHARTEXT) | A_ALTCHARSET; - default: - i++; - break; - } - } -#ifdef TRACE - else { - T(("acsc not defined, using default mapping")); - } -#endif -} - diff --git a/lib/libncurses/lib_addch.c b/lib/libncurses/lib_addch.c deleted file mode 100644 index 60386b4056fb..000000000000 --- a/lib/libncurses/lib_addch.c +++ /dev/null @@ -1,127 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_addch.c -** -** The routine waddch(). -** -*/ - -#include "curses.priv.h" -#include "unctrl.h" - -static inline chtype render_char(WINDOW *win, chtype ch) -/* compute a rendition of the given char correct for the current context */ -{ - if (TextOf(ch) == ' ') - ch = ch_or_attr(ch, win->_bkgd); - else if (!(ch & A_ATTRIBUTES)) - ch = ch_or_attr(ch, (win->_bkgd & A_ATTRIBUTES)); - TR(TRACE_CHARPUT, ("bkg = %#lx -> ch = %#lx", win->_bkgd, ch)); - - return(ch); -} - -chtype _nc_background(WINDOW *win) -/* make render_char() visible while still allowing us to inline it below */ -{ - return(render_char(win, BLANK)); -} - -chtype _nc_render(WINDOW *win, chtype ch) -/* make render_char() visible while still allowing us to inline it below */ -{ - chtype c = render_char(win,ch); - return (ch_or_attr(c,win->_attrs)); -} - -static int -wladdch(WINDOW *win, chtype c, bool literal) -{ -int x, y; -int newx; -chtype ch = c; - - x = win->_curx; - y = win->_cury; - - if (y > win->_maxy || x > win->_maxx || y < 0 || x < 0) - return(ERR); - - /* ugly, but necessary --- and, bizarrely enough, even portable! */ - if (literal) - goto noctrl; - - switch (ch&A_CHARTEXT) { - case '\t': - for (newx = x + (8 - (x & 07)); x < newx; x++) - if (waddch(win, ' ') == ERR) - return(ERR); - return(OK); - case '\n': - wclrtoeol(win); - x = 0; - goto newline; - case '\r': - x = 0; - break; - case '\b': - if (--x < 0) - x = 0; - break; - default: - if (ch < ' ') - return(waddstr(win, unctrl(ch))); - - /* FALL THROUGH */ - noctrl: - T(("win attr = %x", win->_attrs)); - ch = render_char(win, ch); - ch = ch_or_attr(ch,win->_attrs); - - if (win->_line[y][x] != ch) { - if (win->_firstchar[y] == _NOCHANGE) - win->_firstchar[y] = win->_lastchar[y] = x; - else if (x < win->_firstchar[y]) - win->_firstchar[y] = x; - else if (x > win->_lastchar[y]) - win->_lastchar[y] = x; - - } - - T(("char %d of line %d is %x", x, y, ch)); - win->_line[y][x++] = ch; - if (x > win->_maxx) { - x = 0; -newline: - y++; - if (y > win->_regbottom) { - y--; - if (win->_scroll) - scroll(win); - } - } - break; - } - - win->_curx = x; - win->_cury = y; - - return(OK); -} - -int waddch(WINDOW *win, chtype ch) -{ - TR(TRACE_CHARPUT, ("waddch(%x,%c (%x)) called", win, ch&A_CHARTEXT, ch)); - return wladdch(win, ch, FALSE); -} - -int wechochar(WINDOW *win, chtype ch) -{ - T(("wechochar(%x,%c (%x)) called", win, ch&A_CHARTEXT, ch)); - - return wladdch(win, ch, TRUE); -} diff --git a/lib/libncurses/lib_addstr.c b/lib/libncurses/lib_addstr.c deleted file mode 100644 index d9cb30aae2fb..000000000000 --- a/lib/libncurses/lib_addstr.c +++ /dev/null @@ -1,56 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_addstr.c -* -** The routines waddnstr(), waddchnstr(). -** -*/ - -#include "curses.priv.h" - -int -waddnstr(WINDOW *win, char *str, int n) -{ - T(("waddnstr(%x,\"%s\",%d) called", win, visbuf(str), n)); - - if (str == NULL) - return ERR; - - if (n < 0) { - while (*str != '\0') { - if (waddch(win, (chtype)(unsigned char)*str++) == ERR) - return(ERR); - } - return OK; - } - - while((n-- > 0) && (*str != '\0')) { - if (waddch(win, (chtype)(unsigned char)*str++) == ERR) - return ERR; - } - return OK; -} - -int -waddchnstr(WINDOW *win, chtype *str, int n) -{ - T(("waddchnstr(%x,%x,%d) called", win, str, n)); - - if (n < 0) { - while (*str) { - if (waddch(win, (chtype)(unsigned char)*str++) == ERR) - return(ERR); - } - return OK; - } - - while(n-- > 0) { - if (waddch(win, (chtype)(unsigned char)*str++) == ERR) - return ERR; - } - return OK; -} diff --git a/lib/libncurses/lib_beep.c b/lib/libncurses/lib_beep.c deleted file mode 100644 index 60ce5920b20e..000000000000 --- a/lib/libncurses/lib_beep.c +++ /dev/null @@ -1,56 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* - * beep.c - * - * Routines beep() and flash() - * - */ - -#include "curses.priv.h" -#include "terminfo.h" - -/* - * beep() - * - * Sound the current terminal's audible bell if it has one. If not, - * flash the screen if possible. - * - */ - -int beep() -{ - T(("beep() called")); - - /* should make sure that we are not in altchar mode */ - if (bell) - return(putp(bell)); - else if (flash_screen) - return(putp(flash_screen)); - else - return(ERR); -} - -/* - * flash() - * - * Flash the current terminal's screen if possible. If not, - * sound the audible bell if one exists. - * - */ - -int flash() -{ - T(("flash() called")); - - /* should make sure that we are not in altchar mode */ - if (flash_screen) - return(putp(flash_screen)); - else if (bell) - return(putp(bell)); - else - return(ERR); -} diff --git a/lib/libncurses/lib_bkgd.c b/lib/libncurses/lib_bkgd.c deleted file mode 100644 index d75585c44427..000000000000 --- a/lib/libncurses/lib_bkgd.c +++ /dev/null @@ -1,49 +0,0 @@ - -/*************************************************************************** -* COPYRIGHT NOTICE * -**************************************************************************** -* ncurses is copyright (C) 1992, 1993, 1994 * -* by Zeyd M. Ben-Halim * -* zmbenhal@netcom.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, not removed * -* from header files, and is reproduced in any documentation * -* accompanying it or the applications linked with it. * -* * -* ncurses comes AS IS with no warranty, implied or expressed. * -* * -***************************************************************************/ - -#include "curses.h" -#include "curses.priv.h" - -int wbkgd(WINDOW *win, chtype ch) -{ -int x, y; -chtype old_bkgd = getbkgd(win); -chtype new_bkgd = ch; - - T(("wbkgd(%x, %x) called", win, ch)); - - if (TextOf(new_bkgd) == 0) - new_bkgd |= BLANK; - wbkgdset(win, new_bkgd); - wattrset(win, AttrOf(new_bkgd)); - - for (y = 0; y <= win->_maxy; y++) { - for (x = 0; x <= win->_maxx; x++) { - if (win->_line[y][x] == old_bkgd) - win->_line[y][x] = new_bkgd; - else - win->_line[y][x] = - TextOf(win->_line[y][x]) - | AttrOf(new_bkgd); - } - } - touchwin(win); - return OK; -} - diff --git a/lib/libncurses/lib_box.c b/lib/libncurses/lib_box.c deleted file mode 100644 index a467808c4cd6..000000000000 --- a/lib/libncurses/lib_box.c +++ /dev/null @@ -1,131 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_box.c -** -** line drawing routines: -** wborder() -** whline() -** wvline() -** -*/ - -#include "curses.priv.h" - -int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, - chtype bs, chtype tl, chtype tr, chtype bl, chtype br) -{ -int i; -int endx, endy; - - T(("wborder() called")); - - if (ls == 0) ls = ACS_VLINE; - if (rs == 0) rs = ACS_VLINE; - if (ts == 0) ts = ACS_HLINE; - if (bs == 0) bs = ACS_HLINE; - if (tl == 0) tl = ACS_ULCORNER; - if (tr == 0) tr = ACS_URCORNER; - if (bl == 0) bl = ACS_LLCORNER; - if (br == 0) br = ACS_LRCORNER; - - ls = _nc_render(win, ls); - rs = _nc_render(win, rs); - ts = _nc_render(win, ts); - bs = _nc_render(win, bs); - tl = _nc_render(win, tl); - tr = _nc_render(win, tr); - bl = _nc_render(win, bl); - br = _nc_render(win, br); - - T(("using %x, %x, %x, %x, %x, %x, %x, %x", ls, rs, ts, bs, tl, tr, bl, br)); - - endx = win->_maxx; - endy = win->_maxy; - - for (i = 0; i <= endx; i++) { - win->_line[0][i] = ts; - win->_line[endy][i] = bs; - } - win->_firstchar[endy] = win->_firstchar[0] = 0; - win->_lastchar[endy] = win->_lastchar[0] = endx; - - for (i = 0; i <= endy; i++) { - win->_line[i][0] = ls; - win->_line[i][endx] = rs; - win->_firstchar[i] = 0; - win->_lastchar[i] = endx; - } - win->_line[0][0] = tl; - win->_line[0][endx] = tr; - win->_line[endy][0] = bl; - win->_line[endy][endx] = br; - -#if 0 - if (! win->_scroll && (win->_flags & _SCROLLWIN)) - fp[0] = fp[endx] = lp[0] = lp[endx] = ' '; -#endif - - return OK; -} - -int whline(WINDOW *win, chtype ch, int n) -{ -int line; -int start; -int end; - - T(("whline(%x,%x,%d) called", win, ch, n)); - - line = win->_cury; - start = win->_curx; - end = start + n - 1; - if (end > win->_maxx) - end = win->_maxx; - - if (win->_firstchar[line] == _NOCHANGE || win->_firstchar[line] > start) - win->_firstchar[line] = start; - if (win->_lastchar[line] == _NOCHANGE || win->_lastchar[line] < start) - win->_lastchar[line] = end; - - if (ch == 0) - ch = ACS_HLINE; - while ( end >= start) { - win->_line[line][end] = ch | win->_attrs; - end--; - } - - return OK; -} - -int wvline(WINDOW *win, chtype ch, int n) -{ -int row, col; -int end; - - T(("wvline(%x,%x,%d) called", win, ch, n)); - - row = win->_cury; - col = win->_curx; - end = row + n - 1; - if (end > win->_maxy) - end = win->_maxy; - - if (ch == 0) - ch = ACS_VLINE; - - while(end >= row) { - win->_line[end][col] = ch | win->_attrs; - if (win->_firstchar[end] == _NOCHANGE || win->_firstchar[end] > col) - win->_firstchar[end] = col; - if (win->_lastchar[end] == _NOCHANGE || win->_lastchar[end] < col) - win->_lastchar[end] = col; - end--; - } - - return OK; -} - diff --git a/lib/libncurses/lib_clear.c b/lib/libncurses/lib_clear.c deleted file mode 100644 index c82db9bc13ec..000000000000 --- a/lib/libncurses/lib_clear.c +++ /dev/null @@ -1,24 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_clear.c -** -** The routine wclear(). -** -*/ - -#include "curses.priv.h" - -int wclear(WINDOW *win) -{ - T(("wclear(%x) called", win)); - - werase(win); - - win->_clear = TRUE; - - return OK; -} diff --git a/lib/libncurses/lib_clrbot.c b/lib/libncurses/lib_clrbot.c deleted file mode 100644 index e803920a8af7..000000000000 --- a/lib/libncurses/lib_clrbot.c +++ /dev/null @@ -1,53 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_clrbot.c -** -** The routine wclrtobot(). -** -*/ - -#include "curses.priv.h" - -int wclrtobot(WINDOW *win) -{ -chtype *ptr, *end, *maxx = NULL; -int y, startx, minx; - - T(("wclrtobot(%x) called", win)); - - startx = win->_curx; - - T(("clearing from y = %d to y = %d with maxx = %d", win->_cury, win->_maxy, win->_maxx)); - - for (y = win->_cury; y <= win->_maxy; y++) { - minx = _NOCHANGE; - end = &win->_line[y][win->_maxx]; - - for (ptr = &win->_line[y][startx]; ptr <= end; ptr++) { - chtype blank = _nc_background(win); - - if (*ptr != blank) { - maxx = ptr; - if (minx == _NOCHANGE) - minx = ptr - win->_line[y]; - *ptr = blank; - } - } - - if (minx != _NOCHANGE) { - if (win->_firstchar[y] > minx - || win->_firstchar[y] == _NOCHANGE) - win->_firstchar[y] = minx; - - if (win->_lastchar[y] < maxx - win->_line[y]) - win->_lastchar[y] = maxx - win->_line[y]; - } - - startx = 0; - } - return OK; -} diff --git a/lib/libncurses/lib_clreol.c b/lib/libncurses/lib_clreol.c deleted file mode 100644 index b0a15b9d2075..000000000000 --- a/lib/libncurses/lib_clreol.c +++ /dev/null @@ -1,48 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_clreol.c -** -** The routine wclrtoeol(). -** -*/ - -#include "curses.priv.h" - -int wclrtoeol(WINDOW *win) -{ -chtype *maxx, *ptr, *end; -int y, x, minx; - - T(("wclrtoeol(%x) called", win)); - - y = win->_cury; - x = win->_curx; - - end = &win->_line[y][win->_maxx]; - minx = _NOCHANGE; - maxx = &win->_line[y][x]; - - for (ptr = maxx; ptr <= end; ptr++) { - chtype blank = _nc_background(win); - - if (*ptr != blank) { - maxx = ptr; - if (minx == _NOCHANGE) - minx = ptr - win->_line[y]; - *ptr = blank; - } - } - - if (minx != _NOCHANGE) { - if (win->_firstchar[y] > minx || win->_firstchar[y] == _NOCHANGE) - win->_firstchar[y] = minx; - - if (win->_lastchar[y] < maxx - win->_line[y]) - win->_lastchar[y] = maxx - win->_line[y]; - } - return(OK); -} diff --git a/lib/libncurses/lib_color.c b/lib/libncurses/lib_color.c deleted file mode 100644 index 3d40a693f11d..000000000000 --- a/lib/libncurses/lib_color.c +++ /dev/null @@ -1,107 +0,0 @@ -/* This work is copyrighted. See COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* lib_color.c - * - * Handles color emulation of SYS V curses - * - */ - -#include <stdlib.h> -#include "curses.priv.h" -#include "terminfo.h" - -int COLOR_PAIRS; -int COLORS; -unsigned char *color_pairs; - -int start_color() -{ - T(("start_color() called.")); - - if (orig_pair != NULL) - putp(orig_pair); - else return ERR; - if (max_pairs != -1) - COLOR_PAIRS = max_pairs; - else return ERR; - color_pairs = malloc(max_pairs); - if (max_colors != -1) - COLORS = max_colors; - else return ERR; - SP->_coloron = 1; - - T(("started color: COLORS = %d, COLOR_PAIRS = %d", COLORS, COLOR_PAIRS)); - - return OK; -} - -int init_pair(short pair, short f, short b) -{ - T(("init_pair( %d, %d, %d )", pair, f, b)); - - if ((pair < 1) || (pair >= COLOR_PAIRS)) - return ERR; - if ((f < 0) || (f >= COLORS) || (b < 0) || (b >= COLORS)) - return ERR; - - /* still to do: - if pair was initialized before a screen update is performed - replacing original pair colors with the new ones - */ - - color_pairs[pair] = ( (f & 0x0f) | (b & 0x0f) << 4 ); - - return OK; -} - -int init_color(short color, short r, short g, short b) -{ - if (initialize_color != NULL) { - if (color < 0 || color >= COLORS) - return ERR; - if (hue_lightness_saturation == TRUE) - if (r < 0 || r > 360 || g < 0 || g > 100 || b < 0 || b > 100) - return ERR; - if (hue_lightness_saturation == FALSE) - if (r < 0 || r > 1000 || g < 0 || g > 1000 || b < 0 || b > 1000) - return ERR; - - putp(tparm(initialize_color, color, r, g, b)); - return OK; - } - - return ERR; -} - -bool can_change_color() -{ - return can_change; -} - -int has_colors() -{ - return ((orig_pair != NULL) && (max_colors != -1) && (max_pairs != -1) - && - (((set_foreground != NULL) && (set_background != NULL)) || - ((set_a_foreground != NULL) && (set_a_background != NULL))) - ); -} - -int color_content(short color, short *r, short *g, short *b) -{ - return ERR; -} - -int pair_content(short pair, short *f, short *b) -{ - - if ((pair < 1) || (pair > COLOR_PAIRS)) - return ERR; - *f = color_pairs[pair] & 0x0f; - *b = color_pairs[pair] & 0xf0; - *b >>= 4; - return OK; -} - diff --git a/lib/libncurses/lib_delch.c b/lib/libncurses/lib_delch.c deleted file mode 100644 index 0a0fd0a66fd7..000000000000 --- a/lib/libncurses/lib_delch.c +++ /dev/null @@ -1,39 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_delch.c -** -** The routine wdelch(). -** -*/ - -#include "curses.priv.h" -#include "terminfo.h" - -int wdelch(WINDOW *win) -{ -chtype *temp1, *temp2; -chtype *end; -chtype blank = _nc_background(win); - - T(("wdelch(%x) called", win)); - - end = &win->_line[win->_cury][win->_maxx]; - temp2 = &win->_line[win->_cury][win->_curx + 1]; - temp1 = temp2 - 1; - - while (temp1 < end) - *temp1++ = *temp2++; - - *temp1 = blank; - - win->_lastchar[win->_cury] = win->_maxx; - - if (win->_firstchar[win->_cury] == _NOCHANGE - || win->_firstchar[win->_cury] > win->_curx) - win->_firstchar[win->_cury] = win->_curx; - return OK; -} diff --git a/lib/libncurses/lib_delwin.c b/lib/libncurses/lib_delwin.c deleted file mode 100644 index 0edc73b28976..000000000000 --- a/lib/libncurses/lib_delwin.c +++ /dev/null @@ -1,36 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_delwin.c -** -** The routine delwin(). -** -*/ - -#include <stdlib.h> -#include "curses.priv.h" - -int delwin(WINDOW *win) -{ -int i; - - T(("delwin(%x) called", win)); - - if (! (win->_flags & _SUBWIN)) { - for (i = 0; i < win->_maxy && win->_line[i]; i++) - free(win->_line[i]); - } - - free(win->_firstchar); - free(win->_lastchar); - free(win->_line); - - touchwin((win->_flags & _SUBWIN) ? win->_parent : curscr); - - free(win); - - return(OK); -} diff --git a/lib/libncurses/lib_doupdate.c b/lib/libncurses/lib_doupdate.c deleted file mode 100644 index 1f42a90ef39e..000000000000 --- a/lib/libncurses/lib_doupdate.c +++ /dev/null @@ -1,593 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/*----------------------------------------------------------------- - * - * lib_doupdate.c - * - * The routine doupdate() and its dependents - * - *-----------------------------------------------------------------*/ - -#include <stdlib.h> -#include <sys/time.h> -#ifdef SYS_SELECT -#include <sys/select.h> -#endif -#include <string.h> -#include "curses.priv.h" -#include "terminfo.h" -#ifdef SVR4_ACTION -#define _POSIX_SOURCE -#endif -#include <signal.h> - -static void ClrUpdate( WINDOW *scr ); -static void TransformLine( int lineno ); -static void NoIDcTransformLine( int lineno ); -static void IDcTransformLine( int lineno ); -static void ClearScreen( void ); -static void InsStr( chtype *line, int count ); -static void DelChar( int count ); - -static inline void PutAttrChar(chtype ch) -{ - TR(TRACE_CHARPUT, ("PutAttrChar(%s, %s)", - _tracechar(ch & A_CHARTEXT), - _traceattr((ch & (chtype)A_ATTRIBUTES)))); - if (curscr->_attrs != (ch & (chtype)A_ATTRIBUTES)) { - curscr->_attrs = ch & (chtype)A_ATTRIBUTES; - vidputs(curscr->_attrs, _outch); - } - putc(ch & A_CHARTEXT, SP->_ofp); -} - -static int LRCORNER = FALSE; - -static inline void PutChar(chtype ch) -{ - if (LRCORNER == TRUE && SP->_curscol == columns-1) { - int i = lines -1; - int j = columns -1; - - LRCORNER = FALSE; - if ( (!enter_insert_mode || !exit_insert_mode) - && !insert_character - ) - return; - if (cursor_left) - putp(cursor_left); - else - mvcur(-1, -1, i, j); - PutAttrChar(ch); - if (cursor_left) - putp(cursor_left); - else - mvcur(-1, -1, i, j); - if (enter_insert_mode && exit_insert_mode) { - putp(enter_insert_mode); - PutAttrChar(newscr->_line[i][j-1]); - putp(exit_insert_mode); - } else if (insert_character) { - putp(insert_character); - PutAttrChar(newscr->_line[i][j-1]); - } - return; - } - PutAttrChar(ch); - SP->_curscol++; - if (SP->_curscol >= columns) { - if (auto_right_margin) { - SP->_curscol = 0; - SP->_cursrow++; - } else { - SP->_curscol--; - } - } -} - -static inline void GoTo(int row, int col) -{ - mvcur(SP->_cursrow, SP->_curscol, row, col); - SP->_cursrow = row; - SP->_curscol = col; -} - -int _outch(int ch) -{ - if (SP != NULL) - putc(ch, SP->_ofp); - else - putc(ch, stdout); - return OK; -} - -int doupdate(void) -{ -int i; -sigaction_t act, oact; - - T(("doupdate() called")); - - act.sa_handler = SIG_IGN; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; - sigaction(SIGTSTP, &act, &oact); - - if (SP->_endwin == TRUE) { - T(("coming back from shell mode")); - reset_prog_mode(); - if (enter_ca_mode) - putp(enter_ca_mode); - /* is this necessary? */ - if (enter_alt_charset_mode) - init_acs(); - newscr->_clear = TRUE; - SP->_endwin = FALSE; - } - -#if 0 /* Not works for output-only pgms */ - /* check for pending input */ - { - fd_set fdset; - struct timeval timeout = {0,0}; - - FD_ZERO(&fdset); - FD_SET(SP->_checkfd, &fdset); - if (select(SP->_checkfd+1, &fdset, NULL, NULL, &timeout) != 0) { - fflush(SP->_ofp); - return OK; - } - } -#endif - - if (curscr->_clear) { /* force refresh ? */ - T(("clearing and updating curscr")); - ClrUpdate(newscr); /* yes, clear all & update */ - curscr->_clear = FALSE; /* reset flag */ - } else if (newscr->_clear) { - T(("clearing and updating newscr")); - ClrUpdate(newscr); - newscr->_clear = FALSE; - } else { - T(("Transforming lines")); - for (i = 0; i < lines ; i++) { - if(newscr->_firstchar[i] != _NOCHANGE) - TransformLine(i); - } - } - T(("marking screen as updated")); - for (i = 0; i < lines; i++) { - newscr->_firstchar[i] = _NOCHANGE; - newscr->_lastchar[i] = _NOCHANGE; - } - - curscr->_curx = newscr->_curx; - curscr->_cury = newscr->_cury; - - GoTo(curscr->_cury, curscr->_curx); - - /* perhaps we should turn attributes off here */ - - if (curscr->_attrs != A_NORMAL) - vidattr(curscr->_attrs = A_NORMAL); - - fflush(SP->_ofp); - - sigaction(SIGTSTP, &oact, NULL); - - return OK; -} - -static int move_right_cost = -1; - -static int countc(int c) -{ - return(move_right_cost++); -} - -/* -** ClrUpdate(scr) -** -** Update by clearing and redrawing the entire screen. -** -*/ - -static void ClrUpdate(WINDOW *scr) -{ -int i = 0, j = 0; -int lastNonBlank; - - T(("ClrUpdate(%x) called", scr)); - if (back_color_erase && curscr->_attrs != A_NORMAL) { - T(("back_color_erase, turning attributes off")); - vidattr(curscr->_attrs = A_NORMAL); - } - ClearScreen(); - - if ((move_right_cost == -1) && parm_right_cursor) { - move_right_cost = 0; - tputs(tparm(parm_right_cursor, 10), 1, countc); - } - - T(("updating screen from scratch")); - for (i = 0; i < min(lines, scr->_maxy + 1); i++) { - lastNonBlank = scr->_maxx; - - while (lastNonBlank >= 0 && scr->_line[i][lastNonBlank] == BLANK) - lastNonBlank--; - - /* check if we are at the lr corner */ - if (i == lines-1) - if ((auto_right_margin) && !(eat_newline_glitch) && - (lastNonBlank == columns-1)) - { - T(("Lower-right corner needs special handling")); - LRCORNER = TRUE; - } - - for (j = 0; j <= lastNonBlank; j++) { - if (parm_right_cursor) { - static int inspace = 0; - - if ((scr->_line[i][j]) == BLANK) { - inspace++; - continue; - } else if(inspace) { - if (inspace < move_right_cost) { - for (; inspace > 0; inspace--) - PutChar(scr->_line[i][j-1]); - } else { - T(("trying to use parm_right_cursor")); - putp(tparm(parm_right_cursor, inspace)); - SP->_curscol += inspace; - inspace = 0; - } - } - } - PutChar(scr->_line[i][j]); - } - /* move cursor to the next line */ - if ((!auto_right_margin) || (lastNonBlank < columns - 1) || - (auto_right_margin && eat_newline_glitch && lastNonBlank == columns-1)) - { - SP->_curscol = (lastNonBlank < 0) ? 0 : lastNonBlank; - SP->_cursrow++; - GoTo(i+1, 0); - } - } - - - if (scr != curscr) { - for (i = 0; i < lines ; i++) - for (j = 0; j < columns; j++) - curscr->_line[i][j] = scr->_line[i][j]; - } -} - -/* -** TransformLine(lineno) -** -** Call either IDcTransformLine or NoIDcTransformLine to do the -** update, depending upon availability of insert/delete character. -*/ - -static void TransformLine(int lineno) -{ - - T(("TransformLine(%d) called",lineno)); - - if ( (insert_character || (enter_insert_mode && exit_insert_mode)) - && delete_character) - IDcTransformLine(lineno); - else - NoIDcTransformLine(lineno); -} - - - -/* -** NoIDcTransformLine(lineno) -** -** Transform the given line in curscr to the one in newscr, without -** using Insert/Delete Character. -** -** firstChar = position of first different character in line -** lastChar = position of last different character in line -** -** overwrite all characters between firstChar and lastChar. -** -*/ - -static void NoIDcTransformLine(int lineno) -{ -int firstChar, lastChar; -chtype *newLine = newscr->_line[lineno]; -chtype *oldLine = curscr->_line[lineno]; -int k; -int attrchanged = 0; - - T(("NoIDcTransformLine(%d) called", lineno)); - - firstChar = 0; - while (firstChar < columns - 1 && newLine[firstChar] == oldLine[firstChar]) { - if(ceol_standout_glitch) { - if((newLine[firstChar] & (chtype)A_ATTRIBUTES) != (oldLine[firstChar] & (chtype)A_ATTRIBUTES)) - attrchanged = 1; - } - firstChar++; - } - - T(("first char at %d is %x", firstChar, newLine[firstChar])); - if (firstChar > columns) - return; - - if(ceol_standout_glitch && attrchanged) { - firstChar = 0; - lastChar = columns - 1; - GoTo(lineno, firstChar); - if(clr_eol) { - if (back_color_erase && curscr->_attrs != A_NORMAL) { - T(("back_color_erase, turning attributes off")); - vidattr(curscr->_attrs = A_NORMAL); - } - putp(clr_eol); - } - } else { - lastChar = columns - 1; - while (lastChar > firstChar && newLine[lastChar] == oldLine[lastChar]) - lastChar--; - GoTo(lineno, firstChar); - } - - /* check if we are at the lr corner */ - if (lineno == lines-1) - if ((auto_right_margin) && !(eat_newline_glitch) && - (lastChar == columns-1)) - { - T(("Lower-right corner needs special handling")); - LRCORNER = TRUE; - } - - T(("updating chars %d to %d", firstChar, lastChar)); - for (k = firstChar; k <= lastChar; k++) { - PutChar(newLine[k]); - oldLine[k] = newLine[k]; - } -} - -/* -** IDcTransformLine(lineno) -** -** Transform the given line in curscr to the one in newscr, using -** Insert/Delete Character. -** -** firstChar = position of first different character in line -** oLastChar = position of last different character in old line -** nLastChar = position of last different character in new line -** -** move to firstChar -** overwrite chars up to min(oLastChar, nLastChar) -** if oLastChar < nLastChar -** insert newLine[oLastChar+1..nLastChar] -** else -** delete oLastChar - nLastChar spaces -*/ - -static void IDcTransformLine(int lineno) -{ -int firstChar, oLastChar, nLastChar; -chtype *newLine = newscr->_line[lineno]; -chtype *oldLine = curscr->_line[lineno]; -int k, n; -int attrchanged = 0; - - T(("IDcTransformLine(%d) called", lineno)); - - if(ceol_standout_glitch && clr_eol) { - firstChar = 0; - while(firstChar < columns) { - if((newLine[firstChar] & (chtype)A_ATTRIBUTES) != (oldLine[firstChar] & (chtype)A_ATTRIBUTES)) - attrchanged = 1; - firstChar++; - } - } - - firstChar = 0; - - if (attrchanged) { - GoTo(lineno, firstChar); - if (back_color_erase && curscr->_attrs != A_NORMAL) { - T(("back_color_erase, turning attributes off")); - vidattr(curscr->_attrs = A_NORMAL); - } - putp(clr_eol); - - /* check if we are at the lr corner */ - if (lineno == lines-1) - if ((auto_right_margin) && !(eat_newline_glitch)) - { - T(("Lower-right corner needs special handling")); - LRCORNER = TRUE; - } - - for( k = 0 ; k <= (columns-1) ; k++ ) - PutChar(newLine[k]); - } else { - while (firstChar < columns && - newLine[firstChar] == oldLine[firstChar]) - firstChar++; - - if (firstChar >= columns) - return; - - oLastChar = columns - 1; - while (oLastChar > firstChar && oldLine[oLastChar] == BLANK) - oLastChar--; - - nLastChar = columns - 1; - while (nLastChar > firstChar && newLine[nLastChar] == BLANK) - nLastChar--; - - if((nLastChar == firstChar) && clr_eol) { - GoTo(lineno, firstChar); - if (back_color_erase && curscr->_attrs != A_NORMAL) { - T(("back_color_erase, turning attributes off")); - vidattr(curscr->_attrs = A_NORMAL); - } - putp(clr_eol); - - if(newLine[firstChar] != BLANK ) { - /* check if we are at the lr corner */ - if (lineno == lines-1) - if ((auto_right_margin) && !(eat_newline_glitch) && - (firstChar == columns-1)) - { - T(("Lower-right corner needs special handling")); - LRCORNER = TRUE; - } - PutChar(newLine[firstChar]); - } - } else if( newLine[nLastChar] != oldLine[oLastChar] ) { - n = max( nLastChar , oLastChar ); - - GoTo(lineno, firstChar); - - /* check if we are at the lr corner */ - if (lineno == lines-1) - if ((auto_right_margin) && !(eat_newline_glitch) && - (n == columns-1)) - { - T(("Lower-right corner needs special handling")); - LRCORNER = TRUE; - } - - for( k=firstChar ; k <= n ; k++ ) - PutChar(newLine[k]); - } else { - while (newLine[nLastChar] == oldLine[oLastChar]) { - nLastChar--; - oLastChar--; - } - - n = min(oLastChar, nLastChar); - - GoTo(lineno, firstChar); - - /* check if we are at the lr corner */ - if (lineno == lines-1) - if ((auto_right_margin) && !(eat_newline_glitch) && - (n == columns-1)) - { - T(("Lower-right corner needs special handling")); - LRCORNER = TRUE; - } - - for (k=firstChar; k <= n; k++) - PutChar(newLine[k]); - - if (oLastChar < nLastChar) - InsStr(&newLine[k], nLastChar - oLastChar); - - else if (oLastChar > nLastChar ) - DelChar(oLastChar - nLastChar); - } - } - for (k = firstChar; k < columns; k++) - oldLine[k] = newLine[k]; -} - -/* -** ClearScreen() -** -** Clear the physical screen and put cursor at home -** -*/ - -static void ClearScreen() -{ - - T(("ClearScreen() called")); - - if (clear_screen) { - putp(clear_screen); - SP->_cursrow = SP->_curscol = 0; - } else if (clr_eos) { - SP->_cursrow = SP->_curscol = -1; - GoTo(0,0); - - putp(clr_eos); - } else if (clr_eol) { - SP->_cursrow = SP->_curscol = -1; - - while (SP->_cursrow < lines) { - GoTo(SP->_cursrow, 0); - putp(clr_eol); - } - GoTo(0,0); - } - T(("screen cleared")); -} - - -/* -** InsStr(line, count) -** -** Insert the count characters pointed to by line. -** -*/ - -static void InsStr(chtype *line, int count) -{ - T(("InsStr(%x,%d) called", line, count)); - - if (enter_insert_mode && exit_insert_mode) { - putp(enter_insert_mode); - while (count) { - PutChar(*line); - line++; - count--; - } - putp(exit_insert_mode); - } else if (parm_ich) { - putp(tparm(parm_ich, count)); - while (count) { - PutChar(*line); - line++; - count--; - } - } else { - while (count) { - putp(insert_character); - PutChar(*line); - line++; - count--; - } - } -} - -/* -** DelChar(count) -** -** Delete count characters at current position -** -*/ - -static void DelChar(int count) -{ - T(("DelChar(%d) called", count)); - - if (back_color_erase && curscr->_attrs != A_NORMAL) { - T(("back_color_erase, turning attributes off")); - vidattr(curscr->_attrs = A_NORMAL); - } - if (parm_dch) { - putp(tparm(parm_dch, count)); - } else { - while (count--) - putp(delete_character); - } -} - diff --git a/lib/libncurses/lib_endwin.c b/lib/libncurses/lib_endwin.c deleted file mode 100644 index 4e07e8fc24bd..000000000000 --- a/lib/libncurses/lib_endwin.c +++ /dev/null @@ -1,50 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_endwin.c -** -** The routine endwin(). -** -*/ - -#include "terminfo.h" -#include "curses.priv.h" - -int isendwin() -{ - if (SP == NULL) - return FALSE; - return SP->_endwin; -} - -int -endwin() -{ - T(("endwin() called")); - - SP->_endwin = TRUE; - - if (change_scroll_region) - putp(tparm(change_scroll_region, 0, lines - 1)); - - mvcur(-1, -1, lines - 1, 0); - - if (exit_ca_mode) - putp(exit_ca_mode); - - if (SP->_coloron == TRUE) - putp(orig_pair); - - if (curscr && (curscr->_attrs != A_NORMAL)) - vidattr(curscr->_attrs = A_NORMAL); - - if (SP->_cursor != 1) - putp(cursor_normal); - - fflush(SP->_ofp); - - return(reset_shell_mode()); -} diff --git a/lib/libncurses/lib_erase.c b/lib/libncurses/lib_erase.c deleted file mode 100644 index 38bf5ea8d93e..000000000000 --- a/lib/libncurses/lib_erase.c +++ /dev/null @@ -1,48 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_erase.c -** -** The routine werase(). -** -*/ - -#include "curses.priv.h" -#include "terminfo.h" - -int werase(WINDOW *win) -{ -int y; -chtype *sp, *end, *start, *maxx = NULL; -int minx; - - T(("werase(%x) called", win)); - - for (y = win->_regtop; y <= win->_regbottom; y++) { - minx = _NOCHANGE; - start = win->_line[y]; - end = &start[win->_maxx]; - - maxx = start; - for (sp = start; sp <= end; sp++) { - maxx = sp; - if (minx == _NOCHANGE) - minx = sp - start; - *sp = _nc_background(win); - } - - if (minx != _NOCHANGE) { - if (win->_firstchar[y] > minx || - win->_firstchar[y] == _NOCHANGE) - win->_firstchar[y] = minx; - - if (win->_lastchar[y] < maxx - win->_line[y]) - win->_lastchar[y] = maxx - win->_line[y]; - } - } - win->_curx = win->_cury = 0; - return OK; -} diff --git a/lib/libncurses/lib_getch.c b/lib/libncurses/lib_getch.c deleted file mode 100644 index c30f7f21f1f2..000000000000 --- a/lib/libncurses/lib_getch.c +++ /dev/null @@ -1,224 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_getch.c -** -** The routine getch(). -** -*/ - -#include <sys/types.h> -#include <string.h> -#include <signal.h> -#include <errno.h> -#if defined(BRAINDEAD) -extern int errno; -#endif -#include "curses.priv.h" - -#define head SP->_fifohead -#define tail SP->_fifotail -#define peek SP->_fifopeek - -#define h_inc() { head == FIFO_SIZE-1 ? head = 0 : head++; if (head == tail) head = -1, tail = 0;} -#define h_dec() { head == 0 ? head = FIFO_SIZE-1 : head--; if (head == tail) tail = -1;} -#define t_inc() { tail == FIFO_SIZE-1 ? tail = 0 : tail++; if (tail == head) tail = -1;} -#define p_inc() { peek == FIFO_SIZE-1 ? peek = 0 : peek++;} - -static int fifo_peek() -{ - T(("peeking at %d", peek+1)); - return SP->_fifo[++peek]; -} - -static inline void fifo_dump() -{ -int i; - T(("head = %d, tail = %d, peek = %d", head, tail, peek)); - for (i = 0; i < 10; i++) - T(("char %d = %d (%c)", i, SP->_fifo[i], (unsigned char)SP->_fifo[i])); -} - -static inline int fifo_pull() -{ -int ch; - ch = SP->_fifo[head]; - T(("pulling %d from %d", ch, head)); - - h_inc(); - fifo_dump(); - return ch; -} - -int ungetch(int ch) -{ - if (tail == -1) - return ERR; - if (head == -1) { - head = 0; - t_inc() - } else - h_dec(); - - SP->_fifo[head] = ch; - T(("ungetch ok")); - fifo_dump(); - return OK; -} - -static inline int fifo_push() -{ -int n; -unsigned char ch; - - if (tail == -1) return ERR; -again: - n = read(fileno(SP->_ifp), &ch, 1); - if (n == -1 && errno == EINTR) - goto again; - T(("read %d characters", n)); - SP->_fifo[tail] = ch; - if (head == -1) head = tail; - t_inc(); - T(("pushed %d at %d", ch, tail)); - fifo_dump(); - return ch; -} - -static inline void fifo_clear() -{ -int i; - for (i = 0; i < FIFO_SIZE; i++) - SP->_fifo[i] = 0; - head = -1; tail = peek = 0; -} - -static int kgetch(WINDOW *); - -int -wgetch(WINDOW *win) -{ -bool setHere = FALSE; /* cbreak mode was set here */ -int ch; - - T(("wgetch(%x) called", win)); - - /* this should be eliminated */ - if (! win->_scroll && (SP->_echo) && (win->_flags & _FULLWIN) - && win->_curx == win->_maxx && win->_cury == win->_maxy) - return(ERR); - - if ((is_wintouched(win) || (win->_flags & _HASMOVED)) && - !(win->_flags & _ISPAD)) - wrefresh(win); - - if (SP->_echo && ! (SP->_raw || SP->_cbreak)) { - cbreak(); - setHere = TRUE; - } - - if (win->_delay >= 0 || SP->_cbreak > 1) { - int delay; - - T(("timed delay in wgetch()")); - if (SP->_cbreak > 1) - delay = (SP->_cbreak-1) * 100; - else - delay = win->_delay; - - T(("delay is %d microseconds", delay)); - - if (head == -1) /* fifo is empty */ - if (timed_wait(fileno(SP->_ifp), delay, NULL) == 0) - return ERR; - /* else go on to read data available */ - } - - if (win->_use_keypad) - ch = kgetch(win); - else { - if (head == -1) - fifo_push(); - ch = fifo_pull(); - } - - /* This should be eliminated */ - /* handle 8-bit input */ - if (ch & 0x80) - if (!win->_use_meta) - ch &= 0x7f; - - /* there must be a simpler way of doing this */ - if (!(win->_flags & _ISPAD) && - SP->_echo && ch < 0400) { /* ch < 0400 => not a keypad key */ - mvwaddch(curscr, win->_begy + win->_cury, - win->_begx + win->_curx, ch | win->_attrs); - waddch(win, ch | win->_attrs); - } - if (setHere) - nocbreak(); - - T(("wgetch returning : '%c', '0x%x'", ch, ch)); - - return(ch); -} - - -/* -** int -** kgetch() -** -** Get an input character, but take care of keypad sequences, returning -** an appropriate code when one matches the input. After each character -** is received, set a one-second alarm call. If no more of the sequence -** is received by the time the alarm goes off, pass through the sequence -** gotten so far. -** -*/ - -static int -kgetch(WINDOW *win) -{ -struct try *ptr; -int ch = 0; -int timeleft = 1000; - - T(("kgetch(%x) called", win)); - - ptr = SP->_keytry; - - if (head == -1) { - ch = fifo_push(); - peek = 0; - while (ptr != NULL) { - T(("ch = %d", ch)); - while ((ptr != NULL) && (ptr->ch != (unsigned char)ch)) - ptr = ptr->sibling; - - if (ptr != NULL) - if (ptr->value != 0) { /* sequence terminated */ - T(("end of sequence")); - fifo_clear(); - return(ptr->value); - } else { /* go back for another character */ - ptr = ptr->child; - T(("going back for more")); - } else - break; - - T(("waiting for rest of sequence")); - if (timed_wait(fileno(SP->_ifp), timeleft, &timeleft) < 1) { - T(("ran out of time")); - return(fifo_pull()); - } else { - T(("got more!")); - fifo_push(); - ch = fifo_peek(); - } - } - } - return(fifo_pull()); -} diff --git a/lib/libncurses/lib_getstr.c b/lib/libncurses/lib_getstr.c deleted file mode 100644 index 0eda9b914a66..000000000000 --- a/lib/libncurses/lib_getstr.c +++ /dev/null @@ -1,113 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_getstr.c -** -** The routine wgetstr(). -** -*/ - -#include "curses.priv.h" -#include "unctrl.h" - -inline void backspace(WINDOW *win) -{ - mvwaddstr(curscr, win->_begy + win->_cury, win->_begx + win->_curx, - "\b \b"); - waddstr(win, "\b \b"); - fputs("\b \b", SP->_ofp); - fflush(SP->_ofp); - SP->_curscol--; -} - -int wgetnstr(WINDOW *win, char *str, int maxlen) -{ -bool oldnl, oldecho, oldraw, oldcbreak, oldkeypad; -char erasec; -char killc; -char *oldstr; -int ch; - - T(("wgetnstr(%x,%x, %d) called", win, str, maxlen)); - - oldnl = SP->_nl; - oldecho = SP->_echo; - oldraw = SP->_raw; - oldcbreak = SP->_cbreak; - oldkeypad = win->_use_keypad; - nl(); - noecho(); - noraw(); - cbreak(); - keypad(win, TRUE); - - erasec = erasechar(); - killc = killchar(); - - oldstr = str; - - vidattr(win->_attrs); - if (is_wintouched(win) || (win->_flags & _HASMOVED)) - wrefresh(win); - - while ((ch = wgetch(win)) != ERR) { - if (ch == '\n' || ch == '\r') - break; - if (ch == erasec || ch == KEY_LEFT || ch == KEY_BACKSPACE) { - if (str > oldstr) { - str--; - backspace(win); - } - } else if (ch == killc) { - while (str > oldstr) { - str--; - backspace(win); - } - } else if (maxlen >= 0 && str - oldstr >= maxlen) { - beep(); - } else { - mvwaddstr(curscr, win->_begy + win->_cury, - win->_begx + win->_curx, unctrl(ch)); - waddstr(win, unctrl(ch)); - if (oldecho == TRUE) { - fputs(unctrl(ch), SP->_ofp); - fflush(SP->_ofp); - } - SP->_curscol++; - *str++ = ch; - } - } - - win->_curx = 0; - if (win->_cury < win->_maxy) - win->_cury++; - wrefresh(win); - - if (oldnl == FALSE) - nonl(); - - if (oldecho == TRUE) - echo(); - - if (oldraw == TRUE) - raw(); - - if (oldcbreak == FALSE) - nocbreak(); - - if (oldkeypad == FALSE) - keypad(win, FALSE); - - if (ch == ERR) { - *str = '\0'; - return ERR; - } - *str = '\0'; - - T(("wgetnstr returns \"%s\"", visbuf(oldstr))); - - return(OK); -} diff --git a/lib/libncurses/lib_inchstr.c b/lib/libncurses/lib_inchstr.c deleted file mode 100644 index d0ad351360f4..000000000000 --- a/lib/libncurses/lib_inchstr.c +++ /dev/null @@ -1,29 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_inchstr.c -** -** The routine winchnstr(). -** -*/ - -#include "curses.priv.h" - -int winchnstr(WINDOW *win, chtype *chstr, int i) -{ -chtype *point, *end; - - T(("winschnstr(%x,'%x',%d) called", win, chstr, i)); - - point = &win->_line[win->_cury][win->_curx]; - end = &win->_line[win->_cury][win->_maxx]; - if (point + i - 1 < end) - end = point + i - 1; - - chstr = (chtype *)malloc((end - point + 1)*sizeof(chtype)); - chstr[end - point] = '\0'; - return OK; -} diff --git a/lib/libncurses/lib_initscr.c b/lib/libncurses/lib_initscr.c deleted file mode 100644 index 1c2d9e374123..000000000000 --- a/lib/libncurses/lib_initscr.c +++ /dev/null @@ -1,40 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_initscr.c -** -** The routine initscr(). -** -*/ - -#include <stdlib.h> -#include "curses.priv.h" - -WINDOW *initscr() -{ -static bool initialized = FALSE; -char *name; -#ifdef TRACE - _init_trace(); - - T(("initscr() called")); -#endif - - /* Portable applications must not call initscr() more than once */ - if (!initialized) { - initialized = TRUE; - - if ((name = getenv("TERM")) == 0) - name = "unknown"; - if (newterm(name, stdout, stdin) == 0) { - fprintf(stderr, "Error opening terminal: %s.\n", name); - exit(1); - } - /* def_shell_mode - done in newterm */ - def_prog_mode(); - } - return(stdscr); -} diff --git a/lib/libncurses/lib_insch.c b/lib/libncurses/lib_insch.c deleted file mode 100644 index ff306682659a..000000000000 --- a/lib/libncurses/lib_insch.c +++ /dev/null @@ -1,36 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_insch.c -** -** The routine winsch(). -** -*/ - -#include "curses.priv.h" - -int winsch(WINDOW *win, chtype c) -{ -chtype *temp1, *temp2; -chtype *end; - - T(("winsch(%x,'%x') called", win, c)); - - end = &win->_line[win->_cury][win->_curx]; - temp1 = &win->_line[win->_cury][win->_maxx]; - temp2 = temp1 - 1; - - while (temp1 > end) - *temp1-- = *temp2--; - - *temp1 = _nc_render(win, c); - - win->_lastchar[win->_cury] = win->_maxx; - if (win->_firstchar[win->_cury] == _NOCHANGE - || win->_firstchar[win->_cury] > win->_curx) - win->_firstchar[win->_cury] = win->_curx; - return OK; -} diff --git a/lib/libncurses/lib_insdel.c b/lib/libncurses/lib_insdel.c deleted file mode 100644 index 8729efee8593..000000000000 --- a/lib/libncurses/lib_insdel.c +++ /dev/null @@ -1,31 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_insdel.c -** -** The routine winsdel(win, n). -** positive n insert n lines above current line -** negative n delete n lines starting from current line -** -*/ - -#include "curses.priv.h" - -int -winsdelln(WINDOW *win, int n) -{ -int code = ERR; - - T(("winsdel(%x,%d) called", win, n)); - - if (win) { - if (n != 0) { - _nc_scroll_window(win, -n, win->_cury, win->_maxy, _nc_background(win)); - } - code = OK; - } - return code; -} diff --git a/lib/libncurses/lib_insstr.c b/lib/libncurses/lib_insstr.c deleted file mode 100644 index 63076626d26a..000000000000 --- a/lib/libncurses/lib_insstr.c +++ /dev/null @@ -1,21 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_insstr.c -** -** The routine winsnstr(). -** -*/ - -#include "curses.priv.h" - -int winsnstr(WINDOW *win, char *str, int n) -{ - - T(("winsstr(%x,'%x',%d) called", win, str, n)); - - return OK; -} diff --git a/lib/libncurses/lib_instr.c b/lib/libncurses/lib_instr.c deleted file mode 100644 index 6d850b3a9280..000000000000 --- a/lib/libncurses/lib_instr.c +++ /dev/null @@ -1,54 +0,0 @@ - -/*************************************************************************** -* 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. * -* * -***************************************************************************/ - - -/* -** lib_instr.c -** -** The routine winnstr(). -** -*/ - -#include "curses.priv.h" - -int winnstr(WINDOW *win, char *str, int n) -{ - int i, row, col; - - T(("winnstr(%p,%p,%d) called", win, str, n)); - - getyx(win, row, col); - - if (n < 0) - n = win->_maxx - win->_curx + 1; - - for (i = 0; i < n;) { - str[i++] = TextOf(win->_line[row][col]); - if (++col > win->_maxx) { - col = 0; - if (++row > win->_maxy) - break; - } - } - str[i] = '\0'; /* SVr4 does not seem to count the null */ - - return (i); -} diff --git a/lib/libncurses/lib_kernel.c b/lib/libncurses/lib_kernel.c deleted file mode 100644 index 2cc71dad11e2..000000000000 --- a/lib/libncurses/lib_kernel.c +++ /dev/null @@ -1,324 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* - * lib_kernel.c - * - * Misc. low-level routines: - * reset_prog_mode() - * reset_shell_mode() - * baudrate() - * erasechar() - * killchar() - * flushinp() - * savetty() - * resetty() - * - * - */ - -#include "curses.priv.h" -#include "terminfo.h" - -int wattron(WINDOW *win, chtype at) -{ - T(("wattron(%x,%s) current = %s", win, _traceattr(at), _traceattr(win->_attrs))); - if (PAIR_NUMBER(at) > 0x00) { - win->_attrs = (win->_attrs & ~A_COLOR) | at ; - T(("new attribute is %s", _traceattr(win->_attrs))); - } else { - win->_attrs |= at; - T(("new attribute is %s", _traceattr(win->_attrs))); - } - return OK; -} - -int wattroff(WINDOW *win, chtype at) -{ -#define IGNORE_COLOR_OFF FALSE - - T(("wattroff(%x,%s) current = %s", win, _traceattr(at), _traceattr(win->_attrs))); - if (IGNORE_COLOR_OFF == TRUE) { - if (PAIR_NUMBER(at) == 0xff) /* turn off color */ - win->_attrs &= ~at; - else /* leave color alone */ - win->_attrs &= ~(at & ~A_COLOR); - } else { - if (PAIR_NUMBER(at) > 0x00) /* turn off color */ - win->_attrs &= ~at; - else /* leave color alone */ - win->_attrs &= ~(at & ~A_COLOR); - } - T(("new attribute is %s", _traceattr(win->_attrs))); - return OK; -} - -int reset_prog_mode() -{ - int ret = ERR; - - T(("reset_prog_mode() called")); - - if (cur_term != 0) { - if (tcsetattr(cur_term->fd, TCSADRAIN, &cur_term->prog_mode)==0) - ret = OK; - if (SP && stdscr && stdscr->_use_keypad) - _nc_keypad(TRUE); - } - return ret; -} - - -int reset_shell_mode() -{ - int ret = ERR; - - T(("reset_shell_mode() called")); - - if (cur_term != 0) { - if (SP) - { - fflush(SP->_ofp); - _nc_keypad(FALSE); - } - if (tcsetattr(cur_term->fd, TCSADRAIN, &cur_term->shell_mode)==0) - ret = OK; - } - - return ret; -} - -int curs_set(int vis) -{ -int cursor = SP->_cursor; - - T(("curs_set(%d)", vis)); - - if (vis < 0 || vis > 2) - return ERR; - - switch(vis) { - case 2: - if (cursor_visible) - putp(cursor_visible); - break; - case 1: - if (cursor_normal) - putp(cursor_normal); - break; - case 0: - if (cursor_invisible) - putp(cursor_invisible); - break; - } - SP->_cursor = vis; - return cursor; -} - -int delay_output(int ms) -{ -int speed = 0; - - T(("delay_output(%d) called", ms)); - - if (!no_pad_char && (speed = baudrate()) == ERR) - return(ERR); - else { - register int nullcount; - - if (!no_pad_char) - for (nullcount = ms * 1000 / speed; nullcount > 0; nullcount--) - putc(*pad_char, SP->_ofp); - (void) fflush(SP->_ofp); - if (no_pad_char) - napms(ms); - } - - return OK; -} - -/* - * erasechar() - * - * Return erase character as given in cur_term->Ottyb. - * - */ - -char -erasechar() -{ - T(("erasechar() called")); - -#ifdef TERMIOS - return(cur_term->Ottyb.c_cc[VERASE]); -#else - return(cur_term->Ottyb.sg_erase); -#endif - -} - - - -/* - * killchar() - * - * Return kill character as given in cur_term->Ottyb. - * - */ - -char -killchar() -{ - T(("killchar() called")); - -#ifdef TERMIOS - return(cur_term->Ottyb.c_cc[VKILL]); -#else - return(cur_term->Ottyb.sg_kill); -#endif -} - - - -/* - * flushinp() - * - * Flush any input on cur_term->Filedes - * - */ - -int flushinp() -{ - T(("flushinp() called")); - -#ifdef TERMIOS - tcflush(cur_term->Filedes, TCIFLUSH); -#else - ioctl(cur_term->Filedes, TIOCFLUSH, 0); -#endif - if (SP) { - SP->_fifohead = -1; - SP->_fifotail = 0; - SP->_fifopeek = 0; - } - return OK; - -} - - - -/* - * int - * baudrate() - * - * Returns the current terminal's baud rate. - * - */ - -#ifndef TERMIOS -struct speed { - speed_t s; - int sp; -}; - -static struct speed speeds[] = { - {B0, 0}, - {B50, 50}, - {B75, 75}, - {B110, 110}, - {B134, 134}, - {B150, 150}, - {B200, 200}, - {B300, 300}, - {B600, 600}, - {B1200, 1200}, - {B1800, 1800}, - {B2400, 2400}, - {B4800, 4800}, - {B9600, 9600} -#define MAX_BAUD B9600 -#ifdef B19200 -#undef MAX_BAUD -#define MAX_BAUD B19200 - ,{B19200, 19200} -#endif -#ifdef B38400 -#undef MAX_BAUD -#define MAX_BAUD B38400 - ,{B38400, 38400} -#endif -#ifdef B57600 -#undef MAX_BAUD -#define MAX_BAUD B57600 - ,{B57600, 57600} -#endif -#ifdef B115200 -#undef MAX_BAUD -#define MAX_BAUD B115200 - ,{B115200, 115200} -#endif -}; -#endif - -int -baudrate() -{ -#ifndef TERMIOS -int i, ret; -#endif - - T(("baudrate() called")); - -#ifdef TERMIOS - return cfgetospeed(&cur_term->Nttyb); -#else - ret = cur_term->Nttyb.sg_ospeed; - if(ret < 0 || ret > MAX_BAUD) - return ERR; - for (i = 0; i < (sizeof(speeds) / sizeof(struct speed)); i++) - if (speeds[i].s == ret) - return speeds[i].sp; - return ERR; -#endif -} - - -/* -** savetty() and resetty() -** -*/ - -static TTY buf; - -int savetty() -{ - T(("savetty() called")); - -#ifdef TERMIOS - tcgetattr(cur_term->Filedes, &buf); -#else - gtty(cur_term->Filedes, &buf); -#endif - return OK; -} - -int resetty() -{ - T(("resetty() called")); - -#ifdef TERMIOS - tcsetattr(cur_term->Filedes, TCSANOW, &buf); -#else - stty(cur_term->Filedes, &buf); -#endif - return OK; -} - - -int -resizeterm(int ToLines, int ToCols) -{ - return OK; -} diff --git a/lib/libncurses/lib_longname.c b/lib/libncurses/lib_longname.c deleted file mode 100644 index a8de0856a2aa..000000000000 --- a/lib/libncurses/lib_longname.c +++ /dev/null @@ -1,35 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_longname.c -** -** The routine longname(). -** -*/ - -#include <string.h> -#include "curses.priv.h" -#include "terminfo.h" - -char * -longname() -{ -#ifndef MYTINFO -char *ptr; -#endif - - T(("longname() called")); - -#ifdef MYTINFO - return cur_term->name_long; -#else - for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--) - if (*ptr == '|') - return(ptr + 1); - - return(ttytype); -#endif -} diff --git a/lib/libncurses/lib_move.c b/lib/libncurses/lib_move.c deleted file mode 100644 index cf56fa07df3f..000000000000 --- a/lib/libncurses/lib_move.c +++ /dev/null @@ -1,30 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_move.c -** -** The routine wmove(). -** -*/ - -#include "curses.priv.h" - -int -wmove(WINDOW *win, int y, int x) -{ - T(("wmove(%x,%d,%d) called", win, y, x)); - - if (x >= 0 && x <= win->_maxx && - y >= 0 && y <= win->_maxy) - { - win->_curx = x; - win->_cury = y; - - win->_flags |= _HASMOVED; - return(OK); - } else - return(ERR); -} diff --git a/lib/libncurses/lib_mvcur.c b/lib/libncurses/lib_mvcur.c deleted file mode 100644 index 388c680b42e2..000000000000 --- a/lib/libncurses/lib_mvcur.c +++ /dev/null @@ -1,700 +0,0 @@ -/*--------------------------------------------------------------------------- - * - * lib_mvcur.c - * - * The routine mvcur() etc. - * - * last edit-date: [Wed Jun 16 14:13:22 1993] - * - * -hm conversion from termcap -> terminfo - * -hm optimization debugging - * -hm zeyd's ncurses 0.7 update - * -hm eat_newline_glitch bugfix - * -hm hpux lint'ing .. - * - *---------------------------------------------------------------------------*/ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -#include <string.h> -#include <stdlib.h> -#include "terminfo.h" -#include "curses.priv.h" - -#ifndef OPT_MVCUR -/* -** -** mvcur(oldrow, oldcol, newrow, newcol) -** A hack for terminals that are smart enough -** to know how to move cursor. -** There is still a bug in the alternative long- -** winded code. -** -*/ - -int mvcur(int oldrow, int oldcol, int newrow, int newcol) -{ - T(("mvcur(%d,%d,%d,%d) called", oldrow, oldcol, newrow, newcol)); - - if(!cursor_address) - return ERR; - - newrow %= lines; - newcol %= columns; - - if (cursor_address) - putp(tparm(cursor_address, newrow, newcol)); - return OK; - -} - -#else - -#define BUFSIZE 128 /* size of strategy buffer */ - -struct Sequence -{ - int vec[BUFSIZE]; /* vector of operations */ - int *end; /* end of vector */ - int cost; /* cost of vector */ -}; - -static void row(struct Sequence *outseq, int orow, int nrow); -static void column(struct Sequence *outseq, int ocol, int ncol); -static void simp_col(struct Sequence *outseq, int oc, int nc); -static void zero_seq(struct Sequence *seq); -static void add_seq(struct Sequence *seq1, struct Sequence *seq2); -static void out_seq(struct Sequence *seq); -static void update_ops(void); -static void init_costs(int costs[]); -static int countc(char ch); -static void add_op(struct Sequence *seq, int op, ...); -static char *sequence(int op); - -static int c_count; /* used for counting tputs output */ - -#define INFINITY 1000 /* biggest, impossible sequence cost */ -#define NUM_OPS 16 /* num. term. control sequences */ -#define NUM_NPARM 9 /* num. ops wo/ parameters */ - - /* operator indexes into op_info */ - -#define CARRIAGE_RETURN 0 /* watch out for nl mapping */ -#define CURS_DOWN 1 -#define CURS_HOME 2 -#define CURS_LEFT 3 -#define CURS_RIGHT 4 -#define CURS_TO_LL 5 -#define CURS_UP 6 -#define TAB 7 -#define BACK_TAB 8 -#define ROW_ADDR 9 -#define COL_ADDR 10 -#define P_DOWN_CURS 11 -#define P_LEFT_CURS 12 -#define P_RIGHT_CURS 13 -#define P_UP_CURS 14 -#define CURS_ADDR 15 - -static bool loc_init = FALSE; /* set if op_info is init'ed */ - -static bool rel_ok; /* set if we really know where we are */ - -/* - * op_info[NUM_OPS] - * - * op_info[] contains for operations with no parameters - * the cost of the operation. These ops should be first in the array. - * For operations with parameters, op_info[] contains - * the negative of the number of parameters. - */ - -static int op_info[NUM_OPS] = { - 0, /* carriage_return */ - 0, /* cursor_down */ - 0, /* cursor_home */ - 0, /* cursor_left */ - 0, /* cursor_right */ - 0, /* cursor_to_ll */ - 0, /* cursor_up */ - 0, /* tab */ - 0, /* back_tab */ - -1, /* row_address */ - -1, /* column_address */ - -1, /* parm_down_cursor */ - -1, /* parm_left_cursor */ - -1, /* parm_right_cursor */ - -1, /* parm_up_cursor */ - -2 /* cursor_address */ -}; - -/* -** Make_seq_best(best, try) -** -** Make_seq_best() copies try to best if try->cost < best->cost -** -** fixed the old version, now it really runs .. (-hm/08.04.93) -** -*/ - -inline void Make_seq_best(struct Sequence *best, struct Sequence *try) -{ - if (best->cost > try->cost) { - register int *sptr; - - sptr = try->vec; /* src ptr */ - best->end = best->vec; /* dst ptr */ - while(sptr != try->end) /* copy src -> dst */ - *(best->end++) = *(sptr++); - best->cost = try->cost; /* copy cost */ - } -} - - -/* -** -** mvcur(oldrow, oldcol, newrow, newcol) -** -** mvcur() optimally moves the cursor from the position -** specified by (oldrow, oldcol) to (newrow, newcol). If -** (oldrow, oldcol) == (-1, -1), mvcur() does not use relative -** cursor motions. If the coordinates are otherwise -** out of bounds, it mods them into range. -** -** Revisions needed: -** eat_newline_glitch, auto_right_margin -*/ - -int mvcur(int oldrow, int oldcol, int newrow, int newcol) -{ -struct Sequence seqA, seqB, /* allocate work structures */ - col0seq, /* sequence to get from col0 to nc */ - *best, /* best sequence so far */ - *try; /* next try */ -bool nlstat = SP->_nl; /* nl-output-mapping in effect ?*/ - - T(("=============================\nmvcur(%d,%d,%d,%d) called", - oldrow, oldcol, newrow, newcol)); - - if ((oldrow == newrow) && (oldcol == newcol)) - return OK; - - if (oldcol == columns-1 && eat_newline_glitch && auto_right_margin) { - putp(tparm(cursor_address, newrow, newcol)); - return OK; - } - -#if 0 - if (nlstat) - nonl(); -#endif - update_ops(); /* make sure op_info[] is current */ - - if (oldrow < 0 || oldcol < 0 || (eat_newline_glitch && oldcol == 0 )) { - rel_ok = FALSE; /* relative ops ok? */ - } else { - rel_ok = TRUE; - oldrow %= lines; /* mod values into range */ - oldcol %= columns; - } - - newrow %= lines; - newcol %= columns; - - best = &seqA; - try = &seqB; - - /* try out direct cursor addressing */ - - zero_seq(best); - add_op(best, CURS_ADDR, newrow, newcol); - - /* try out independent row/column addressing */ - - if(rel_ok) { - zero_seq(try); - row(try, oldrow, newrow); - column(try, oldcol, newcol); - Make_seq_best(best, try); - } - - zero_seq(&col0seq); /* store seq. to get from c0 to nc */ - column(&col0seq, 0, newcol); - - if(col0seq.cost < INFINITY) { /* can get from col0 to newcol */ - - /* try out homing and then row/column */ - - if (! rel_ok || newcol < oldcol || newrow < oldrow) { - zero_seq(try); - add_op(try, CURS_HOME, 1); - row(try, 0, newrow); - add_seq(try, &col0seq); - Make_seq_best(best, try); - } - - /* try out homing to last line and then row/column */ - - if (! rel_ok || newcol < oldcol || newrow > oldrow) { - zero_seq(try); - add_op(try, CURS_TO_LL, 1); - row(try, lines - 1, newrow); - add_seq(try, &col0seq); - Make_seq_best(best, try); - } - } - - out_seq(best); -#if 0 - if(nlstat) - nl(); -#endif - - T(("===================================")); - - return OK; -} - -/* -** row(outseq, oldrow, newrow) -** -** row() adds the best sequence for moving -** the cursor from oldrow to newrow to seq. -** row() considers row_address, parm_up/down_cursor -** and cursor_up/down. -*/ - -static void -row(struct Sequence *outseq, /* where to put the output */ -int orow, int nrow) /* old, new cursor locations */ -{ -struct Sequence seqA, seqB, - *best, /* best sequence so far */ - *try; /* next try */ - -int parm_cursor, one_step; - - best = &seqA; - try = &seqB; - - if (nrow == orow) - return; - - if (nrow < orow) { - parm_cursor = P_UP_CURS; - one_step = CURS_UP; - } else { - parm_cursor = P_DOWN_CURS; - one_step = CURS_DOWN; - } - - /* try out direct row addressing */ - - zero_seq(best); - add_op(best, ROW_ADDR, nrow); - - /* try out paramaterized up or down motion */ - - if (rel_ok) { - zero_seq(try); - add_op(try, parm_cursor, abs(orow - nrow)); - Make_seq_best(best, try); - } - - /* try getting there one step at a time... */ - - if (rel_ok) { - zero_seq(try); - add_op(try, one_step, abs(orow-nrow)); - Make_seq_best(best, try); - } - - add_seq(outseq, best); -} - - -/* -** column(outseq, oldcol, newcol) -** -** column() adds the best sequence for moving -** the cursor from oldcol to newcol to outseq. -** column() considers column_address, parm_left/right_cursor, -** simp_col(), and carriage_return followed by simp_col(). -*/ - -static void column(struct Sequence *outseq, /* where to put the output */ -int ocol, int ncol) /* old, new cursor column */ -{ -struct Sequence seqA, seqB, - *best, *try; -int parm_cursor; /* set to either parm_up/down_cursor */ - - best = &seqA; - try = &seqB; - - if (ncol == ocol) - return; - - if (ncol < ocol) - parm_cursor = P_LEFT_CURS; - else - parm_cursor = P_RIGHT_CURS; - - /* try out direct column addressing */ - - zero_seq(best); - add_op(best, COL_ADDR, ncol); - - /* try carriage_return then simp_col() */ - - if(! rel_ok || (ncol < ocol)) { - zero_seq(try); - add_op(try, CARRIAGE_RETURN, 1); - simp_col(try, 0, ncol); - Make_seq_best(best, try); - } - if(rel_ok) { - /* try out paramaterized left or right motion */ - - zero_seq(try); - add_op(try, parm_cursor, abs(ocol - ncol)); - Make_seq_best(best, try); - - /* try getting there with simp_col() */ - - zero_seq(try); - simp_col(try, ocol, ncol); - Make_seq_best(best, try); - } - - add_seq(outseq, best); -} - - -/* -** simp_col(outseq, oldcol, newcol) -** -** simp_col() adds the best simple sequence for getting -** from oldcol to newcol to outseq. -** simp_col() considers (back_)tab and cursor_left/right. -** -** Revisions needed: -** Simp_col asssumes that the cost of a (back_)tab -** is less then the cost of one-stepping to get to the same column. -** Should sometimes use overprinting instead of cursor_right. -*/ - -static void -simp_col( struct Sequence *outseq, /* place to put sequence */ -int oc, int nc) /* old column, new column */ -{ -struct Sequence seqA, seqB, tabseq, - *best, *try; -int mytab, tabs, onepast, - one_step, opp_step; - - onepast = -1; - - if (oc == nc) - return; - - if(! rel_ok) { - outseq->cost = INFINITY; - return; - } - - best = &seqA; - try = &seqB; - - if(oc < nc) { - mytab = TAB; - - if (init_tabs > 0 && op_info[TAB] < INFINITY) { - tabs = (nc / init_tabs) - (oc / init_tabs); - onepast = ((nc / init_tabs) + 1) * init_tabs; - if (tabs) - oc = onepast - init_tabs; /* consider it done */ - } else { - tabs = 0; - } - one_step = CURS_RIGHT; - opp_step = CURS_LEFT; - } else { - mytab = BACK_TAB; - if (init_tabs > 0 && op_info[BACK_TAB] < INFINITY) { - tabs = (oc / init_tabs) - (nc / init_tabs); - onepast = ((nc - 1) / init_tabs) * init_tabs; - if (tabs) - oc = onepast + init_tabs; /* consider it done */ - } else { - tabs = 0; - } - one_step = CURS_LEFT; - opp_step = CURS_RIGHT; - } - - /* tab as close as possible to nc */ - - zero_seq(&tabseq); - add_op(&tabseq, mytab, tabs); - - /* try extra tab and backing up */ - - zero_seq(best); - - if (onepast >= 0 && onepast < columns) { - add_op(best, mytab, 1); - add_op(best, opp_step, abs(onepast - nc)); - } else { - best->cost = INFINITY; /* make sure of next swap */ - } - - /* try stepping to nc */ - - zero_seq(try); - add_op(try, one_step, abs(nc - oc)); - Make_seq_best(best, try); - - if (tabseq.cost < INFINITY) - add_seq(outseq, &tabseq); - add_seq(outseq, best); -} - - -/* -** zero_seq(seq) empties seq. -** add_seq(seq1, seq2) adds seq1 to seq2. -** out_seq(seq) outputs a sequence. -*/ - -static void -zero_seq(seq) -struct Sequence *seq; -{ - seq->end = seq->vec; - seq->cost = 0; -} - -static void -add_seq(struct Sequence *seq1, struct Sequence *seq2) -{ -int *vptr; - - T(("add_seq(%x, %x)", seq1, seq2)); - - if(seq1->cost >= INFINITY || seq2->cost >= INFINITY) - seq1->cost = INFINITY; - else { - vptr = seq2->vec; - while (vptr != seq2->end) - *(seq1->end++) = *(vptr++); - seq1->cost += seq2->cost; - } -} - - -static void -out_seq(struct Sequence *seq) -{ -int *opptr, prm[9], ps, p, op; -int count; -char *sequence(); - - T(("out_seq(%x)", seq)); - - if (seq->cost >= INFINITY) - return; - - for (opptr = seq->vec; opptr < seq->end; opptr++) { - op = *opptr; /* grab operator */ - ps = -op_info[op]; - if(ps > 0) { /* parameterized */ - for (p = 0; p < ps; p++) /* fill in needed parms */ - prm[p] = *(++opptr); - - putp(tparm(sequence(op), - prm[0], prm[1], prm[2], prm[3], prm[4], - prm[5], prm[6], prm[7], prm[8])); - } else { - count = *(++opptr); - /*rev should save tputs output instead of mult calls */ - while (count--) /* do count times */ - putp(sequence(op)); - } - } -} - - -/* -** update_ops() -** -** update_ops() makes sure that -** the op_info[] array is updated and initializes -** the cost array for SP if needed. -*/ - -static void -update_ops() -{ - T(("update_ops()")); - - if (SP) { /* SP structure exists */ - int op; - - if (! SP->_costinit) { /* this term not yet assigned costs */ - loc_init = FALSE; /* if !SP in the future, new term */ - init_costs(SP->_costs); /* fill term costs */ - SP->_costinit = TRUE; - } - - for (op = 0; op < NUM_NPARM; op++) - op_info[op] = SP->_costs[op]; /* set up op_info */ - - /* check for newline that might be mapped... */ - - if (SP->_nlmapping && index(sequence(CURS_DOWN), '\n')) - op_info[CURS_DOWN] = INFINITY; - } else { - if (! loc_init) { /* using local costs */ - loc_init = TRUE; - init_costs(op_info); /* set up op_info */ - } - - /* check for newline that might be mapped... */ - - if (index(sequence(CURS_DOWN), '\n')) - op_info[CURS_DOWN] = INFINITY; - } -} - - -/* -** init_costs(costs) -** -** init_costs() fills the array costs[NUM_NPARM] -** with costs calculated by doing tputs() calls. -*/ - -static void -init_costs(int costs[]) -{ -int i; - - for (i = 0; i < NUM_NPARM; i++) { - if (sequence(i) != (char *) 0) { - c_count = 0; - tputs(sequence(i), 1, countc); - costs[i] = c_count; - } else - costs[i] = INFINITY; - } -} - - -/* -** countc() increments global var c_count. -*/ - -static int countc(char ch) -{ - return(c_count++); -} - -/* -** add_op(seq, op, p0, p1, ... , p8) -** -** add_op() adds the operator op and the appropriate -** number of paramaters to seq. It also increases the -** cost appropriately. -** if op has no parameters, p0 is taken to be a count. -*/ - -static void add_op(struct Sequence *seq, int op, ...) -{ -va_list argp; -int num_ps, p; - - T(("adding op %d to sequence", op)); - - va_start(argp, op); - - num_ps = - op_info[op]; /* get parms or -cost */ - - *(seq->end++) = op; - - if (num_ps == (- INFINITY) || sequence(op) == (char *) 0) { - seq->cost = INFINITY; - } else if (num_ps <= 0) { /* no parms, -cost */ - int i = va_arg(argp, int); - seq->cost -= i * num_ps; /* ADD count * cost */ - *(seq->end++) = i; - } else { - int prm[9]; - - for (p = 0; p < num_ps; p++) - *(seq->end++) = prm[p] = va_arg(argp, int); - - c_count = 0; - - tputs(tparm(sequence(op), prm[0], prm[1], prm[2], prm[3], prm[4], - prm[5], prm[6], prm[7], prm[8]), 1, countc); - - seq->cost += c_count; - } - va_end(argp); -} - - -/* -** char *sequence(op) -** -** sequence() returns a pointer to the op's -** terminal control sequence. -*/ - -static char *sequence(int op) -{ - T(("sequence(%d)", op)); - - switch(op) { - case CARRIAGE_RETURN: - return (carriage_return); - case CURS_DOWN: - return (cursor_down); - case CURS_HOME: - return (cursor_home); - case CURS_LEFT: - return (cursor_left); - case CURS_RIGHT: - return (cursor_right); - case CURS_TO_LL: - return (cursor_to_ll); - case CURS_UP: - return (cursor_up); - case TAB: - return (tab); - case BACK_TAB: - return (back_tab); - case ROW_ADDR: - return (row_address); - case COL_ADDR: - return (column_address); - case P_DOWN_CURS: - return (parm_down_cursor); - case P_LEFT_CURS: - return (parm_left_cursor); - case P_RIGHT_CURS: - return (parm_right_cursor); - case P_UP_CURS: - return (parm_up_cursor); - case CURS_ADDR: - return (cursor_address); - default: - return ((char *) 0); - } -} - -#endif - diff --git a/lib/libncurses/lib_mvwin.c b/lib/libncurses/lib_mvwin.c deleted file mode 100644 index 2e6159fa2788..000000000000 --- a/lib/libncurses/lib_mvwin.c +++ /dev/null @@ -1,29 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_mvwin.c -** -** The routine mvwin(). -** -*/ - -#include "curses.priv.h" -#include "terminfo.h" - -int mvwin(WINDOW *win, int by, int bx) -{ - T(("mvwin(%x,%d,%d) called", win, by, bx)); - - if (by + win->_maxy > lines - 1 || bx + win->_maxx > columns - 1) - return(ERR); - - win->_begy = by; - win->_begx = bx; - - touchwin(win); - - return(OK); -} diff --git a/lib/libncurses/lib_newterm.c b/lib/libncurses/lib_newterm.c deleted file mode 100644 index 4b49c8debf13..000000000000 --- a/lib/libncurses/lib_newterm.c +++ /dev/null @@ -1,177 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_newterm.c -** -** The newterm() function. -** -*/ - -#include <stdlib.h> -#include "curses.priv.h" -#include "terminfo.h" -#ifdef SVR4_ACTION -#define _POSIX_SOURCE -#endif -#include <signal.h> - -#ifdef MYTINFO -int LINES, COLS; -#endif - -static void cleanup(int sig) -{ - - if (sig == SIGSEGV) - fprintf(stderr, "Got a segmentation violation signal, cleaning up and exiting\n"); - endwin(); - exit(1); -} - -static void -size_change(int sig) -{ - struct ttysize ws; - - if (ioctl(0, TIOCGSIZE, &ws) != -1) { - LINES = ws.ts_lines; - COLS = ws.ts_cols; - } -} - -WINDOW *stdscr, *curscr, *newscr; -SCREEN *SP; - -struct ripoff_t -{ - int line; - int (*hook)(); -} -rippedoff[5], *rsp = rippedoff; - -SCREEN * newterm(char *term, FILE *ofp, FILE *ifp) -{ -sigaction_t act; -int errret; -int stolen, topstolen; -extern char _ncurses_copyright[]; -char *use_it = _ncurses_copyright; - - use_it = use_it; /* shut up compiler */ -#ifdef TRACE - _init_trace(); - T(("newterm(\"%s\",%x,%x) called", term, ofp, ifp)); -#endif - -#ifdef MYTINFO - if (setupterm(term, fileno(ofp), &errret) != OK) - return NULL; - COLS = columns; - LINES = lines; -#else - if (setupterm(term, fileno(ofp), &errret) != 1) - return NULL; -#endif - - if ((SP = (SCREEN *) malloc(sizeof *SP)) == NULL) - return NULL; - - if (ofp == stdout && ifp == stdin) { - SP->_ofp = stdout; - SP->_ifp = stdin; - } else { - SP->_ofp = ofp; - SP->_ifp = ofp; - } - SP->_term = cur_term; - SP->_cursrow = -1; - SP->_curscol = -1; - SP->_keytry = UNINITIALISED; - SP->_nl = TRUE; - SP->_raw = FALSE; - SP->_cbreak = FALSE; - SP->_echo = TRUE; - SP->_nlmapping = TRUE; - SP->_fifohead = -1; - SP->_fifotail = 0; - SP->_fifopeek = 0; - SP->_endwin = FALSE; - SP->_checkfd = fileno(ifp); - typeahead(fileno(ifp)); - - if (enter_ca_mode) - putp(enter_ca_mode); - - init_acs(); - - T(("creating newscr")); - if ((newscr = newwin(lines, columns, 0, 0)) == (WINDOW *)NULL) - return(NULL); - - T(("creating curscr")); - if ((curscr = newwin(lines, columns, 0, 0)) == (WINDOW *)NULL) - return(NULL); - - SP->_newscr = newscr; - SP->_curscr = curscr; - - newscr->_clear = TRUE; - curscr->_clear = FALSE; - - stolen = topstolen = 0; - for (rsp = rippedoff; rsp->line; rsp++) { - if (rsp->hook) { - if (rsp->line < 0) - rsp->hook(newwin(1,COLS, LINES-1,0), COLS); - else - rsp->hook(newwin(1,COLS, topstolen++,0), COLS); - } - --LINES; - stolen++; - } - - act.sa_handler = tstp; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; - sigaction(SIGTSTP, &act, NULL); - act.sa_handler = cleanup; - sigaction(SIGINT, &act, NULL); - sigaction(SIGTERM, &act, NULL); -#if 0 - sigaction(SIGSEGV, &act, NULL); -#endif - act.sa_handler = size_change; - act.sa_flags = SA_RESTART; - sigaction(SIGWINCH, &act, NULL); /* this must restart read() */ - if ((stdscr = newwin(lines - stolen, columns, topstolen, 0)) == NULL) - return(NULL); - - SP->_stdscr = stdscr; - - def_shell_mode(); - def_prog_mode(); - - T(("newterm returns %x", SP)); - - return(SP); -} - -int -ripoffline(int line, int (*init)(WINDOW *, int)) -{ - if (line == 0) - return(OK); - - if (rsp >= rippedoff + sizeof(rippedoff)/sizeof(rippedoff[0])) - return(ERR); - - rsp->line = line; - rsp->hook = init; - rsp++; - - return(OK); -} - diff --git a/lib/libncurses/lib_newwin.c b/lib/libncurses/lib_newwin.c deleted file mode 100644 index b58eb07e37d0..000000000000 --- a/lib/libncurses/lib_newwin.c +++ /dev/null @@ -1,185 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_newwin.c -** -** The routines newwin(), subwin() and their dependent -** -*/ - -#include <stdlib.h> -#include "terminfo.h" -#include "curses.priv.h" - -WINDOW * newwin(int num_lines, int num_columns, int begy, int begx) -{ -WINDOW *win; -chtype *ptr; -int i, j; - - T(("newwin(%d,%d,%d,%d) called", num_lines, num_columns, begy, begx)); - - if (num_lines == 0) - num_lines = lines - begy; - - if (num_columns == 0) - num_columns = columns - begx; - - if (num_columns + begx > columns || num_lines + begy > lines) - return NULL; - - if ((win = makenew(num_lines, num_columns, begy, begx)) == NULL) - return NULL; - - for (i = 0; i < num_lines; i++) { - if ((win->_line[i] = (chtype *) calloc(num_columns, sizeof(chtype))) == NULL) { - for (j = 0; j < i; j++) - free(win->_line[j]); - - free(win->_firstchar); - free(win->_lastchar); - free(win->_line); - free(win); - - return NULL; - } - else - for (ptr = win->_line[i]; ptr < win->_line[i] + num_columns; ) - *ptr++ = ' '; - } - - T(("newwin: returned window is %x", win)); - - return(win); -} - -WINDOW * derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) -{ -WINDOW *win; -int i; - - T(("derwin(%x, %d,%d,%d,%d) called", orig, num_lines, num_columns, begy, begx)); - - /* - ** make sure window fits inside the original one - */ - if ( begy < 0 || begx < 0) - return NULL; - if ( begy + num_lines > orig->_maxy + 1 - || begx + num_columns > orig->_maxx + 1) - return NULL; - - if (num_lines == 0) - num_lines = orig->_maxy - orig->_begy - begy; - - if (num_columns == 0) - num_columns = orig->_maxx - orig->_begx - begx; - - if ((win = makenew(num_lines, num_columns, orig->_begy + begy, orig->_begx + begx)) == NULL) - return NULL; - - win->_pary = begy; - win->_parx = begx; - win->_attrs = orig->_attrs; - win->_bkgd = orig->_bkgd; - - for (i = 0; i < num_lines; i++) - win->_line[i] = &orig->_line[begy++][begx]; - - win->_flags = _SUBWIN; - win->_parent = orig; - - T(("derwin: returned window is %x", win)); - - return(win); -} - - -WINDOW *subwin(WINDOW *w, int l, int c, int y, int x) -{ - T(("subwin(%x, %d, %d, %d, %d) called", w, l, c, y, x)); - T(("parent has begy = %d, begx = %d", w->_begy, w->_begx)); - - return derwin(w, l, c, y - w->_begy, x - w->_begx); -} - -WINDOW * -makenew(int num_lines, int num_columns, int begy, int begx) -{ -int i; -WINDOW *win; - - T(("makenew(%d,%d,%d,%d)", num_lines, num_columns, begy, begx)); - - if ((win = (WINDOW *) malloc(sizeof(WINDOW))) == NULL) - return NULL; - - if ((win->_line = (chtype **) calloc(num_lines, sizeof (chtype *))) == NULL) { - free(win); - return NULL; - } - - if ((win->_firstchar = calloc(num_lines, sizeof(short))) == NULL) { - free(win); - free(win->_line); - return NULL; - } - - if ((win->_lastchar = calloc(num_lines, sizeof(short))) == NULL) { - free(win); - free(win->_line); - free(win->_firstchar); - return NULL; - } - - win->_curx = 0; - win->_cury = 0; - win->_maxy = num_lines - 1; - win->_maxx = num_columns - 1; - win->_begy = begy; - win->_begx = begx; - - win->_flags = 0; - win->_attrs = A_NORMAL; - win->_bkgd = BLANK; - - win->_clear = (num_lines == lines && num_columns == columns); - win->_idlok = FALSE; - win->_use_idc = TRUE; - win->_scroll = FALSE; - win->_leave = FALSE; - win->_use_keypad = FALSE; -#ifdef TERMIOS - win->_use_meta = ((cur_term->Ottyb.c_cflag & CSIZE) == CS8 && - !(cur_term->Ottyb.c_iflag & ISTRIP)); -#else - win->_use_meta = FALSE; -#endif - win->_delay = -1; - win->_immed = FALSE; - win->_sync = 0; - win->_parx = 0; - win->_pary = 0; - win->_parent = (WINDOW *)NULL; - - win->_regtop = 0; - win->_regbottom = num_lines - 1; - - for (i = 0; i < num_lines; i++) - win->_firstchar[i] = win->_lastchar[i] = _NOCHANGE; - - if (begx + num_columns == columns) { - win->_flags |= _ENDLINE; - - if (begx == 0 && num_lines == lines && begy == 0) - win->_flags |= _FULLWIN; - - if (begy + num_lines == lines) - win->_flags |= _SCROLLWIN; - } - - return(win); -} diff --git a/lib/libncurses/lib_options.c b/lib/libncurses/lib_options.c deleted file mode 100644 index 789ebc62a303..000000000000 --- a/lib/libncurses/lib_options.c +++ /dev/null @@ -1,273 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_options.c -** -** The routines to handle option setting. -** -*/ - -#include <stdlib.h> -#include "terminfo.h" -#include "curses.priv.h" - -int idlok(WINDOW *win, int flag) -{ - T(("idlok(%x,%d) called", win, flag)); - - if (flag == FALSE) { - win->_idlok = FALSE; - return OK; - } - - if ((insert_line || parm_insert_line) && (delete_line || parm_delete_line)) { - win->_idlok = TRUE; - } - return OK; -} - - -int clearok(WINDOW *win, int flag) -{ - T(("clearok(%x,%d) called", win, flag)); - - if (win == curscr) - newscr->_clear = flag; - else - win->_clear = flag; - return OK; -} - - -int leaveok(WINDOW *win, int flag) -{ - T(("leaveok(%x,%d) called", win, flag)); - - win->_leave = flag; - if (flag == TRUE) - curs_set(0); - else - curs_set(1); - return OK; -} - - -int scrollok(WINDOW *win, int flag) -{ - T(("scrollok(%x,%d) called", win, flag)); - - win->_scroll = flag; - return OK; -} - -int halfdelay(int t) -{ - T(("halfdelay(%d) called", t)); - - if (t < 1 || t > 255) - return ERR; - - cbreak(); - SP->_cbreak = t+1; - return OK; -} - -int nodelay(WINDOW *win, int flag) -{ - T(("nodelay(%x,%d) called", win, flag)); - - if (flag == TRUE) - win->_delay = 0; - else win->_delay = -1; - return OK; -} - -int notimeout(WINDOW *win, bool f) -{ - T(("notimout(%x,%d) called", win, f)); - - win->_notimeout = f; - return OK; -} - -int wtimeout(WINDOW *win, int delay) -{ - T(("wtimeout(%x,%d) called", win, delay)); - - win->_delay = delay; - return OK; -} - -static void init_keytry(); -static void add_to_try(char *, short); - -int keypad(WINDOW *win, int flag) -{ - T(("keypad(%x,%d) called", win, flag)); - - if (win) { - win->_use_keypad = flag; - return _nc_keypad(flag); - } - else - return ERR; -} - - - -int meta(WINDOW *win, int flag) -{ - T(("meta(%x,%d) called", win, flag)); - - win->_use_meta = flag; - - if (flag && meta_on) - putp(meta_on); - else if (! flag && meta_off) - putp(meta_off); - return OK; -} - -/* -** init_keytry() -** -** Construct the try for the current terminal's keypad keys. -** -*/ - - -static struct try *newtry; - -static void init_keytry() -{ - newtry = NULL; - -#include "keys.tries.h" - - SP->_keytry = newtry; -} - - -static void add_to_try(char *str, short code) -{ -static bool out_of_memory = FALSE; -struct try *ptr, *savedptr; - - if (! str || out_of_memory) - return; - - if (newtry != NULL) { - ptr = savedptr = newtry; - - for (;;) { - while (ptr->ch != (unsigned char) *str - && ptr->sibling != NULL) - ptr = ptr->sibling; - - if (ptr->ch == (unsigned char) *str) { - if (*(++str)) { - if (ptr->child != NULL) - ptr = ptr->child; - else - break; - } else { - ptr->value = code; - return; - } - } else { - if ((ptr->sibling = (struct try *) malloc(sizeof *ptr)) == NULL) { - out_of_memory = TRUE; - return; - } - - savedptr = ptr = ptr->sibling; - ptr->child = ptr->sibling = NULL; - ptr->ch = *str++; - ptr->value = (short) NULL; - - break; - } - } /* end for (;;) */ - } else { /* newtry == NULL :: First sequence to be added */ - savedptr = ptr = newtry = (struct try *) malloc(sizeof *ptr); - - if (ptr == NULL) { - out_of_memory = TRUE; - return; - } - - ptr->child = ptr->sibling = NULL; - ptr->ch = *(str++); - ptr->value = (short) NULL; - } - - /* at this point, we are adding to the try. ptr->child == NULL */ - - while (*str) { - ptr->child = (struct try *) malloc(sizeof *ptr); - - ptr = ptr->child; - - if (ptr == NULL) { - out_of_memory = TRUE; - - ptr = savedptr; - while (ptr != NULL) { - savedptr = ptr->child; - free(ptr); - ptr = savedptr; - } - - return; - } - - ptr->child = ptr->sibling = NULL; - ptr->ch = *(str++); - ptr->value = (short) NULL; - } - - ptr->value = code; - return; -} - -int typeahead(int fd) -{ - - T(("typeahead(%d) called", fd)); - SP->_checkfd = fd; - return OK; -} - -int intrflush(WINDOW *win, bool flag) -{ - T(("intrflush(%x, %d) called", win, flag)); - return OK; -} - -/* Turn the keypad on/off - * - * Note: we flush the output because changing this mode causes some terminals - * to emit different escape sequences for cursor and keypad keys. If we don't - * flush, then the next wgetch may get the escape sequence that corresponds to - * the terminal state _before_ switching modes. - */ -int _nc_keypad(bool flag) -{ - if (flag && keypad_xmit) - { - putp(keypad_xmit); - (void) fflush(SP->_ofp); - } - else if (! flag && keypad_local) - { - putp(keypad_local); - (void) fflush(SP->_ofp); - } - - if (SP->_keytry == UNINITIALISED) - init_keytry(); - return(OK); -} diff --git a/lib/libncurses/lib_overlay.c b/lib/libncurses/lib_overlay.c deleted file mode 100644 index 19e58f31f96d..000000000000 --- a/lib/libncurses/lib_overlay.c +++ /dev/null @@ -1,110 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_overlay.c -** -** The routines overlay(), copywin(), and overwrite(). -** -*/ - -#include "curses.priv.h" - -static void overlap(WINDOW *s, WINDOW *d, int flag) -{ -int sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol; - - T(("overlap : sby %d, sbx %d, smy %d, smx %d, dby %d, dbx %d, dmy %d, dmx %d", - s->_begy, s->_begx, s->_maxy, s->_maxx, - d->_begy, d->_begx, d->_maxy, d->_maxx)); - sminrow = max(s->_begy, d->_begy) - s->_begy; - smincol = max(s->_begx, d->_begx) - s->_begx; - dminrow = max(s->_begy, d->_begy) - d->_begy; - dmincol = max(s->_begx, d->_begx) - d->_begx; - dmaxrow = min(s->_maxy+s->_begy, d->_maxy+d->_begy) - d->_begy; - dmaxcol = min(s->_maxx+s->_begx, d->_maxx+d->_begx) - d->_begx; - - copywin(s, d, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, flag); -} - -/* -** -** overlay(win1, win2) -** -** -** overlay() writes the overlapping area of win1 behind win2 -** on win2 non-destructively. -** -**/ - -int overlay(WINDOW *win1, WINDOW *win2) -{ - overlap(win1, win2, TRUE); - return OK; -} - -/* -** -** overwrite(win1, win2) -** -** -** overwrite() writes the overlapping area of win1 behind win2 -** on win2 destructively. -** -**/ - -int overwrite(WINDOW *win1, WINDOW *win2) -{ - overlap(win1, win2, FALSE); - return OK; -} - -int copywin(WINDOW *src, WINDOW *dst, - int sminrow, int smincol, - int dminrow, int dmincol, int dmaxrow, int dmaxcol, - int over) -{ -int sx, sy, dx, dy; - - T(("copywin(%x, %x, %d, %d, %d, %d, %d, %d, %d)", - src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over)); - - /* make sure rectangle exists in source */ - if ((sminrow + dmaxrow - dminrow) > (src->_maxy + 1) || - (smincol + dmaxcol - dmincol) > (src->_maxx + 1)) { - return ERR; - } - - T(("rectangle exists in source")); - - /* make sure rectangle fits in destination */ - if (dmaxrow > dst->_maxy || dmaxcol > dst->_maxx) { - return ERR; - } - - T(("rectangle fits in destination")); - - for (dy = dminrow, sy = sminrow; dy <= dmaxrow; sy++, dy++) { - dst->_firstchar[dy] = dmincol; - dst->_lastchar[dy] = dmincol; - for (dx = dmincol, sx = smincol; dx <= dmaxcol; sx++, dx++) { - if (over == TRUE ) { - if (((src->_line[sy][sx] & A_CHARTEXT) != ' ') && (dst->_line[dy][dx] != src->_line[sy][sx])) { - dst->_line[dy][dx] = src->_line[sy][sx]; - dst->_lastchar[dy] = dx; - } else - dst->_firstchar[dy]++; - } else { - if (dst->_line[dy][dx] != src->_line[sy][sx]) { - dst->_line[dy][dx] = src->_line[sy][sx]; - dst->_lastchar[dy] = dx; - } else - dst->_firstchar[dy]++; - } - } - } - T(("finished copywin")); - return OK; -} diff --git a/lib/libncurses/lib_pad.c b/lib/libncurses/lib_pad.c deleted file mode 100644 index 5b4aa9926fce..000000000000 --- a/lib/libncurses/lib_pad.c +++ /dev/null @@ -1,143 +0,0 @@ -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* - * lib_pad.c - * newpad -- create a new pad - * pnoutrefresh -- refresh a pad, no update - * pechochar -- add a char to a pad and refresh - */ - -#include <stdlib.h> -#include "curses.priv.h" - -WINDOW *newpad(int l, int c) -{ -WINDOW *win; -chtype *ptr; -int i, j; - - T(("newpad(%d, %d) called", l, c)); - - if (l <= 0 || c <= 0) - return NULL; - - if ((win = makenew(l,c,0,0)) == NULL) - return NULL; - - win->_flags |= _ISPAD; - - for (i = 0; i < l; i++) { - if ((win->_line[i] = (chtype *) calloc(c, sizeof(chtype))) == NULL) { - for (j = 0; j < i; j++) - free(win->_line[j]); - - free(win->_firstchar); - free(win->_lastchar); - free(win->_line); - free(win); - - return NULL; - } - else - for (ptr = win->_line[i]; ptr < win->_line[i] + c; ) - *ptr++ = ' '; - } - - T(("newpad: returned window is %x", win)); - - return(win); -} - -int prefresh(WINDOW *win, int pminrow, int pmincol, - int sminrow, int smincol, int smaxrow, int smaxcol) -{ - T(("prefresh() called")); - if (pnoutrefresh(win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol) != ERR) - return (doupdate()); - else - return ERR; - -} - -int pnoutrefresh(WINDOW *win, int pminrow, int pmincol, - int sminrow, int smincol, int smaxrow, int smaxcol) -{ -int i, j; -int m, n; - - T(("pnoutrefresh(%x, %d, %d, %d, %d, %d, %d) called", - win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)); - - if (!(win->_flags & _ISPAD)) - return ERR; - - T(("one")); - if (pminrow < 0) pminrow = 0; - if (pmincol < 0) pmincol = 0; - if (sminrow < 0) sminrow = 0; - if (smincol < 0) smincol = 0; - - T(("two")); - if (smaxrow >= LINES || smaxcol >= COLS) - return ERR; - - T(("three")); - if ((pminrow + smaxrow - sminrow > win->_maxy) || - (pmincol + smaxcol - smincol > win->_maxx)) - return ERR; - - T(("pad being refreshed")); - - for (i = pminrow, m = sminrow; i <= pminrow + smaxrow-sminrow; - i++, m++) { - for (j = pmincol, n = smincol; j <= pmincol + smaxcol-smincol; - j++, n++) { - if (win->_line[i][j] != newscr->_line[m][n]) { - newscr->_line[m][n] = win->_line[i][j]; - - if (newscr->_firstchar[m] == _NOCHANGE) - newscr->_firstchar[m] = newscr->_lastchar[m] = n; - else if (n < newscr->_firstchar[m]) - newscr->_firstchar[m] = n; - else if (n > newscr->_lastchar[m]) - newscr->_lastchar[m] = n; - } - } - } - - win->_firstchar[i] = win->_lastchar[i] = _NOCHANGE; - - win->_begx = smincol; - win->_begy = sminrow; - - if (win->_clear) { - win->_clear = FALSE; - newscr->_clear = TRUE; - } - - if (! win->_leave) { - newscr->_cury = win->_cury + win->_begy; - newscr->_curx = win->_curx + win->_begx; - } - return OK; -} - -int pechochar(WINDOW *pad, chtype ch) -{ -int x, y; - - T(("echochar(%x, %x)", pad, ch)); - - if (pad->_flags & _ISPAD) - return ERR; - - x = pad->_begx + pad->_curx; - y = pad->_begy + pad->_cury; - - waddch(curscr, ch); - doupdate(); - return OK; -} - diff --git a/lib/libncurses/lib_printw.c b/lib/libncurses/lib_printw.c deleted file mode 100644 index 236c29a4beaa..000000000000 --- a/lib/libncurses/lib_printw.c +++ /dev/null @@ -1,75 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_printw.c -** -** The routines printw(), wprintw() and friends. -** -*/ - -#include "curses.priv.h" - -int printw(char *fmt, ...) -{ -va_list argp; -char buf[BUFSIZ]; - - T(("printw(\"%s\",...) called", fmt)); - - va_start(argp, fmt); - vsprintf(buf, fmt, argp); - va_end(argp); - return(waddstr(stdscr, buf)); -} - - - -int wprintw(WINDOW *win, char *fmt, ...) -{ -va_list argp; -char buf[BUFSIZ]; - - T(("wprintw(%x,\"%s\",...) called", win, fmt)); - - va_start(argp, fmt); - vsprintf(buf, fmt, argp); - va_end(argp); - return(waddstr(win, buf)); -} - - - -int mvprintw(int y, int x, char *fmt, ...) -{ -va_list argp; -char buf[BUFSIZ]; - - va_start(argp, fmt); - vsprintf(buf, fmt, argp); - va_end(argp); - return(move(y, x) == OK ? waddstr(stdscr, buf) : ERR); -} - - - -int mvwprintw(WINDOW *win, int y, int x, char *fmt, ...) -{ -va_list argp; -char buf[BUFSIZ]; - - va_start(argp, fmt); - vsprintf(buf, fmt, argp); - va_end(argp); - return(wmove(win, y, x) == OK ? waddstr(win, buf) : ERR); -} - -int vwprintw(WINDOW *win, char *fmt, va_list argp) -{ -char buf[BUFSIZ]; - - vsprintf(buf, fmt, argp); - return(waddstr(win, buf)); -} diff --git a/lib/libncurses/lib_raw.c b/lib/libncurses/lib_raw.c deleted file mode 100644 index fac726e6583f..000000000000 --- a/lib/libncurses/lib_raw.c +++ /dev/null @@ -1,201 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* - * raw.c - * - * Routines: - * raw() - * echo() - * nl() - * cbreak() - * noraw() - * noecho() - * nonl() - * nocbreak() - * - */ - -#include "curses.priv.h" -#include "terminfo.h" - -#ifdef TERMIOS -static tcflag_t iexten = 0; -#endif - -int raw() -{ - T(("raw() called")); - - SP->_raw = TRUE; - SP->_cbreak = TRUE; - SP->_nlmapping = TRUE; - -#ifdef TERMIOS - if(iexten == 0) - iexten = cur_term->Nttyb.c_lflag & IEXTEN; - cur_term->Nttyb.c_lflag &= ~(ICANON|ISIG|iexten); - cur_term->Nttyb.c_iflag &= ~(INPCK|ISTRIP|IXON); - cur_term->Nttyb.c_oflag &= ~(OPOST); - cur_term->Nttyb.c_cc[VMIN] = 1; - cur_term->Nttyb.c_cc[VTIME] = 0; - if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1) - return ERR; - else - return OK; -#else - cur_term->Nttyb.sg_flags |= RAW; - stty(cur_term->Filedes, &cur_term->Nttyb); - return OK; -#endif -} - -int cbreak() -{ - T(("cbreak() called")); - - SP->_cbreak = 1; - -#ifdef TERMIOS - cur_term->Nttyb.c_lflag &= ~ICANON; - cur_term->Nttyb.c_lflag |= ISIG; - cur_term->Nttyb.c_cc[VMIN] = 1; - cur_term->Nttyb.c_cc[VTIME] = 0; - if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1) - return ERR; - else - return OK; -#else - cur_term->Nttyb.sg_flags |= CBREAK; - stty(cur_term->Filedes, &cur_term->Nttyb); - return OK; -#endif -} - -int echo() -{ - T(("echo() called")); - - SP->_echo = TRUE; - -#ifdef TERMIOS - cur_term->Nttyb.c_lflag |= ECHO; - if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1) - return ERR; - else - return OK; -#else - cur_term->Nttyb.sg_flags |= ECHO; - stty(cur_term->Filedes, &cur_term->Nttyb); - return OK; -#endif -} - - -int nl() -{ - T(("nl() called")); - - SP->_nl = TRUE; - SP->_nlmapping = ! SP->_raw; - -#ifdef TERMIOS - cur_term->Nttyb.c_iflag |= IXON|ICRNL|IXOFF; - cur_term->Nttyb.c_oflag |= OPOST|ONLCR; - if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1) - return ERR; - else - return OK; -#else - cur_term->Nttyb.sg_flags |= CRMOD; - stty(cur_term->Filedes, &cur_term->Nttyb); - return OK; -#endif -} - - -int noraw() -{ - T(("noraw() called")); - - SP->_raw = FALSE; - SP->_cbreak = FALSE; - SP->_nlmapping = SP->_nl; - -#ifdef TERMIOS - cur_term->Nttyb.c_lflag |= ISIG|ICANON|iexten; - cur_term->Nttyb.c_iflag |= IXON; - cur_term->Nttyb.c_oflag |= OPOST; - if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1) - return ERR; - else - return OK; -#else - cur_term->Nttyb.sg_flags &= ~(RAW|CBREAK); - stty(cur_term->Filedes, &cur_term->Nttyb); - return OK; -#endif - -} - - -int nocbreak() -{ - T(("nocbreak() called")); - - SP->_cbreak = 0; - -#ifdef TERMIOS - cur_term->Nttyb.c_lflag |= ICANON; - if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1) - return ERR; - else - return OK; -#else - cur_term->Nttyb.sg_flags &= ~CBREAK; - stty(cur_term->Filedes, &cur_term->Nttyb); - return OK; -#endif -} - -int noecho() -{ - T(("noecho() called")); - - SP->_echo = FALSE; - -#ifdef TERMIOS - cur_term->Nttyb.c_lflag &= ~(ECHO); - if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1) - return ERR; - else - return OK; -#else - cur_term->Nttyb.sg_flags &= ~ECHO; - stty(cur_term->Filedes, &cur_term->Nttyb); - return OK; -#endif -} - - -int nonl() -{ - T(("nonl() called")); - - SP->_nl = SP->_nlmapping = FALSE; - -#ifdef TERMIOS - cur_term->Nttyb.c_iflag &= ~ICRNL; - cur_term->Nttyb.c_oflag &= ~ONLCR; - if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1) - return ERR; - else - return OK; -#else - cur_term->Nttyb.sg_flags &= ~CRMOD; - stty(cur_term->Filedes, &cur_term->Nttyb); - return OK; -#endif -} diff --git a/lib/libncurses/lib_refresh.c b/lib/libncurses/lib_refresh.c deleted file mode 100644 index 994802525a14..000000000000 --- a/lib/libncurses/lib_refresh.c +++ /dev/null @@ -1,91 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* - * lib_refresh.c - * - * The routines wredrawln(), wrefresh() and wnoutrefresh(). - * - */ - -#include "curses.priv.h" - -int wredrawln(WINDOW *win, int beg, int num) -{ - T(("wredrawln(%x,%d,%d) called", win, beg, num)); - touchline(win, beg, num); - wrefresh(win); - return OK; -} - -int wrefresh(WINDOW *win) -{ - T(("wrefresh(%x) called", win)); - - if (win == curscr) - curscr->_clear = TRUE; - else - wnoutrefresh(win); - return(doupdate()); -} - -int wnoutrefresh(WINDOW *win) -{ -int i, j; -int begx = win->_begx; -int begy = win->_begy; -int m, n; - - T(("wnoutrefresh(%x) called", win)); - - /* - * This function will break badly if we try to refresh a pad. - */ - if ((win == 0) - || (win->_flags & _ISPAD)) - return(ERR); - - /* - * If 'newscr' has a different background than the window that we're - * trying to refresh, we'll have to copy the whole thing. - */ - if (win->_bkgd != newscr->_bkgd) { - touchwin(win); - newscr->_bkgd = win->_bkgd; - } - newscr->_attrs = win->_attrs; - - win->_flags &= ~_HASMOVED; - for (i = 0, m = begy; i <= win->_maxy; i++, m++) { - if (win->_firstchar[i] != _NOCHANGE) { - j = win->_firstchar[i]; - n = j + begx; - for (; j <= win->_lastchar[i]; j++, n++) { - if (win->_line[i][j] != newscr->_line[m][n]) { - newscr->_line[m][n] = win->_line[i][j]; - - if (newscr->_firstchar[m] == _NOCHANGE) - newscr->_firstchar[m] = newscr->_lastchar[m] = n; - else if (n < newscr->_firstchar[m]) - newscr->_firstchar[m] = n; - else if (n > newscr->_lastchar[m]) - newscr->_lastchar[m] = n; - } - } - } - win->_firstchar[i] = win->_lastchar[i] = _NOCHANGE; - } - - if (win->_clear) { - win->_clear = FALSE; - newscr->_clear = TRUE; - } - - if (! win->_leave) { - newscr->_cury = win->_cury + win->_begy; - newscr->_curx = win->_curx + win->_begx; - } - return(OK); -} diff --git a/lib/libncurses/lib_scanw.c b/lib/libncurses/lib_scanw.c deleted file mode 100644 index 69b5a33f5b71..000000000000 --- a/lib/libncurses/lib_scanw.c +++ /dev/null @@ -1,66 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_scanw.c -** -** The routines scanw(), wscanw() and friends. -** -*/ - -#include <stdio.h> -#include "curses.priv.h" - -int vwscanw(WINDOW *win, char *fmt, va_list argp) -{ -char buf[BUFSIZ]; - - if (wgetstr(win, buf) == ERR) - return(ERR); - - return(vsscanf(buf, fmt, argp)); -} - -int scanw(char *fmt, ...) -{ -va_list ap; - - T(("scanw(\"%s\",...) called", fmt)); - - va_start(ap, fmt); - return(vwscanw(stdscr, fmt, ap)); -} - -int wscanw(WINDOW *win, char *fmt, ...) -{ -va_list ap; - - T(("wscanw(%x,\"%s\",...) called", win, fmt)); - - va_start(ap, fmt); - return(vwscanw(win, fmt, ap)); -} - - - -int mvscanw(int y, int x, char *fmt, ...) -{ -va_list ap; - - va_start(ap, fmt); - return(move(y, x) == OK ? vwscanw(stdscr, fmt, ap) : ERR); -} - - - -int mvwscanw(WINDOW *win, int y, int x, char *fmt, ...) -{ -va_list ap; - - va_start(ap, fmt); - return(wmove(win, y, x) == OK ? vwscanw(win, fmt, ap) : ERR); -} - - diff --git a/lib/libncurses/lib_screen.c b/lib/libncurses/lib_screen.c deleted file mode 100644 index 382411bc657b..000000000000 --- a/lib/libncurses/lib_screen.c +++ /dev/null @@ -1,58 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -#included "curses.priv.h" - -int putwin(WINDOW *win, char *file) -{ -int fd, i; - - fd = open(file, O_WRONLY); - if (fd < -1) - return ERR; - for (i = 0; i < lines; i++) - write(fd, win->_line[i], sizeof(chtype)*columns); - close(fd); - return OK; -} - -int scr_restore(char *file) -{ -int fd, i; - - fd = open(file, O_RDONLY); - if (fd < -1) - return ERR; - for (i = 0; i < lines; i++) - read(fd, curscr->_line[i], sizeof(chtype)*columns); - touchwin(curscr); - close(fd); - return OK; -} - -int scr_dump(char *file) -{ - - putwin(curscr, file); -} - -int scr_init(char *file) -{ - - return ERR; -} - -int scr_set(char *file) -{ - - return ERR; -} - -WINDOW *getwin(FILE *filep) -{ - - return NULL; -} - diff --git a/lib/libncurses/lib_scroll.c b/lib/libncurses/lib_scroll.c deleted file mode 100644 index 3a608369d7f9..000000000000 --- a/lib/libncurses/lib_scroll.c +++ /dev/null @@ -1,218 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_scroll.c -** -** The routine wscrl(win, n). -** positive n scroll the window up (ie. move lines down) -** negative n scroll the window down (ie. move lines up) -** -*/ - -#include <stdlib.h> -#include "curses.priv.h" -#include "terminfo.h" - -void _nc_soft_scroll_window(WINDOW *win, int const n, short const top, short const bottom, chtype blank) -{ -int line, i; -chtype *ptr, *temp; -chtype **saved; - - saved = (chtype **)calloc(abs(n), sizeof(chtype *)); - - if (n < 0) { - /* save overwritten lines */ - - for (i = 0; i < -n && bottom-i >= 0; i++) - saved[i] = win->_line[bottom-i]; - - /* shift n lines */ - - for (line = bottom; line >= top-n && line >= 0; line--) - win->_line[line] = win->_line[line+n]; - - /* restore saved lines and blank them */ - - for (i = 0, line = top; line < top-n && line <= win->_maxy; line++, i++) { - if (saved[i]) - win->_line[line] = saved[i]; - temp = win->_line[line]; - for (ptr = temp; ptr - temp <= win->_maxx; ptr++) - *ptr = blank; - } - } else { - /* save overwritten lines */ - - for (i = 0; i < n && top+i <= win->_maxy; i++) - saved[i] = win->_line[top+i]; - - /* shift n lines */ - - for (line = top; line <= bottom-n && line+n <= win->_maxy; line++) - win->_line[line] = win->_line[line+n]; - - /* restore saved lines and blank them */ - - for (i = 0, line = bottom; line > bottom - n && line >= 0; line--, i++) { - if (saved[i]) - win->_line[line] = saved[i]; - temp = win->_line[line]; - for (ptr = temp; ptr - temp <= win->_maxx; ptr++) - *ptr = blank; - } - } - /* touchline(win, top, bottom-top+1); */ /* not yet */ - free(saved); -} - -void _nc_scroll_window(WINDOW *win, int n, short const top, short const bottom, chtype blank) -{ -int physical = FALSE; -int i; - - if (n > lines) - n = lines; - else if (-n > lines) - n = -lines; - - /* as an optimization, if the scrolling region is the entire screen - scroll the physical screen */ - - if ( top != bottom - && win->_begx == 0 && win->_maxx == columns - 1 - && !memory_above && !memory_below - && ((((win->_begy+top == 0 && win->_begy+bottom == lines - 1) - || change_scroll_region) - && ( (n < 0 && (parm_rindex || scroll_reverse)) - || (n > 0 && (parm_index || scroll_forward)) - ) - ) || (win->_idlok && (parm_insert_line || insert_line) - && (parm_delete_line || delete_line) - ) - ) - ) - physical = TRUE; - - if (physical == TRUE) { - wrefresh(win); - _nc_soft_scroll_window(curscr, n, win->_begy+top, win->_begy+bottom, blank); - _nc_soft_scroll_window(newscr, n, win->_begy+top, win->_begy+bottom, blank); - } - _nc_soft_scroll_window(win, n, top, bottom, blank); - - if (physical == TRUE) { - if (n < 0) { - if ( (( win->_begy+top == 0 - && win->_begy+bottom == lines - 1) - || change_scroll_region) - && (parm_rindex || scroll_reverse) - ) { - if (change_scroll_region && - (win->_begy+top != 0 || win->_begy+bottom != lines - 1) - ) - putp(tparm(change_scroll_region, win->_begy+top, win->_begy+bottom)); - i = abs(n); - mvcur(-1, -1, win->_begy+top, 0); - if (parm_rindex) { - putp(tparm(parm_rindex, i)); - } else if (scroll_reverse) { - while (i--) - putp(scroll_reverse); - } - if (change_scroll_region && - (win->_begy+top != 0 || win->_begy+bottom != lines - 1) - ) - putp(tparm(change_scroll_region, 0, lines-1)); - } else { - i = abs(n); - if (win->_begy+bottom < lines - 1) { - mvcur(-1, -1, win->_begy+bottom, 0); - if (parm_delete_line) { - putp(tparm(parm_delete_line, i)); - } else if (delete_line) { - while (i--) - putp(delete_line); - i = abs(n); - } - } - mvcur(-1, -1, win->_begy+top, 0); - if (parm_insert_line) { - putp(tparm(parm_insert_line, i)); - } else if (insert_line) { - while (i--) - putp(insert_line); - } - } - } else { - if ( (( win->_begy+top == 0 - && win->_begy+bottom == lines - 1) - || change_scroll_region) - && (parm_index || scroll_forward) - ) { - if (change_scroll_region && - (win->_begy+top != 0 || win->_begy+bottom != lines - 1) - ) - putp(tparm(change_scroll_region, win->_begy+top, win->_begy+bottom)); - mvcur(-1, -1, win->_begy+bottom, 0); - if (parm_index) { - putp(tparm(parm_index, n)); - } else if (scroll_forward) { - i = n; - while (i--) - putp(scroll_forward); - } - if (change_scroll_region && - (win->_begy+top != 0 || win->_begy+bottom != lines - 1) - ) - putp(tparm(change_scroll_region, 0, lines-1)); - } else { - mvcur(-1, -1, win->_begy+top, 0); - if (parm_delete_line) { - putp(tparm(parm_delete_line, n)); - } else if (delete_line) { - i = n; - while (i--) - putp(delete_line); - } - if (win->_begy+bottom < lines - 1) { - mvcur(win->_begy+top, 0, win->_begy+bottom, 0); - if (parm_insert_line) { - putp(tparm(parm_insert_line, n)); - } else if (insert_line) { - i = n; - while (i--) - putp(insert_line); - } - } - } - } - - mvcur(-1, -1, win->_begy+win->_cury, win->_begx+win->_curx); - } else - touchline(win, top, bottom - top + 1); -} - - -int -wscrl(WINDOW *win, int n) -{ - T(("wscrl(%x,%d) called", win, n)); - - if (!win || !win->_scroll) - return ERR; - - if (n == 0) - return OK; - - if ((n > (win->_regbottom - win->_regtop)) || - (-n > (win->_regbottom - win->_regtop))) - return ERR; - - _nc_scroll_window(win, n, win->_regtop, win->_regbottom, _nc_background(win)); - - return OK; -} diff --git a/lib/libncurses/lib_scrreg.c b/lib/libncurses/lib_scrreg.c deleted file mode 100644 index 31bab4f5a96a..000000000000 --- a/lib/libncurses/lib_scrreg.c +++ /dev/null @@ -1,32 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_scrreg.c -** -** The routine wsetscrreg(). -** -*/ - -#include "curses.priv.h" -#include "terminfo.h" - -int wsetscrreg(WINDOW *win, int top, int bottom) -{ - T(("wsetscrreg(%x,%d,%d) called", win, top, bottom)); - - if (top >= 0 && top <= win->_maxy && - bottom >= 0 && bottom <= win->_maxy && - bottom > top) - { - win->_regtop = top; - win->_regbottom = bottom; - - T(("correctly set scrolling region between %d and %d", top, bottom)); - - return(OK); - } else - return(ERR); -} diff --git a/lib/libncurses/lib_set_term.c b/lib/libncurses/lib_set_term.c deleted file mode 100644 index bc73ca335360..000000000000 --- a/lib/libncurses/lib_set_term.c +++ /dev/null @@ -1,33 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_set_term.c -** -** The routine set_term(). -** -*/ - -#include "curses.priv.h" -#include "terminfo.h" - -struct screen * -set_term(screen) -struct screen *screen; -{ -struct screen *oldSP; - - T(("set_term(%o) called", screen)); - - oldSP = SP; - SP = screen; - - cur_term = SP->_term; - curscr = SP->_curscr; - newscr = SP->_newscr; - stdscr = SP->_stdscr; - - return(oldSP); -} diff --git a/lib/libncurses/lib_slk.c b/lib/libncurses/lib_slk.c deleted file mode 100644 index 8be6ac016924..000000000000 --- a/lib/libncurses/lib_slk.c +++ /dev/null @@ -1,255 +0,0 @@ - -/* - * lib_slk.c - * Soft key routines. - * - * Copyright (C) Gerhard Fuernkranz 1993 - * Permisson is granted to redistribute this - * code under the terms of the GNU Copyleft. - */ - -#include "terminfo.h" -#include "curses.priv.h" -#include <string.h> -#include <stdlib.h> - -int _slk_format; /* format specified in slk_init() */ - -#define MAXCOLUMNS 135 -#define MAXLINES 66 -#define UNINITIALISED ((struct try * ) -1) -/* - * Retrieve label text. - */ - -char * -slk_label(int n) -{ -SLK *slk = SP->_slk; - - T(("slk_label(%d)", n)); - - if (slk == NULL || n < 1 || n > 8) - return NULL; - return slk->ent[n-1].text; -} - -/* - * Write the soft lables to the slk window. - */ - -static void -slk_intern_refresh(SLK *slk) -{ -int i; - T(("slk_intern_refresh(%x)", slk)); - - for (i = 0; i < 8; i++) { - if (slk->dirty || slk->ent[i].dirty) { - if (slk->ent[i].visible) { - wmove(slk->win,0,slk->ent[i].x); - wattrset(slk->win,A_REVERSE); - waddstr(slk->win,slk->ent[i].form_text); - wattrset(slk->win,A_NORMAL); - } - slk->ent[i].dirty = FALSE; - } - } - slk->dirty = FALSE; -} - -/* - * Refresh the soft label window. - */ - -int -slk_noutrefresh(void) -{ -SLK *slk = SP->_slk; - - T(("slk_noutrefresh()")); - - if (slk == NULL) - return ERR; - if (slk->hidden) - return OK; - slk_intern_refresh(slk); - return wnoutrefresh(slk->win); -} - -/* - * Refresh the soft label window. - */ - -int -slk_refresh(void) -{ -SLK *slk = SP->_slk; - - T(("slk_refresh()")); - - if (slk == NULL) - return ERR; - if (slk->hidden) - return OK; - slk_intern_refresh(slk); - return wrefresh(slk->win); -} - -/* - * Restore the soft labels on the screen. - */ - -int -slk_restore(void) -{ -SLK *slk = SP->_slk; - - T(("slk_restore()")); - - if (slk == NULL) - return ERR; - slk->hidden = FALSE; - slk->dirty = TRUE; - return slk_refresh(); -} - -/* - * Set soft label text. - */ - -int -slk_set(int i, char *str, int format) -{ -SLK *slk = SP->_slk; -int len; - T(("slk_set(%d, \"%s\", %d)", i, str, format)); - - if (slk == NULL || i < 1 || i > 8 || format < 0 || format > 2) - return ERR; - if (str == NULL) - str = ""; - i--; - strncpy(slk->ent[i].text,str,8); - memset(slk->ent[i].form_text,' ',8); - slk->ent[i].text[8] = 0; - slk->ent[i].form_text[8] = 0; - len = strlen(slk->ent[i].text); - switch(format) { - case 0: /* left */ - memcpy(slk->ent[i].form_text,slk->ent[i].text,len); - break; - case 1: /* center */ - memcpy(slk->ent[i].form_text+(8-len)/2,slk->ent[i].text,len); - break; - case 2: /* right */ - memcpy(slk->ent[i].form_text+8-len,slk->ent[i].text,len); - break; - } - slk->ent[i].dirty = TRUE; - return OK; -} - -/* - * Pretend, that soft keys have been changed. - */ - -int -slk_touch(void) -{ -SLK *slk = SP->_slk; - T(("slk_touch()")); - - if (slk == NULL) - return ERR; - slk->dirty = TRUE; - return OK; -} - -/* - * Remove soft labels from the screen. - */ - -int -slk_clear(void) -{ -SLK *slk = SP->_slk; - - T(("slk_clear()")); - - if (slk == NULL) - return ERR; - slk->hidden = TRUE; - /* For simulated SLK's it's looks much more natural to - inherit those attributes from the standard screen */ - slk->win->_bkgd = stdscr->_bkgd; - slk->win->_attrs = stdscr->_attrs; - werase(slk->win); - return wrefresh(slk->win); -} - -/* - * Initialize soft labels. - * Called from newterm() - */ - -static int -slk_initialize(WINDOW *stwin, int cols) -{ -SLK *slk; -int i, maxlab, x; - - T(("slk_initialize()")); - - if ((SP->_slk = slk = (SLK*) calloc(1,sizeof(SLK))) == NULL) - return OK; - maxlab = (cols+1)/9; - for (i = 0; i < 8; i++) { - memset(slk->ent[i].form_text,' ',8); - slk->ent[i].visible = i < maxlab; - } - if (_slk_format == 1) { /* 4-4 */ - int gap = cols - 64 - 6; - if (gap < 1) - gap = 1; - for (i = x = 0; i < 8; i++) { - slk->ent[i].x = x; - x += 8; - x += (i == 3) ? gap : 1; - } - } - else { /* 0 -> 3-2-3 */ - int gap = (cols - 64 - 5) / 2; - if (gap < 1) - gap = 1; - for (i = x = 0; i < 8; i++) { - slk->ent[i].x = x; - x += 8; - x += (i == 2 || i == 4) ? gap : 1; - } - } - slk->dirty = TRUE; - if ((slk->win = stwin) == NULL) - { - free(slk); - return ERR; - } - - return OK; -} - -/* - * Initialize soft labels. - * Called by the user. - */ - -int -slk_init(int format) -{ - if (format < 0 || format > 1) - return ERR; - _slk_format = format; - ripoffline(-1, slk_initialize); - return OK; -} - diff --git a/lib/libncurses/lib_touch.c b/lib/libncurses/lib_touch.c deleted file mode 100644 index 4d291b3f33c1..000000000000 --- a/lib/libncurses/lib_touch.c +++ /dev/null @@ -1,48 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_touch.c -** -** The routines untouchwin(), -** wtouchln(), -** is_linetouched() -** is_wintouched(). -** -*/ - -#include "curses.priv.h" - -int is_linetouched(WINDOW *win, int line) -{ - if (line > win->_maxy || line < 0) - return ERR; - if (win->_firstchar[line] != _NOCHANGE) return TRUE; - return FALSE; -} - -int is_wintouched(WINDOW *win) -{ -int i; - - for (i = 0; i <= win->_maxy; i++) - if (win->_firstchar[i] != _NOCHANGE) - return TRUE; - return FALSE; -} - -int wtouchln(WINDOW *win, int y, int n, int changed) -{ -int i; - - T(("wtouchln(%x,%d,%d,%d)", win, y, n, changed)); - - for (i = y; i < y+n; i++) { - win->_firstchar[i] = changed ? 0 : _NOCHANGE; - win->_lastchar[i] = changed ? win->_maxx : _NOCHANGE; - } - return OK; -} - diff --git a/lib/libncurses/lib_trace.c b/lib/libncurses/lib_trace.c deleted file mode 100644 index 3a6646725577..000000000000 --- a/lib/libncurses/lib_trace.c +++ /dev/null @@ -1,179 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* - * lib_trace.c - Tracing/Debugging routines - */ - -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include <fcntl.h> -#include <errno.h> -#include "curses.priv.h" -#include "terminfo.h" - -#if defined(BRAINDEAD) -extern int errno; -#endif - -int _tracing = 0; - -static int tracefd; - -void _tracef(char *fmt, ...); - -void _init_trace() -{ -static int been_here = 0; - - if (! been_here) { - been_here = 1; - - if ((tracefd = creat("trace", 0644)) < 0) { - write(2, "curses: Can't open 'trace' file: ", 33); - write(2, strerror(errno), strlen(strerror(errno))); - write(2, "\n", 1); - exit(1); - } - _tracef("TRACING NCURSES version %s", NCURSES_VERSION); - } -} - - -void trace(const unsigned int tracelevel) -{ - _tracing = tracelevel; -} - - -char *_traceattr(int newmode) -{ -static char buf[BUFSIZ]; -struct {unsigned int val; char *name;} -names[] = - { - {A_STANDOUT, "A_STANDOUT, ",}, - {A_UNDERLINE, "A_UNDERLINE, ",}, - {A_REVERSE, "A_REVERSE, ",}, - {A_BLINK, "A_BLINK, ",}, - {A_DIM, "A_DIM, ",}, - {A_BOLD, "A_BOLD, ",}, - {A_ALTCHARSET, "A_ALTCHARSET, ",}, - {A_INVIS, "A_INVIS, ",}, - {A_PROTECT, "A_PROTECT, ",}, - {A_CHARTEXT, "A_CHARTEXT, ",}, - {A_NORMAL, "A_NORMAL, ",}, - }, -colors[] = - { - {COLOR_BLACK, "COLOR_BLACK",}, - {COLOR_RED, "COLOR_RED",}, - {COLOR_GREEN, "COLOR_GREEN",}, - {COLOR_YELLOW, "COLOR_YELLOW",}, - {COLOR_BLUE, "COLOR_BLUE",}, - {COLOR_MAGENTA, "COLOR_MAGENTA",}, - {COLOR_CYAN, "COLOR_CYAN",}, - {COLOR_WHITE, "COLOR_WHITE",}, - }, - *sp; - - strcpy(buf, "{"); - for (sp = names; sp->val; sp++) - if (newmode & sp->val) - strcat(buf, sp->name); - if (newmode & A_COLOR) - { - int pairnum = PAIR_NUMBER(newmode); - - (void) sprintf(buf + strlen(buf), - "COLOR_PAIR(%d) = (%s, %s), ", - pairnum, - colors[FG(color_pairs[pairnum])].name, - colors[BG(color_pairs[pairnum])].name - ); - } - if ((newmode & A_ATTRIBUTES) == 0) - strcat(buf,"A_NORMAL, "); - if (buf[strlen(buf) - 2] == ',') - buf[strlen(buf) - 2] = '\0'; - return(strcat(buf,"}")); -} - -char *visbuf(const char *buf) -/* visibilize a given string */ -{ - static char vbuf[BUFSIZ]; - char *tp = vbuf; - - while (*buf) - { - if (isprint(*buf) || *buf == ' ') - *tp++ = *buf++; - else if (*buf == '\n') - { - *tp++ = '\\'; *tp++ = 'n'; - buf++; - } - else if (*buf == '\r') - { - *tp++ = '\\'; *tp++ = 'r'; - buf++; - } - else if (*buf == '\b') - { - *tp++ = '\\'; *tp++ = 'b'; - buf++; - } - else if (*buf == '\033') - { - *tp++ = '\\'; *tp++ = 'e'; - buf++; - } - else if (*buf < ' ') - { - *tp++ = '\\'; *tp++ = '^'; *tp++ = '@' + *buf; - buf++; - } - else - { - (void) sprintf(tp, "\\0x%02x", *buf++); - tp += strlen(tp); - } - } - *tp++ = '\0'; - return(vbuf); -} - -char *_tracechar(const unsigned char ch) -{ - static char crep[20]; - /* - * We can show the actual character if it's either an ordinary printable - * or one of the high-half characters. - */ - if (isprint(ch) || (ch & 0x80)) - { - crep[0] = '\''; - crep[1] = ch; /* necessary; printf tries too hard on metachars */ - (void) sprintf(crep + 2, "' = 0x%02x", ch); - } - else - (void) sprintf(crep, "0x%02x", ch); - return(crep); -} - -void -_tracef(char *fmt, ...) -{ -va_list ap; -char buffer[256]; - - va_start(ap, fmt); - vsprintf(buffer, fmt, ap); - write(tracefd, buffer, strlen(buffer)); - write(tracefd, "\n", 1); -} - diff --git a/lib/libncurses/lib_tstp.c b/lib/libncurses/lib_tstp.c deleted file mode 100644 index cb96ff022124..000000000000 --- a/lib/libncurses/lib_tstp.c +++ /dev/null @@ -1,78 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_tstp.c -** -** The routine tstp(). -** -*/ - -#include "curses.priv.h" -#include "terminfo.h" -#ifdef SVR4_ACTION -#define _POSIX_SOURCE -#endif -#include <signal.h> - -void tstp(int dummy) -{ -sigaction_t act, oact; -sigset_t mask, omask; - - T(("tstp() called")); - - /* - * The user may have changed the prog_mode tty bits, so save them. - */ - def_prog_mode(); - - /* - * Block window change and timer signals. The latter - * is because applications use timers to decide when - * to repaint the screen. - */ - (void)sigemptyset(&mask); - (void)sigaddset(&mask, SIGALRM); -#ifdef SIGWINCH - (void)sigaddset(&mask, SIGWINCH); -#endif - (void)sigprocmask(SIG_BLOCK, &mask, &omask); - - endwin(); - - sigemptyset(&mask); - sigaddset(&mask, SIGTSTP); - sigprocmask(SIG_UNBLOCK, &mask, NULL); - - act.sa_handler = SIG_DFL; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; -#ifdef SA_RESTART - act.sa_flags |= SA_RESTART; -#endif - sigaction(SIGTSTP, &act, &oact); - kill(getpid(), SIGTSTP); - - T(("SIGCONT received")); - sigaction(SIGTSTP, &oact, NULL); - flushinp(); - - /* - * If the user modified the tty state while suspended, he wants - * those changes to stick. So save the new "default" terminal state. - */ - def_shell_mode(); - - /* - * This relies on the fact that doupdate() will restore the - * program-mode tty state, and issue enter_ca_mode if need be. - */ - doupdate(); - - /* Reset the signals. */ - (void)sigprocmask(SIG_SETMASK, &omask, NULL); -} - diff --git a/lib/libncurses/lib_twait.c b/lib/libncurses/lib_twait.c deleted file mode 100644 index 1b0fd1ea7563..000000000000 --- a/lib/libncurses/lib_twait.c +++ /dev/null @@ -1,75 +0,0 @@ -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_twait.c -** -** The routine timed_wait(). -** -*/ - -#include <string.h> -#include <sys/types.h> /* some systems can't live without this */ -#include <sys/time.h> -#include <unistd.h> -#if defined(SYS_SELECT) -#include <sys/select.h> -#endif -#include "curses.priv.h" - -#if defined(NOUSLEEP) -void usleep(unsigned int usec) -{ -struct timeval tval; - - tval.tv_sec = usec / 1000000; - tval.tv_usec = usec % 1000000; - select(0, NULL, NULL, NULL, &tval); - -} -#endif - -int timed_wait(int fd, int wait, int *timeleft) -{ -int result; -struct timeval timeout; -static fd_set set; -#ifndef GOOD_SELECT -struct timeval starttime, returntime; - - gettimeofday(&starttime, NULL); -#endif - - FD_ZERO(&set); - FD_SET(fd, &set); - - /* the units of wait are milliseconds */ - timeout.tv_sec = wait / 1000; - timeout.tv_usec = (wait % 1000) * 1000; - - T(("start twait: sec = %d, usec = %d", timeout.tv_sec, timeout.tv_usec)); - - result = select(fd+1, &set, NULL, NULL, &timeout); - -#ifndef GOOD_SELECT - gettimeofday(&returntime, NULL); - timeout.tv_sec -= (returntime.tv_sec - starttime.tv_sec); - timeout.tv_usec -= (returntime.tv_usec - starttime.tv_usec); - if (timeout.tv_usec < 0 && timeout.tv_sec > 0) { - timeout.tv_sec--; - timeout.tv_usec += 1000000; - } - if (timeout.tv_sec < 0) - timeout.tv_sec = timeout.tv_usec = 0; -#endif - - /* return approximate time left on the timeout, in milliseconds */ - if (timeleft) - *timeleft = (timeout.tv_sec * 1000) + (timeout.tv_usec / 1000); - - T(("end twait: returned %d, sec = %d, usec = %d (%d msec)", - result, timeout.tv_sec, timeout.tv_usec, *timeleft)); - - return(result); -} diff --git a/lib/libncurses/lib_unctrl.c b/lib/libncurses/lib_unctrl.c deleted file mode 100644 index 6c04d325eb24..000000000000 --- a/lib/libncurses/lib_unctrl.c +++ /dev/null @@ -1,43 +0,0 @@ -/* generated by MKunctrl.awk */ - -#include "curses.priv.h" - -char *unctrl(register chtype ch) -{ -static const char* const table[] = { - "^\100", "^\101", "^\102", "^\103", "^\104", "^\105", "^\106", "^\107", - "^\110", "^\111", "^\112", "^\113", "^\114", "^\115", "^\116", "^\117", - "^\120", "^\121", "^\122", "^\123", "^\124", "^\125", "^\126", "^\127", - "^\130", "^\131", "^\132", "^\133", "^\134", "^\135", "^\136", "^\137", - "\040", "\041", "\042", "\043", "\044", "\045", "\046", "\047", - "\050", "\051", "\052", "\053", "\054", "\055", "\056", "\057", - "\060", "\061", "\062", "\063", "\064", "\065", "\066", "\067", - "\070", "\071", "\072", "\073", "\074", "\075", "\076", "\077", - "\100", "\101", "\102", "\103", "\104", "\105", "\106", "\107", - "\110", "\111", "\112", "\113", "\114", "\115", "\116", "\117", - "\120", "\121", "\122", "\123", "\124", "\125", "\126", "\127", - "\130", "\131", "\132", "\133", "\134", "\135", "\136", "\137", - "\140", "\141", "\142", "\143", "\144", "\145", "\146", "\147", - "\150", "\151", "\152", "\153", "\154", "\155", "\156", "\157", - "\160", "\161", "\162", "\163", "\164", "\165", "\166", "\167", - "\170", "\171", "\172", "\173", "\174", "\175", "\176", "^?", - "\200", "\201", "\202", "\203", "\204", "\205", "\206", "\207", - "\210", "\211", "\212", "\213", "\214", "\215", "\216", "\217", - "\220", "\221", "\222", "\223", "\224", "\225", "\226", "\227", - "\230", "\231", "\232", "\233", "\234", "\235", "\236", "\237", - "\240", "\241", "\242", "\243", "\244", "\245", "\246", "\247", - "\250", "\251", "\252", "\253", "\254", "\255", "\256", "\257", - "\260", "\261", "\262", "\263", "\264", "\265", "\266", "\267", - "\270", "\271", "\272", "\273", "\274", "\275", "\276", "\277", - "\300", "\301", "\302", "\303", "\304", "\305", "\306", "\307", - "\310", "\311", "\312", "\313", "\314", "\315", "\316", "\317", - "\320", "\321", "\322", "\323", "\324", "\325", "\326", "\327", - "\330", "\331", "\332", "\333", "\334", "\335", "\336", "\337", - "\340", "\341", "\342", "\343", "\344", "\345", "\346", "\347", - "\350", "\351", "\352", "\353", "\354", "\355", "\356", "\357", - "\360", "\361", "\362", "\363", "\364", "\365", "\366", "\367", - "\370", "\371", "\372", "\373", "\374", "\375", "\376", "\377" -}; - - return (char *)table[TextOf(ch)]; -} diff --git a/lib/libncurses/lib_vidattr.c b/lib/libncurses/lib_vidattr.c deleted file mode 100644 index ef8213906227..000000000000 --- a/lib/libncurses/lib_vidattr.c +++ /dev/null @@ -1,205 +0,0 @@ - -/*************************************************************************** -* COPYRIGHT NOTICE * -**************************************************************************** -* ncurses is copyright (C) 1992, 1993, 1994 * -* by Zeyd M. Ben-Halim * -* zmbenhal@netcom.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, not removed * -* from header files, and is reproduced in any documentation * -* accompanying it or the applications linked with it. * -* * -* ncurses comes AS IS with no warranty, implied or expressed. * -* * -***************************************************************************/ - -/* - * vidputs(newmode, outc) - * - * newmode is taken to be the logical 'or' of the symbols in curses.h - * representing graphic renditions. The teminal is set to be in all of - * the given modes, if possible. - * - * if set-attributes exists - * use it to set exactly what you want - * else - * if exit-attribute-mode exists - * turn off everything - * else - * turn off those which can be turned off and aren't in - * newmode. - * turn on each mode which should be on and isn't, one by one - * - * NOTE that this algorithm won't achieve the desired mix of attributes - * in some cases, but those are probably just those cases in which it is - * actually impossible, anyway, so... - * - */ - -#include <string.h> -#include "curses.priv.h" -#include "terminfo.h" - -static void do_color(int pair, int (*outc)(int)) -{ -int fg, bg; - - if ( pair == 0 ) { - if (orig_pair) { - tputs(orig_pair, 1, outc); - } - } else if ((set_a_foreground || set_foreground) && - (set_a_background || set_background) - ) { - fg = FG(color_pairs[pair]); - bg = BG(color_pairs[pair]); - - T(("setting colors: pair = %d, fg = %d, bg = %d\n", pair, fg, bg)); - - if (set_a_foreground) - tputs(tparm(set_a_foreground, fg), 1, outc); - else - tputs(tparm(set_foreground, fg), 1, outc); - if (set_a_background) - tputs(tparm(set_a_background, bg), 1, outc); - else - tputs(tparm(set_background, bg), 1, outc); - } -} - -int vidputs(chtype newmode, int (*outc)(int)) -{ -static chtype previous_attr=0; -chtype turn_off,turn_on; -int pair, current_pair; - - if (SP) - previous_attr = SP->_current_attr; - - T(("vidputs(%x) called %s", newmode, _traceattr(newmode))); - T(("previous attribute was %s", _traceattr(previous_attr))); - - if (newmode == previous_attr) - return OK; - - turn_off = (~newmode & previous_attr) & ~A_COLOR; - turn_on = (newmode & ~previous_attr) & ~A_COLOR; - - pair = PAIR_NUMBER(newmode); - current_pair = PAIR_NUMBER(previous_attr); - - if ((!SP || SP->_coloron) && pair == 0) { - T(("old pair = %d -- new pair = %d", current_pair, pair)); - if (pair != current_pair) { - do_color(pair, outc); - previous_attr &= ~A_COLOR; - } - } - - if (newmode == A_NORMAL && exit_attribute_mode) { - if((previous_attr & A_ALTCHARSET) && exit_alt_charset_mode) { - tputs(exit_alt_charset_mode, 1, outc); - previous_attr &= ~A_ALTCHARSET; - } - if (previous_attr) { - tputs(exit_attribute_mode, 1, outc); - previous_attr &= ~A_COLOR; - } - } else if (set_attributes) { - if (turn_on || turn_off) { - tputs(tparm(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), 1, outc); - previous_attr &= ~A_COLOR; - } - } else { - - T(("turning %x off", _traceattr(turn_off))); - - if ((turn_off & A_ALTCHARSET) && exit_alt_charset_mode) { - tputs(exit_alt_charset_mode, 1, outc); - turn_off &= ~A_ALTCHARSET; - } - - if ((turn_off & A_UNDERLINE) && exit_underline_mode) { - tputs(exit_underline_mode, 1, outc); - turn_off &= ~A_UNDERLINE; - } - - if ((turn_off & A_STANDOUT) && exit_standout_mode) { - tputs(exit_standout_mode, 1, outc); - turn_off &= ~A_STANDOUT; - } - - if (turn_off && exit_attribute_mode) { - tputs(exit_attribute_mode, 1, outc); - turn_on |= newmode & (A_UNDERLINE|A_REVERSE|A_BLINK|A_DIM|A_BOLD|A_INVIS|A_PROTECT); - previous_attr &= ~A_COLOR; - } - - T(("turning %x on", _traceattr(turn_on))); - - if ((turn_on & A_ALTCHARSET) && enter_alt_charset_mode) - tputs(enter_alt_charset_mode, 1, outc); - - if ((turn_on & A_BLINK) && enter_blink_mode) - tputs(enter_blink_mode, 1, outc); - - if ((turn_on & A_BOLD) && enter_bold_mode) - tputs(enter_bold_mode, 1, outc); - - if ((turn_on & A_DIM) && enter_dim_mode) - tputs(enter_dim_mode, 1, outc); - - if ((turn_on & A_REVERSE) && enter_reverse_mode) - tputs(enter_reverse_mode, 1, outc); - - if ((turn_on & A_STANDOUT) && enter_standout_mode) - tputs(enter_standout_mode, 1, outc); - - if ((turn_on & A_PROTECT) && enter_protected_mode) - tputs(enter_protected_mode, 1, outc); - - if ((turn_on & A_INVIS) && enter_secure_mode) - tputs(enter_secure_mode, 1, outc); - - if ((turn_on & A_UNDERLINE) && enter_underline_mode) - tputs(enter_underline_mode, 1, outc); - - } - - if ((!SP || SP->_coloron) && pair != 0) { - current_pair = PAIR_NUMBER(previous_attr); - T(("old pair = %d -- new pair = %d", current_pair, pair)); - if (pair != current_pair) { - do_color(pair, outc); - } - } - - previous_attr = newmode; - if (SP) - SP->_current_attr = previous_attr; - - T(("vidputs finished")); - return OK; -} - -int vidattr(chtype newmode) -{ - - T(("vidattr(%x) called", newmode)); - - return(vidputs(newmode, _outch)); -} - diff --git a/lib/libncurses/lib_window.c b/lib/libncurses/lib_window.c deleted file mode 100644 index 699863c76ae2..000000000000 --- a/lib/libncurses/lib_window.c +++ /dev/null @@ -1,85 +0,0 @@ - -/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * -* details. If they are missing then this copy is in violation of * -* the copyright conditions. */ - -/* -** lib_window.c -** -** -*/ - -#include <string.h> -#include "curses.priv.h" - -int mvder(WINDOW *win, int y, int x) -{ - return(ERR); -} - -void wsyncup(WINDOW *win) -{ - -} - -int syncok(WINDOW *win, bool bf) -{ - return(ERR); -} - -void wcursyncup(WINDOW *win) -{ - -} - -void wsyncdown(WINDOW *win) -{ - -} - -WINDOW *dupwin(WINDOW *win) -{ -WINDOW *nwin; -int linesize, i; - - T(("dupwin(%x) called", win)); - - if ((nwin = newwin(win->_maxy + 1, win->_maxx + 1, win->_begy, win->_begx)) == NULL) - return NULL; - - nwin->_curx = win->_curx; - nwin->_cury = win->_cury; - nwin->_maxy = win->_maxy; - nwin->_maxx = win->_maxx; - nwin->_begy = win->_begy; - nwin->_begx = win->_begx; - - nwin->_flags = win->_flags; - nwin->_attrs = win->_attrs; - nwin->_bkgd = win->_bkgd; - - nwin->_clear = win->_clear; - nwin->_scroll = win->_scroll; - nwin->_leave = win->_leave; - nwin->_use_keypad = win->_use_keypad; - nwin->_use_meta = win->_use_meta; - nwin->_delay = win->_delay; - nwin->_immed = win->_immed; - nwin->_sync = win->_sync; - nwin->_parx = win->_parx; - nwin->_pary = win->_pary; - nwin->_parent = win->_parent; - - nwin->_regtop = win->_regtop; - nwin->_regbottom = win->_regbottom; - - linesize = (win->_maxx + 1) * sizeof(chtype); - for (i = 0; i <= nwin->_maxy; i++) { - memcpy(nwin->_line[i], win->_line[i], linesize); - nwin->_firstchar[i] = win->_firstchar[i]; - nwin->_lastchar[i] = win->_lastchar[i]; - } - - return nwin; -} - diff --git a/lib/libncurses/ncurses.3 b/lib/libncurses/ncurses.3 deleted file mode 100644 index 6b678f5bcfb8..000000000000 --- a/lib/libncurses/ncurses.3 +++ /dev/null @@ -1,429 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH ncurses 3 "" -.ds n 5 -.ds d @TERMINFO@ -.SH NAME -\fBncurses\fR - CRT screen handling and optimization package -.SH SYNOPSIS -\fB#include <ncurses.h>\fR -.br -.SH DESCRIPTION -The \fBncurses\fR library routines give the user a terminal-independent -method of updating character screens with reasonable optimization. - -The \fBncurses\fR routines emulate the \fBcurses\fR(3) library of System V -Release 4 UNIX, but is freely redistributable in source form. Differences from -the SVr4 curses are described in the BUGS sections of individual man pages. -There are only few of these, and as ncurses matures they will become fewer -still. - -A program using these routines must be linked with the \fB-lncurses\fR option, -or (if they have been generated) with one of the debugging libraries -\fB-ldcurses\fR or \fB-lpcurses\fR. The dcurses library generates trace logs -that describe curses actions; the pcurses library supports profiling. - -The \fBncurses\fR package supports: overall screen, window and pad -manipulation; output to windows and pads; reading terminal input; control over -terminal and \fBncurses\fR input and output options; environment query -routines; color manipulation; use of soft label keys; terminfo capabilities; -and access to low-level \fBncurses\fR routines. - -To initialize the routines, the routine \fBinitscr\fR or \fBnewterm\fR -must be called before any of the other routines that deal with windows -and screens are used. The routine \fBendwin\fR must be called before -exiting. To get character-at-a-time input without echoing (most -interactive, screen oriented programs want this), the following -sequence should be used: - - \fBinitscr(); cbreak(); noecho();\fR - -Most programs would additionally use the sequence: - - \fBnonl(); intrflush(stdscr,FALSE); keypad(stdscr,TRUE);\fR - -Before a \fBncurses\fR program is run, the tab stops of the terminal -should be set and its initialization strings, if defined, must be -output. This can be done by executing the \fBtput init\fR command -after the shell environment variable \fBTERM\fR has been exported. -[See \fBterminfo\fR(\*n) for further details.] - -The \fBncurses\fR library permits manipulation of data structures, -called \fIwindows\fR, which can be thought of as two-dimensional -arrays of characters representing all or part of a CRT screen. A -default window called \fBstdscr\fR, which is the size of the terminal -screen, is supplied. Others may be created with \fBnewwin\fR. - -Windows are referred to by variables declared as \fBWINDOW *\fR. -These data structures are manipulated with routines described in manual section 3 -pages (whose names begin "curs_"). Among which the most basic -routines are \fBmove\fR and \fBaddch\fR. More general versions of -these routines are included with names beginning with \fBw\fR, -allowing the user to specify a window. The routines not beginning -with \fBw\fR affect \fBstdscr\fR.) - -After using routines to manipulate a window, \fBrefresh\fR is called, -telling \fBncurses\fR to make the user's CRT screen look like -\fBstdscr\fR. The characters in a window are actually of type -\fBchtype\fR, (character and attribute data) so that other information -about the character may also be stored with each character. - -Special windows called \fIpads\fR may also be manipulated. These are windows -which are not constrained to the size of the screen and whose contents need not -be completely displayed. See curs_pad(3) for more information. - -In addition to drawing characters on the screen, video attributes and colors -may be supported, causing the characters to show up in such modes as -underlined, in reverse video, or in color on terminals that support such -display enhancements. Line drawing characters may be specified to be output. -On input, \fBncurses\fR is also able to translate arrow and function keys that -transmit escape sequences into single values. The video attributes, line -drawing characters, and input values use names, defined in \fB<ncurses.h>\fR, -such as \fBA_REVERSE\fR, \fBACS_HLINE\fR, and \fBKEY_LEFT\fR. - -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. - -If the environment variable \fBTERMINFO\fR is defined, any program using -\fBncurses\fR checks for a local terminal definition before checking in the -standard place. For example, if \fBTERM\fR is set to \fBatt4424\fR, then the -compiled terminal definition is found in - - \fB\*d/a/att4424\fR. - -(The \fBa\fR is copied from the first letter of \fBatt4424\fR to avoid -creation of huge directories.) However, if \fBTERMINFO\fR is set to -\fB$HOME/myterms\fR, \fBncurses\fR first checks - - \fB$HOME/myterms/a/att4424\fR, - -and if that fails, it then checks - - \fB\*d/a/att4424\fR. - -This is useful for developing experimental definitions or when write -permission in \fB\*d\fR is not available. - -The integer variables \fBLINES\fR and \fBCOLS\fR are defined in -\fB<ncurses.h>\fR and will be filled in by \fBinitscr\fR with the size of the -screen. The constants \fBTRUE\fR and \fBFALSE\fR have the values \fB1\fR and -\fB0\fR, respectively. - -The \fBncurses\fR routines also define the \fBWINDOW *\fR variable \fBcurscr\fR -which is used for certain low-level operations like clearing and redrawing a -screen containing garbage. The \fBcurscr\fR can be used in only a few -routines. - -.SS Routine and Argument Names -Many \fBncurses\fR routines have two or more versions. The routines prefixed -with \fBw\fR require a window argument. The routines prefixed with \fBp\fR -require a pad argument. Those without a prefix generally use \fBstdscr\fR. - -The routines prefixed with \fBmv\fR require a \fIy\fR and \fIx\fR -coordinate to move to before performing the appropriate action. The -\fBmv\fR routines imply a call to \fBmove\fR before the call to the -other routine. The coordinate \fIy\fR always refers to the row (of -the window), and \fIx\fR always refers to the column. The upper -left-hand corner is always (0,0), not (1,1). - -The routines prefixed with \fBmvw\fR take both a window argument and -\fIx\fR and \fIy\fR coordinates. The window argument is always -specified before the coordinates. - -In each case, \fIwin\fR is the window affected, and \fIpad\fR is the -pad affected; \fIwin\fR and \fIpad\fR are always pointers to type -\fBWINDOW\fR. - -Option setting routines require a Boolean flag \fIbf\fR with the value -\fBTRUE\fR or \fBFALSE\fR; \fIbf\fR is always of type \fBbool\fR. The -variables \fIch\fR and \fIattrs\fR below are always of type -\fBchtype\fR. The types \fBWINDOW\fR, \fBSCREEN\fR, \fBbool\fR, and -\fBchtype\fR are defined in \fB<ncurses.h>\fR. The type \fBTERMINAL\fR -is defined in \fB<term.h>\fR. All other arguments are integers. - -.SS Routine Name Index -The following table lists each \fBncurses\fR routine and the name of -the manual page on which it is described. - -.nf -\fBncurses\fR Routine Name Manual Page Name -___________________________________________ -addch curs_addch(3) -addchnstr curs_addchstr(3) -addchstr curs_addchstr(3) -addnstr curs_addstr(3) -addstr curs_addstr(3) -attroff curs_attr(3) -attron curs_attr(3) -attrset curs_attr(3) -baudrate curs_termattrs(3) -beep curs_beep(3) -bkgd curs_bkgd(3) -bkgdset curs_bkgd(3) -border curs_border(3) -box curs_border(3) -can_change_color curs_color(3) -cbreak curs_inopts(3) -clear curs_clear(3) -clearok curs_outopts(3) -clrtobot curs_clear(3) -clrtoeol curs_clear(3) -color_content curs_color(3) -copywin curs_overlay(3) -curs_set curs_kernel(3) -def_prog_mode curs_kernel(3) -def_shell_mode curs_kernel(3) -del_curterm curs_terminfo(\*n) -delay_output curs_util(3) -delch curs_delch(3) -deleteln curs_deleteln(3) -delscreen curs_initscr(3) -delwin curs_window(3) -derwin curs_window(3) -doupdate curs_refresh(3) -dupwin curs_window(3) -echo curs_inopts(3) -echochar curs_addch(3) -endwin curs_initscr(3) -erase curs_clear(3) -erasechar curs_termattrs(3) -filter curs_util(3) -flash curs_beep(3) -flushinp curs_util(3) -getbegyx curs_getyx(3) -getch curs_getch(3) -getmaxyx curs_getyx(3) -getparyx curs_getyx(3) -getstr curs_getstr(3) -getsyx curs_kernel(3) -getwin curs_util(3) -getyx curs_getyx(3) -halfdelay curs_inopts(3) -has_colors curs_color(3) -has_ic curs_termattrs(3) -has_il curs_termattrs(3) -hline curs_border(3) -idcok curs_outopts(3) -idlok curs_outopts(3) -immedok curs_outopts(3) -inch curs_inch(3) -inchnstr curs_inchstr(3) -inchstr curs_inchstr(3) -init_color curs_color(3) -init_pair curs_color(3) -initscr curs_initscr(3) -innstr curs_instr(3) -insch curs_insch(3) -insdelln curs_deleteln(3) -insertln curs_deleteln(3) -insnstr curs_insstr(3) -insstr curs_insstr(3) -instr curs_instr(3) -intrflush curs_inopts(3) -is_linetouched curs_touch(3) -is_wintouched curs_touch(3) -isendwin curs_initscr(3) -keyname curs_util(3) -keypad curs_inopts(3) -killchar curs_termattrs(3) -leaveok curs_outopts(3) -longname curs_termattrs(3) -meta curs_inopts(3) -move curs_move(3) -mvaddch curs_addch(3) -mvaddchnstr curs_addchstr(3) -mvaddchstr curs_addchstr(3) -mvaddnstr curs_addstr(3) -mvaddstr curs_addstr(3) -mvcur curs_terminfo(\*n) -mvdelch curs_delch(3) -mvderwin curs_window(3) -mvgetch curs_getch(3) -mvgetstr curs_getstr(3) -mvinch curs_inch(3) -mvinchnstr curs_inchstr(3) -mvinchstr curs_inchstr(3) -mvinnstr curs_instr(3) -mvinsch curs_insch(3) -mvinsnstr curs_insstr(3) -mvinsstr curs_insstr(3) -mvinstr curs_instr(3) -mvprintw curs_printw(3) -mvscanw curs_scanw(3) -mvwaddch curs_addch(3) -mvwaddchnstr curs_addchstr(3) -mvwaddchstr curs_addchstr(3) -mvwaddnstr curs_addstr(3) -mvwaddstr curs_addstr(3) -mvwdelch curs_delch(3) -mvwgetch curs_getch(3) -mvwgetstr curs_getstr(3) -mvwin curs_window(3) -mvwinch curs_inch(3) -mvwinchnstr curs_inchstr(3) -mvwinchstr curs_inchstr(3) -mvwinnstr curs_instr(3) -mvwinsch curs_insch(3) -mvwinsnstr curs_insstr(3) -mvwinsstr curs_insstr(3) -mvwinstr curs_instr(3) -mvwprintw curs_printw(3) -mvwscanw curs_scanw(3) -napms curs_kernel(3) -newpad curs_pad(3) -newterm curs_initscr(3) -newwin curs_window(3) -nl curs_outopts(3) -nocbreak curs_inopts(3) -nodelay curs_inopts(3) -noecho curs_inopts(3) -nonl curs_outopts(3) -noqiflush curs_inopts(3) -noraw curs_inopts(3) -notimeout curs_inopts(3) -overlay curs_overlay(3) -overwrite curs_overlay(3) -pair_content curs_color(3) -pechochar curs_pad(3) -pnoutrefresh curs_pad(3) -prefresh curs_pad(3) -printw curs_printw(3) -putp curs_terminfo(\*n) -putwin curs_util(3) -qiflush curs_inopts(3) -raw curs_inopts(3) -redrawwin curs_refresh(3) -refresh curs_refresh(3) -reset_prog_mode curs_kernel(3) -reset_shell_mode curs_kernel(3) -resetty curs_kernel(3) -restartterm curs_terminfo(\*n) -ripoffline curs_kernel(3) -savetty curs_kernel(3) -scanw curs_scanw(3) -scr_dump curs_scr_dmp(3) -scr_init curs_scr_dmp(3) -scr_restore curs_scr_dmp(3) -scr_set curs_scr_dmp(3) -scrl curs_scroll(3) -scroll curs_scroll(3) -scrollok curs_outopts(3) -set_curterm curs_terminfo(\*n) -set_term curs_initscr(3) -setscrreg curs_outopts(3) -setsyx curs_kernel(3) -setterm curs_terminfo(\*n) -setupterm curs_terminfo(\*n) -slk_attroff curs_slk(3) -slk_attron curs_slk(3) -slk_attrset curs_slk(3) -slk_clear curs_slk(3) -slk_init curs_slk(3) -slk_label curs_slk(3) -slk_noutrefresh curs_slk(3) -slk_refresh curs_slk(3) -slk_restore curs_slk(3) -slk_set curs_slk(3) -slk_touch curs_slk(3) -standend curs_attr(3) -standout curs_attr(3) -start_color curs_color(3) -subpad curs_pad(3) -subwin curs_window(3) -syncok curs_window(3) -termattrs curs_termattrs(3) -termname curs_termattrs(3) -tigetflag curs_terminfo(\*n) -tigetnum curs_terminfo(\*n) -tigetstr curs_terminfo(\*n) -timeout curs_inopts(3) -touchline curs_touch(3) -touchwin curs_touch(3) -tparm curs_terminfo(\*n) -tputs curs_terminfo(\*n) -typeahead curs_inopts(3) -unctrl curs_util(3) -ungetch curs_getch(3) -untouchwin curs_touch(3) -use_env curs_util(3) -vidattr curs_terminfo(\*n) -vidputs curs_terminfo(\*n) -vline curs_border(3) -vwprintw curs_printw(3) -vwscanw curs_scanw(3) -waddch curs_addch(3) -waddchnstr curs_addchstr(3) -waddchstr curs_addchstr(3) -waddnstr curs_addstr(3) -waddstr curs_addstr(3) -wattroff curs_attr(3) -wattron curs_attr(3) -wattrset curs_attr(3) -wbkgd curs_bkgd(3) -wbkgdset curs_bkgd(3) -wborder curs_border(3) -wclear curs_clear(3) -wclrtobot curs_clear(3) -wclrtoeol curs_clear(3) -wcursyncup curs_window(3) -wdelch curs_delch(3) -wdeleteln curs_deleteln(3) -wechochar curs_addch(3) -werase curs_clear(3) -wgetch curs_getch(3) -wgetnstr curs_getstr(3) -wgetstr curs_getstr(3) -whline curs_border(3) -winch curs_inch(3) -winchnstr curs_inchstr(3) -winchstr curs_inchstr(3) -winnstr curs_instr(3) -winsch curs_insch(3) -winsdelln curs_deleteln(3) -winsertln curs_deleteln(3) -winsnstr curs_insstr(3) -winsstr curs_insstr(3) -winstr curs_instr(3) -wmove curs_move(3) -wnoutrefresh curs_refresh(3) -wprintw curs_printw(3) -wredrawln curs_refresh(3) -wrefresh curs_refresh(3) -wscanw curs_scanw(3) -wscrl curs_scroll(3) -wsetscrreg curs_outopts(3) -wstandend curs_attr(3) -wstandout curs_attr(3) -wsyncdown curs_window(3) -wsyncup curs_window(3) -wtimeout curs_inopts(3) -wtouchln curs_touch(3) -wvline curs_border(3) -.fi -.SH RETURN VALUE -Routines that return an integer return \fBERR\fR upon failure and an -integer value other than \fBERR\fR upon successful completion, unless -otherwise noted in the routine descriptions. - -All macros return the value of the \fBw\fR version, except \fBsetscrreg\fR, -\fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, \fBgetmaxyx\fR. The return -values of \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and -\fBgetmaxyx\fR are undefined (\fIi\fR.\fIe\fR., these should not be used as the -right-hand side of assignment statements). - -Routines that return pointers return \fBNULL\fR on error. -.SH SEE ALSO -\fBterminfo\fR(5) and section 3 pages whose names begin "curs_" for detailed routine -descriptions. -.SH NOTES -The header file \fB<ncurses.h>\fR automatically includes the header files -\fB<stdio.h>\fR and \fB<unctrl.h>\fR. -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff --git a/lib/libncurses/ncurses_cfg.h b/lib/libncurses/ncurses_cfg.h new file mode 100644 index 000000000000..a14d5ba57363 --- /dev/null +++ b/lib/libncurses/ncurses_cfg.h @@ -0,0 +1,129 @@ +/* include/ncurses_cfg.h. Generated automatically by configure. */ +/**************************************************************************** + * 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 * + ****************************************************************************/ +/* + * Id: ncurses_cfg.hin,v 1.2 1998/02/11 12:13:46 tom Exp + * + * This is a template-file used to generate the "ncurses_cfg.h" file. + * + * Rather than list every definition, the configuration script substitutes + * the definitions that it finds using 'sed'. You need a patch (971222) + * to autoconf 2.12 to do this. + */ +#ifndef NC_CONFIG_H +#define NC_CONFIG_H + +#define BSD_TPUTS 1 +#define CC_HAS_INLINE_FUNCS 1 +#define CC_HAS_PROTOS 1 +#define ETIP_NEEDS_ 1 +#define GCC_NORETURN __dead2 +#define GCC_PRINTF 1 +#define GCC_SCANF 1 +#define GCC_UNUSED __unused +#define HAVE_BIG_CORE 1 +#define HAVE_BSD_CGETENT 1 +#define HAVE_DIRENT_H 1 +#define HAVE_ERRNO 1 +#define HAVE_FCNTL_H 1 +#define HAVE_FORM_H 1 +#define HAVE_GETCWD 1 +#define HAVE_GETTIMEOFDAY 1 +#define HAVE_GETTTYNAM 1 +#define HAVE_ISASCII 1 +#define HAVE_LIBFORM 1 +#define HAVE_LIBMENU 1 +#define HAVE_LIBPANEL 1 +#define HAVE_LIMITS_H 1 +#define HAVE_LINK 1 +#define HAVE_LOCALE_H 1 +#define HAVE_LONG_FILE_NAMES 1 +#define HAVE_MEMCCPY 1 +#define HAVE_MENU_H 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_NC_ALLOC_H 1 +#define HAVE_PANEL_H 1 +#define HAVE_POLL 1 +#define HAVE_POLL_H 1 +#define HAVE_REGEX_H_FUNCS 1 +#define HAVE_REMOVE 1 +#define HAVE_SELECT 1 +#define HAVE_SETBUF 1 +#define HAVE_SETBUFFER 1 +#define HAVE_SETVBUF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SIGVEC 1 +#define HAVE_SIZECHANGE 1 +#define HAVE_STRDUP 1 +#define HAVE_STRSTR 1 +#define HAVE_SYMLINK 1 +#define HAVE_SYS_IOCTL_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_SELECT_H 1 +#define HAVE_SYS_TIMES_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TIME_SELECT 1 +#define HAVE_TCGETATTR 1 +#define HAVE_TCGETPGRP 1 +#define HAVE_TERMIOS_H 1 +#define HAVE_TIMES 1 +#define HAVE_TTYENT_H 1 +#define HAVE_TYPEINFO 1 +#define HAVE_UNISTD_H 1 +#define HAVE_USLEEP 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_VSSCANF 1 +#define NCURSES_EXT_FUNCS 1 +#define NCURSES_NO_PADDING 1 +#define NDEBUG 1 +#define RETSIGTYPE void +#define STDC_HEADERS 1 +#define SYSTEM_NAME "FreeBSD" +#define TERMINFO_DIRS "/usr/share/misc/terminfo" +#define TYPEOF_CHTYPE long +#define USE_DATABASE 1 +#define USE_GETCAP 1 +#define USE_HASHMAP 1 +#define USE_SIGWINCH 1 + + /* The C compiler may not treat these properly but C++ has to */ +#ifdef __cplusplus +#undef const +#undef inline +#else +#if defined(lint) || defined(TRACE) +#undef inline +#define inline /* nothing */ +#endif +#endif + +#endif /* NC_CONFIG_H */ diff --git a/lib/libncurses/pathnames.h b/lib/libncurses/pathnames.h new file mode 100644 index 000000000000..5cac36f3651f --- /dev/null +++ b/lib/libncurses/pathnames.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)pathnames.h 8.1 (Berkeley) 6/4/93 + * $FreeBSD$ + */ + +#define _PATH_DEF ".termcap /usr/share/misc/termcap" +#define _PATH_DEF_SEC "/usr/share/misc/termcap" diff --git a/lib/libncurses/term.5 b/lib/libncurses/term.5 deleted file mode 100644 index 1dc0a32bd5fb..000000000000 --- a/lib/libncurses/term.5 +++ /dev/null @@ -1,155 +0,0 @@ -.\" $FreeBSD$ -.\" -.TH TERM 5 -.ds n 5 -.ds d /usr/lib/terminfo -.SH NAME -term \- format of compiled term file. -.SH SYNOPSIS -.B term -.SH DESCRIPTION -.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 . -Both of these pieces of software are part of -.IR ncurses (3). -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 0377, 0377, other negative -value are illegal. -The -\-1 generally means that a 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. -Machines where this does not correspond to the hardware read the -integers as two bytes and compute the result. -.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. -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 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 -As an example, an octal dump of the description for the Microterm ACT 4 -is included: -.nf -.sp -microterm|act4|microterm act iv, - cr=^M, cud1=^J, ind=^J, bel=^G, am, cub1=^H, - ed=^_, el=^^, clear=^L, cup=^T%p1%c%p2%c, - cols#80, lines#24, cuf1=^X, cuu1=^Z, home=^], -.sp -.ft CW -\s-2000 032 001 \e0 025 \e0 \eb \e0 212 \e0 " \e0 m i c r -020 o t e r m | a c t 4 | m i c r o -040 t e r m a c t i v \e0 \e0 001 \e0 \e0 -060 \e0 \e0 \e0 \e0 \e0 \e0 \e0 \e0 \e0 \e0 \e0 \e0 \e0 \e0 \e0 \e0 -100 \e0 \e0 P \e0 377 377 030 \e0 377 377 377 377 377 377 377 377 -120 377 377 377 377 \e0 \e0 002 \e0 377 377 377 377 004 \e0 006 \e0 -140 \eb \e0 377 377 377 377 \en \e0 026 \e0 030 \e0 377 377 032 \e0 -160 377 377 377 377 034 \e0 377 377 036 \e0 377 377 377 377 377 377 -200 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 -* -520 377 377 377 377 \e0 377 377 377 377 377 377 377 377 377 377 -540 377 377 377 377 377 377 007 \e0 \er \e0 \ef \e0 036 \e0 037 \e0 -560 024 % p 1 % c % p 2 % c \e0 \en \e0 035 \e0 -600 \eb \e0 030 \e0 032 \e0 \en \e0\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" -ncurses(3), terminfo(5). diff --git a/lib/libncurses/termcap.c b/lib/libncurses/termcap.c new file mode 100644 index 000000000000..e2bde8b6f442 --- /dev/null +++ b/lib/libncurses/termcap.c @@ -0,0 +1,265 @@ +/* A portion of this file is from ncurses: */ +/*************************************************************************** +* 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> + +#include <string.h> +#include <term.h> +#include <tic.h> +#include <term_entry.h> + +/* The rest is from BSD */ +/* + * Copyright (c) 1980, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef lint +static const char sccsid[] = "@(#)termcap.c 8.1 (Berkeley) 6/4/93"; +#endif /* not lint */ + +#include <stdio.h> +#include <ctype.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <sys/param.h> +#include "pathnames.h" + +#define PBUFSIZ MAXPATHLEN /* max length of filename path */ +#define PVECSIZ 32 /* max number of names in path */ +#define TBUFSIZ 1024 /* max length of _nc_tgetent buffer */ + +char _nc_termcap[TBUFSIZ + 1]; /* Last getcap, provided to tgetent() emul */ + +/* + * termcap - routines for dealing with the terminal capability data base + * + * BUG: Should use a "last" pointer in tbuf, so that searching + * for capabilities alphabetically would not be a n**2/2 + * process when large numbers of capabilities are given. + * Note: If we add a last pointer now we will screw up the + * tc capability. We really should compile termcap. + * + * Essentially all the work here is scanning and decoding escapes + * in string capabilities. We don't use stdio because the editor + * doesn't, and because living w/o it is not hard. + */ + +/* + * Get an entry for terminal name in buffer _nc_termcap from the termcap + * file. + */ +int +_nc_read_termcap_entry(const char *const name, TERMTYPE *const tp) +{ + ENTRY *ep; + register char *p; + register char *cp; + char *dummy; + char **fname; + char *home; + int i; + char pathbuf[PBUFSIZ]; /* holds raw path of filenames */ + char *pathvec[PVECSIZ]; /* to point to names in pathbuf */ + char **pvec; /* holds usable tail of path vector */ + char *termpath; + + _nc_termcap[0] = '\0'; /* in case */ + dummy = NULL; + fname = pathvec; + pvec = pathvec; + p = pathbuf; + cp = getenv("TERMCAP"); + /* + * TERMCAP can have one of two things in it. It can be the + * name of a file to use instead of /etc/termcap. In this + * case it better start with a "/". Or it can be an entry to + * use so we don't have to read the file. In this case it + * has to already have the newlines crunched out. If TERMCAP + * does not hold a file name then a path of names is searched + * instead. The path is found in the TERMPATH variable, or + * becomes "$HOME/.termcap /etc/termcap" if no TERMPATH exists. + */ + if (!cp || *cp != '/') { /* no TERMCAP or it holds an entry */ + if ( (termpath = getenv("TERMPATH")) ) + strncpy(pathbuf, termpath, PBUFSIZ); + else { + if ( (home = getenv("HOME")) ) {/* set up default */ + strncpy(pathbuf, home, PBUFSIZ - 1); /* $HOME first */ + pathbuf[PBUFSIZ - 2] = '\0'; /* -2 because we add a slash */ + p += strlen(pathbuf); /* path, looking in */ + *p++ = '/'; + } /* if no $HOME look in current directory */ + strncpy(p, _PATH_DEF, PBUFSIZ - (p - pathbuf)); + } + } + else /* user-defined name in TERMCAP */ + strncpy(pathbuf, cp, PBUFSIZ); /* still can be tokenized */ + + /* For safety */ + if (issetugid()) + strcpy(pathbuf, _PATH_DEF_SEC); + + pathbuf[PBUFSIZ - 1] = '\0'; + + *fname++ = pathbuf; /* tokenize path into vector of names */ + while (*++p) + if (*p == ' ' || *p == ':') { + *p = '\0'; + while (*++p) + if (*p != ' ' && *p != ':') + break; + if (*p == '\0') + break; + *fname++ = p; + if (fname >= pathvec + PVECSIZ) { + fname--; + break; + } + } + *fname = (char *) 0; /* mark end of vector */ + if (cp && *cp && *cp != '/') + if (cgetset(cp) < 0) + return(-2); + + i = cgetent(&dummy, pathvec, (char *)name); + + if (i == 0) { + char *pd, *ps, *tok, *s, *tcs; + size_t len; + + pd = _nc_termcap; + ps = dummy; + if ((tok = strchr(ps, ':')) == NULL) { + len = strlen(ps); + if (len >= TBUFSIZ) + i = -1; + else + strcpy(pd, ps); + goto done; + } + len = tok - ps + 1; + if (pd + len + 1 - _nc_termcap >= TBUFSIZ) { + i = -1; + goto done; + } + memcpy(pd, ps, len); + ps += len; + pd += len; + *pd = '\0'; + tcs = pd - 1; + for (;;) { + while ((tok = strsep(&ps, ":")) != NULL && + (*tok == '\0' || *tok == '\\' || !isgraph(*tok))) + ; + if (tok == NULL) + break; + for (s = tcs; s != NULL && s[1] != '\0'; + s = strchr(s, ':')) { + s++; + if (s[0] == tok[0] && s[1] == tok[1]) + goto skip_it; + } + len = strlen(tok); + if (pd + len + 1 - _nc_termcap >= TBUFSIZ) { + i = -1; + break; + } + memcpy(pd, tok, len); + pd += len; + *pd++ = ':'; + *pd = '\0'; + skip_it: ; + } + } +done: + if (dummy) + free(dummy); + + +/* + * From here on is ncurses-specific glue code + */ + + if (i < 0) + return(ERR); + + _nc_set_source("TERMCAP"); + _nc_read_entry_source((FILE *)NULL, _nc_termcap, FALSE, FALSE,NULLHOOK); + + if (_nc_head == (ENTRY *)NULL) + return(ERR); + + /* resolve all use references */ + _nc_resolve_uses(); + + for_entry_list(ep) + if (_nc_name_match(ep->tterm.term_names, name, "|:")) + { + /* + * Make a local copy of the terminal capabilities. free + * all entry storage except the string table for the + * loaded type (which we disconnected from the list by + * NULLing out ep->tterm.str_table above). + */ + memcpy(tp, &ep->tterm, sizeof(TERMTYPE)); + ep->tterm.str_table = (char *)NULL; + _nc_free_entries(_nc_head); + _nc_head = _nc_tail = NULL; /* do not reuse! */ + + return 1; /* OK */ + } + + _nc_free_entries(_nc_head); + _nc_head = _nc_tail = NULL; /* do not reuse! */ + return(0); /* not found */ +} diff --git a/lib/libncurses/terminfo.h b/lib/libncurses/terminfo.h deleted file mode 100644 index c238040b881c..000000000000 --- a/lib/libncurses/terminfo.h +++ /dev/null @@ -1,2 +0,0 @@ -/* fake header for sources compatibility */ -#include <nterm.h> diff --git a/lib/libncurses/unctrl.h b/lib/libncurses/unctrl.h deleted file mode 100644 index 43986dcf234f..000000000000 --- a/lib/libncurses/unctrl.h +++ /dev/null @@ -1,52 +0,0 @@ -/*************************************************************************** -* 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. * -* * -***************************************************************************/ - -/* - * unctrl.h - * - * Display a printable version of a control character. - * Control characters are displayed in caret notation (^x), DELETE is displayed - * as ^?. Printable characters are displayed as is. - * - * The returned pointer points to a static buffer which gets overwritten by - * each call. Therefore, you must copy the resulting string to a safe place - * before calling unctrl() again. - * - */ - -#ifndef _UNCTRL_H -#define _UNCTRL_H 1 - -#undef NCURSES_VERSION -#define NCURSES_VERSION "1.8.6/ache" - -#ifdef __cplusplus -extern "C" { -#endif - -#include <ncurses.h> - -extern char *unctrl(chtype); - -#ifdef __cplusplus -} -#endif - -#endif /* _UNCTRL_H */ diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 30886f5866fa..40f456df0fd2 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -1,205 +1,516 @@ -# Makefile for ncurses # $FreeBSD$ -LIB= ncurses -SHLIB_MAJOR= 3 -SHLIB_MINOR= 1 -SRCS= lib_kernel.c lib_pad.c lib_bkgd.c \ - lib_unctrl.c lib_raw.c lib_vidattr.c lib_trace.c lib_beep.c \ - lib_doupdate.c lib_refresh.c lib_initscr.c lib_newwin.c lib_addch.c \ - lib_addstr.c lib_scroll.c lib_clreol.c lib_touch.c lib_mvcur.c \ - lib_keyname.c keys.tries.h \ - lib_delwin.c lib_endwin.c lib_clrbot.c lib_move.c lib_printw.c \ - lib_scanw.c lib_erase.c lib_getch.c lib_options.c lib_acs.c lib_slk.c\ - lib_box.c lib_clear.c lib_delch.c lib_insch.c lib_instr.c \ - lib_getstr.c lib_mvwin.c lib_longname.c lib_tstp.c \ - lib_newterm.c lib_set_term.c lib_overlay.c lib_scrreg.c lib_color.c \ - lib_insstr.c lib_insdel.c lib_twait.c lib_window.c copyright.c - -CFLAGS+= -I. -I${.CURDIR} -Wall -DMYTINFO #-DTRACE -DPADD= ${LIBMYTINFO} -LDADD= -lmytinfo - -CLEANFILES+= lib_keyname.c keys.tries.h - -beforeinstall: - ${INSTALL} -C -m 444 -o $(BINOWN) -g $(BINGRP) ${.CURDIR}/unctrl.h \ - ${DESTDIR}/usr/include - ${INSTALL} -C -m 444 -o $(BINOWN) -g $(BINGRP) ${.CURDIR}/curses.h \ - ${DESTDIR}/usr/include/ncurses.h - -keys.tries.h: ${.CURDIR}/keys.list ${.CURDIR}/MKkeys.awk - awk -f ${.CURDIR}/MKkeys.awk ${.CURDIR}/keys.list > keys.tries.h - -lib_keyname.c: ${.CURDIR}/keys.list ${.CURDIR}/MKkeyname.awk - awk -f ${.CURDIR}/MKkeyname.awk ${.CURDIR}/keys.list > lib_keyname.c - -MAN3 = curs_addch.3 \ - curs_addchst.3 \ - curs_addstr.3 \ - curs_attr.3 \ - curs_beep.3 \ - curs_bkgd.3 \ - curs_border.3 \ - curs_clear.3 \ - curs_color.3 \ - curs_delch.3 \ - curs_delln.3 \ - curs_getch.3 \ - curs_getstr.3 \ - curs_getyx.3 \ - curs_inch.3 \ - curs_inchstr.3 \ - curs_initscr.3 \ - curs_inopts.3 \ - curs_insch.3 \ - curs_insstr.3 \ - curs_instr.3 \ - curs_kernel.3 \ - curs_move.3 \ - curs_outopts.3 \ - curs_overlay.3 \ - curs_pad.3 \ - curs_printw.3 \ - curs_refresh.3 \ - curs_scanw.3 \ - curs_scr_dmp.3 \ - curs_scroll.3 \ - curs_slk.3 \ - curs_termatt.3 \ - curs_termin.3 \ - curs_touch.3 \ - curs_util.3 \ - curs_window.3 \ - ncurses.3 - -MAN5 = term.5 - -MLINKS+=curs_addch.3 addch.3 curs_addch.3 waddch.3 curs_addch.3 echochar.3 \ - curs_addch.3 wechochar.3 curs_addch.3 mvaddch.3 \ - curs_addch.3 mvwaddch.3 -MLINKS+=curs_addchst.3 addchstr.3 curs_addchst.3 addchnstr.3 \ - curs_addchst.3 waddchstr.3 curs_addchst.3 waddchnstr.3 \ - curs_addchst.3 mvaddchstr.3 curs_addchst.3 mvaddchnstr.3 \ - curs_addchst.3 mvwaddchstr.3 curs_addchst.3 mvwaddchnstr.3 -MLINKS+=curs_addstr.3 addstr.3 curs_addstr.3 addnstr.3 \ - curs_addstr.3 waddstr.3 curs_addstr.3 waddnstr.3 \ - curs_addstr.3 mvaddstr.3 curs_addstr.3 mvaddnstr.3 \ - curs_addstr.3 mvwaddstr.3 curs_addstr.3 mvwaddnstr.3 -MLINKS+=curs_attr.3 attroff.3 curs_attr.3 wattroff.3 \ - curs_attr.3 attron.3 curs_attr.3 wattron.3 \ - curs_attr.3 attrset.3 curs_attr.3 wattrset.3 \ - curs_attr.3 standend.3 curs_attr.3 wstandend.3 \ - curs_attr.3 standout.3 curs_attr.3 wstandout.3 +NCURSES=${.CURDIR}/../../contrib/ncurses + +LIB= ncurses +SHLIB_MAJOR=5 +SHLIB_MINOR=0 + +# Should be elsewhere +AWK?= awk +TERMINFODIR?= ${DESTDIR}/usr/share/misc + +NCURSES_MAJOR!=egrep 'NCURSES_MAJOR[ ]*=' ${NCURSES}/dist.mk | sed -e 's/^[^0-9]*//' +NCURSES_MINOR!=egrep 'NCURSES_MINOR[ ]*=' ${NCURSES}/dist.mk | sed -e 's/^[^0-9]*//' +NCURSES_PATCH!=egrep 'NCURSES_PATCH[ ]*=' ${NCURSES}/dist.mk | sed -e 's/^[^0-9]*//' + +# From autoconf (!) +NCURSES_CONST= +NCURSES_XNAMES= 0 +OSPEED_INCLUDES=\#include <termios.h> +OSPEED_TYPE= speed_t +BUILTIN_BOOL= 1 +BOOL_TYPE= 0 +TYPE_OF_BOOL= char +TYPEOF_CHTYPE= long +WIDEC_SHIFT= 8 +SHIFT_LIMIT= 32 +ONEUL= 1UL + +.PATH: ${NCURSES}/ncurses +.PATH: ${NCURSES}/ncurses/base +.PATH: ${NCURSES}/ncurses/tinfo +.PATH: ${NCURSES}/ncurses/tty +.PATH: ${NCURSES}/ncurses/trace +.PATH: ${NCURSES}/include +.PATH: ${NCURSES}/man + +INCS= -I. -I${.CURDIR} -I${NCURSES}/ncurses -I${NCURSES}/include +CFLAGS+=${INCS} -Wall -DFREEBSD_NATIVE -DNDEBUG -DHAVE_CONFIG_H + +GENSRC= \ + codes.c \ + expanded.c \ + fallback.c \ + lib_gen.c \ + lib_keyname.c \ + names.c \ + unctrl.c + +GENHDR= \ + curses.h \ + hashsize.h \ + init_keytry.h \ + nomacros.h \ + parametrized.h \ + term.h \ + termcap.h \ + unctrl.h + +# Installed +HEADERS=curses.h term.h termcap.h unctrl.h + +# Components of names.c and codes.c +NAMESRC=boolnames boolfnames numnames numfnames strnames strfnames +CODESRC=boolcodes numcodes strcodes + +SRCS= ${GENHDR} ${GENSRC} \ + access.c \ + add_tries.c \ + alloc_entry.c \ + alloc_ttype.c \ + captoinfo.c \ + comp_captab.c \ + comp_error.c \ + comp_expand.c \ + comp_hash.c \ + comp_parse.c \ + comp_scan.c \ + define_key.c \ + doalloc.c \ + free_ttype.c \ + getenv_num.c \ + hardscroll.c \ + hashmap.c \ + home_terminfo.c \ + init_keytry.c \ + keybound.c \ + keyok.c \ + lib_acs.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_echo.c \ + lib_endwin.c \ + lib_erase.c \ + lib_flash.c \ + lib_freeall.c \ + lib_getch.c \ + lib_getstr.c \ + lib_has_cap.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_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_termname.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_ttyflags.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 \ + memmove.c \ + name_match.c \ + nc_panel.c \ + parse_entry.c \ + read_entry.c \ + resizeterm.c \ + safe_sprintf.c \ + setbuf.c \ + sigaction.c \ + trace_buf.c \ + trace_tries.c \ + trace_xnames.c \ + tries.c \ + tty_update.c \ + vsscanf.c \ + wresize.c \ + write_entry.c \ + +# From our old libtermcap. +# Used instead of the hideous read_termcap.c abomination. +SRCS+= termcap.c + +CLEANFILES+= ${GENSRC} ${GENHDR} keys.tries make_hash term.h.new \ + make_keys MKterm.h.awk comp_captab.c \ + namehdr nameftr codeftr ${NAMESRC} ${CODESRC} + +SYMLINKS+=${LIBDIR}/libncurses.a ${LIBDIR}/libcurses.a +SYMLINKS+=${LIBDIR}/libncurses.a ${LIBDIR}/libtermcap.a +SYMLINKS+=${LIBDIR}/libncurses.a ${LIBDIR}/libtermlib.a +SYMLINKS+=${LIBDIR}/libncurses.a ${LIBDIR}/libmytinfo.a +SYMLINKS+=${LIBDIR}/libncurses.a ${LIBDIR}/libtinfo.a +.if !defined(NOPIC) +.if ${OBJFORMAT} == aout +SYMLINKS+=${SHLIBDIR}/libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ${SHLIBDIR}/libcurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +SYMLINKS+=${SHLIBDIR}/libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ${SHLIBDIR}/libtermcap.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +SYMLINKS+=${SHLIBDIR}/libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ${SHLIBDIR}/libtermlib.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +SYMLINKS+=${SHLIBDIR}/libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ${SHLIBDIR}/libmytinfo.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +SYMLINKS+=${SHLIBDIR}/libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ${SHLIBDIR}/libtinfo.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +.else +# no need for major at all, it's an ld-time redirection only +SYMLINKS+=${SHLIBDIR}/libncurses.so ${SHLIBDIR}/libcurses.so +SYMLINKS+=${SHLIBDIR}/libncurses.so ${SHLIBDIR}/libtermcap.so +SYMLINKS+=${SHLIBDIR}/libncurses.so ${SHLIBDIR}/libtermlib.so +SYMLINKS+=${SHLIBDIR}/libncurses.so ${SHLIBDIR}/libmytinfo.so +SYMLINKS+=${SHLIBDIR}/libncurses.so ${SHLIBDIR}/libtinfo.so +.endif +.endif +.if !defined(NOPROFILE) +SYMLINKS+=${LIBDIR}/libncurses_p.a ${LIBDIR}/libcurses_p.a +SYMLINKS+=${LIBDIR}/libncurses_p.a ${LIBDIR}/libtermcap_p.a +SYMLINKS+=${LIBDIR}/libncurses_p.a ${LIBDIR}/libtermlib_p.a +SYMLINKS+=${LIBDIR}/libncurses_p.a ${LIBDIR}/libmytinfo_p.a +SYMLINKS+=${LIBDIR}/libncurses_p.a ${LIBDIR}/libtinfo_p.a +.endif + +beforeinstall: ${HEADERS} + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${HEADERS} \ + ${DESTDIR}/usr/include + rm -f ${DESTDIR}/usr/include/ncurses.h + ln -s curses.h ${DESTDIR}/usr/include/ncurses.h + +# Generated source +namehdr nameftr codeftr ${NAMESRC} ${CODESRC}: MKnames.awk Caps + ${AWK} -f ${NCURSES}/ncurses/tinfo/MKnames.awk ${NCURSES}/include/Caps + +names.c: namehdr ${NAMESRC} nameftr + cat namehdr ${NAMESRC} nameftr > $@ + +codes.c: namehdr ${CODESRC} codeftr + cat namehdr ${CODESRC} codeftr > $@ + +lib_gen.c: MKlib_gen.sh curses.h + sh ${NCURSES}/ncurses/base/MKlib_gen.sh "${CC} -E ${INCS}" \ + "${AWK}" < curses.h >$@ + +lib_keyname.c: keys.list MKkeyname.awk + ${AWK} -f ${NCURSES}/ncurses/base/MKkeyname.awk \ + ${NCURSES}/ncurses/tinfo/keys.list > lib_keyname.c + +unctrl.c: MKunctrl.awk + echo | ${AWK} -f ${NCURSES}/ncurses/base/MKunctrl.awk > unctrl.c + +comp_captab.c: MKcaptab.awk Caps make_hash + sh ${NCURSES}/ncurses/tinfo/MKcaptab.awk "${AWK}" \ + ${NCURSES}/include/Caps > comp_captab.c + +expanded.c: MKexpanded.sh + sh ${NCURSES}/ncurses/tty/MKexpanded.sh "${CC} -E" ${CFLAGS} >expanded.c + +fallback.c: MKfallback.sh + sh ${NCURSES}/ncurses/tinfo/MKfallback.sh > fallback.c + +# Generated headers +nomacros.h: MKlib_gen.sh curses.h + sh ${NCURSES}/ncurses/base/MKlib_gen.sh "${CC} -E ${INCS}" \ + "${AWK}" < curses.h | fgrep undef > $@ + +init_keytry.h: keys.list make_keys + ./make_keys ${NCURSES}/ncurses/tinfo/keys.list > init_keytry.h + +hashsize.h: MKhashsize.sh Caps + sh ${NCURSES}/include/MKhashsize.sh ${NCURSES}/include/Caps > $@ + +parametrized.h: MKparametrized.sh Caps + AWK=${AWK} sh ${NCURSES}/include/MKparametrized.sh \ + ${NCURSES}/include/Caps > $@ + +term.h: MKterm.h.awk edit_cfg.sh Caps + ${AWK} -f MKterm.h.awk ${NCURSES}/include/Caps > $@.new + sh ${NCURSES}/include/edit_cfg.sh ${.CURDIR}/ncurses_cfg.h $@.new + mv -f $@.new $@ + +# Build tools +make_keys: make_keys.c names.c + ${CC} -o $@ ${CFLAGS} ${NCURSES}/ncurses/tinfo/make_keys.c + +make_hash: comp_hash.c + ${CC} -o $@ ${CFLAGS} -DMAIN_PROGRAM \ + ${NCURSES}/ncurses/tinfo/comp_hash.c + +# ./configure generated +MKterm.h.awk: MKterm.h.awk.in + sed <${NCURSES}/include/$@.in >$@ \ + -e "/@NCURSES_MAJOR@/s//${NCURSES_MAJOR}/" \ + -e "/@NCURSES_MINOR@/s//${NCURSES_MINOR}/" \ + -e "/@NCURSES_CONST@/s//${NCURSES_CONST}/" \ + -e "/@NCURSES_XNAMES@/s//${NCURSES_XNAMES}/" + +termcap.h: termcap.h.in + sed <${NCURSES}/include/$@.in >$@ \ + -e "/@NCURSES_MAJOR@/s//${NCURSES_MAJOR}/" \ + -e "/@NCURSES_MINOR@/s//${NCURSES_MINOR}/" \ + -e "/@NCURSES_CONST@/s//${NCURSES_CONST}/" \ + -e "/@OSPEED_INCLUDES@/s//${OSPEED_INCLUDES}/" \ + -e "/@OSPEED_TYPE@/s//${OSPEED_TYPE}/" + +curses.h: curses.h.in + sed <${NCURSES}/include/$@.in >$@ \ + -e "/@NCURSES_MAJOR@/s//${NCURSES_MAJOR}/" \ + -e "/@NCURSES_MINOR@/s//${NCURSES_MINOR}/" \ + -e "/@NCURSES_PATCH@/s//${NCURSES_PATCH}/" \ + -e "/@NCURSES_CONST@/s//${NCURSES_CONST}/" \ + -e "s/@cf_cv_builtin_bool@/${BUILTIN_BOOL}/g" \ + -e "s/@cf_cv_cc_bool_type@/${BOOL_TYPE}/g" \ + -e "s/@cf_cv_type_of_bool@/${TYPE_OF_BOOL}/g" \ + -e "s/@cf_cv_typeof_chtype@/${TYPEOF_CHTYPE}/g" \ + -e "s/@cf_cv_widec_shift@/${WIDEC_SHIFT}/g" \ + -e "s/@cf_cv_shift_limit@/${SHIFT_LIMIT}/g" \ + -e "s/@cf_cv_1UL@/${ONEUL}/g" + +unctrl.h: unctrl.h.in + sed <${NCURSES}/include/$@.in >$@ \ + -e "/@NCURSES_MAJOR@/s//${NCURSES_MAJOR}/" \ + -e "/@NCURSES_MINOR@/s//${NCURSES_MINOR}/" + +# MAN page gunk +terminfo.5: MKterminfo.sh terminfo.head Caps + sh ${NCURSES}/man/MKterminfo.sh ${NCURSES}/man/terminfo.head \ + ${NCURSES}/include/Caps ${NCURSES}/man/terminfo.tail >$@ + +CLEANFILES+= terminfo.5 +MANFILTER= sed -e 's\#@DATADIR@\#${TERMINFODIR}/terminfo\#g' + +MAN3x= curs_addch.3x curs_addchstr.3x curs_addstr.3x curs_attr.3x \ + curs_beep.3x curs_bkgd.3x curs_border.3x curs_clear.3x curs_color.3x \ + curs_delch.3x curs_deleteln.3x curs_getch.3x curs_getstr.3x \ + curs_getyx.3x curs_inch.3x curs_inchstr.3x curs_initscr.3x \ + curs_inopts.3x curs_insch.3x curs_insstr.3x curs_instr.3x \ + curs_kernel.3x curs_mouse.3x curs_move.3x curs_outopts.3x \ + curs_overlay.3x curs_pad.3x curs_print.3x curs_printw.3x \ + curs_refresh.3x curs_scanw.3x curs_scr_dump.3x curs_scroll.3x \ + curs_slk.3x curs_termattrs.3x curs_termcap.3x curs_terminfo.3x \ + curs_touch.3x curs_util.3x curs_window.3x define_key.3x \ + dft_fgbg.3x keybound.3x keyok.3x ncurses.3x resizeterm.3x wresize.3x +MAN5= term.5 terminfo.5 +MAN7= term.7 + +# Generate the MAN3 list from MAN3x +.for page in ${MAN3x} +CLEANFILES+=${page:T:S/3x$/3/g} +MAN3+=${page:T:S/3x$/3/g} +all-man: ${page:T:S/3x$/3/g} +${page:T:S/3x$/3/g}: ${page} + ln -s ${.ALLSRC} ${.TARGET} +.endfor + +MLINKS+=curs_addch.3 addch.3 curs_addch.3 echochar.3 curs_addch.3 mvaddch.3 \ + curs_addch.3 mvwaddch.3 curs_addch.3 waddch.3 curs_addch.3 wechochar.3 +MLINKS+=curs_addchstr.3 addchnstr.3 curs_addchstr.3 addchstr.3 \ + curs_addchstr.3 mvaddchnstr.3 curs_addchstr.3 mvaddchstr.3 \ + curs_addchstr.3 mvwaddchnstr.3 curs_addchstr.3 mvwaddchstr.3 \ + curs_addchstr.3 waddchnstr.3 curs_addchstr.3 waddchstr.3 +MLINKS+=curs_addstr.3 addnstr.3 curs_addstr.3 addstr.3 \ + curs_addstr.3 mvaddnstr.3 curs_addstr.3 mvaddstr.3 \ + curs_addstr.3 mvwaddnstr.3 curs_addstr.3 mvwaddstr.3 \ + curs_addstr.3 waddnstr.3 curs_addstr.3 waddstr.3 +MLINKS+=curs_attr.3 attr_get.3 curs_attr.3 attr_off.3 curs_attr.3 attr_on.3 \ + curs_attr.3 attr_set.3 curs_attr.3 attroff.3 curs_attr.3 attron.3 \ + curs_attr.3 attrset.3 curs_attr.3 chgat.3 curs_attr.3 color_set.3 \ + curs_attr.3 mvchgat.3 curs_attr.3 mvwchgat.3 curs_attr.3 standend.3 \ + curs_attr.3 standout.3 curs_attr.3 wattr_get.3 curs_attr.3 wattr_off.3 \ + curs_attr.3 wattr_on.3 curs_attr.3 wattr_set.3 curs_attr.3 wattroff.3 \ + curs_attr.3 wattron.3 curs_attr.3 wattrset.3 curs_attr.3 wchgat.3 \ + curs_attr.3 wcolor_set.3 curs_attr.3 wstandend.3 \ + curs_attr.3 wstandout.3 MLINKS+=curs_beep.3 beep.3 curs_beep.3 flash.3 -MLINKS+=curs_bkgd.3 bkgdset.3 curs_bkgd.3 wbkgdset.3 \ - curs_bkgd.3 bkgd.3 curs_bkgd.3 wbkgd.3 -MLINKS+=curs_border.3 border.3 curs_border.3 wborder.3 curs_border.3 box.3 \ - curs_border.3 hline.3 curs_border.3 whline.3 \ - curs_border.3 vline.3 curs_border.3 wvline.3 -MLINKS+=curs_clear.3 erase.3 curs_clear.3 werase.3 curs_clear.3 clear.3 \ - curs_clear.3 wclear.3 curs_clear.3 clrtobot.3 \ - curs_clear.3 wclrtobot.3 curs_clear.3 clrtoeol.3 \ - curs_clear.3 wclrtoeol.3 -MLINKS+=curs_color.3 start_color.3 curs_color.3 init_pair.3 \ - curs_color.3 init_color.3 curs_color.3 has_colors.3 \ - curs_color.3 can_change_color.3 curs_color.3 color_content.3 \ - curs_color.3 pair_content.3 -MLINKS+=curs_delch.3 delch.3 curs_delch.3 wdelch.3 curs_delch.3 mvdelch.3 \ - curs_delch.3 mvwdelch.3 -MLINKS+=curs_delln.3 deleteln.3 curs_delln.3 wdeleteln.3 \ - curs_delln.3 insdelln.3 curs_delln.3 winsdelln.3 \ - curs_delln.3 insertln.3 curs_delln.3 winsertln.3 -MLINKS+=curs_getch.3 getch.3 curs_getch.3 wgetch.3 curs_getch.3 mvgetch.3 \ - curs_getch.3 mvwgetch.3 curs_getch.3 ungetch.3 -MLINKS+=curs_getstr.3 getstr.3 curs_getstr.3 wgetstr.3 \ - curs_getstr.3 mvgetstr.3 curs_getstr.3 mvwgetstr.3 \ - curs_getstr.3 wgetnstr.3 -MLINKS+=curs_getyx.3 getyx.3 curs_getyx.3 pgetparyx.3 curs_getyx.3 getbegyx.3 \ - curs_getyx.3 getmaxyx.3 -MLINKS+=curs_inch.3 inch.3 curs_inch.3 winch.3 curs_inch.3 mvinch.3 \ - curs_inch.3 mvwinch.3 -MLINKS+=curs_inchstr.3 inchstr.3 curs_inchstr.3 inchnstr.3 \ - curs_inchstr.3 winchstr.3 curs_inchstr.3 winchnstr.3 \ - curs_inchstr.3 mvinchstr.3 curs_inchstr.3 mvinchnstr.3 \ - curs_inchstr.3 mvwinchstr.3 curs_inchstr.3 mvwinchnstr.3 -MLINKS+=curs_initscr.3 initscr.3 curs_initscr.3 newterm.3 \ - curs_initscr.3 endwin.3 curs_initscr.3 isendwin.3 \ - curs_initscr.3 set_term.3 curs_initscr.3 delscreen.3 -MLINKS+=curs_inopts.3 cbreak.3 curs_inopts.3 nocbreak.3 curs_inopts.3 echo.3 \ - curs_inopts.3 noecho.3 curs_inopts.3 halfdelay.3 \ +MLINKS+=curs_bkgd.3 bkgd.3 curs_bkgd.3 bkgdset.3 curs_bkgd.3 getbkgd.3 \ + curs_bkgd.3 wbkgd.3 curs_bkgd.3 wbkgdset.3 +MLINKS+=curs_border.3 border.3 curs_border.3 box.3 curs_border.3 hline.3 \ + curs_border.3 mvhline.3 curs_border.3 mvwhline.3 \ + curs_border.3 mvwvline.3 curs_border.3 vline.3 curs_border.3 wborder.3 \ + curs_border.3 whline.3 curs_border.3 wvline.3 +MLINKS+=curs_clear.3 clear.3 curs_clear.3 clrtobot.3 curs_clear.3 clrtoeol.3 \ + curs_clear.3 erase.3 curs_clear.3 wclear.3 curs_clear.3 wclrtobot.3 \ + curs_clear.3 wclrtoeol.3 curs_clear.3 werase.3 +MLINKS+=curs_color.3 can_change_color.3 curs_color.3 color_content.3 \ + curs_color.3 has_colors.3 curs_color.3 init_color.3 \ + curs_color.3 init_pair.3 curs_color.3 pair_content.3 \ + curs_color.3 start_color.3 +MLINKS+=curs_delch.3 delch.3 curs_delch.3 mvdelch.3 curs_delch.3 mvwdelch.3 \ + curs_delch.3 wdelch.3 +MLINKS+=curs_deleteln.3 deleteln.3 curs_deleteln.3 insdelln.3 \ + curs_deleteln.3 insertln.3 curs_deleteln.3 wdeleteln.3 \ + curs_deleteln.3 winsdelln.3 curs_deleteln.3 winsertln.3 +MLINKS+=curs_getch.3 getch.3 curs_getch.3 has_key.3 curs_getch.3 mvgetch.3 \ + curs_getch.3 mvwgetch.3 curs_getch.3 ungetch.3 curs_getch.3 wgetch.3 +MLINKS+=curs_getstr.3 getnstr.3 curs_getstr.3 getstr.3 \ + curs_getstr.3 mvgetnstr.3 curs_getstr.3 mvgetstr.3 \ + curs_getstr.3 mvwgetnstr.3 curs_getstr.3 mvwgetstr.3 \ + curs_getstr.3 wgetnstr.3 curs_getstr.3 wgetstr.3 +MLINKS+=curs_getyx.3 getbegyx.3 curs_getyx.3 getmaxyx.3 \ + curs_getyx.3 getparyx.3 curs_getyx.3 getyx.3 +MLINKS+=curs_inch.3 inch.3 curs_inch.3 mvinch.3 curs_inch.3 mvwinch.3 \ + curs_inch.3 winch.3 +MLINKS+=curs_inchstr.3 inchnstr.3 curs_inchstr.3 inchstr.3 \ + curs_inchstr.3 mvinchnstr.3 curs_inchstr.3 mvinchstr.3 \ + curs_inchstr.3 mvwinchnstr.3 curs_inchstr.3 mvwinchstr.3 \ + curs_inchstr.3 winchnstr.3 curs_inchstr.3 winchstr.3 +MLINKS+=curs_initscr.3 delscreen.3 curs_initscr.3 endwin.3 \ + curs_initscr.3 initscr.3 curs_initscr.3 isendwin.3 \ + curs_initscr.3 newterm.3 curs_initscr.3 set_term.3 +MLINKS+=curs_inopts.3 cbreak.3 curs_inopts.3 echo.3 curs_inopts.3 halfdelay.3 \ curs_inopts.3 intrflush.3 curs_inopts.3 keypad.3 curs_inopts.3 meta.3 \ - curs_inopts.3 nodelay.3 curs_inopts.3 notimeout.3 curs_inopts.3 raw.3 \ - curs_inopts.3 noraw.3 curs_inopts.3 noqiflush.3 \ - curs_inopts.3 qiflush.3 curs_inopts.3 timeout.3 \ - curs_inopts.3 wtimeout.3 curs_inopts.3 typeahead.3 -MLINKS+=curs_insch.3 insch.3 curs_insch.3 winsch.3 curs_insch.3 mvinsch.3 \ - curs_insch.3 mvwinsch.3 -MLINKS+=curs_insstr.3 insstr.3 curs_insstr.3 insnstr.3 \ - curs_insstr.3 winsstr.3 curs_insstr.3 winsnstr.3 \ - curs_insstr.3 mvinsstr.3 curs_insstr.3 mvinsnstr.3 \ - curs_insstr.3 mvwinsstr.3 curs_insstr.3 mvwinsnstr.3 -MLINKS+=curs_instr.3 instr.3 curs_instr.3 innstr.3 curs_instr.3 winstr.3 \ - curs_instr.3 winnstr.3 curs_instr.3 mvinstr.3 curs_instr.3 mvinnstr.3 \ - curs_instr.3 mvwinstr.3 curs_instr.3 mvwinnstr.3 -MLINKS+=curs_kernel.3 def_prog_mode.3 curs_kernel.3 def_shell_mode.3 \ - curs_kernel.3 reset_prog_mode.3 curs_kernel.3 reset_shell_mode.3 \ - curs_kernel.3 resetty.3 curs_kernel.3 savetty.3 \ - curs_kernel.3 getsyx.3 curs_kernel.3 setsyx.3 \ - curs_kernel.3 ripoffline.3 curs_kernel.3 curs_set.3 \ - curs_kernel.3 napms.3 + curs_inopts.3 nocbreak.3 curs_inopts.3 nodelay.3 \ + curs_inopts.3 noecho.3 curs_inopts.3 noqiflush.3 curs_inopts.3 noraw.3 \ + curs_inopts.3 notimeout.3 curs_inopts.3 qiflush.3 curs_inopts.3 raw.3 \ + curs_inopts.3 timeout.3 curs_inopts.3 typeahead.3 \ + curs_inopts.3 wtimeout.3 +MLINKS+=curs_insch.3 insch.3 curs_insch.3 mvinsch.3 curs_insch.3 mvwinsch.3 \ + curs_insch.3 winsch.3 +MLINKS+=curs_insstr.3 insnstr.3 curs_insstr.3 insstr.3 \ + curs_insstr.3 mvinsnstr.3 curs_insstr.3 mvinsstr.3 \ + curs_insstr.3 mvwinsnstr.3 curs_insstr.3 mvwinsstr.3 \ + curs_insstr.3 winsnstr.3 curs_insstr.3 winsstr.3 +MLINKS+=curs_instr.3 innstr.3 curs_instr.3 instr.3 curs_instr.3 mvinnstr.3 \ + curs_instr.3 mvinstr.3 curs_instr.3 mvwinnstr.3 \ + curs_instr.3 mvwinstr.3 curs_instr.3 winnstr.3 curs_instr.3 winstr.3 +MLINKS+=curs_kernel.3 curs_set.3 curs_kernel.3 def_prog_mode.3 \ + curs_kernel.3 def_shell_mode.3 curs_kernel.3 getsyx.3 \ + curs_kernel.3 napms.3 curs_kernel.3 reset_prog_mode.3 \ + curs_kernel.3 reset_shell_mode.3 curs_kernel.3 resetty.3 \ + curs_kernel.3 ripoffline.3 curs_kernel.3 savetty.3 \ + curs_kernel.3 setsyx.3 +MLINKS+=curs_mouse.3 getmouse.3 curs_mouse.3 mouseinterval.3 \ + curs_mouse.3 mousemask.3 curs_mouse.3 ungetmouse.3 \ + curs_mouse.3 wenclose.3 curs_mouse.3 wmouse_trafo.3 MLINKS+=curs_move.3 move.3 curs_move.3 wmove.3 -MLINKS+=curs_outopts.3 clearok.3 curs_outopts.3 idlok.3 \ - curs_outopts.3 idcok.3 curs_outopts.3 immedok.3 \ - curs_outopts.3 leaveok.3 curs_outopts.3 setscrreg.3 \ - curs_outopts.3 wsetscrreg.3 curs_outopts.3 scrollok.3 \ - curs_outopts.3 nl.3 curs_outopts.3 nonl.3 -MLINKS+=curs_overlay.3 overlay.3 curs_overlay.3 overwrite.3 \ - curs_overlay.3 copywin.3 -MLINKS+=curs_pad.3 newpad.3 curs_pad.3 subpad.3 curs_pad.3 prefresh.3 \ - curs_pad.3 pnoutrefresh.3 curs_pad.3 pechochar.3 -MLINKS+=curs_printw.3 printw.3 curs_printw.3 wprintw.3 \ - curs_printw.3 mvprintw.3 curs_printw.3 mvwprintw.3 \ - curs_printw.3 vwprintw.3 -MLINKS+=curs_refresh.3 refresh.3 curs_refresh.3 wrefresh.3 \ - curs_refresh.3 wnoutrefresh.3 curs_refresh.3 doupdate.3 \ - curs_refresh.3 redrawwin.3 curs_refresh.3 wredrawln.3 -MLINKS+=curs_scanw.3 scanw.3 curs_scanw.3 wscanw.3 curs_scanw.3 mvscanw.3 \ - curs_scanw.3 mvwscanw.3 curs_scanw.3 vwscanw.3 -MLINKS+=curs_scr_dmp.3 scr_dump.3 curs_scr_dmp.3 scr_restore.3 \ - curs_scr_dmp.3 scr_init.3 curs_scr_dmp.3 scr_set.3 -MLINKS+=curs_scroll.3 scroll.3 curs_scroll.3 scrl.3 curs_scroll.3 wscrl.3 -MLINKS+=curs_slk.3 slk_init.3 curs_slk.3 slk_set.3 curs_slk.3 slk_refresh.3 \ - curs_slk.3 slk_noutrefresh.3 curs_slk.3 slk_label.3 \ - curs_slk.3 slk_clear.3 curs_slk.3 slk_restore.3 \ - curs_slk.3 slk_touch.3 curs_slk.3 slk_attron.3 \ - curs_slk.3 slk_attrset.3 curs_slk.3 slk_attroff.3 -MLINKS+=curs_termatt.3 baudrate.3 curs_termatt.3 erasechar.3 \ - curs_termatt.3 has_ic.3 curs_termatt.3 has_il.3 \ - curs_termatt.3 killchar.3 curs_termatt.3 longname.3 \ - curs_termatt.3 termattrs.3 curs_termatt.3 termname.3 - -# XXX name clash with termcap(3) -# MLINKS+= curs_termin.3 tparm.3 -MLINKS+=curs_termin.3 setupterm.3 curs_termin.3 setterm.3 \ - curs_termin.3 set_curterm.3 curs_termin.3 del_curterm.3 \ - curs_termin.3 restartterm.3 \ - curs_termin.3 putp.3 curs_termin.3 vidputs.3 \ - curs_termin.3 vidattr.3 curs_termin.3 mvcur.3 \ - curs_termin.3 tigetflag.3 curs_termin.3 tigetnum.3 \ - curs_termin.3 tigetstr.3 -MLINKS+=curs_touch.3 touchwin.3 curs_touch.3 touchline.3 \ - curs_touch.3 untouchwin.3 curs_touch.3 wtouchln.3 \ - curs_touch.3 is_linetouched.3 curs_touch.3 is_wintouched.3 -MLINKS+=curs_util.3 unctrl.3 curs_util.3 keyname.3 \ - curs_util.3 filter.3 curs_util.3 use_env.3 \ - curs_util.3 putwin.3 curs_util.3 getwin.3 \ - curs_util.3 delay_output.3 curs_util.3 flushinp.3 -MLINKS+=curs_window.3 newwin.3 curs_window.3 delwin.3 \ - curs_window.3 mvwin.3 curs_window.3 subwin.3 \ - curs_window.3 derwin.3 curs_window.3 mvderwin.3 \ - curs_window.3 dupwin.3 curs_window.3 wsyncup.3 \ - curs_window.3 syncok.3 curs_window.3 wcursyncup.3 \ - curs_window.3 wsyncdown.3 +MLINKS+=curs_outopts.3 clearok.3 curs_outopts.3 idcok.3 curs_outopts.3 idlok.3 \ + curs_outopts.3 immedok.3 curs_outopts.3 leaveok.3 curs_outopts.3 nl.3 \ + curs_outopts.3 nonl.3 curs_outopts.3 scrollok.3 \ + curs_outopts.3 setscrreg.3 curs_outopts.3 wsetscrreg.3 +MLINKS+=curs_overlay.3 copywin.3 curs_overlay.3 overlay.3 \ + curs_overlay.3 overwrite.3 +MLINKS+=curs_pad.3 newpad.3 curs_pad.3 pechochar.3 curs_pad.3 pnoutrefresh.3 \ + curs_pad.3 prefresh.3 curs_pad.3 subpad.3 +MLINKS+=curs_print.3 mcprint.3 +MLINKS+=curs_printw.3 mvprintw.3 curs_printw.3 mvwprintw.3 \ + curs_printw.3 printw.3 curs_printw.3 vw_printw.3 \ + curs_printw.3 vwprintw.3 curs_printw.3 wprintw.3 +MLINKS+=curs_refresh.3 doupdate.3 curs_refresh.3 redrawwin.3 \ + curs_refresh.3 refresh.3 curs_refresh.3 wnoutrefresh.3 \ + curs_refresh.3 wredrawln.3 curs_refresh.3 wrefresh.3 +MLINKS+=curs_scanw.3 mvscanw.3 curs_scanw.3 mvwscanw.3 curs_scanw.3 scanw.3 \ + curs_scanw.3 vw_scanw.3 curs_scanw.3 vwscanw.3 curs_scanw.3 wscanw.3 +MLINKS+=curs_scr_dump.3 scr_dump.3 curs_scr_dump.3 scr_init.3 \ + curs_scr_dump.3 scr_restore.3 curs_scr_dump.3 scr_set.3 +MLINKS+=curs_scroll.3 scrl.3 curs_scroll.3 scroll.3 curs_scroll.3 wscrl.3 +MLINKS+=curs_slk.3 slk_attr.3 curs_slk.3 slk_attr_off.3 \ + curs_slk.3 slk_attr_on.3 curs_slk.3 slk_attr_set.3 \ + curs_slk.3 slk_attroff.3 curs_slk.3 slk_attron.3 \ + curs_slk.3 slk_attrset.3 curs_slk.3 slk_clear.3 \ + curs_slk.3 slk_color.3 curs_slk.3 slk_init.3 curs_slk.3 slk_label.3 \ + curs_slk.3 slk_noutrefresh.3 curs_slk.3 slk_refresh.3 \ + curs_slk.3 slk_restore.3 curs_slk.3 slk_set.3 curs_slk.3 slk_touch.3 +MLINKS+=curs_termattrs.3 baudrate.3 curs_termattrs.3 erasechar.3 \ + curs_termattrs.3 has_ic.3 curs_termattrs.3 has_il.3 \ + curs_termattrs.3 killchar.3 curs_termattrs.3 longname.3 \ + curs_termattrs.3 termattrs.3 curs_termattrs.3 termname.3 +MLINKS+=curs_termcap.3 tgetent.3 curs_termcap.3 tgetflag.3 \ + curs_termcap.3 tgetnum.3 curs_termcap.3 tgetstr.3 \ + curs_termcap.3 tgoto.3 curs_termcap.3 tputs.3 +MLINKS+=curs_terminfo.3 del_curterm.3 curs_terminfo.3 mvcur.3 \ + curs_terminfo.3 putp.3 curs_terminfo.3 restartterm.3 \ + curs_terminfo.3 set_curterm.3 curs_terminfo.3 setterm.3 \ + curs_terminfo.3 setupterm.3 curs_terminfo.3 tigetflag.3 \ + curs_terminfo.3 tigetnum.3 curs_terminfo.3 tigetstr.3 \ + curs_terminfo.3 tparm.3 curs_terminfo.3 tputs.3 \ + curs_terminfo.3 vidattr.3 curs_terminfo.3 vidputs.3 +MLINKS+=curs_touch.3 is_linetouched.3 curs_touch.3 is_wintouched.3 \ + curs_touch.3 touchline.3 curs_touch.3 touchwin.3 \ + curs_touch.3 untouchwin.3 curs_touch.3 wtouchln.3 +MLINKS+=curs_util.3 delay_output.3 curs_util.3 filter.3 \ + curs_util.3 flushinp.3 curs_util.3 getwin.3 \ + curs_util.3 keyname.3 curs_util.3 putwin.3 \ + curs_util.3 unctrl.3 curs_util.3 use_env.3 +MLINKS+=curs_window.3 delwin.3 curs_window.3 derwin.3 curs_window.3 dupwin.3 \ + curs_window.3 mvderwin.3 curs_window.3 mvwin.3 curs_window.3 newwin.3 \ + curs_window.3 subwin.3 curs_window.3 syncok.3 \ + curs_window.3 wcursyncup.3 curs_window.3 wsyncdown.3 \ + curs_window.3 wsyncup.3 +MLINKS+=dft_fgbg.3 use_default_colors.3 .include <bsd.lib.mk> + +.SUFFIXES: .3x .3 diff --git a/lib/ncurses/ncurses/ncurses_cfg.h b/lib/ncurses/ncurses/ncurses_cfg.h new file mode 100644 index 000000000000..a14d5ba57363 --- /dev/null +++ b/lib/ncurses/ncurses/ncurses_cfg.h @@ -0,0 +1,129 @@ +/* include/ncurses_cfg.h. Generated automatically by configure. */ +/**************************************************************************** + * 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 * + ****************************************************************************/ +/* + * Id: ncurses_cfg.hin,v 1.2 1998/02/11 12:13:46 tom Exp + * + * This is a template-file used to generate the "ncurses_cfg.h" file. + * + * Rather than list every definition, the configuration script substitutes + * the definitions that it finds using 'sed'. You need a patch (971222) + * to autoconf 2.12 to do this. + */ +#ifndef NC_CONFIG_H +#define NC_CONFIG_H + +#define BSD_TPUTS 1 +#define CC_HAS_INLINE_FUNCS 1 +#define CC_HAS_PROTOS 1 +#define ETIP_NEEDS_ 1 +#define GCC_NORETURN __dead2 +#define GCC_PRINTF 1 +#define GCC_SCANF 1 +#define GCC_UNUSED __unused +#define HAVE_BIG_CORE 1 +#define HAVE_BSD_CGETENT 1 +#define HAVE_DIRENT_H 1 +#define HAVE_ERRNO 1 +#define HAVE_FCNTL_H 1 +#define HAVE_FORM_H 1 +#define HAVE_GETCWD 1 +#define HAVE_GETTIMEOFDAY 1 +#define HAVE_GETTTYNAM 1 +#define HAVE_ISASCII 1 +#define HAVE_LIBFORM 1 +#define HAVE_LIBMENU 1 +#define HAVE_LIBPANEL 1 +#define HAVE_LIMITS_H 1 +#define HAVE_LINK 1 +#define HAVE_LOCALE_H 1 +#define HAVE_LONG_FILE_NAMES 1 +#define HAVE_MEMCCPY 1 +#define HAVE_MENU_H 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_NC_ALLOC_H 1 +#define HAVE_PANEL_H 1 +#define HAVE_POLL 1 +#define HAVE_POLL_H 1 +#define HAVE_REGEX_H_FUNCS 1 +#define HAVE_REMOVE 1 +#define HAVE_SELECT 1 +#define HAVE_SETBUF 1 +#define HAVE_SETBUFFER 1 +#define HAVE_SETVBUF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SIGVEC 1 +#define HAVE_SIZECHANGE 1 +#define HAVE_STRDUP 1 +#define HAVE_STRSTR 1 +#define HAVE_SYMLINK 1 +#define HAVE_SYS_IOCTL_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_SELECT_H 1 +#define HAVE_SYS_TIMES_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TIME_SELECT 1 +#define HAVE_TCGETATTR 1 +#define HAVE_TCGETPGRP 1 +#define HAVE_TERMIOS_H 1 +#define HAVE_TIMES 1 +#define HAVE_TTYENT_H 1 +#define HAVE_TYPEINFO 1 +#define HAVE_UNISTD_H 1 +#define HAVE_USLEEP 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_VSSCANF 1 +#define NCURSES_EXT_FUNCS 1 +#define NCURSES_NO_PADDING 1 +#define NDEBUG 1 +#define RETSIGTYPE void +#define STDC_HEADERS 1 +#define SYSTEM_NAME "FreeBSD" +#define TERMINFO_DIRS "/usr/share/misc/terminfo" +#define TYPEOF_CHTYPE long +#define USE_DATABASE 1 +#define USE_GETCAP 1 +#define USE_HASHMAP 1 +#define USE_SIGWINCH 1 + + /* The C compiler may not treat these properly but C++ has to */ +#ifdef __cplusplus +#undef const +#undef inline +#else +#if defined(lint) || defined(TRACE) +#undef inline +#define inline /* nothing */ +#endif +#endif + +#endif /* NC_CONFIG_H */ diff --git a/lib/ncurses/ncurses/pathnames.h b/lib/ncurses/ncurses/pathnames.h new file mode 100644 index 000000000000..5cac36f3651f --- /dev/null +++ b/lib/ncurses/ncurses/pathnames.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)pathnames.h 8.1 (Berkeley) 6/4/93 + * $FreeBSD$ + */ + +#define _PATH_DEF ".termcap /usr/share/misc/termcap" +#define _PATH_DEF_SEC "/usr/share/misc/termcap" diff --git a/lib/ncurses/ncurses/termcap.c b/lib/ncurses/ncurses/termcap.c new file mode 100644 index 000000000000..e2bde8b6f442 --- /dev/null +++ b/lib/ncurses/ncurses/termcap.c @@ -0,0 +1,265 @@ +/* A portion of this file is from ncurses: */ +/*************************************************************************** +* 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> + +#include <string.h> +#include <term.h> +#include <tic.h> +#include <term_entry.h> + +/* The rest is from BSD */ +/* + * Copyright (c) 1980, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef lint +static const char sccsid[] = "@(#)termcap.c 8.1 (Berkeley) 6/4/93"; +#endif /* not lint */ + +#include <stdio.h> +#include <ctype.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <sys/param.h> +#include "pathnames.h" + +#define PBUFSIZ MAXPATHLEN /* max length of filename path */ +#define PVECSIZ 32 /* max number of names in path */ +#define TBUFSIZ 1024 /* max length of _nc_tgetent buffer */ + +char _nc_termcap[TBUFSIZ + 1]; /* Last getcap, provided to tgetent() emul */ + +/* + * termcap - routines for dealing with the terminal capability data base + * + * BUG: Should use a "last" pointer in tbuf, so that searching + * for capabilities alphabetically would not be a n**2/2 + * process when large numbers of capabilities are given. + * Note: If we add a last pointer now we will screw up the + * tc capability. We really should compile termcap. + * + * Essentially all the work here is scanning and decoding escapes + * in string capabilities. We don't use stdio because the editor + * doesn't, and because living w/o it is not hard. + */ + +/* + * Get an entry for terminal name in buffer _nc_termcap from the termcap + * file. + */ +int +_nc_read_termcap_entry(const char *const name, TERMTYPE *const tp) +{ + ENTRY *ep; + register char *p; + register char *cp; + char *dummy; + char **fname; + char *home; + int i; + char pathbuf[PBUFSIZ]; /* holds raw path of filenames */ + char *pathvec[PVECSIZ]; /* to point to names in pathbuf */ + char **pvec; /* holds usable tail of path vector */ + char *termpath; + + _nc_termcap[0] = '\0'; /* in case */ + dummy = NULL; + fname = pathvec; + pvec = pathvec; + p = pathbuf; + cp = getenv("TERMCAP"); + /* + * TERMCAP can have one of two things in it. It can be the + * name of a file to use instead of /etc/termcap. In this + * case it better start with a "/". Or it can be an entry to + * use so we don't have to read the file. In this case it + * has to already have the newlines crunched out. If TERMCAP + * does not hold a file name then a path of names is searched + * instead. The path is found in the TERMPATH variable, or + * becomes "$HOME/.termcap /etc/termcap" if no TERMPATH exists. + */ + if (!cp || *cp != '/') { /* no TERMCAP or it holds an entry */ + if ( (termpath = getenv("TERMPATH")) ) + strncpy(pathbuf, termpath, PBUFSIZ); + else { + if ( (home = getenv("HOME")) ) {/* set up default */ + strncpy(pathbuf, home, PBUFSIZ - 1); /* $HOME first */ + pathbuf[PBUFSIZ - 2] = '\0'; /* -2 because we add a slash */ + p += strlen(pathbuf); /* path, looking in */ + *p++ = '/'; + } /* if no $HOME look in current directory */ + strncpy(p, _PATH_DEF, PBUFSIZ - (p - pathbuf)); + } + } + else /* user-defined name in TERMCAP */ + strncpy(pathbuf, cp, PBUFSIZ); /* still can be tokenized */ + + /* For safety */ + if (issetugid()) + strcpy(pathbuf, _PATH_DEF_SEC); + + pathbuf[PBUFSIZ - 1] = '\0'; + + *fname++ = pathbuf; /* tokenize path into vector of names */ + while (*++p) + if (*p == ' ' || *p == ':') { + *p = '\0'; + while (*++p) + if (*p != ' ' && *p != ':') + break; + if (*p == '\0') + break; + *fname++ = p; + if (fname >= pathvec + PVECSIZ) { + fname--; + break; + } + } + *fname = (char *) 0; /* mark end of vector */ + if (cp && *cp && *cp != '/') + if (cgetset(cp) < 0) + return(-2); + + i = cgetent(&dummy, pathvec, (char *)name); + + if (i == 0) { + char *pd, *ps, *tok, *s, *tcs; + size_t len; + + pd = _nc_termcap; + ps = dummy; + if ((tok = strchr(ps, ':')) == NULL) { + len = strlen(ps); + if (len >= TBUFSIZ) + i = -1; + else + strcpy(pd, ps); + goto done; + } + len = tok - ps + 1; + if (pd + len + 1 - _nc_termcap >= TBUFSIZ) { + i = -1; + goto done; + } + memcpy(pd, ps, len); + ps += len; + pd += len; + *pd = '\0'; + tcs = pd - 1; + for (;;) { + while ((tok = strsep(&ps, ":")) != NULL && + (*tok == '\0' || *tok == '\\' || !isgraph(*tok))) + ; + if (tok == NULL) + break; + for (s = tcs; s != NULL && s[1] != '\0'; + s = strchr(s, ':')) { + s++; + if (s[0] == tok[0] && s[1] == tok[1]) + goto skip_it; + } + len = strlen(tok); + if (pd + len + 1 - _nc_termcap >= TBUFSIZ) { + i = -1; + break; + } + memcpy(pd, tok, len); + pd += len; + *pd++ = ':'; + *pd = '\0'; + skip_it: ; + } + } +done: + if (dummy) + free(dummy); + + +/* + * From here on is ncurses-specific glue code + */ + + if (i < 0) + return(ERR); + + _nc_set_source("TERMCAP"); + _nc_read_entry_source((FILE *)NULL, _nc_termcap, FALSE, FALSE,NULLHOOK); + + if (_nc_head == (ENTRY *)NULL) + return(ERR); + + /* resolve all use references */ + _nc_resolve_uses(); + + for_entry_list(ep) + if (_nc_name_match(ep->tterm.term_names, name, "|:")) + { + /* + * Make a local copy of the terminal capabilities. free + * all entry storage except the string table for the + * loaded type (which we disconnected from the list by + * NULLing out ep->tterm.str_table above). + */ + memcpy(tp, &ep->tterm, sizeof(TERMTYPE)); + ep->tterm.str_table = (char *)NULL; + _nc_free_entries(_nc_head); + _nc_head = _nc_tail = NULL; /* do not reuse! */ + + return 1; /* OK */ + } + + _nc_free_entries(_nc_head); + _nc_head = _nc_tail = NULL; /* do not reuse! */ + return(0); /* not found */ +} |