├── .gitignore ├── COPYING ├── GNUmakefile ├── README.md ├── genpc ├── infocmp ├── Makefile ├── infocmp.1 └── infocmp.c ├── install.sh ├── libcurses ├── EXAMPLES │ ├── Makefile │ ├── ex1.c │ └── view.c ├── GNUmakefile ├── Makefile ├── PSD.doc │ ├── Makefile │ ├── Master │ ├── appen.A │ ├── appen.B │ ├── appen.C │ ├── c_macros │ ├── doc.I │ ├── doc.II │ ├── doc.III │ ├── doc.IV │ ├── ex1.c │ ├── ex2.c │ ├── fns.doc │ ├── intro.0 │ ├── intro.1 │ ├── intro.2 │ ├── intro.3 │ ├── intro.4 │ ├── intro.5 │ ├── intro.6 │ ├── life.c │ ├── macros │ ├── twinkle1.c │ ├── twinkle2.c │ └── win_st.c ├── acs.c ├── add_wch.c ├── add_wchstr.c ├── addbytes.c ├── addch.3 ├── addch.c ├── addchnstr.3 ├── addchnstr.c ├── addchstr.3 ├── addnstr.3 ├── addnstr.c ├── addstr.3 ├── addwstr.c ├── assume_default_colors.3 ├── attr_get.3 ├── attr_off.3 ├── attr_on.3 ├── attr_set.3 ├── attributes.c ├── attroff.3 ├── attron.3 ├── attrset.3 ├── background.c ├── beep.3 ├── bell.c ├── bkgd.3 ├── bkgdset.3 ├── border.3 ├── border.c ├── box.3 ├── box.c ├── can_change_color.3 ├── cbreak.3 ├── cchar.c ├── chgat.3 ├── chgat.c ├── clear.3 ├── clear.c ├── clearok.3 ├── clearok.c ├── clrtobot.3 ├── clrtobot.c ├── clrtoeol.3 ├── clrtoeol.c ├── color.c ├── color_content.3 ├── color_set.3 ├── copywin.3 ├── copywin.c ├── cr_put.c ├── ctrace.c ├── cur_hash.c ├── curs_set.3 ├── curs_set.c ├── curses.3 ├── curses.c ├── curses.h ├── curses_addch.3 ├── curses_addchstr.3 ├── curses_addstr.3 ├── curses_attributes.3 ├── curses_background.3 ├── curses_border.3 ├── curses_cchar.3 ├── curses_chgat.3 ├── curses_clear.3 ├── curses_color.3 ├── curses_cursor.3 ├── curses_default_colors.3 ├── curses_delch.3 ├── curses_deleteln.3 ├── curses_echochar.3 ├── curses_fileio.3 ├── curses_inch.3 ├── curses_input.3 ├── curses_insch.3 ├── curses_insdelln.3 ├── curses_insertln.3 ├── curses_keyname.3 ├── curses_line.3 ├── curses_mouse.3 ├── curses_pad.3 ├── curses_print.3 ├── curses_private.h ├── curses_refresh.3 ├── curses_scanw.3 ├── curses_screen.3 ├── curses_scroll.3 ├── curses_slk.3 ├── curses_standout.3 ├── curses_termcap.3 ├── curses_touch.3 ├── curses_tty.3 ├── curses_underscore.3 ├── curses_version.3 ├── curses_window.3 ├── def_prog_mode.3 ├── def_shell_mode.3 ├── define_key.3 ├── delay_output.3 ├── delch.3 ├── delch.c ├── deleteln.3 ├── deleteln.c ├── delscreen.3 ├── delwin.3 ├── delwin.c ├── derwin.3 ├── doupdate.3 ├── dupwin.3 ├── echo.3 ├── echo_wchar.c ├── echochar.3 ├── echochar.c ├── endwin.3 ├── erase.3 ├── erase.c ├── erasechar.3 ├── fileio.c ├── fileio.h ├── filter.3 ├── flash.3 ├── flushinp.3 ├── flushok.3 ├── flushok.c ├── fullname.3 ├── fullname.c ├── genfileioh.awk ├── get_wch.c ├── get_wstr.c ├── getattrs.3 ├── getbegx.3 ├── getbegy.3 ├── getbkgd.3 ├── getcchar.3 ├── getch.3 ├── getch.c ├── getcurx.3 ├── getcury.3 ├── getmaxx.3 ├── getmaxy.3 ├── getmaxyx.3 ├── getnstr.3 ├── getparx.3 ├── getpary.3 ├── getparyx.3 ├── getstr.3 ├── getstr.c ├── getsyx.3 ├── gettmode.3 ├── getwin.3 ├── getyx.3 ├── getyx.c ├── halfdelay.3 ├── has_colors.3 ├── has_ic.3 ├── has_il.3 ├── has_key.3 ├── hline.3 ├── id_subwins.c ├── idcok.3 ├── idcok.c ├── idlok.3 ├── idlok.c ├── immedok.3 ├── immedok.c ├── in_wch.c ├── in_wchstr.c ├── inch.3 ├── inch.c ├── inchnstr.3 ├── inchstr.3 ├── inchstr.c ├── init_color.3 ├── init_pair.3 ├── initscr.3 ├── initscr.c ├── innstr.3 ├── ins_wch.c ├── ins_wstr.c ├── insch.3 ├── insch.c ├── insdelln.3 ├── insdelln.c ├── insertln.3 ├── insertln.c ├── insstr.c ├── instr.3 ├── instr.c ├── intrflush.3 ├── inwstr.c ├── is_keypad.3 ├── is_leaveok.3 ├── is_linetouched.3 ├── is_pad.3 ├── is_term_resized.3 ├── is_wintouched.3 ├── isendwin.3 ├── keymap.h ├── keyname.3 ├── keyname.c ├── keypad.3 ├── keypad.c ├── killchar.3 ├── leaveok.3 ├── leaveok.c ├── line.c ├── meta.3 ├── meta.c ├── mouse.c ├── move.3 ├── move.c ├── mvaddch.3 ├── mvaddchnstr.3 ├── mvaddchstr.3 ├── mvaddnstr.3 ├── mvaddstr.3 ├── mvchgat.3 ├── mvcur.3 ├── mvderwin.3 ├── mvgetch.3 ├── mvgetnstr.3 ├── mvgetstr.3 ├── mvhline.3 ├── mvinchnstr.3 ├── mvinchstr.3 ├── mvinnstr.3 ├── mvinsch.3 ├── mvinstr.3 ├── mvprintw.3 ├── mvvline.3 ├── mvwaddch.3 ├── mvwaddchnstr.3 ├── mvwaddchstr.3 ├── mvwaddnstr.3 ├── mvwaddstr.3 ├── mvwchgat.3 ├── mvwgetch.3 ├── mvwgetnstr.3 ├── mvwgetstr.3 ├── mvwhline.3 ├── mvwin.3 ├── mvwin.c ├── mvwinchnstr.3 ├── mvwinchstr.3 ├── mvwinnstr.3 ├── mvwinsch.3 ├── mvwinstr.3 ├── mvwprintw.3 ├── mvwvline.3 ├── napms.3 ├── newpad.3 ├── newterm.3 ├── newwin.3 ├── newwin.c ├── nl.3 ├── nocbreak.3 ├── nodelay.3 ├── nodelay.c ├── noecho.3 ├── nonl.3 ├── noqiflush.3 ├── noraw.3 ├── notimeout.3 ├── notimeout.c ├── overlay.3 ├── overlay.c ├── overwrite.3 ├── overwrite.c ├── pair_content.3 ├── pause.c ├── pechochar.3 ├── pnoutrefresh.3 ├── prefresh.3 ├── printw.3 ├── printw.c ├── putchar.c ├── putwin.3 ├── qiflush.3 ├── raw.3 ├── refresh.3 ├── refresh.c ├── reset_prog_mode.3 ├── reset_shell_mode.3 ├── resetty.3 ├── resize.c ├── resize_term.3 ├── resizeterm.3 ├── ripoffline.3 ├── ripoffline.c ├── savetty.3 ├── scanw.3 ├── scanw.c ├── screen.c ├── scrl.3 ├── scroll.3 ├── scroll.c ├── scrollok.3 ├── scrollok.c ├── set_escdelay.3 ├── set_tabsize.3 ├── set_term.3 ├── setcchar.3 ├── setscrreg.3 ├── setsyx.3 ├── setterm.3 ├── setterm.c ├── shlib_version ├── slk.c ├── slk_attr_off.3 ├── slk_attr_on.3 ├── slk_attr_set.3 ├── slk_attroff.3 ├── slk_attron.3 ├── slk_attrset.3 ├── slk_clear.3 ├── slk_color.3 ├── slk_init.3 ├── slk_label.3 ├── slk_noutrefresh.3 ├── slk_refresh.3 ├── slk_restore.3 ├── slk_set.3 ├── slk_touch.3 ├── slk_wset.3 ├── standend.3 ├── standout.3 ├── standout.c ├── start_color.3 ├── subpad.3 ├── subwin.3 ├── syncok.3 ├── syncok.c ├── timeout.3 ├── timeout.c ├── touchline.3 ├── toucholap.c ├── touchoverlap.3 ├── touchwin.3 ├── touchwin.c ├── tscroll.c ├── tstp.c ├── tty.c ├── typeahead.3 ├── unctrl.3 ├── unctrl.c ├── unctrl.h ├── underend.3 ├── underscore.3 ├── underscore.c ├── ungetch.3 ├── untouchwin.3 ├── use_default_colors.3 ├── use_env.3 ├── version.c ├── vline.3 ├── waddch.3 ├── waddchnstr.3 ├── waddchstr.3 ├── waddnstr.3 ├── waddstr.3 ├── wattr_get.3 ├── wattr_off.3 ├── wattr_on.3 ├── wattr_set.3 ├── wattroff.3 ├── wattron.3 ├── wattrset.3 ├── wbkgd.3 ├── wbkgdset.3 ├── wborder.3 ├── wchgat.3 ├── wclear.3 ├── wclrtobot.3 ├── wclrtoeol.3 ├── wcolor_set.3 ├── wcursyncup.3 ├── wdelch.3 ├── wdeleteln.3 ├── wechochar.3 ├── werase.3 ├── wgetch.3 ├── wgetnstr.3 ├── wgetstr.3 ├── whline.3 ├── winch.3 ├── winchnstr.3 ├── winchstr.3 ├── winnstr.3 ├── winsch.3 ├── winsdelln.3 ├── winsertln.3 ├── winstr.3 ├── wmove.3 ├── wnoutrefresh.3 ├── wprintw.3 ├── wrefresh.3 ├── wresize.3 ├── wscanw.3 ├── wscrl.3 ├── wsetscrreg.3 ├── wstandend.3 ├── wstandout.3 ├── wsyncup.3 ├── wtimeout.3 ├── wtouchln.3 ├── wunderend.3 ├── wunderscore.3 └── wvline.3 ├── libform ├── GNUmakefile ├── Makefile ├── current_field.3 ├── data_ahead.3 ├── data_behind.3 ├── driver.c ├── dup_field.3 ├── dynamic_field_info.3 ├── field.c ├── field_arg.3 ├── field_back.3 ├── field_buffer.3 ├── field_count.3 ├── field_fore.3 ├── field_index.3 ├── field_info.3 ├── field_init.3 ├── field_just.3 ├── field_opts.3 ├── field_opts_off.3 ├── field_opts_on.3 ├── field_pad.3 ├── field_status.3 ├── field_term.3 ├── field_type.3 ├── field_types.c ├── field_userptr.3 ├── form.3 ├── form.c ├── form.h ├── form_cursor.3 ├── form_data.3 ├── form_driver.3 ├── form_field.3 ├── form_field_attributes.3 ├── form_field_buffer.3 ├── form_field_info.3 ├── form_field_just.3 ├── form_field_new.3 ├── form_field_opts.3 ├── form_field_userptr.3 ├── form_field_validation.3 ├── form_fields.3 ├── form_fieldtype.3 ├── form_hook.3 ├── form_init.3 ├── form_max_page.3 ├── form_new.3 ├── form_new_page.3 ├── form_opts.3 ├── form_opts_off.3 ├── form_opts_on.3 ├── form_page.3 ├── form_post.3 ├── form_sub.3 ├── form_term.3 ├── form_userptr.3 ├── form_win.3 ├── forms.3 ├── free_field.3 ├── free_fieldtype.3 ├── free_form.3 ├── gdbinit ├── internals.c ├── internals.h ├── link_field.3 ├── link_fieldtype.3 ├── move_field.3 ├── new_field.3 ├── new_fieldtype.3 ├── new_form.3 ├── new_page.3 ├── pos_form_cursor.3 ├── post.c ├── post_form.3 ├── scale_form.3 ├── set_current_field.3 ├── set_field_back.3 ├── set_field_buffer.3 ├── set_field_fore.3 ├── set_field_init.3 ├── set_field_just.3 ├── set_field_opts.3 ├── set_field_pad.3 ├── set_field_printf.3 ├── set_field_status.3 ├── set_field_term.3 ├── set_field_type.3 ├── set_field_userptr.3 ├── set_fieldtype_arg.3 ├── set_fieldtype_choice.3 ├── set_form_fields.3 ├── set_form_init.3 ├── set_form_opts.3 ├── set_form_page.3 ├── set_form_sub.3 ├── set_form_term.3 ├── set_form_userptr.3 ├── set_form_win.3 ├── set_max_field.3 ├── set_new_page.3 ├── shlib_version ├── std_header.c ├── type_alnum.c ├── type_alpha.c ├── type_enum.c ├── type_integer.c ├── type_ipv4.c ├── type_ipv6.c ├── type_numeric.c ├── type_regex.c └── unpost_form.3 ├── libmenu ├── GNUmakefile ├── Makefile ├── attributes.c ├── current_item.3 ├── driver.c ├── eti.h ├── free_item.3 ├── free_menu.3 ├── internals.c ├── internals.h ├── item.c ├── item_count.3 ├── item_description.3 ├── item_index.3 ├── item_init.3 ├── item_name.3 ├── item_opts.3 ├── item_opts_off.3 ├── item_opts_on.3 ├── item_selected.3 ├── item_term.3 ├── item_userptr.3 ├── item_value.3 ├── item_visible.3 ├── menu.c ├── menu.h ├── menu_attributes.3 ├── menu_back.3 ├── menu_cursor.3 ├── menu_driver.3 ├── menu_fore.3 ├── menu_format.3 ├── menu_grey.3 ├── menu_hook.3 ├── menu_init.3 ├── menu_item_current.3 ├── menu_item_name.3 ├── menu_item_new.3 ├── menu_item_opts.3 ├── menu_item_userptr.3 ├── menu_item_value.3 ├── menu_item_visible.3 ├── menu_items.3 ├── menu_mark.3 ├── menu_new.3 ├── menu_opts.3 ├── menu_opts_off.3 ├── menu_opts_on.3 ├── menu_pad.3 ├── menu_pattern.3 ├── menu_post.3 ├── menu_sub.3 ├── menu_term.3 ├── menu_unmark.3 ├── menu_userptr.3 ├── menu_win.3 ├── menus.3 ├── new_item.3 ├── new_menu.3 ├── pos_menu_cursor.3 ├── post.c ├── post_menu.3 ├── scale_menu.3 ├── set_current_item.3 ├── set_item_init.3 ├── set_item_term.3 ├── set_item_userptr.3 ├── set_item_value.3 ├── set_menu_back.3 ├── set_menu_fore.3 ├── set_menu_format.3 ├── set_menu_grey.3 ├── set_menu_init.3 ├── set_menu_items.3 ├── set_menu_mark.3 ├── set_menu_opts.3 ├── set_menu_pad.3 ├── set_menu_sub.3 ├── set_menu_term.3 ├── set_menu_unmark.3 ├── set_menu_userptr.3 ├── set_menu_win.3 ├── set_top_row.3 ├── shlib_version ├── top_row.3 ├── unpost_menu.3 └── userptr.c ├── libpanel ├── GNUmakefile ├── Makefile ├── _deck.c ├── above.c ├── below.c ├── bottom.c ├── bottom_panel.3 ├── del.c ├── del_panel.3 ├── getuser.c ├── hidden.c ├── hide.c ├── hide_panel.3 ├── move.c ├── move_panel.3 ├── new.c ├── new_panel.3 ├── panel.3 ├── panel.h ├── panel_above.3 ├── panel_below.3 ├── panel_hidden.3 ├── panel_impl.h ├── panel_userptr.3 ├── panel_window.3 ├── replace.c ├── replace_panel.3 ├── replace_window.3 ├── set_panel_userptr.3 ├── setuser.c ├── shlib_version ├── show.c ├── show_panel.3 ├── top.c ├── top_panel.3 ├── update.c ├── update_panels.3 └── window.c ├── libterminfo ├── GNUmakefile ├── Makefile ├── Makefile.hash ├── cdbr.c ├── compile.c ├── curterm.c ├── del_curterm.3 ├── genhash ├── genman ├── genterms ├── genthash ├── longname.3 ├── mi_vector_hash.c ├── putp.3 ├── set_curterm.3 ├── setupterm.3 ├── setupterm.c ├── shlib_version ├── term.c ├── term.h ├── term_private.h ├── termcap.3 ├── termcap.c ├── termcap.h ├── termcap_map.c ├── terminfo.3 ├── terminfo.5.in ├── termname.3 ├── tgetent.3 ├── tgetflag.3 ├── tgetnum.3 ├── tgetstr.3 ├── tgoto.3 ├── ti.c ├── ti_getflag.3 ├── ti_getnum.3 ├── ti_getstr.3 ├── ti_putp.3 ├── ti_puts.3 ├── ti_setupterm.3 ├── ti_tiparm.3 ├── tigetflag.3 ├── tigetnum.3 ├── tigetstr.3 ├── tiparm.3 ├── tparm.3 ├── tparm.c ├── tputs.3 └── tputs.c ├── nbperf ├── GNUmakefile ├── Makefile ├── graph2.c ├── graph2.h ├── graph3.c ├── graph3.h ├── mi_vector_hash.c ├── nbperf-bdz.c ├── nbperf-chm.c ├── nbperf-chm3.c ├── nbperf.1 ├── nbperf.c └── nbperf.h ├── netbsd_sys ├── cdbr.h ├── cdefs.h ├── emalloc.h ├── endian.h └── queue.h ├── tabs ├── Makefile ├── tabs.1 └── tabs.c ├── terminfo ├── Makefile └── terminfo ├── tic ├── GNUmakefile ├── Makefile ├── cdbw.c ├── cdbw.h ├── compile.c ├── mi_vector_hash.c ├── tic.1 └── tic.c ├── tput ├── GNUmakefile ├── Makefile ├── clear.1 ├── clear.sh ├── tput.1 └── tput.c └── tset ├── GNUmakefile ├── Makefile ├── extern.h ├── map.c ├── misc.c ├── reset.1 ├── set.c ├── term.c ├── tset.1 └── tset.c /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.ho 4 | *.so 5 | *.a 6 | *.xz 7 | infocmp/infocmp 8 | tabs/tabs 9 | nbperf/nbperf 10 | tic/tic 11 | tic/host_tic 12 | tic/hash.c 13 | tput/tput 14 | tset/tset 15 | config.mak 16 | terminfo/terminfo.cdb 17 | libterminfo/compiled_terms.c 18 | libterminfo/termcap_hash.c 19 | libterminfo/hash.c 20 | -------------------------------------------------------------------------------- /genpc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cat << EOF 3 | Name: $1 4 | Description: $2 5 | Version: 5.9 6 | Requires: 7 | Conflicts: 8 | Libs: $3 9 | Cflags: 10 | EOF 11 | -------------------------------------------------------------------------------- /infocmp/Makefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.2 2013/08/11 06:48:46 dholland Exp $ 2 | 3 | PROG= infocmp 4 | 5 | CPPFLAGS+= -I${.CURDIR}/../../lib/libterminfo 6 | LDADD+= -lterminfo 7 | DPADD+= ${LIBTERMINFO} 8 | 9 | .include 10 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This is an actually-safe install command which installs the new 4 | # file atomically in the new location, rather than overwriting 5 | # existing files. 6 | # 7 | 8 | usage() { 9 | printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2 10 | exit 1 11 | } 12 | 13 | mkdirp= 14 | symlink= 15 | mode=755 16 | 17 | while getopts Dlm: name ; do 18 | case "$name" in 19 | D) mkdirp=yes ;; 20 | l) symlink=yes ;; 21 | m) mode=$OPTARG ;; 22 | ?) usage ;; 23 | esac 24 | done 25 | shift $(($OPTIND - 1)) 26 | 27 | test "$#" -eq 2 || usage 28 | src=$1 29 | dst=$2 30 | tmp="$dst.tmp.$$" 31 | 32 | case "$dst" in 33 | */) printf "%s: %s ends in /\n", "$0" "$dst" 1>&2 ; exit 1 ;; 34 | esac 35 | 36 | set -C 37 | set -e 38 | 39 | if test "$mkdirp" ; then 40 | umask 022 41 | case "$2" in 42 | */*) mkdir -p "${dst%/*}" ;; 43 | esac 44 | fi 45 | 46 | trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP 47 | 48 | umask 077 49 | 50 | if test "$symlink" ; then 51 | ln -s "$1" "$tmp" 52 | else 53 | cat < "$1" > "$tmp" 54 | chmod "$mode" "$tmp" 55 | fi 56 | 57 | mv -f "$tmp" "$2" 58 | test -d "$2" && { 59 | rm -f "$2/$tmp" 60 | printf "%s: %s is a directory\n" "$0" "$dst" 1>&2 61 | exit 1 62 | } 63 | 64 | exit 0 65 | -------------------------------------------------------------------------------- /libcurses/EXAMPLES/Makefile: -------------------------------------------------------------------------------- 1 | #$Id: Makefile,v 1.2 2007/05/28 15:01:58 blymn Exp $ 2 | #$Log: Makefile,v $ 3 | #Revision 1.2 2007/05/28 15:01:58 blymn 4 | #Merge in wide curses code done as a Summer of Code project by 5 | #Ruibiao Qiu. 6 | # 7 | #Revision 1.1.2.2 2007/01/31 10:08:47 blymn 8 | #Fix up build errors. 9 | # 10 | #Revision 1.1.2.1 2007/01/21 12:05:54 blymn 11 | #Merge wide curses. 12 | # 13 | #Revision 1.1 2007/01/21 11:38:59 blymn 14 | #Wide curses merge 15 | # 16 | #Revision 1.1 2005/08/31 14:52:08 ruibiao 17 | # 18 | #A patach for the current source 19 | # 20 | #Revision 1.2 2005/08/23 21:29:08 ruibiao 21 | # 22 | #Changed to the right libraries 23 | # 24 | #Revision 1.1 2005/08/23 16:38:22 ruibiao 25 | # 26 | #Initial version, to build all versions of file views and the unit tester 27 | # 28 | 29 | RM = /bin/rm -f 30 | CFLAGS = 31 | 32 | .if defined(DEBUG) 33 | CFLAGS+= -g 34 | .endif 35 | 36 | all: wcview nwview ccview tcview ncview ex1 37 | 38 | wcview: view.c 39 | gcc -DHAVE_WCHAR -o wcview view.c -I.. $(CFLAGS) -lcurses -Wl,-rpath,.. -L.. 40 | 41 | nwview: view.c 42 | gcc -DHAVE_WCHAR -o nwview view.c -DNCURSES -I/usr/pkg/include $(CFLAGS) -lcurses -Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib 43 | 44 | ccview: view.c 45 | gcc -o ccview view.c -I.. $(CFLAGS) -lcurses -Wl,-rpath,.. -L.. 46 | 47 | tcview: view.c 48 | gcc -o tcview view.c -L/usr/lib -Wl,-rpath,/usr/lib $(CFLAGS) -lcurses 49 | 50 | ncview: view.c 51 | gcc -o ncview view.c -I/usr/pkg/include -DNCURSES -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib $(CFLAGS) -lncurses 52 | 53 | ex1: ex1.c 54 | gcc -DHAVE_WCHAR -o ex1 ex1.c -I.. $(CFLAGS) -lcurses -Wl,-rpath,.. -L.. 55 | -------------------------------------------------------------------------------- /libcurses/EXAMPLES/ex1.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabotage-linux/netbsd-curses/51d179dad861640caeb76674b5908ccd79f04fae/libcurses/EXAMPLES/ex1.c -------------------------------------------------------------------------------- /libcurses/PSD.doc/Makefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.14 2014/07/15 13:27:58 christos Exp $ 2 | # from: @(#)Makefile 8.2 (Berkeley) 5/23/94 3 | 4 | SECTION=reference/ref3 5 | ARTICLE=curses 6 | SRCS= Master 7 | CEXAMPLES= ex1.gr ex2.gr life.gr twinkle1.gr twinkle2.gr win_st.gr 8 | DEPSRCS=appen.A appen.B appen.C doc.I doc.II doc.III doc.IV fns.doc \ 9 | intro.0 intro.1 intro.2.tbl intro.3 intro.4 intro.5 intro.6 \ 10 | macros c_macros $(CEXAMPLES) 11 | MACROS= -me 12 | CLEANFILES+= ${CEXAMPLES} intro.2.tbl 13 | 14 | .SUFFIXES: 15 | .SUFFIXES: .c .gr 16 | 17 | # 18 | # this section formats C input source into nice troffable (or nroffable) 19 | # versions. It uses the capabilites of "vgrind", which sets keywords in 20 | # bold font, and comments in italics. 21 | # 22 | 23 | # Don't re-run vgrind unless you want to patch the output files. 24 | 25 | .c.gr: 26 | ${TOOL_VFONTEDPR} ${.IMPSRC} | grep -v "^'wh" > ${.TARGET} 27 | 28 | # Unfortunately our make doesn't handle single-suffix rules. 29 | intro.2.tbl: intro.2 30 | ${TOOL_TBL} ${.ALLSRC} > ${.TARGET} 31 | 32 | .include 33 | -------------------------------------------------------------------------------- /libcurses/PSD.doc/Master: -------------------------------------------------------------------------------- 1 | .\" $NetBSD: Master,v 1.5 2003/08/07 16:44:26 agc Exp $ 2 | .\" 3 | .\" Copyright (c) 1980, 1993 4 | .\" The Regents of the University of California. All rights reserved. 5 | .\" 6 | .\" Redistribution and use in source and binary forms, with or without 7 | .\" modification, are permitted provided that the following conditions 8 | .\" are met: 9 | .\" 1. Redistributions of source code must retain the above copyright 10 | .\" notice, this list of conditions and the following disclaimer. 11 | .\" 2. Redistributions in binary form must reproduce the above copyright 12 | .\" notice, this list of conditions and the following disclaimer in the 13 | .\" documentation and/or other materials provided with the distribution. 14 | .\" 3. Neither the name of the University nor the names of its contributors 15 | .\" may be used to endorse or promote products derived from this software 16 | .\" without specific prior written permission. 17 | .\" 18 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | .\" SUCH DAMAGE. 29 | .\" 30 | .\" @(#)Master 8.2 (Berkeley) 5/24/94 31 | .\" 32 | .ds Ln Screen Package 33 | .so macros 34 | .so c_macros 35 | .so intro.0 36 | .pn 3 37 | .bp 38 | .so intro.1 39 | .so intro.2.tbl 40 | .so intro.3 41 | .so intro.4 42 | .so intro.5 43 | .so intro.6 44 | .bp 45 | .so appen.A 46 | .pn 2 47 | .oh '\*(Ln''PSD:19-%' 48 | .eh 'PSD:19-%''\*(Ln' 49 | .bp 50 | .bi Contents 51 | .sp 52 | .xp 53 | -------------------------------------------------------------------------------- /libcurses/PSD.doc/c_macros: -------------------------------------------------------------------------------- 1 | .\" $NetBSD: c_macros,v 1.5 2003/08/07 16:44:26 agc Exp $ 2 | .\" 3 | .\" Copyright (c) 1980, 1993 4 | .\" The Regents of the University of California. All rights reserved. 5 | .\" 6 | .\" Redistribution and use in source and binary forms, with or without 7 | .\" modification, are permitted provided that the following conditions 8 | .\" are met: 9 | .\" 1. Redistributions of source code must retain the above copyright 10 | .\" notice, this list of conditions and the following disclaimer. 11 | .\" 2. Redistributions in binary form must reproduce the above copyright 12 | .\" notice, this list of conditions and the following disclaimer in the 13 | .\" documentation and/or other materials provided with the distribution. 14 | .\" 3. Neither the name of the University nor the names of its contributors 15 | .\" may be used to endorse or promote products derived from this software 16 | .\" without specific prior written permission. 17 | .\" 18 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | .\" SUCH DAMAGE. 29 | .\" 30 | .\" @(#)c_macros 8.1 (Berkeley) 6/4/93 31 | .\" 32 | 'ie t 'ds _ \d\(mi\u 33 | 'el 'ds _ _ 34 | 'tr *\(** 35 | 'ps 9p 36 | 'vs 10p 37 | 'ds - \(mi 38 | 'ds /* \\h'\\w' 'u-\\w'/'u'/* 39 | 'bd B 3 40 | 'bd S B 3 41 | 'nr cm 0 42 | 'nf 43 | 'de () 44 | 'pn 1 45 | .. 46 | 'de +C 47 | 'nr cm 1 48 | 'ft 2 49 | 'ds +K 50 | 'ds -K 51 | .. 52 | 'de -C 53 | 'nr cm 0 54 | 'ft 1 55 | .ie t 'ds +K \f3 56 | .el 'ds +K \fI 57 | 'ds -K \fP 58 | .. 59 | '+C 60 | '-C 61 | 'am +C 62 | 'ne 3 63 | .. 64 | 'de -F 65 | 'rm =f 66 | .. 67 | 'ft 1 68 | 'lg 0 69 | -------------------------------------------------------------------------------- /libcurses/PSD.doc/intro.6: -------------------------------------------------------------------------------- 1 | .\" $NetBSD: intro.6,v 1.6 2003/08/07 16:44:28 agc Exp $ 2 | .\" 3 | .\" Copyright (c) 1980, 1993 4 | .\" The Regents of the University of California. All rights reserved. 5 | .\" 6 | .\" Redistribution and use in source and binary forms, with or without 7 | .\" modification, are permitted provided that the following conditions 8 | .\" are met: 9 | .\" 1. Redistributions of source code must retain the above copyright 10 | .\" notice, this list of conditions and the following disclaimer. 11 | .\" 2. Redistributions in binary form must reproduce the above copyright 12 | .\" notice, this list of conditions and the following disclaimer in the 13 | .\" documentation and/or other materials provided with the distribution. 14 | .\" 3. Neither the name of the University nor the names of its contributors 15 | .\" may be used to endorse or promote products derived from this software 16 | .\" without specific prior written permission. 17 | .\" 18 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | .\" SUCH DAMAGE. 29 | .\" 30 | .\" @(#)intro.6 8.1 (Berkeley) 6/4/93 31 | .\" 32 | .sh 1 "The Functions" 33 | .pp 34 | In the following definitions, 35 | .q \*m 36 | means that if 37 | .Vn _CURSES_USE_MACROS 38 | is defined, the 39 | .q function 40 | is really a 41 | .q #define 42 | macro with arguments. 43 | .ta 11m 17m 25m 33m 41m 49m 57m 65m 73m 44 | .so fns.doc 45 | -------------------------------------------------------------------------------- /libcurses/PSD.doc/win_st.c: -------------------------------------------------------------------------------- 1 | .\" $NetBSD: win_st.c,v 1.5 2003/08/07 16:44:29 agc Exp $ 2 | .\" 3 | .\" Copyright (c) 1980, 1993 4 | .\" The Regents of the University of California. All rights reserved. 5 | .\" 6 | .\" Redistribution and use in source and binary forms, with or without 7 | .\" modification, are permitted provided that the following conditions 8 | .\" are met: 9 | .\" 1. Redistributions of source code must retain the above copyright 10 | .\" notice, this list of conditions and the following disclaimer. 11 | .\" 2. Redistributions in binary form must reproduce the above copyright 12 | .\" notice, this list of conditions and the following disclaimer in the 13 | .\" documentation and/or other materials provided with the distribution. 14 | .\" 3. Neither the name of the University nor the names of its contributors 15 | .\" may be used to endorse or promote products derived from this software 16 | .\" without specific prior written permission. 17 | .\" 18 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | .\" SUCH DAMAGE. 29 | .\" 30 | .\" @(#)win_st.c 8.1 (Berkeley) 6/8/93 31 | .\" 32 | # define WINDOW struct _win_st 33 | 34 | struct _win_st { 35 | short _cury, _curx; 36 | short _maxy, _maxx; 37 | short _begy, _begx; 38 | short _flags; 39 | short _ch_off; 40 | bool _clear; 41 | bool _leave; 42 | bool _scroll; 43 | char **_y; 44 | short *_firstch; 45 | short *_lastch; 46 | struct _win_st *_nextp, *_orig; 47 | }; 48 | 49 | # define _ENDLINE 001 50 | # define _FULLWIN 002 51 | # define _SCROLLWIN 004 52 | # define _FLUSH 010 53 | # define _FULLLINE 020 54 | # define _IDLINE 040 55 | # define _STANDOUT 0200 56 | # define _NOCHANGE -1 57 | -------------------------------------------------------------------------------- /libcurses/addch.3: -------------------------------------------------------------------------------- 1 | curses_addch.3 -------------------------------------------------------------------------------- /libcurses/addchnstr.3: -------------------------------------------------------------------------------- 1 | curses_addchstr.3 -------------------------------------------------------------------------------- /libcurses/addchstr.3: -------------------------------------------------------------------------------- 1 | curses_addchstr.3 -------------------------------------------------------------------------------- /libcurses/addnstr.3: -------------------------------------------------------------------------------- 1 | curses_addstr.3 -------------------------------------------------------------------------------- /libcurses/addstr.3: -------------------------------------------------------------------------------- 1 | curses_addstr.3 -------------------------------------------------------------------------------- /libcurses/assume_default_colors.3: -------------------------------------------------------------------------------- 1 | curses_default_colors.3 -------------------------------------------------------------------------------- /libcurses/attr_get.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/attr_off.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/attr_on.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/attr_set.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/attroff.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/attron.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/attrset.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/beep.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/bkgd.3: -------------------------------------------------------------------------------- 1 | curses_background.3 -------------------------------------------------------------------------------- /libcurses/bkgdset.3: -------------------------------------------------------------------------------- 1 | curses_background.3 -------------------------------------------------------------------------------- /libcurses/border.3: -------------------------------------------------------------------------------- 1 | curses_border.3 -------------------------------------------------------------------------------- /libcurses/box.3: -------------------------------------------------------------------------------- 1 | curses_border.3 -------------------------------------------------------------------------------- /libcurses/box.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: box.c,v 1.15 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1981, 1993, 1994 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | 36 | /* 37 | * box -- 38 | * Draw a box around the given window with "vert" as the vertical 39 | * delimiting char, and "hor", as the horizontal one. Uses wborder(). 40 | */ 41 | int 42 | box(WINDOW *win, chtype vert, chtype hor) 43 | { 44 | return (wborder(win, vert, vert, hor, hor, 0, 0, 0, 0)); 45 | } 46 | 47 | int 48 | box_set(WINDOW *win, const cchar_t *verch, const cchar_t *horch) 49 | { 50 | #ifndef HAVE_WCHAR 51 | return ERR; 52 | #else 53 | return wborder_set(win, verch, verch, horch, horch, 54 | NULL, NULL, NULL, NULL); 55 | #endif /* HAVE_WCHAR */ 56 | } 57 | -------------------------------------------------------------------------------- /libcurses/can_change_color.3: -------------------------------------------------------------------------------- 1 | curses_color.3 -------------------------------------------------------------------------------- /libcurses/cbreak.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/chgat.3: -------------------------------------------------------------------------------- 1 | curses_chgat.3 -------------------------------------------------------------------------------- /libcurses/clear.3: -------------------------------------------------------------------------------- 1 | curses_clear.3 -------------------------------------------------------------------------------- /libcurses/clear.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: clear.c,v 1.13 2003/08/07 16:44:19 agc Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1981, 1993, 1994 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | #ifndef _CURSES_USE_MACROS 38 | 39 | /* 40 | * clear -- 41 | * Clear stdscr 42 | */ 43 | int 44 | clear(void) 45 | { 46 | return wclear(_cursesi_screen->stdscr); 47 | } 48 | 49 | #endif 50 | 51 | /* 52 | * wclear -- 53 | * Clear the window. 54 | */ 55 | int 56 | wclear(WINDOW *win) 57 | { 58 | if (werase(win) == OK) { 59 | win->flags |= __CLEAROK; 60 | return (OK); 61 | } 62 | return (ERR); 63 | } 64 | -------------------------------------------------------------------------------- /libcurses/clearok.3: -------------------------------------------------------------------------------- 1 | curses_clear.3 -------------------------------------------------------------------------------- /libcurses/clearok.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: clearok.c,v 1.5 2008/04/28 20:23:01 martin Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. 5 | * All rights reserved. 6 | * 7 | * This code is derived from software contributed to The NetBSD Foundation 8 | * by Julian Coleman. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | /* 38 | * clearok -- 39 | * Turn on and off clear before refresh for the given window. 40 | */ 41 | int 42 | clearok(WINDOW *win, bool bf) 43 | { 44 | if (bf) 45 | win->flags |= __CLEAROK; 46 | else 47 | win->flags &= ~__CLEAROK; 48 | return (OK); 49 | } 50 | -------------------------------------------------------------------------------- /libcurses/clrtobot.3: -------------------------------------------------------------------------------- 1 | curses_clear.3 -------------------------------------------------------------------------------- /libcurses/clrtoeol.3: -------------------------------------------------------------------------------- 1 | curses_clear.3 -------------------------------------------------------------------------------- /libcurses/color_content.3: -------------------------------------------------------------------------------- 1 | curses_color.3 -------------------------------------------------------------------------------- /libcurses/color_set.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/copywin.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/cur_hash.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: cur_hash.c,v 1.13 2017/01/06 09:14:07 roy Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1992, 1993 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include 35 | 36 | #include "curses.h" 37 | #include "curses_private.h" 38 | 39 | /* 40 | * __hash_more() is "hashpjw" from the Dragon Book, Aho, Sethi & Ullman, p.436. 41 | */ 42 | unsigned int 43 | __hash_more(const void *v_s, size_t len, unsigned int h) 44 | { 45 | unsigned int g; 46 | size_t i = 0; 47 | const char *s = v_s; 48 | 49 | while (i < len) { 50 | h = (h << 4) + s[i]; 51 | if ((g = h & 0xf0000000) != 0) { 52 | h = h ^ (g >> 24); 53 | h = h ^ g; 54 | } 55 | i++; 56 | } 57 | return h; 58 | } 59 | -------------------------------------------------------------------------------- /libcurses/curs_set.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/curses_version.3: -------------------------------------------------------------------------------- 1 | .\" $NetBSD: curses_version.3,v 1.1 2019/09/02 09:08:29 roy Exp $ 2 | .\" 3 | .\" Copyright (c) 2019 The NetBSD Foundation, Inc. 4 | .\" All rights reserved. 5 | .\" 6 | .\" This code is derived from software contributed to The NetBSD Foundation 7 | .\" by Roy Marples. 8 | .\" 9 | .\" Redistribution and use in source and binary forms, with or without 10 | .\" modification, are permitted provided that the following conditions 11 | .\" are met: 12 | .\" 1. Redistributions of source code must retain the above copyright 13 | .\" notice, this list of conditions and the following disclaimer. 14 | .\" 2. Redistributions in binary form must reproduce the above copyright 15 | .\" notice, this list of conditions and the following disclaimer in the 16 | .\" documentation and/or other materials provided with the distribution. 17 | .\" 18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | .\" POSSIBILITY OF SUCH DAMAGE. 29 | .\" 30 | .\" 31 | .Dd August 29, 2019 32 | .Dt CURSES_VERSION 3 33 | .Os 34 | .Sh NAME 35 | .Nm curses_version 36 | .Nd Curses version information 37 | .Sh LIBRARY 38 | .Lb libcurses 39 | .Sh SYNOPSIS 40 | .In curses.h 41 | .Ft const char * 42 | .Fn curses_version "void" 43 | .Sh DESCRIPTION 44 | The 45 | .Fn curses_version 46 | function returns a read-only string representing the version of the 47 | .Nx 48 | curses library. 49 | This has no relation to the 50 | .Nx 51 | release it might have been taken from. 52 | .Sh SEE ALSO 53 | .Xr curses 3 54 | .Sh HISTORY 55 | The 56 | .Fn curses_version 57 | function is a 58 | .Em ncurses 59 | extension to the Curses library and was added in 60 | .Nx 10.0 . 61 | -------------------------------------------------------------------------------- /libcurses/def_prog_mode.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/def_shell_mode.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/define_key.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/delay_output.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/delch.3: -------------------------------------------------------------------------------- 1 | curses_delch.3 -------------------------------------------------------------------------------- /libcurses/deleteln.3: -------------------------------------------------------------------------------- 1 | curses_deleteln.3 -------------------------------------------------------------------------------- /libcurses/deleteln.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: deleteln.c,v 1.15 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1981, 1993, 1994 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | #ifndef _CURSES_USE_MACROS 38 | /* 39 | * deleteln -- 40 | * Delete a line from stdscr. It leaves (cury, curx) unchanged. 41 | */ 42 | int 43 | deleteln(void) 44 | { 45 | return winsdelln(stdscr, -1); 46 | } 47 | 48 | #endif 49 | 50 | /* 51 | * wdeleteln -- 52 | * Delete a line from the screen. It leaves (cury, curx) unchanged. 53 | */ 54 | int 55 | wdeleteln(WINDOW *win) 56 | { 57 | return winsdelln(win, -1); 58 | } 59 | -------------------------------------------------------------------------------- /libcurses/delscreen.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/delwin.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/derwin.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/doupdate.3: -------------------------------------------------------------------------------- 1 | curses_refresh.3 -------------------------------------------------------------------------------- /libcurses/dupwin.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/echo.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/echochar.3: -------------------------------------------------------------------------------- 1 | curses_echochar.3 -------------------------------------------------------------------------------- /libcurses/endwin.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/erase.3: -------------------------------------------------------------------------------- 1 | curses_clear.3 -------------------------------------------------------------------------------- /libcurses/erasechar.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/fileio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Do not edit! Automatically generated file: 3 | * from: NetBSD: shlib_version,v 1.43 2018/11/16 10:12:00 blymn Exp 4 | * by : NetBSD: genfileioh.awk,v 1.2 2008/05/02 11:13:02 martin Exp 5 | */ 6 | 7 | #define CURSES_LIB_MAJOR 8 8 | #define CURSES_LIB_MINOR 2 9 | -------------------------------------------------------------------------------- /libcurses/filter.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/flash.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/flushinp.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/flushok.3: -------------------------------------------------------------------------------- 1 | curses_refresh.3 -------------------------------------------------------------------------------- /libcurses/flushok.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: flushok.c,v 1.6 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. 5 | * All rights reserved. 6 | * 7 | * This code is derived from software contributed to The NetBSD Foundation 8 | * by Julian Coleman. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | /* 38 | * flushok -- 39 | * Turn on and off Fflush(stdout) after refresh for the given window. 40 | */ 41 | int 42 | flushok(WINDOW *win, bool bf) 43 | { 44 | if (bf) 45 | win->flags |= __FLUSH; 46 | else 47 | win->flags &= ~__FLUSH; 48 | return OK; 49 | } 50 | -------------------------------------------------------------------------------- /libcurses/fullname.3: -------------------------------------------------------------------------------- 1 | curses_termcap.3 -------------------------------------------------------------------------------- /libcurses/fullname.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: fullname.c,v 1.12 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1981, 1993 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | 36 | /* 37 | * fullname -- 38 | * This routine fills in "def" with the full name of the terminal. 39 | * This is assumed to be the last name in the list of aliases. 40 | */ 41 | char * 42 | fullname(const char *bp, char *def) 43 | { 44 | char *cp; 45 | 46 | *def = '\0'; /* In case no name. */ 47 | 48 | while (*bp && *bp != ':') { 49 | cp = def; /* Start of answer. */ 50 | while (*bp && *bp != ':' && *bp != '|') 51 | *cp++ = *bp++; /* Copy name over. */ 52 | *cp = '\0'; /* Zero end of name. */ 53 | if (*bp == '|') 54 | bp++; /* Skip over '|' if that is case. */ 55 | } 56 | return def; 57 | } 58 | -------------------------------------------------------------------------------- /libcurses/getattrs.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/getbegx.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/getbegy.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/getbkgd.3: -------------------------------------------------------------------------------- 1 | curses_background.3 -------------------------------------------------------------------------------- /libcurses/getcchar.3: -------------------------------------------------------------------------------- 1 | curses_cchar.3 -------------------------------------------------------------------------------- /libcurses/getch.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/getcurx.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/getcury.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/getmaxx.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/getmaxy.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/getmaxyx.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/getnstr.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/getparx.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/getpary.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/getparyx.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/getstr.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/getsyx.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/gettmode.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/getwin.3: -------------------------------------------------------------------------------- 1 | curses_fileio.3 -------------------------------------------------------------------------------- /libcurses/getyx.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/halfdelay.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/has_colors.3: -------------------------------------------------------------------------------- 1 | curses_color.3 -------------------------------------------------------------------------------- /libcurses/has_ic.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/has_il.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/has_key.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/hline.3: -------------------------------------------------------------------------------- 1 | curses_line.3 -------------------------------------------------------------------------------- /libcurses/id_subwins.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: id_subwins.c,v 1.14 2009/07/22 16:57:14 roy Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1981, 1993, 1994 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | /* 38 | * __id_subwins -- 39 | * Re-sync the pointers to lines for all the subwindows. 40 | */ 41 | void 42 | __id_subwins(WINDOW *orig) 43 | { 44 | WINDOW *win; 45 | int oy, y; 46 | 47 | for (win = orig->nextp; win != orig; win = win->nextp) { 48 | oy = win->begy - orig->begy; 49 | for (y = 0; y < win->maxy; y++) 50 | win->alines[y]->line = 51 | &orig->alines[oy + y]->line[win->ch_off]; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /libcurses/idcok.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/idcok.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: idcok.c,v 1.2 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1998-1999 Brett Lymn (blymn@baea.com.au, brett_lymn@yahoo.com) 5 | * All rights reserved. 6 | * 7 | * This software has been donated to the NetBSD Foundation by the 8 | * Author. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | /* 38 | * idcok -- 39 | * Turn on and off using insert/delete char sequences for the 40 | * given window. Note, currently, the ic/dc capabilities are not 41 | * used, this function is only provided for compatibility. 42 | */ 43 | int 44 | idcok(WINDOW *win, bool bf) 45 | { 46 | if (bf) 47 | win->flags |= __IDCHAR; 48 | else 49 | win->flags &= ~__IDCHAR; 50 | return OK; 51 | } 52 | -------------------------------------------------------------------------------- /libcurses/idlok.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/idlok.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: idlok.c,v 1.12 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1981, 1993, 1994 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | /* 38 | * idlok -- 39 | * Turn on and off using insert/deleteln sequences for the 40 | * given window. 41 | */ 42 | int 43 | idlok(WINDOW *win, bool bf) 44 | { 45 | if (bf) 46 | win->flags |= __IDLINE; 47 | else 48 | win->flags &= ~__IDLINE; 49 | return OK; 50 | } 51 | -------------------------------------------------------------------------------- /libcurses/immedok.3: -------------------------------------------------------------------------------- 1 | curses_refresh.3 -------------------------------------------------------------------------------- /libcurses/immedok.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: immedok.c,v 1.2 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 2017 The NetBSD Foundation, Inc. 5 | * All rights reserved. 6 | * 7 | * This code is derived from software contributed to The NetBSD Foundation 8 | * by Roy Marples. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include "curses.h" 33 | #include "curses_private.h" 34 | 35 | /* 36 | * immedok -- 37 | * Refresh the window when changed. 38 | */ 39 | int 40 | immedok(WINDOW *win, bool bf) 41 | { 42 | if (bf) 43 | win->flags |= __IMMEDOK; 44 | else 45 | win->flags &= ~__IMMEDOK; 46 | return OK; 47 | } 48 | -------------------------------------------------------------------------------- /libcurses/inch.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/inchnstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/inchstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/init_color.3: -------------------------------------------------------------------------------- 1 | curses_color.3 -------------------------------------------------------------------------------- /libcurses/init_pair.3: -------------------------------------------------------------------------------- 1 | curses_color.3 -------------------------------------------------------------------------------- /libcurses/initscr.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/innstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/insch.3: -------------------------------------------------------------------------------- 1 | curses_insch.3 -------------------------------------------------------------------------------- /libcurses/insdelln.3: -------------------------------------------------------------------------------- 1 | curses_insdelln.3 -------------------------------------------------------------------------------- /libcurses/insertln.3: -------------------------------------------------------------------------------- 1 | curses_insertln.3 -------------------------------------------------------------------------------- /libcurses/insertln.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: insertln.c,v 1.14 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1981, 1993, 1994 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | #ifndef _CURSES_USE_MACROS 38 | 39 | /* 40 | * insertln -- 41 | * Do an insert-line on stdscr, leaving (cury, curx) unchanged. 42 | */ 43 | int 44 | insertln(void) 45 | { 46 | 47 | return winsdelln(stdscr, 1); 48 | } 49 | 50 | #endif 51 | 52 | /* 53 | * winsertln -- 54 | * Do an insert-line on the window, leaving (cury, curx) unchanged. 55 | */ 56 | int 57 | winsertln(WINDOW *win) 58 | { 59 | 60 | return winsdelln(win, 1); 61 | } 62 | -------------------------------------------------------------------------------- /libcurses/instr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/intrflush.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/is_keypad.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/is_leaveok.3: -------------------------------------------------------------------------------- 1 | curses_refresh.3 -------------------------------------------------------------------------------- /libcurses/is_linetouched.3: -------------------------------------------------------------------------------- 1 | curses_touch.3 -------------------------------------------------------------------------------- /libcurses/is_pad.3: -------------------------------------------------------------------------------- 1 | curses_pad.3 -------------------------------------------------------------------------------- /libcurses/is_term_resized.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/is_wintouched.3: -------------------------------------------------------------------------------- 1 | curses_touch.3 -------------------------------------------------------------------------------- /libcurses/isendwin.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/keyname.3: -------------------------------------------------------------------------------- 1 | curses_keyname.3 -------------------------------------------------------------------------------- /libcurses/keypad.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/keypad.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: keypad.c,v 1.14 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1998-1999 Brett Lymn (blymn@baea.com.au, brett_lymn@yahoo.com) 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. The name of the author may not be used to endorse or promote products 13 | * derived from this software without specific prior written permission 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | * 27 | */ 28 | 29 | #include 30 | 31 | #include "curses.h" 32 | #include "curses_private.h" 33 | 34 | /* 35 | * keypad -- 36 | * Turn on and off interpretation of function/keypad keys in the 37 | * given window. 38 | */ 39 | int 40 | keypad(WINDOW *win, bool bf) 41 | { 42 | #ifdef DEBUG 43 | __CTRACE(__CTRACE_MISC, 44 | "keypad: win %p, %s\n", win, bf ? "TRUE" : "FALSE"); 45 | #endif 46 | if (bf) { 47 | win->flags |= __KEYPAD; 48 | if (!(curscr->flags & __KEYPAD)) { 49 | tputs(keypad_xmit, 0, __cputchar); 50 | curscr->flags |= __KEYPAD; 51 | } 52 | } else 53 | win->flags &= ~__KEYPAD; 54 | 55 | return OK; 56 | } 57 | 58 | /* 59 | * is_keypad -- 60 | * Return true if window is set for keypad. 61 | */ 62 | bool 63 | is_keypad(const WINDOW *win) 64 | { 65 | 66 | return win->flags & __KEYPAD ? true : false; 67 | } 68 | -------------------------------------------------------------------------------- /libcurses/killchar.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/leaveok.3: -------------------------------------------------------------------------------- 1 | curses_refresh.3 -------------------------------------------------------------------------------- /libcurses/leaveok.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: leaveok.c,v 1.7 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. 5 | * All rights reserved. 6 | * 7 | * This code is derived from software contributed to The NetBSD Foundation 8 | * by Julian Coleman. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | /* 38 | * leaveok -- 39 | * Turn on and off leave cursor after refresh for the given window. 40 | */ 41 | int 42 | leaveok(WINDOW *win, bool bf) 43 | { 44 | if (bf) 45 | win->flags |= __LEAVEOK; 46 | else 47 | win->flags &= ~__LEAVEOK; 48 | return OK; 49 | } 50 | 51 | /* 52 | * is_leaveok -- 53 | * Return true if window is set for leaveok. 54 | */ 55 | bool 56 | is_leaveok(const WINDOW *win) 57 | { 58 | 59 | return win->flags & __LEAVEOK ? true : false; 60 | } 61 | -------------------------------------------------------------------------------- /libcurses/meta.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/move.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/mvaddch.3: -------------------------------------------------------------------------------- 1 | curses_addch.3 -------------------------------------------------------------------------------- /libcurses/mvaddchnstr.3: -------------------------------------------------------------------------------- 1 | curses_addchstr.3 -------------------------------------------------------------------------------- /libcurses/mvaddchstr.3: -------------------------------------------------------------------------------- 1 | curses_addchstr.3 -------------------------------------------------------------------------------- /libcurses/mvaddnstr.3: -------------------------------------------------------------------------------- 1 | curses_addstr.3 -------------------------------------------------------------------------------- /libcurses/mvaddstr.3: -------------------------------------------------------------------------------- 1 | curses_addstr.3 -------------------------------------------------------------------------------- /libcurses/mvchgat.3: -------------------------------------------------------------------------------- 1 | curses_chgat.3 -------------------------------------------------------------------------------- /libcurses/mvcur.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/mvderwin.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/mvgetch.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/mvgetnstr.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/mvgetstr.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/mvhline.3: -------------------------------------------------------------------------------- 1 | curses_line.3 -------------------------------------------------------------------------------- /libcurses/mvinchnstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/mvinchstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/mvinnstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/mvinsch.3: -------------------------------------------------------------------------------- 1 | curses_insch.3 -------------------------------------------------------------------------------- /libcurses/mvinstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/mvprintw.3: -------------------------------------------------------------------------------- 1 | curses_print.3 -------------------------------------------------------------------------------- /libcurses/mvvline.3: -------------------------------------------------------------------------------- 1 | curses_line.3 -------------------------------------------------------------------------------- /libcurses/mvwaddch.3: -------------------------------------------------------------------------------- 1 | curses_addch.3 -------------------------------------------------------------------------------- /libcurses/mvwaddchnstr.3: -------------------------------------------------------------------------------- 1 | curses_addchstr.3 -------------------------------------------------------------------------------- /libcurses/mvwaddchstr.3: -------------------------------------------------------------------------------- 1 | curses_addchstr.3 -------------------------------------------------------------------------------- /libcurses/mvwaddnstr.3: -------------------------------------------------------------------------------- 1 | curses_addstr.3 -------------------------------------------------------------------------------- /libcurses/mvwaddstr.3: -------------------------------------------------------------------------------- 1 | curses_addstr.3 -------------------------------------------------------------------------------- /libcurses/mvwchgat.3: -------------------------------------------------------------------------------- 1 | curses_chgat.3 -------------------------------------------------------------------------------- /libcurses/mvwgetch.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/mvwgetnstr.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/mvwgetstr.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/mvwhline.3: -------------------------------------------------------------------------------- 1 | curses_line.3 -------------------------------------------------------------------------------- /libcurses/mvwin.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/mvwinchnstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/mvwinchstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/mvwinnstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/mvwinsch.3: -------------------------------------------------------------------------------- 1 | curses_insch.3 -------------------------------------------------------------------------------- /libcurses/mvwinstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/mvwprintw.3: -------------------------------------------------------------------------------- 1 | curses_print.3 -------------------------------------------------------------------------------- /libcurses/mvwvline.3: -------------------------------------------------------------------------------- 1 | curses_line.3 -------------------------------------------------------------------------------- /libcurses/napms.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/newpad.3: -------------------------------------------------------------------------------- 1 | curses_pad.3 -------------------------------------------------------------------------------- /libcurses/newterm.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/newwin.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/nl.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/nocbreak.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/nodelay.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/nodelay.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: nodelay.c,v 1.7 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1998-1999 Brett Lymn (blymn@baea.com.au, brett_lymn@yahoo.com) 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. The name of the author may not be used to endorse or promote products 13 | * derived from this software without specific prior written permission 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | * 27 | */ 28 | 29 | #include 30 | 31 | #include "curses.h" 32 | #include "curses_private.h" 33 | 34 | /* 35 | * nodelay -- 36 | * Turn on and off blocking reads in getch for a 37 | * given window. 38 | */ 39 | int 40 | nodelay(WINDOW *win, bool bf) 41 | { 42 | 43 | if (bf) 44 | win->delay = 0; 45 | else 46 | win->delay = -1; 47 | return OK; 48 | } 49 | -------------------------------------------------------------------------------- /libcurses/noecho.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/nonl.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/noqiflush.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/noraw.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/notimeout.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/notimeout.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: notimeout.c,v 1.7 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1998-2014 Brett Lymn (blymn@netbsd.org) 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. The name of the author may not be used to endorse or promote products 13 | * derived from this software without specific prior written permission 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | * 27 | */ 28 | 29 | #include 30 | 31 | #include "curses.h" 32 | #include "curses_private.h" 33 | 34 | /* 35 | * notimeout -- 36 | * Turn on and off inter-key timeout when assembling function keys for a 37 | * given window. 38 | */ 39 | int 40 | notimeout(WINDOW *win, bool bf) 41 | { 42 | 43 | if (bf) 44 | win->flags |= __NOTIMEOUT; 45 | else 46 | win->flags &= ~__NOTIMEOUT; 47 | 48 | return OK; 49 | } 50 | -------------------------------------------------------------------------------- /libcurses/overlay.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/overlay.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: overlay.c,v 1.17 2007/01/21 13:25:36 jdc Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1981, 1993, 1994 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include 35 | 36 | #include "curses.h" 37 | #include "curses_private.h" 38 | 39 | /* 40 | * overlay -- 41 | * Writes win1 on win2 non-destructively. 42 | */ 43 | int 44 | overlay(const WINDOW *win1, WINDOW *win2) 45 | { 46 | 47 | #ifdef DEBUG 48 | __CTRACE(__CTRACE_WINDOW, "overlay: (%p, %p);\n", win1, win2); 49 | #endif 50 | return copywin(win1, win2, 51 | win2->begy - win1->begy, win2->begx - win1->begx, 52 | 0, 0, win2->maxy - 1, win2->maxx - 1, TRUE); 53 | } 54 | -------------------------------------------------------------------------------- /libcurses/overwrite.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/overwrite.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: overwrite.c,v 1.18 2007/01/21 13:25:36 jdc Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1981, 1993, 1994 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | #include "curses.h" 38 | #include "curses_private.h" 39 | 40 | /* 41 | * overwrite -- 42 | * Writes win1 on win2 destructively. 43 | */ 44 | int 45 | overwrite(const WINDOW *win1, WINDOW *win2) 46 | { 47 | #ifdef DEBUG 48 | __CTRACE(__CTRACE_WINDOW, "overwrite: (%p, %p);\n", win1, win2); 49 | #endif 50 | return copywin(win1, win2, 51 | win2->begy - win1->begy, win2->begx - win1->begx, 52 | 0, 0, win2->maxy - 1, win2->maxx - 1, FALSE); 53 | } 54 | -------------------------------------------------------------------------------- /libcurses/pair_content.3: -------------------------------------------------------------------------------- 1 | curses_color.3 -------------------------------------------------------------------------------- /libcurses/pechochar.3: -------------------------------------------------------------------------------- 1 | curses_echochar.3 -------------------------------------------------------------------------------- /libcurses/pnoutrefresh.3: -------------------------------------------------------------------------------- 1 | curses_pad.3 -------------------------------------------------------------------------------- /libcurses/prefresh.3: -------------------------------------------------------------------------------- 1 | curses_pad.3 -------------------------------------------------------------------------------- /libcurses/printw.3: -------------------------------------------------------------------------------- 1 | curses_print.3 -------------------------------------------------------------------------------- /libcurses/putwin.3: -------------------------------------------------------------------------------- 1 | curses_fileio.3 -------------------------------------------------------------------------------- /libcurses/qiflush.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/raw.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/refresh.3: -------------------------------------------------------------------------------- 1 | curses_refresh.3 -------------------------------------------------------------------------------- /libcurses/reset_prog_mode.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/reset_shell_mode.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/resetty.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/resize_term.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/resizeterm.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/ripoffline.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/savetty.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/scanw.3: -------------------------------------------------------------------------------- 1 | curses_scanw.3 -------------------------------------------------------------------------------- /libcurses/scrl.3: -------------------------------------------------------------------------------- 1 | curses_scroll.3 -------------------------------------------------------------------------------- /libcurses/scroll.3: -------------------------------------------------------------------------------- 1 | curses_scroll.3 -------------------------------------------------------------------------------- /libcurses/scrollok.3: -------------------------------------------------------------------------------- 1 | curses_scroll.3 -------------------------------------------------------------------------------- /libcurses/scrollok.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: scrollok.c,v 1.6 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. 5 | * All rights reserved. 6 | * 7 | * This code is derived from software contributed to The NetBSD Foundation 8 | * by Julian Coleman. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | /* 38 | * scrollok -- 39 | * Turn on and off scrolling for the given window. 40 | */ 41 | int 42 | scrollok(WINDOW *win, bool bf) 43 | { 44 | 45 | if (bf) 46 | win->flags |= __SCROLLOK; 47 | else 48 | win->flags &= ~__SCROLLOK; 49 | return OK; 50 | } 51 | -------------------------------------------------------------------------------- /libcurses/set_escdelay.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/set_tabsize.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/set_term.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/setcchar.3: -------------------------------------------------------------------------------- 1 | curses_cchar.3 -------------------------------------------------------------------------------- /libcurses/setscrreg.3: -------------------------------------------------------------------------------- 1 | curses_scroll.3 -------------------------------------------------------------------------------- /libcurses/setsyx.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/setterm.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/shlib_version: -------------------------------------------------------------------------------- 1 | # $NetBSD: shlib_version,v 1.43 2018/11/16 10:12:00 blymn Exp $ 2 | # Remember to update distrib/sets/lists/base/shl.* when changing 3 | # Remember to run `make fileio.h` when changing 4 | # Remember to increment the major numbers of libform, libmenu and 5 | # libpanel when the libcurses major number increments. 6 | # 7 | major=7 8 | minor=2 9 | -------------------------------------------------------------------------------- /libcurses/slk_attr_off.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_attr_on.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_attr_set.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_attroff.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_attron.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_attrset.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_clear.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_color.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_init.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_label.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_noutrefresh.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_refresh.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_restore.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_set.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_touch.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/slk_wset.3: -------------------------------------------------------------------------------- 1 | curses_slk.3 -------------------------------------------------------------------------------- /libcurses/standend.3: -------------------------------------------------------------------------------- 1 | curses_standout.3 -------------------------------------------------------------------------------- /libcurses/standout.3: -------------------------------------------------------------------------------- 1 | curses_standout.3 -------------------------------------------------------------------------------- /libcurses/start_color.3: -------------------------------------------------------------------------------- 1 | curses_color.3 -------------------------------------------------------------------------------- /libcurses/subpad.3: -------------------------------------------------------------------------------- 1 | curses_pad.3 -------------------------------------------------------------------------------- /libcurses/subwin.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/syncok.3: -------------------------------------------------------------------------------- 1 | curses_touch.3 -------------------------------------------------------------------------------- /libcurses/syncok.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: syncok.c,v 1.2 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 2017 The NetBSD Foundation, Inc. 5 | * All rights reserved. 6 | * 7 | * This code is derived from software contributed to The NetBSD Foundation 8 | * by Roy Marples. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include "curses.h" 33 | #include "curses_private.h" 34 | 35 | /* 36 | * immedok -- 37 | * Refresh the window when changed. 38 | */ 39 | int 40 | syncok(WINDOW *win, bool bf) 41 | { 42 | 43 | if (bf) 44 | win->flags |= __SYNCOK; 45 | else 46 | win->flags &= ~__SYNCOK; 47 | return OK; 48 | } 49 | -------------------------------------------------------------------------------- /libcurses/timeout.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/timeout.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: timeout.c,v 1.9 2017/01/06 13:53:18 roy Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. 5 | * All rights reserved. 6 | * 7 | * This code is derived from software contributed to The NetBSD Foundation 8 | * by Julian Coleman. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | #include "curses.h" 35 | #include "curses_private.h" 36 | 37 | #ifndef _CURSES_USE_MACROS 38 | 39 | /* 40 | * timeout -- 41 | * Set the getch() delay for stdscr. 42 | */ 43 | void 44 | timeout(int delay) 45 | { 46 | 47 | wtimeout(stdscr, delay); 48 | } 49 | 50 | #endif 51 | 52 | /* 53 | * wtimeout -- 54 | * Set the getch() delay for a window. 55 | */ 56 | void 57 | wtimeout(WINDOW *win, int delay) 58 | { 59 | 60 | if (delay < 0) 61 | win->delay = -1; 62 | else if (!delay) 63 | win->delay = delay; 64 | else { 65 | /* 66 | * 1. VTIME is a char 67 | * 2. timeout granularity is ms but VTIME is 0.1s 68 | */ 69 | if (delay > 25500) 70 | win->delay = 255; 71 | else 72 | win->delay = (delay - 1)/ 100 + 1; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /libcurses/touchline.3: -------------------------------------------------------------------------------- 1 | curses_touch.3 -------------------------------------------------------------------------------- /libcurses/touchoverlap.3: -------------------------------------------------------------------------------- 1 | curses_touch.3 -------------------------------------------------------------------------------- /libcurses/touchwin.3: -------------------------------------------------------------------------------- 1 | curses_touch.3 -------------------------------------------------------------------------------- /libcurses/typeahead.3: -------------------------------------------------------------------------------- 1 | curses_tty.3 -------------------------------------------------------------------------------- /libcurses/unctrl.3: -------------------------------------------------------------------------------- 1 | curses_print.3 -------------------------------------------------------------------------------- /libcurses/underend.3: -------------------------------------------------------------------------------- 1 | curses_underscore.3 -------------------------------------------------------------------------------- /libcurses/underscore.3: -------------------------------------------------------------------------------- 1 | curses_underscore.3 -------------------------------------------------------------------------------- /libcurses/ungetch.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/untouchwin.3: -------------------------------------------------------------------------------- 1 | curses_touch.3 -------------------------------------------------------------------------------- /libcurses/use_default_colors.3: -------------------------------------------------------------------------------- 1 | curses_default_colors.3 -------------------------------------------------------------------------------- /libcurses/use_env.3: -------------------------------------------------------------------------------- 1 | curses_screen.3 -------------------------------------------------------------------------------- /libcurses/vline.3: -------------------------------------------------------------------------------- 1 | curses_line.3 -------------------------------------------------------------------------------- /libcurses/waddch.3: -------------------------------------------------------------------------------- 1 | curses_addch.3 -------------------------------------------------------------------------------- /libcurses/waddchnstr.3: -------------------------------------------------------------------------------- 1 | curses_addchstr.3 -------------------------------------------------------------------------------- /libcurses/waddchstr.3: -------------------------------------------------------------------------------- 1 | curses_addchstr.3 -------------------------------------------------------------------------------- /libcurses/waddnstr.3: -------------------------------------------------------------------------------- 1 | curses_addstr.3 -------------------------------------------------------------------------------- /libcurses/waddstr.3: -------------------------------------------------------------------------------- 1 | curses_addstr.3 -------------------------------------------------------------------------------- /libcurses/wattr_get.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/wattr_off.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/wattr_on.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/wattr_set.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/wattroff.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/wattron.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/wattrset.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/wbkgd.3: -------------------------------------------------------------------------------- 1 | curses_background.3 -------------------------------------------------------------------------------- /libcurses/wbkgdset.3: -------------------------------------------------------------------------------- 1 | curses_background.3 -------------------------------------------------------------------------------- /libcurses/wborder.3: -------------------------------------------------------------------------------- 1 | curses_border.3 -------------------------------------------------------------------------------- /libcurses/wchgat.3: -------------------------------------------------------------------------------- 1 | curses_chgat.3 -------------------------------------------------------------------------------- /libcurses/wclear.3: -------------------------------------------------------------------------------- 1 | curses_clear.3 -------------------------------------------------------------------------------- /libcurses/wclrtobot.3: -------------------------------------------------------------------------------- 1 | curses_clear.3 -------------------------------------------------------------------------------- /libcurses/wclrtoeol.3: -------------------------------------------------------------------------------- 1 | curses_clear.3 -------------------------------------------------------------------------------- /libcurses/wcolor_set.3: -------------------------------------------------------------------------------- 1 | curses_attributes.3 -------------------------------------------------------------------------------- /libcurses/wcursyncup.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/wdelch.3: -------------------------------------------------------------------------------- 1 | curses_delch.3 -------------------------------------------------------------------------------- /libcurses/wdeleteln.3: -------------------------------------------------------------------------------- 1 | curses_deleteln.3 -------------------------------------------------------------------------------- /libcurses/wechochar.3: -------------------------------------------------------------------------------- 1 | curses_echochar.3 -------------------------------------------------------------------------------- /libcurses/werase.3: -------------------------------------------------------------------------------- 1 | curses_clear.3 -------------------------------------------------------------------------------- /libcurses/wgetch.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/wgetnstr.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/wgetstr.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/whline.3: -------------------------------------------------------------------------------- 1 | curses_line.3 -------------------------------------------------------------------------------- /libcurses/winch.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/winchnstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/winchstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/winnstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/winsch.3: -------------------------------------------------------------------------------- 1 | curses_insch.3 -------------------------------------------------------------------------------- /libcurses/winsdelln.3: -------------------------------------------------------------------------------- 1 | curses_insdelln.3 -------------------------------------------------------------------------------- /libcurses/winsertln.3: -------------------------------------------------------------------------------- 1 | curses_insertln.3 -------------------------------------------------------------------------------- /libcurses/winstr.3: -------------------------------------------------------------------------------- 1 | curses_inch.3 -------------------------------------------------------------------------------- /libcurses/wmove.3: -------------------------------------------------------------------------------- 1 | curses_cursor.3 -------------------------------------------------------------------------------- /libcurses/wnoutrefresh.3: -------------------------------------------------------------------------------- 1 | curses_refresh.3 -------------------------------------------------------------------------------- /libcurses/wprintw.3: -------------------------------------------------------------------------------- 1 | curses_print.3 -------------------------------------------------------------------------------- /libcurses/wrefresh.3: -------------------------------------------------------------------------------- 1 | curses_refresh.3 -------------------------------------------------------------------------------- /libcurses/wresize.3: -------------------------------------------------------------------------------- 1 | curses_window.3 -------------------------------------------------------------------------------- /libcurses/wscanw.3: -------------------------------------------------------------------------------- 1 | curses_scanw.3 -------------------------------------------------------------------------------- /libcurses/wscrl.3: -------------------------------------------------------------------------------- 1 | curses_scroll.3 -------------------------------------------------------------------------------- /libcurses/wsetscrreg.3: -------------------------------------------------------------------------------- 1 | curses_scroll.3 -------------------------------------------------------------------------------- /libcurses/wstandend.3: -------------------------------------------------------------------------------- 1 | curses_standout.3 -------------------------------------------------------------------------------- /libcurses/wstandout.3: -------------------------------------------------------------------------------- 1 | curses_standout.3 -------------------------------------------------------------------------------- /libcurses/wsyncup.3: -------------------------------------------------------------------------------- 1 | curses_touch.3 -------------------------------------------------------------------------------- /libcurses/wtimeout.3: -------------------------------------------------------------------------------- 1 | curses_input.3 -------------------------------------------------------------------------------- /libcurses/wtouchln.3: -------------------------------------------------------------------------------- 1 | curses_touch.3 -------------------------------------------------------------------------------- /libcurses/wunderend.3: -------------------------------------------------------------------------------- 1 | curses_underscore.3 -------------------------------------------------------------------------------- /libcurses/wunderscore.3: -------------------------------------------------------------------------------- 1 | curses_underscore.3 -------------------------------------------------------------------------------- /libcurses/wvline.3: -------------------------------------------------------------------------------- 1 | curses_line.3 -------------------------------------------------------------------------------- /libform/current_field.3: -------------------------------------------------------------------------------- 1 | form_page.3 -------------------------------------------------------------------------------- /libform/data_ahead.3: -------------------------------------------------------------------------------- 1 | form_data.3 -------------------------------------------------------------------------------- /libform/data_behind.3: -------------------------------------------------------------------------------- 1 | form_data.3 -------------------------------------------------------------------------------- /libform/dup_field.3: -------------------------------------------------------------------------------- 1 | form_field_new.3 -------------------------------------------------------------------------------- /libform/dynamic_field_info.3: -------------------------------------------------------------------------------- 1 | form_field_info.3 -------------------------------------------------------------------------------- /libform/field_arg.3: -------------------------------------------------------------------------------- 1 | form_field_validation.3 -------------------------------------------------------------------------------- /libform/field_back.3: -------------------------------------------------------------------------------- 1 | form_field_attributes.3 -------------------------------------------------------------------------------- /libform/field_buffer.3: -------------------------------------------------------------------------------- 1 | form_field_buffer.3 -------------------------------------------------------------------------------- /libform/field_count.3: -------------------------------------------------------------------------------- 1 | form_field.3 -------------------------------------------------------------------------------- /libform/field_fore.3: -------------------------------------------------------------------------------- 1 | form_field_attributes.3 -------------------------------------------------------------------------------- /libform/field_index.3: -------------------------------------------------------------------------------- 1 | form_page.3 -------------------------------------------------------------------------------- /libform/field_info.3: -------------------------------------------------------------------------------- 1 | form_field_info.3 -------------------------------------------------------------------------------- /libform/field_init.3: -------------------------------------------------------------------------------- 1 | form_hook.3 -------------------------------------------------------------------------------- /libform/field_just.3: -------------------------------------------------------------------------------- 1 | form_field_just.3 -------------------------------------------------------------------------------- /libform/field_opts.3: -------------------------------------------------------------------------------- 1 | form_field_opts.3 -------------------------------------------------------------------------------- /libform/field_opts_off.3: -------------------------------------------------------------------------------- 1 | form_field_opts.3 -------------------------------------------------------------------------------- /libform/field_opts_on.3: -------------------------------------------------------------------------------- 1 | form_field_opts.3 -------------------------------------------------------------------------------- /libform/field_pad.3: -------------------------------------------------------------------------------- 1 | form_field_attributes.3 -------------------------------------------------------------------------------- /libform/field_status.3: -------------------------------------------------------------------------------- 1 | form_field_buffer.3 -------------------------------------------------------------------------------- /libform/field_term.3: -------------------------------------------------------------------------------- 1 | form_hook.3 -------------------------------------------------------------------------------- /libform/field_type.3: -------------------------------------------------------------------------------- 1 | form_field_validation.3 -------------------------------------------------------------------------------- /libform/field_userptr.3: -------------------------------------------------------------------------------- 1 | form_field_userptr.3 -------------------------------------------------------------------------------- /libform/form.3: -------------------------------------------------------------------------------- 1 | forms.3 -------------------------------------------------------------------------------- /libform/form_fields.3: -------------------------------------------------------------------------------- 1 | form_field.3 -------------------------------------------------------------------------------- /libform/form_init.3: -------------------------------------------------------------------------------- 1 | form_hook.3 -------------------------------------------------------------------------------- /libform/form_max_page.3: -------------------------------------------------------------------------------- 1 | form_page.3 -------------------------------------------------------------------------------- /libform/form_opts_off.3: -------------------------------------------------------------------------------- 1 | form_opts.3 -------------------------------------------------------------------------------- /libform/form_opts_on.3: -------------------------------------------------------------------------------- 1 | form_opts.3 -------------------------------------------------------------------------------- /libform/form_sub.3: -------------------------------------------------------------------------------- 1 | form_win.3 -------------------------------------------------------------------------------- /libform/form_term.3: -------------------------------------------------------------------------------- 1 | form_hook.3 -------------------------------------------------------------------------------- /libform/free_field.3: -------------------------------------------------------------------------------- 1 | form_field_new.3 -------------------------------------------------------------------------------- /libform/free_fieldtype.3: -------------------------------------------------------------------------------- 1 | form_fieldtype.3 -------------------------------------------------------------------------------- /libform/free_form.3: -------------------------------------------------------------------------------- 1 | form_new.3 -------------------------------------------------------------------------------- /libform/gdbinit: -------------------------------------------------------------------------------- 1 | # 2 | # Print out the line structs 3 | # 4 | define lstructs 5 | set $lstruct=(_FORMI_FIELD_LINES *)$arg0 6 | while ($lstruct) 7 | print *($lstruct) 8 | if ($lstruct->prev != 0x0) 9 | if ($lstruct->prev->next != $lstruct) 10 | print "WARNING: backward pointers inconsistent" 11 | end 12 | end 13 | if ($lstruct->next != 0x0) 14 | if ($lstruct->next->prev != $lstruct) 15 | print "WARNING: forward pointers inconsistent" 16 | end 17 | end 18 | set $lstruct = $lstruct->next 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /libform/link_field.3: -------------------------------------------------------------------------------- 1 | form_field_new.3 -------------------------------------------------------------------------------- /libform/link_fieldtype.3: -------------------------------------------------------------------------------- 1 | form_fieldtype.3 -------------------------------------------------------------------------------- /libform/move_field.3: -------------------------------------------------------------------------------- 1 | form_field.3 -------------------------------------------------------------------------------- /libform/new_field.3: -------------------------------------------------------------------------------- 1 | form_field_new.3 -------------------------------------------------------------------------------- /libform/new_fieldtype.3: -------------------------------------------------------------------------------- 1 | form_fieldtype.3 -------------------------------------------------------------------------------- /libform/new_form.3: -------------------------------------------------------------------------------- 1 | form_new.3 -------------------------------------------------------------------------------- /libform/new_page.3: -------------------------------------------------------------------------------- 1 | form_new_page.3 -------------------------------------------------------------------------------- /libform/pos_form_cursor.3: -------------------------------------------------------------------------------- 1 | form_cursor.3 -------------------------------------------------------------------------------- /libform/post_form.3: -------------------------------------------------------------------------------- 1 | form_post.3 -------------------------------------------------------------------------------- /libform/scale_form.3: -------------------------------------------------------------------------------- 1 | form_win.3 -------------------------------------------------------------------------------- /libform/set_current_field.3: -------------------------------------------------------------------------------- 1 | form_page.3 -------------------------------------------------------------------------------- /libform/set_field_back.3: -------------------------------------------------------------------------------- 1 | form_field_attributes.3 -------------------------------------------------------------------------------- /libform/set_field_buffer.3: -------------------------------------------------------------------------------- 1 | form_field_buffer.3 -------------------------------------------------------------------------------- /libform/set_field_fore.3: -------------------------------------------------------------------------------- 1 | form_field_attributes.3 -------------------------------------------------------------------------------- /libform/set_field_init.3: -------------------------------------------------------------------------------- 1 | form_hook.3 -------------------------------------------------------------------------------- /libform/set_field_just.3: -------------------------------------------------------------------------------- 1 | form_field_just.3 -------------------------------------------------------------------------------- /libform/set_field_opts.3: -------------------------------------------------------------------------------- 1 | form_field_opts.3 -------------------------------------------------------------------------------- /libform/set_field_pad.3: -------------------------------------------------------------------------------- 1 | form_field_attributes.3 -------------------------------------------------------------------------------- /libform/set_field_printf.3: -------------------------------------------------------------------------------- 1 | form_field_buffer.3 -------------------------------------------------------------------------------- /libform/set_field_status.3: -------------------------------------------------------------------------------- 1 | form_field_buffer.3 -------------------------------------------------------------------------------- /libform/set_field_term.3: -------------------------------------------------------------------------------- 1 | form_hook.3 -------------------------------------------------------------------------------- /libform/set_field_type.3: -------------------------------------------------------------------------------- 1 | form_field_validation.3 -------------------------------------------------------------------------------- /libform/set_field_userptr.3: -------------------------------------------------------------------------------- 1 | form_field_userptr.3 -------------------------------------------------------------------------------- /libform/set_fieldtype_arg.3: -------------------------------------------------------------------------------- 1 | form_fieldtype.3 -------------------------------------------------------------------------------- /libform/set_fieldtype_choice.3: -------------------------------------------------------------------------------- 1 | form_fieldtype.3 -------------------------------------------------------------------------------- /libform/set_form_fields.3: -------------------------------------------------------------------------------- 1 | form_field.3 -------------------------------------------------------------------------------- /libform/set_form_init.3: -------------------------------------------------------------------------------- 1 | form_hook.3 -------------------------------------------------------------------------------- /libform/set_form_opts.3: -------------------------------------------------------------------------------- 1 | form_opts.3 -------------------------------------------------------------------------------- /libform/set_form_page.3: -------------------------------------------------------------------------------- 1 | form_page.3 -------------------------------------------------------------------------------- /libform/set_form_sub.3: -------------------------------------------------------------------------------- 1 | form_win.3 -------------------------------------------------------------------------------- /libform/set_form_term.3: -------------------------------------------------------------------------------- 1 | form_hook.3 -------------------------------------------------------------------------------- /libform/set_form_userptr.3: -------------------------------------------------------------------------------- 1 | form_userptr.3 -------------------------------------------------------------------------------- /libform/set_form_win.3: -------------------------------------------------------------------------------- 1 | form_win.3 -------------------------------------------------------------------------------- /libform/set_max_field.3: -------------------------------------------------------------------------------- 1 | form_field_buffer.3 -------------------------------------------------------------------------------- /libform/set_new_page.3: -------------------------------------------------------------------------------- 1 | form_new_page.3 -------------------------------------------------------------------------------- /libform/shlib_version: -------------------------------------------------------------------------------- 1 | # $NetBSD: shlib_version,v 1.17 2009/01/11 03:07:48 christos Exp $ 2 | # Remember to update distrib/sets/lists/base/shl.* when changing 3 | # 4 | major=6 5 | minor=0 6 | -------------------------------------------------------------------------------- /libform/std_header.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: std_header.c,v 1.3 2003/03/09 00:57:19 lukem Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1998-1999 Brett Lymn 5 | * (blymn@baea.com.au, brett_lymn@yahoo.com.au) 6 | * All rights reserved. 7 | * 8 | * This code has been donated to The NetBSD Foundation by the Author. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * 30 | */ 31 | 32 | #include 33 | 34 | -------------------------------------------------------------------------------- /libform/unpost_form.3: -------------------------------------------------------------------------------- 1 | form_post.3 -------------------------------------------------------------------------------- /libmenu/current_item.3: -------------------------------------------------------------------------------- 1 | menu_item_current.3 -------------------------------------------------------------------------------- /libmenu/eti.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: eti.h,v 1.8 2001/06/13 10:45:59 wiz Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1998-1999 Brett Lymn (blymn@baea.com.au, brett_lymn@yahoo.com.au) 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. The name of the author may not be used to endorse or promote products 13 | * derived from this software without specific prior written permission 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | * 27 | */ 28 | 29 | #ifndef _ETI_H_ 30 | #define _ETI_H_ 31 | 32 | /* common return codes for libmenu and libpanel functions */ 33 | 34 | #define E_OK (0) 35 | #define E_SYSTEM_ERROR (-1) 36 | #define E_BAD_ARGUMENT (-2) 37 | #define E_POSTED (-3) 38 | #define E_CONNECTED (-4) 39 | #define E_BAD_STATE (-5) 40 | #define E_NO_ROOM (-6) 41 | #define E_NOT_POSTED (-7) 42 | #define E_UNKNOWN_COMMAND (-8) 43 | #define E_NO_MATCH (-9) 44 | #define E_NOT_SELECTABLE (-10) 45 | #define E_NOT_CONNECTED (-11) 46 | #define E_REQUEST_DENIED (-12) 47 | #define E_INVALID_FIELD (-13) 48 | #define E_CURRENT (-14) 49 | 50 | #endif /* !_ETI_H_ */ 51 | -------------------------------------------------------------------------------- /libmenu/free_item.3: -------------------------------------------------------------------------------- 1 | menu_item_new.3 -------------------------------------------------------------------------------- /libmenu/free_menu.3: -------------------------------------------------------------------------------- 1 | menu_new.3 -------------------------------------------------------------------------------- /libmenu/internals.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: internals.h,v 1.8 2001/06/13 10:45:59 wiz Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1998-1999 Brett Lymn (blymn@baea.com.au, brett_lymn@yahoo.com.au) 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. The name of the author may not be used to endorse or promote products 13 | * derived from this software without specific prior written permission 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | * 27 | */ 28 | 29 | #include 30 | 31 | #ifndef INTERNALS_H 32 | #define INTERNALS_H 33 | 34 | #define MATCH_FORWARD 1 35 | #define MATCH_REVERSE 2 36 | #define MATCH_NEXT_FORWARD 3 37 | #define MATCH_NEXT_REVERSE 4 38 | 39 | /* stole this from curses.h */ 40 | #define max(a,b) ((a) > (b) ? a : b) 41 | 42 | /* function prototypes */ 43 | 44 | void _menui_draw_item(MENU *menu, int item); 45 | int _menui_draw_menu(MENU *menu); 46 | int _menui_goto_item(MENU *menu, ITEM *item, int new_top_row); 47 | int _menui_match_pattern(MENU *menu, int c, int direction , 48 | int *item_matched); 49 | int _menui_match_items(MENU *menu, int direction, int *item_matched); 50 | void _menui_max_item_size(MENU *menu); 51 | int _menui_stitch_items(MENU *menu); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /libmenu/item_count.3: -------------------------------------------------------------------------------- 1 | menu_items.3 -------------------------------------------------------------------------------- /libmenu/item_description.3: -------------------------------------------------------------------------------- 1 | menu_item_name.3 -------------------------------------------------------------------------------- /libmenu/item_index.3: -------------------------------------------------------------------------------- 1 | menu_item_current.3 -------------------------------------------------------------------------------- /libmenu/item_init.3: -------------------------------------------------------------------------------- 1 | menu_hook.3 -------------------------------------------------------------------------------- /libmenu/item_name.3: -------------------------------------------------------------------------------- 1 | menu_item_name.3 -------------------------------------------------------------------------------- /libmenu/item_opts.3: -------------------------------------------------------------------------------- 1 | menu_item_opts.3 -------------------------------------------------------------------------------- /libmenu/item_opts_off.3: -------------------------------------------------------------------------------- 1 | menu_item_opts.3 -------------------------------------------------------------------------------- /libmenu/item_opts_on.3: -------------------------------------------------------------------------------- 1 | menu_item_opts.3 -------------------------------------------------------------------------------- /libmenu/item_selected.3: -------------------------------------------------------------------------------- 1 | menu_item_value.3 -------------------------------------------------------------------------------- /libmenu/item_term.3: -------------------------------------------------------------------------------- 1 | menu_hook.3 -------------------------------------------------------------------------------- /libmenu/item_userptr.3: -------------------------------------------------------------------------------- 1 | menu_item_userptr.3 -------------------------------------------------------------------------------- /libmenu/item_value.3: -------------------------------------------------------------------------------- 1 | menu_item_value.3 -------------------------------------------------------------------------------- /libmenu/item_visible.3: -------------------------------------------------------------------------------- 1 | menu_item_visible.3 -------------------------------------------------------------------------------- /libmenu/menu_back.3: -------------------------------------------------------------------------------- 1 | menu_attributes.3 -------------------------------------------------------------------------------- /libmenu/menu_fore.3: -------------------------------------------------------------------------------- 1 | menu_attributes.3 -------------------------------------------------------------------------------- /libmenu/menu_grey.3: -------------------------------------------------------------------------------- 1 | menu_attributes.3 -------------------------------------------------------------------------------- /libmenu/menu_init.3: -------------------------------------------------------------------------------- 1 | menu_hook.3 -------------------------------------------------------------------------------- /libmenu/menu_opts_off.3: -------------------------------------------------------------------------------- 1 | menu_opts.3 -------------------------------------------------------------------------------- /libmenu/menu_opts_on.3: -------------------------------------------------------------------------------- 1 | menu_opts.3 -------------------------------------------------------------------------------- /libmenu/menu_pad.3: -------------------------------------------------------------------------------- 1 | menu_attributes.3 -------------------------------------------------------------------------------- /libmenu/menu_sub.3: -------------------------------------------------------------------------------- 1 | menu_win.3 -------------------------------------------------------------------------------- /libmenu/menu_term.3: -------------------------------------------------------------------------------- 1 | menu_hook.3 -------------------------------------------------------------------------------- /libmenu/menu_unmark.3: -------------------------------------------------------------------------------- 1 | menu_mark.3 -------------------------------------------------------------------------------- /libmenu/new_item.3: -------------------------------------------------------------------------------- 1 | menu_item_new.3 -------------------------------------------------------------------------------- /libmenu/new_menu.3: -------------------------------------------------------------------------------- 1 | menu_new.3 -------------------------------------------------------------------------------- /libmenu/pos_menu_cursor.3: -------------------------------------------------------------------------------- 1 | menu_cursor.3 -------------------------------------------------------------------------------- /libmenu/post_menu.3: -------------------------------------------------------------------------------- 1 | menu_post.3 -------------------------------------------------------------------------------- /libmenu/scale_menu.3: -------------------------------------------------------------------------------- 1 | menu_win.3 -------------------------------------------------------------------------------- /libmenu/set_current_item.3: -------------------------------------------------------------------------------- 1 | menu_item_current.3 -------------------------------------------------------------------------------- /libmenu/set_item_init.3: -------------------------------------------------------------------------------- 1 | menu_hook.3 -------------------------------------------------------------------------------- /libmenu/set_item_term.3: -------------------------------------------------------------------------------- 1 | menu_hook.3 -------------------------------------------------------------------------------- /libmenu/set_item_userptr.3: -------------------------------------------------------------------------------- 1 | menu_item_userptr.3 -------------------------------------------------------------------------------- /libmenu/set_item_value.3: -------------------------------------------------------------------------------- 1 | menu_item_value.3 -------------------------------------------------------------------------------- /libmenu/set_menu_back.3: -------------------------------------------------------------------------------- 1 | menu_attributes.3 -------------------------------------------------------------------------------- /libmenu/set_menu_fore.3: -------------------------------------------------------------------------------- 1 | menu_attributes.3 -------------------------------------------------------------------------------- /libmenu/set_menu_format.3: -------------------------------------------------------------------------------- 1 | menu_format.3 -------------------------------------------------------------------------------- /libmenu/set_menu_grey.3: -------------------------------------------------------------------------------- 1 | menu_attributes.3 -------------------------------------------------------------------------------- /libmenu/set_menu_init.3: -------------------------------------------------------------------------------- 1 | menu_hook.3 -------------------------------------------------------------------------------- /libmenu/set_menu_items.3: -------------------------------------------------------------------------------- 1 | menu_items.3 -------------------------------------------------------------------------------- /libmenu/set_menu_mark.3: -------------------------------------------------------------------------------- 1 | menu_mark.3 -------------------------------------------------------------------------------- /libmenu/set_menu_opts.3: -------------------------------------------------------------------------------- 1 | menu_opts.3 -------------------------------------------------------------------------------- /libmenu/set_menu_pad.3: -------------------------------------------------------------------------------- 1 | menu_attributes.3 -------------------------------------------------------------------------------- /libmenu/set_menu_sub.3: -------------------------------------------------------------------------------- 1 | menu_win.3 -------------------------------------------------------------------------------- /libmenu/set_menu_term.3: -------------------------------------------------------------------------------- 1 | menu_hook.3 -------------------------------------------------------------------------------- /libmenu/set_menu_unmark.3: -------------------------------------------------------------------------------- 1 | menu_mark.3 -------------------------------------------------------------------------------- /libmenu/set_menu_userptr.3: -------------------------------------------------------------------------------- 1 | menu_userptr.3 -------------------------------------------------------------------------------- /libmenu/set_menu_win.3: -------------------------------------------------------------------------------- 1 | menu_win.3 -------------------------------------------------------------------------------- /libmenu/set_top_row.3: -------------------------------------------------------------------------------- 1 | menu_item_current.3 -------------------------------------------------------------------------------- /libmenu/shlib_version: -------------------------------------------------------------------------------- 1 | # $NetBSD: shlib_version,v 1.11 2009/01/11 03:07:48 christos Exp $ 2 | # Remember to update distrib/sets/lists/base/shl.* when changing 3 | # 4 | major=6 5 | minor=0 6 | -------------------------------------------------------------------------------- /libmenu/top_row.3: -------------------------------------------------------------------------------- 1 | menu_item_current.3 -------------------------------------------------------------------------------- /libmenu/unpost_menu.3: -------------------------------------------------------------------------------- 1 | menu_post.3 -------------------------------------------------------------------------------- /libpanel/GNUmakefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.7 2015/11/22 04:30:33 kamil Exp $ 2 | 3 | CPPFLAGS+= -I. -I.. -I../libcurses 4 | 5 | LIB= panel 6 | 7 | INCS= panel.h 8 | INCSDIR= /usr/include 9 | 10 | SRCS= # 11 | 12 | SRCS+= _deck.c 13 | 14 | SRCS+= above.c 15 | SRCS+= below.c 16 | SRCS+= bottom.c 17 | SRCS+= del.c 18 | SRCS+= getuser.c 19 | SRCS+= hidden.c 20 | SRCS+= hide.c 21 | SRCS+= move.c 22 | SRCS+= new.c 23 | SRCS+= replace.c 24 | SRCS+= setuser.c 25 | SRCS+= show.c 26 | SRCS+= top.c 27 | SRCS+= update.c 28 | SRCS+= window.c 29 | 30 | LIBDPLIBS+= curses ${.CURDIR}/../libcurses 31 | 32 | MAN= # 33 | MAN+= move_panel.3 34 | MAN+= new_panel.3 35 | MAN+= panel.3 36 | MAN+= panel_above.3 37 | MAN+= panel_hidden.3 38 | MAN+= panel_userptr.3 39 | MAN+= update_panels.3 40 | 41 | MLINKS+= new_panel.3 panel_window.3 42 | MLINKS+= new_panel.3 replace_window.3 43 | MLINKS+= new_panel.3 replace_panel.3 44 | MLINKS+= new_panel.3 del_panel.3 45 | 46 | MLINKS+= panel_above.3 top_panel.3 47 | MLINKS+= panel_above.3 bottom_panel.3 48 | MLINKS+= panel_above.3 panel_below.3 49 | 50 | MLINKS+= panel_hidden.3 hide_panel.3 51 | MLINKS+= panel_hidden.3 show_panel.3 52 | 53 | MLINKS+= panel_userptr.3 set_panel_userptr.3 54 | AR?=ar 55 | RANLIB?=ranlib 56 | OBJS = $(SRCS:.c=.o) 57 | LIBA=lib$(LIB).a 58 | all: $(LIBA) 59 | 60 | clean: 61 | rm -f $(OBJS) $(LIBA) 62 | 63 | $(LIBA): $(OBJS) 64 | rm -f $(LIBA) 65 | $(AR) cr $@ $^ 66 | $(RANLIB) $@ 67 | 68 | %.o: %.c 69 | $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $< 70 | 71 | 72 | -------------------------------------------------------------------------------- /libpanel/Makefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.8 2016/10/03 17:06:58 christos Exp $ 2 | 3 | WARNS= 6 4 | 5 | CPPFLAGS+= -I${.CURDIR} 6 | 7 | LIB= panel 8 | 9 | INCS= panel.h 10 | INCSDIR= /usr/include 11 | 12 | SRCS= # 13 | 14 | SRCS+= _deck.c 15 | 16 | SRCS+= above.c 17 | SRCS+= below.c 18 | SRCS+= bottom.c 19 | SRCS+= del.c 20 | SRCS+= getuser.c 21 | SRCS+= hidden.c 22 | SRCS+= hide.c 23 | SRCS+= move.c 24 | SRCS+= new.c 25 | SRCS+= replace.c 26 | SRCS+= setuser.c 27 | SRCS+= show.c 28 | SRCS+= top.c 29 | SRCS+= update.c 30 | SRCS+= window.c 31 | 32 | LIBDPLIBS+= curses ${.CURDIR}/../libcurses 33 | 34 | MAN= # 35 | MAN+= move_panel.3 36 | MAN+= new_panel.3 37 | MAN+= panel.3 38 | MAN+= panel_above.3 39 | MAN+= panel_hidden.3 40 | MAN+= panel_userptr.3 41 | MAN+= update_panels.3 42 | 43 | MLINKS+= new_panel.3 panel_window.3 44 | MLINKS+= new_panel.3 replace_window.3 45 | MLINKS+= new_panel.3 replace_panel.3 46 | MLINKS+= new_panel.3 del_panel.3 47 | 48 | MLINKS+= panel_above.3 top_panel.3 49 | MLINKS+= panel_above.3 bottom_panel.3 50 | MLINKS+= panel_above.3 panel_below.3 51 | 52 | MLINKS+= panel_hidden.3 hide_panel.3 53 | MLINKS+= panel_hidden.3 show_panel.3 54 | 55 | MLINKS+= panel_userptr.3 set_panel_userptr.3 56 | 57 | .include 58 | -------------------------------------------------------------------------------- /libpanel/_deck.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: _deck.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | struct deck _deck __dso_hidden = TAILQ_HEAD_INITIALIZER(_deck); 33 | PANEL _stdscr_panel __dso_hidden; 34 | -------------------------------------------------------------------------------- /libpanel/above.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: above.c,v 1.4 2015/11/02 02:45:25 kamil Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | 33 | PANEL * 34 | panel_above(PANEL *p) 35 | { 36 | 37 | if (p == NULL) { 38 | if (TAILQ_EMPTY(&_deck)) 39 | return NULL; 40 | 41 | return PANEL_ABOVE(&_stdscr_panel); 42 | } 43 | 44 | if (__predict_false(PANEL_HIDDEN(p))) 45 | return NULL; 46 | 47 | return PANEL_ABOVE(p); 48 | } 49 | -------------------------------------------------------------------------------- /libpanel/below.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: below.c,v 1.2 2015/11/01 01:40:23 uwe Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | 33 | PANEL * 34 | panel_below(PANEL *p) 35 | { 36 | PANEL *below; 37 | 38 | if (p == NULL) 39 | below = TAILQ_LAST(&_deck, deck); 40 | else if (__predict_true(!PANEL_HIDDEN(p))) 41 | below = PANEL_BELOW(p); 42 | else 43 | return NULL; 44 | 45 | if (below == &_stdscr_panel) 46 | return NULL; 47 | else 48 | return below; 49 | } 50 | -------------------------------------------------------------------------------- /libpanel/bottom.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: bottom.c,v 1.3 2015/11/02 02:45:25 kamil Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | 33 | int 34 | bottom_panel(PANEL *p) 35 | { 36 | 37 | if (__predict_false(p == NULL)) 38 | return ERR; 39 | 40 | if (__predict_false(PANEL_HIDDEN(p))) 41 | return ERR; 42 | 43 | (void) hide_panel(p); 44 | 45 | DECK_INSERT_BOTTOM(p); 46 | return OK; 47 | } 48 | -------------------------------------------------------------------------------- /libpanel/bottom_panel.3: -------------------------------------------------------------------------------- 1 | panel_above.3 -------------------------------------------------------------------------------- /libpanel/del.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: del.c,v 1.3 2015/11/02 02:45:25 kamil Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | #include 33 | #include 34 | 35 | 36 | int 37 | del_panel(PANEL *p) 38 | { 39 | 40 | if (__predict_false(p == NULL)) 41 | return ERR; 42 | 43 | (void) hide_panel(p); 44 | free(p); 45 | 46 | /* 47 | * If the last panel is removed, remove the phantom stdscr 48 | * panel as well. 49 | * 50 | * A program that wants to switch to a different screen with 51 | * set_term(3), or ends and recreates curses session with 52 | * endwin(3)/initscr(3), must delete all panels first, since 53 | * their windows will become invalid. When it will create its 54 | * first new panel afterwards, it will pick up new stdscr. 55 | */ 56 | if (TAILQ_LAST(&_deck, deck) == &_stdscr_panel) { 57 | (void) hide_panel(&_stdscr_panel); 58 | assert(TAILQ_EMPTY(&_deck)); 59 | } 60 | 61 | return OK; 62 | } 63 | -------------------------------------------------------------------------------- /libpanel/del_panel.3: -------------------------------------------------------------------------------- 1 | new_panel.3 -------------------------------------------------------------------------------- /libpanel/getuser.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: getuser.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | 33 | char * 34 | panel_userptr(PANEL *p) 35 | { 36 | if (p == NULL) 37 | return NULL; 38 | 39 | return p->user; 40 | } 41 | -------------------------------------------------------------------------------- /libpanel/hidden.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: hidden.c,v 1.3 2015/11/02 02:45:25 kamil Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | 33 | int 34 | panel_hidden(PANEL *p) 35 | { 36 | 37 | if (p == NULL) 38 | return ERR; 39 | 40 | if (PANEL_HIDDEN(p)) 41 | return TRUE; 42 | else 43 | return FALSE; 44 | } 45 | -------------------------------------------------------------------------------- /libpanel/hide.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: hide.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | extern int touchoverlap(WINDOW *, WINDOW *); 32 | 33 | 34 | int 35 | hide_panel(PANEL *p) 36 | { 37 | PANEL *other; 38 | 39 | if (__predict_false(p == NULL)) 40 | return ERR; 41 | 42 | if (__predict_false(PANEL_HIDDEN(p))) 43 | return OK; 44 | 45 | DECK_REMOVE(p); 46 | 47 | /* 48 | * The panel is no longer in the deck, so update_panels() will 49 | * not handle it. Touch exposed areas now. 50 | */ 51 | FOREACH_PANEL (other) { 52 | touchoverlap(p->win, other->win); 53 | } 54 | 55 | return OK; 56 | } 57 | -------------------------------------------------------------------------------- /libpanel/hide_panel.3: -------------------------------------------------------------------------------- 1 | panel_hidden.3 -------------------------------------------------------------------------------- /libpanel/move.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: move.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | extern int touchoverlap(WINDOW *, WINDOW *); 32 | 33 | int 34 | move_panel(PANEL *p, int y, int x) 35 | { 36 | int oldy, oldx; 37 | 38 | if (__predict_false(p == NULL)) 39 | return ERR; 40 | 41 | getbegyx(p->win, oldy, oldx); 42 | if (__predict_false(y == oldy && x == oldx)) 43 | return OK; 44 | 45 | if (!PANEL_HIDDEN(p)) { 46 | PANEL *other; 47 | 48 | /* touch exposed areas at the old location now */ 49 | FOREACH_PANEL (other) { 50 | if (other != p) { 51 | touchoverlap(p->win, other->win); 52 | } 53 | } 54 | } 55 | 56 | return mvwin(p->win, y, x); 57 | } 58 | -------------------------------------------------------------------------------- /libpanel/new.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: new.c,v 1.3 2015/11/02 02:45:25 kamil Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | #include 33 | #include 34 | 35 | 36 | static PANEL * 37 | _new_panel(WINDOW *w) 38 | { 39 | PANEL *p; 40 | 41 | p = (PANEL *)malloc(sizeof(PANEL)); 42 | if (__predict_false(p == NULL)) 43 | return NULL; 44 | 45 | p->win = w; 46 | p->user = NULL; 47 | 48 | DECK_INSERT_TOP(p); 49 | return p; 50 | } 51 | 52 | 53 | PANEL * 54 | new_panel(WINDOW *w) 55 | { 56 | 57 | if (__predict_false(w == NULL)) 58 | return NULL; 59 | 60 | if (__predict_false(w == stdscr)) 61 | return NULL; 62 | 63 | /* 64 | * Ensure there's phantom panel for stdscr at (below) the 65 | * bottom. We explicitly re-assign stdscr in case it changed. 66 | */ 67 | if (TAILQ_EMPTY(&_deck)) { 68 | assert(PANEL_HIDDEN(&_stdscr_panel)); 69 | 70 | _stdscr_panel.win = stdscr; 71 | DECK_INSERT_TOP(&_stdscr_panel); 72 | } 73 | 74 | return _new_panel(w); 75 | } 76 | -------------------------------------------------------------------------------- /libpanel/panel.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: panel.h,v 1.2 2015/11/02 01:06:15 kamil Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _PANEL_H_ 29 | #define _PANEL_H_ 30 | 31 | #include 32 | 33 | typedef struct __panel PANEL; 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | PANEL *new_panel(WINDOW *); 39 | int del_panel(PANEL *); 40 | 41 | int replace_panel(PANEL *, WINDOW *); 42 | WINDOW *panel_window(PANEL *); 43 | 44 | int set_panel_userptr(PANEL *, char *); 45 | char *panel_userptr(PANEL *); 46 | 47 | int hide_panel(PANEL *); 48 | int show_panel(PANEL *); 49 | int panel_hidden(PANEL *); 50 | 51 | int top_panel(PANEL *); 52 | int bottom_panel(PANEL *); 53 | 54 | PANEL *panel_above(PANEL *); 55 | PANEL *panel_below(PANEL *); 56 | 57 | int move_panel(PANEL *, int, int); 58 | 59 | void update_panels(void); 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* _PANEL_H_ */ 65 | -------------------------------------------------------------------------------- /libpanel/panel_below.3: -------------------------------------------------------------------------------- 1 | panel_above.3 -------------------------------------------------------------------------------- /libpanel/panel_window.3: -------------------------------------------------------------------------------- 1 | new_panel.3 -------------------------------------------------------------------------------- /libpanel/replace.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: replace.c,v 1.3 2015/11/02 02:45:25 kamil Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | extern int touchoverlap(WINDOW *, WINDOW *); 32 | 33 | int 34 | replace_panel(PANEL *p, WINDOW *w) 35 | { 36 | 37 | if (__predict_false(p == NULL || w == NULL)) 38 | return ERR; 39 | 40 | if (!PANEL_HIDDEN(p)) { 41 | PANEL *other; 42 | 43 | /* touch exposed areas at the old location now */ 44 | FOREACH_PANEL (other) { 45 | if (other != p) 46 | touchoverlap(p->win, other->win); 47 | } 48 | } 49 | 50 | p->win = w; 51 | return OK; 52 | } 53 | -------------------------------------------------------------------------------- /libpanel/replace_panel.3: -------------------------------------------------------------------------------- 1 | new_panel.3 -------------------------------------------------------------------------------- /libpanel/replace_window.3: -------------------------------------------------------------------------------- 1 | new_panel.3 -------------------------------------------------------------------------------- /libpanel/set_panel_userptr.3: -------------------------------------------------------------------------------- 1 | panel_userptr.3 -------------------------------------------------------------------------------- /libpanel/setuser.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: setuser.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | 33 | int 34 | set_panel_userptr(PANEL *p, char *u) 35 | { 36 | if (p == NULL) 37 | return ERR; 38 | 39 | p->user = u; 40 | return OK; 41 | } 42 | -------------------------------------------------------------------------------- /libpanel/shlib_version: -------------------------------------------------------------------------------- 1 | # $NetBSD: shlib_version,v 1.1 2015/10/26 23:09:49 uwe Exp $ 2 | # Remember to update distrib/sets/lists/base/shl.* when changing 3 | # 4 | major=1 5 | minor=0 6 | -------------------------------------------------------------------------------- /libpanel/show.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: show.c,v 1.3 2015/11/02 02:45:25 kamil Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | 33 | int 34 | show_panel(PANEL *p) 35 | { 36 | 37 | if (__predict_false(p == NULL)) 38 | return ERR; 39 | 40 | /* unlike top_panel() */ 41 | if (__predict_false(!PANEL_HIDDEN(p))) 42 | return ERR; 43 | 44 | DECK_INSERT_TOP(p); 45 | return OK; 46 | } 47 | -------------------------------------------------------------------------------- /libpanel/show_panel.3: -------------------------------------------------------------------------------- 1 | panel_hidden.3 -------------------------------------------------------------------------------- /libpanel/top.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: top.c,v 1.3 2015/11/02 02:45:25 kamil Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | 33 | int 34 | top_panel(PANEL *p) 35 | { 36 | 37 | if (__predict_false(p == NULL)) 38 | return ERR; 39 | 40 | /* unlike show_panel() */ 41 | if (__predict_false(PANEL_HIDDEN(p))) 42 | return ERR; 43 | 44 | /* XXX: use common internal functions instead */ 45 | (void) hide_panel(p); 46 | (void) show_panel(p); 47 | return OK; 48 | } 49 | -------------------------------------------------------------------------------- /libpanel/top_panel.3: -------------------------------------------------------------------------------- 1 | panel_above.3 -------------------------------------------------------------------------------- /libpanel/update.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: update.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | extern int touchoverlap(WINDOW *, WINDOW *); 32 | 33 | void 34 | update_panels(void) 35 | { 36 | PANEL *p; 37 | 38 | /* 39 | * For each panel tell panels above it they need to refresh 40 | * regions that overlap (are above) this panel. This ensures 41 | * that even if a panel below was touched, it's still 42 | * overwritten by a panel above. 43 | * 44 | * Note that we also need to do this during "destructive" 45 | * operations (hide, move, replace window - which see). 46 | */ 47 | FOREACH_PANEL (p) { 48 | PANEL *above = p; 49 | while ((above = PANEL_ABOVE(above)) != NULL) { 50 | touchoverlap(p->win, above->win); 51 | } 52 | } 53 | 54 | /* 55 | * This is what effects Z-order: the window updated later 56 | * overwrites contents of the windows below (before) it. 57 | */ 58 | FOREACH_PANEL (p) { 59 | wnoutrefresh(p->win); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /libpanel/window.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: window.c,v 1.3 2015/11/02 02:45:25 kamil Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2015 Valery Ushakov 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "panel_impl.h" 31 | 32 | 33 | WINDOW * 34 | panel_window(PANEL *p) 35 | { 36 | 37 | if (p == NULL) 38 | return NULL; 39 | 40 | return p->win; 41 | } 42 | -------------------------------------------------------------------------------- /libterminfo/Makefile.hash: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile.hash,v 1.7 2013/01/24 14:17:40 roy Exp $ 2 | 3 | SCRIPT_ENV= \ 4 | NETBSDSRCDIR=${NETBSDSRCDIR:Q} \ 5 | TOOL_AWK=${TOOL_AWK:Q} \ 6 | TOOL_NBPERF=${TOOL_NBPERF:Q} \ 7 | TOOL_SED=${TOOL_SED:Q} \ 8 | TOOL_SORT=${TOOL_SORT:Q} \ 9 | TOOL_TIC=${TOOL_TIC:Q} 10 | 11 | PARSEDIR:=${.PARSEDIR} 12 | # Generate our string and hash tables 13 | hash.c: genhash term.h 14 | @echo "Generating terminfo hash" 15 | ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} > ${.TARGET} 16 | 17 | termcap_hash.c: genthash termcap_map.c 18 | @echo "Generating termcap hash" 19 | ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} > ${.TARGET} 20 | 21 | # Allow terminfo descriptions to be compiled into libterminfo 22 | compiled_terms.c: genterms term.h ${NETBSDSRCDIR}/share/terminfo/terminfo 23 | @echo "Generating compiled terminfo descriptions" 24 | ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} > ${.TARGET} 25 | 26 | .if ${USETOOLS} == "yes" 27 | compiled_terms.c: ${TOOL_TIC} 28 | .endif 29 | 30 | DPSRCS+= hash.c termcap_hash.c compiled_terms.c 31 | 32 | CLEANFILES+= hash.c termcap_hash.c compiled_terms.c 33 | -------------------------------------------------------------------------------- /libterminfo/del_curterm.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/genterms: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $NetBSD: genterms,v 1.4 2011/11/02 12:09:25 roy Exp $ 3 | 4 | # Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. 5 | # 6 | # This code is derived from software contributed to The NetBSD Foundation 7 | # by Roy Marples. 8 | # 9 | # Redistribution and use in source and binary forms, with or without 10 | # modification, are permitted provided that the following conditions 11 | # are met: 12 | # 1. Redistributions of source code must retain the above copyright 13 | # notice, this list of conditions and the following disclaimer. 14 | # 2. Redistributions in binary form must reproduce the above copyright 15 | # notice, this list of conditions and the following disclaimer in the 16 | # documentation and/or other materials provided with the distribution. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | 30 | # Generate compiled terminfo descriptions to embed into libterminfo 31 | 32 | set -e 33 | : ${TOOL_TIC:=tic} 34 | : ${NETBSDSRCDIR:=/usr/src} 35 | : ${TERMINFO:=${TERMINFODIR}/terminfo} 36 | 37 | echo "/* DO NOT EDIT" 38 | echo " * Automatically generated from terminfo */" 39 | echo 40 | TERMLIST=" 41 | xterm 42 | linux 43 | xterm-256color 44 | ansi 45 | dumb 46 | vt100 47 | screen 48 | screen-256color 49 | tmux-256color 50 | rxvt-unicode 51 | rxvt-unicode-256color 52 | st-256color 53 | dvtm 54 | dvtm-256color 55 | fbpad-256 56 | " 57 | 58 | ${TOOL_TIC} -Sx ${TERMINFO} ${TERMLIST} 59 | -------------------------------------------------------------------------------- /libterminfo/genthash: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $NetBSD: genthash,v 1.5 2011/11/02 12:09:25 roy Exp $ 3 | 4 | # Copyright (c) 2009, 2011 The NetBSD Foundation, Inc. 5 | # 6 | # This code is derived from software contributed to The NetBSD Foundation 7 | # by Roy Marples. 8 | # 9 | # Redistribution and use in source and binary forms, with or without 10 | # modification, are permitted provided that the following conditions 11 | # are met: 12 | # 1. Redistributions of source code must retain the above copyright 13 | # notice, this list of conditions and the following disclaimer. 14 | # 2. Redistributions in binary form must reproduce the above copyright 15 | # notice, this list of conditions and the following disclaimer in the 16 | # documentation and/or other materials provided with the distribution. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | 30 | # Generate string and hash tables for our termcap strings in termcap.c 31 | 32 | set -e 33 | : ${TOOL_NBPERF:=nbperf} 34 | : ${TOOL_SED:=sed} 35 | 36 | TERMCAPC=${1:-termcap_map.c} 37 | 38 | cat < 43 | #include 44 | #include 45 | extern void mi_vector_hash(const void *restrict, size_t, uint32_t, uint32_t[3]); 46 | 47 | EOF 48 | 49 | $TOOL_SED -n -e "1,/_ti_cap_flagids/d" -e '/};/,$d' \ 50 | -e 's/.*"\([^"]*\)".*/\1/p' $TERMCAPC | \ 51 | $TOOL_NBPERF -p -s -n _t_flaghash 52 | echo 53 | $TOOL_SED -n -e "1,/_ti_cap_numids/d" -e '/};/,$d' \ 54 | -e 's/.*"\([^"]*\)".*/\1/p' $TERMCAPC | \ 55 | $TOOL_NBPERF -p -s -n _t_numhash 56 | echo 57 | $TOOL_SED -n -e "1,/_ti_cap_strids/d" -e '/};/,$d' \ 58 | -e 's/.*"\([^"]*\)".*/\1/p' $TERMCAPC | \ 59 | $TOOL_NBPERF -p -s -n _t_strhash 60 | -------------------------------------------------------------------------------- /libterminfo/longname.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/putp.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/set_curterm.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/setupterm.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/shlib_version: -------------------------------------------------------------------------------- 1 | # $NetBSD: shlib_version,v 1.1 2010/02/03 15:16:32 roy Exp $ 2 | # Remember to update distrib/sets/lists/base/shl.* when changing 3 | # 4 | major=1 5 | minor=0 6 | -------------------------------------------------------------------------------- /libterminfo/termcap.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: termcap.h,v 1.2 2011/04/11 21:13:09 roy Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2009, 2011 The NetBSD Foundation, Inc. 5 | * 6 | * This code is derived from software contributed to The NetBSD Foundation 7 | * by Roy Marples. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef _TERMCAP_H_ 31 | #define _TERMCAP_H_ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Output functions. 38 | * These are still valid for terminfo. */ 39 | int putp(const char *); 40 | int tputs(const char *, int, int (*)(int)); 41 | 42 | extern short ospeed; 43 | extern char PC; 44 | extern char *BC; 45 | extern char *UP; 46 | 47 | int tgetent(char *, const char *); 48 | char * tgetstr(const char *, char **); 49 | int tgetflag(const char *); 50 | int tgetnum(const char *); 51 | char * tgoto(const char *, int, int); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | #endif 57 | -------------------------------------------------------------------------------- /libterminfo/termname.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/tgetent.3: -------------------------------------------------------------------------------- 1 | termcap.3 -------------------------------------------------------------------------------- /libterminfo/tgetflag.3: -------------------------------------------------------------------------------- 1 | termcap.3 -------------------------------------------------------------------------------- /libterminfo/tgetnum.3: -------------------------------------------------------------------------------- 1 | termcap.3 -------------------------------------------------------------------------------- /libterminfo/tgetstr.3: -------------------------------------------------------------------------------- 1 | termcap.3 -------------------------------------------------------------------------------- /libterminfo/tgoto.3: -------------------------------------------------------------------------------- 1 | termcap.3 -------------------------------------------------------------------------------- /libterminfo/ti_getflag.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/ti_getnum.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/ti_getstr.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/ti_putp.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/ti_puts.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/ti_setupterm.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/ti_tiparm.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/tigetflag.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/tigetnum.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/tigetstr.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/tiparm.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/tparm.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /libterminfo/tputs.3: -------------------------------------------------------------------------------- 1 | terminfo.3 -------------------------------------------------------------------------------- /nbperf/GNUmakefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.1 2009/08/15 16:21:04 joerg Exp $ 2 | 3 | PROG= nbperf 4 | SRCS= nbperf.c 5 | SRCS+= nbperf-bdz.c nbperf-chm.c nbperf-chm3.c 6 | SRCS+= graph2.c graph3.c 7 | SRCS+= mi_vector_hash.c 8 | 9 | CPPFLAGS += -I.. 10 | 11 | OBJS = $(SRCS:.c=.o) 12 | 13 | all: $(PROG) 14 | 15 | clean: 16 | rm -f $(OBJS) $(PROG) 17 | 18 | $(PROG): $(OBJS) 19 | $(CC) $(LDFLAGS) $^ -o $@ 20 | 21 | %.o: %.c 22 | $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $< 23 | 24 | -------------------------------------------------------------------------------- /nbperf/Makefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.1 2009/08/15 16:21:04 joerg Exp $ 2 | 3 | PROG= nbperf 4 | SRCS= nbperf.c 5 | SRCS+= nbperf-bdz.c nbperf-chm.c nbperf-chm3.c 6 | SRCS+= graph2.c graph3.c 7 | 8 | .include 9 | -------------------------------------------------------------------------------- /nbperf/graph2.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: graph2.h,v 1.1 2009/08/15 16:21:05 joerg Exp $ */ 2 | /*- 3 | * Copyright (c) 2009 The NetBSD Foundation, Inc. 4 | * All rights reserved. 5 | * 6 | * This code is derived from software contributed to The NetBSD Foundation 7 | * by Joerg Sonnenberger. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 26 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 30 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | */ 33 | 34 | /* 35 | * Implementation of common 2-graph routines: 36 | * - build a 2-graph with hash-pairs as edges 37 | * - check a 2-graph for acyclicness and compute an output order 38 | */ 39 | 40 | struct vertex2 { 41 | uint32_t l_edge, r_edge; 42 | }; 43 | 44 | struct edge2 { 45 | uint32_t left, right; 46 | uint32_t l_prev, l_next; 47 | uint32_t r_prev, r_next; 48 | }; 49 | 50 | struct graph2 { 51 | struct vertex2 *verts; 52 | struct edge2 *edges; 53 | uint32_t output_index; 54 | uint32_t *output_order; 55 | uint8_t *visited; 56 | uint32_t e, v; 57 | }; 58 | 59 | void graph2_setup(struct graph2 *, uint32_t, uint32_t); 60 | void graph2_free(struct graph2 *); 61 | 62 | int graph2_hash(struct nbperf *, struct graph2 *); 63 | int graph2_output_order(struct graph2 *graph); 64 | -------------------------------------------------------------------------------- /nbperf/graph3.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: graph3.h,v 1.1 2009/08/15 16:21:05 joerg Exp $ */ 2 | /*- 3 | * Copyright (c) 2009 The NetBSD Foundation, Inc. 4 | * All rights reserved. 5 | * 6 | * This code is derived from software contributed to The NetBSD Foundation 7 | * by Joerg Sonnenberger. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 26 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 30 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | */ 33 | 34 | /* 35 | * Implementation of common 3-graph routines: 36 | * - build a 3-graph with hash-triple as edges 37 | * - check a 3-graph for acyclicness and compute an output order 38 | */ 39 | 40 | struct vertex3 { 41 | uint32_t l_edge, m_edge, r_edge; 42 | }; 43 | 44 | struct edge3 { 45 | uint32_t left, middle, right; 46 | uint32_t l_prev, m_prev, l_next; 47 | uint32_t r_prev, m_next, r_next; 48 | }; 49 | 50 | struct graph3 { 51 | struct vertex3 *verts; 52 | struct edge3 *edges; 53 | uint32_t output_index; 54 | uint32_t *output_order; 55 | uint32_t e, v; 56 | }; 57 | 58 | void graph3_setup(struct graph3 *, uint32_t, uint32_t); 59 | void graph3_free(struct graph3 *); 60 | 61 | int graph3_hash(struct nbperf *, struct graph3 *); 62 | int graph3_output_order(struct graph3 *); 63 | -------------------------------------------------------------------------------- /nbperf/mi_vector_hash.c: -------------------------------------------------------------------------------- 1 | ../libterminfo/mi_vector_hash.c -------------------------------------------------------------------------------- /nbperf/nbperf-chm3.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: nbperf-chm3.c,v 1.1 2009/08/15 16:21:05 joerg Exp $ */ 2 | 3 | #define BUILD_CHM3 4 | #include "nbperf-chm.c" 5 | -------------------------------------------------------------------------------- /nbperf/nbperf.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: nbperf.h,v 1.4 2013/01/31 16:32:02 joerg Exp $ */ 2 | /*- 3 | * Copyright (c) 2009 The NetBSD Foundation, Inc. 4 | * All rights reserved. 5 | * 6 | * This code is derived from software contributed to The NetBSD Foundation 7 | * by Joerg Sonnenberger. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 26 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 30 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | */ 33 | 34 | #define NBPERF_MAX_HASH_SIZE 3 35 | 36 | struct nbperf { 37 | FILE *output; 38 | FILE *map_output; 39 | const char *hash_name; 40 | int static_hash; 41 | size_t n; 42 | const void * __restrict * keys; 43 | const size_t *keylens; 44 | int first_round, has_duplicates; 45 | 46 | double c; 47 | 48 | size_t hash_size; 49 | void (*seed_hash)(struct nbperf *); 50 | void (*print_hash)(struct nbperf *, const char *, const char *, const char *, 51 | const char *); 52 | void (*compute_hash)(struct nbperf *, const void *, size_t, 53 | uint32_t *); 54 | uint32_t seed[1]; 55 | }; 56 | 57 | int chm_compute(struct nbperf *); 58 | int chm3_compute(struct nbperf *); 59 | int bpz_compute(struct nbperf *); 60 | -------------------------------------------------------------------------------- /netbsd_sys/cdefs.h: -------------------------------------------------------------------------------- 1 | #ifndef NETBSD_SYS_CDEFS_H 2 | #define NETBSD_SYS_CDEFS_H 3 | 4 | #ifndef __RCSID 5 | #define __RCSID(X) 6 | #endif 7 | #ifndef __BEGIN_DECLS 8 | #define __BEGIN_DECLS 9 | #define __END_DECLS 10 | #endif 11 | #ifndef __COPYRIGHT 12 | #define __COPYRIGHT(X) 13 | #endif 14 | 15 | #ifndef __printflike 16 | #if __GNUC__ >= 3 17 | #define __printflike(fmtarg, firstvararg) \ 18 | __attribute__((__format__ (__printf__, fmtarg, firstvararg))) 19 | #define __scanflike(fmtarg, firstvararg) \ 20 | __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) 21 | #else 22 | #define __printflike(fmtarg, firstvararg) /* nothing */ 23 | #define __scanflike(fmtarg, firstvararg) /* nothing */ 24 | #endif 25 | #endif 26 | 27 | #ifndef __warn_references 28 | #define __warn_references(a, b) 29 | #endif 30 | #ifndef __P 31 | #define __P(X) X 32 | #endif 33 | #ifndef __dead 34 | #define __dead __attribute__((__noreturn__)) 35 | #endif 36 | #define __UNCONST(a) (void *)(intptr_t)(a) 37 | # define __STRING(x) #x 38 | #if 0 39 | #define __strong_alias(alias,sym) \ 40 | __asm__(".global " __STRING(alias) " ; " __STRING(alias) \ 41 | " = " __STRING(sym)) ; 42 | #else 43 | #undef myweak_alias 44 | #define myweak_alias(old, new) \ 45 | extern __typeof(old) new __attribute__((weak, alias(#old))) 46 | #define __strong_alias(new, old) myweak_alias(old, new); 47 | #endif 48 | #ifndef _DIAGASSERT 49 | #define _DIAGASSERT(x) 50 | #endif 51 | #ifndef __arraycount 52 | #define __arraycount(a) (sizeof(a) / sizeof(*(a))) 53 | #endif 54 | 55 | #if __GNUC__ >= 4 56 | # define __dso_public __attribute__((__visibility__("default"))) 57 | # define __dso_hidden __attribute__((__visibility__("hidden"))) 58 | #else 59 | # define __dso_public 60 | # define __dso_hidden 61 | #endif 62 | #if defined(__predict_true) 63 | #elif __GNUC__ >= 3 64 | #define __predict_true(exp) __builtin_expect((exp) != 0, 1) 65 | #define __predict_false(exp) __builtin_expect((exp) != 0, 0) 66 | #else 67 | #define __predict_true(exp) (exp) 68 | #define __predict_false(exp) (exp) 69 | #endif 70 | 71 | #endif 72 | 73 | -------------------------------------------------------------------------------- /netbsd_sys/emalloc.h: -------------------------------------------------------------------------------- 1 | #ifndef EMALLOC_H 2 | #define EMALLOC_H 3 | 4 | /* replacement functions for emalloc() and friends used in netbsd code */ 5 | 6 | #undef _GNU_SOURCE 7 | #define _GNU_SOURCE 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | static void mallerr(void) { 14 | dprintf(2, "error: out of memory\n"); 15 | abort(); 16 | } 17 | static inline void* emalloc(size_t x) { 18 | void *p=malloc(x); 19 | if(!p) mallerr(); 20 | return p; 21 | } 22 | static inline void* ecalloc(size_t x, size_t y) { 23 | void *p=calloc(x, y); 24 | if(!p) mallerr(); 25 | return p; 26 | } 27 | static inline void* erealloc(void *x, size_t y) { 28 | void *p=realloc(x, y); 29 | if(!p) mallerr(); 30 | return p; 31 | } 32 | static inline char* estrdup(const char* x) { 33 | char *p = strdup(x); 34 | if(!p) mallerr(); 35 | return p; 36 | } 37 | static int easprintf(char **s, const char *fmt, ...) { 38 | int ret; 39 | va_list ap; 40 | va_start(ap, fmt); 41 | ret = vasprintf(s, fmt, ap); 42 | va_end(ap); 43 | if(ret == -1) mallerr(); 44 | return ret; 45 | } 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /netbsd_sys/endian.h: -------------------------------------------------------------------------------- 1 | #ifndef NETBSD_SYS_ENDIAN_H 2 | #define NETBSD_SYS_ENDIAN_H 3 | 4 | #if defined(__BYTE_ORDER__) 5 | #undef __BYTE_ORDER 6 | #define __BYTE_ORDER __BYTE_ORDER__ 7 | #undef __LITTLE_ENDIAN 8 | #define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ 9 | #else 10 | #include 11 | #endif 12 | #if __LITTLE_ENDIAN+0 != 1234 13 | #error erroneus __LITTLE_ENDIAN macro 14 | #endif 15 | #include 16 | 17 | #ifndef le32toh 18 | #if __BYTE_ORDER == __LITTLE_ENDIAN 19 | #define le32toh(x) (uint32_t)(x) 20 | #define le16toh(x) (uint16_t)(x) 21 | #else 22 | static __inline uint32_t nbs_bswap32(uint32_t __x) 23 | { 24 | return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24; 25 | } 26 | static __inline uint16_t nbs_bswap16(uint16_t __x) 27 | { 28 | return __x<<8 | __x>>8; 29 | } 30 | #define le32toh(x) nbs_bswap32(x) 31 | #define le16toh(x) nbs_bswap16(x) 32 | #endif 33 | #endif 34 | 35 | #define __CAST(__dt, __st) ((__dt)(__st)) 36 | static inline uint16_t 37 | le16dec(const void *buf) 38 | { 39 | const uint8_t *p = __CAST(const uint8_t *, buf); 40 | 41 | return (p[0] | (__CAST(uint16_t, p[1]) << 8)); 42 | } 43 | 44 | static inline uint32_t 45 | le32dec(const void *buf) 46 | { 47 | const uint8_t *p = __CAST(const uint8_t *, buf); 48 | 49 | return (le16dec(p) | (__CAST(uint32_t, le16dec(p + 2)) << 16)); 50 | } 51 | static inline void 52 | le16enc(void *buf, uint16_t u) 53 | { 54 | uint8_t *p = __CAST(uint8_t *, buf); 55 | 56 | p[0] = __CAST(uint8_t, (u & 0xff)); 57 | p[1] = __CAST(uint8_t, ((__CAST(unsigned, u) >> 8) & 0xff)); 58 | } 59 | static inline void 60 | le32enc(void *buf, uint32_t u) 61 | { 62 | uint8_t *p = __CAST(uint8_t *, buf); 63 | 64 | p[0] = __CAST(uint8_t, (u & 0xff)); 65 | p[1] = __CAST(uint8_t, ((u >> 8) & 0xff)); 66 | p[2] = __CAST(uint8_t, ((u >> 16) & 0xff)); 67 | p[3] = __CAST(uint8_t, ((u >> 24) & 0xff)); 68 | } 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /tabs/Makefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.3 2010/02/03 15:34:46 roy Exp $ 2 | 3 | PROG= tabs 4 | DPADD= ${LIBTERMINFO} 5 | LDADD= -lterminfo 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /terminfo/Makefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.5 2020/03/27 15:11:57 christos Exp $ 2 | # from: @(#)Makefile 8.1 (Berkeley) 6/8/93 3 | 4 | CLEANFILES= terminfo.cdb 5 | realall: terminfo.cdb 6 | FILES=terminfo.cdb terminfo 7 | FILESDIR=${BINDIR}/misc 8 | 9 | terminfo.cdb: terminfo ${TOOL_TIC} 10 | ${_MKTARGET_CREATE} 11 | ${TOOL_TIC} -ax -o ${.TARGET} "${.CURDIR}/terminfo" 12 | 13 | .include 14 | -------------------------------------------------------------------------------- /tic/GNUmakefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.2 2012/05/31 20:10:06 joerg Exp $ 2 | PROG= tic 3 | WARNS= 4 4 | SRCS=tic.c 5 | SRCS+=cdbw.c mi_vector_hash.c compile.c hash.c 6 | CLEANFILES+=hash.c 7 | 8 | CPPFLAGS+= -I../libterminfo 9 | CPPFLAGS+= -I.. -I. 10 | CFLAGS+=-Werror-implicit-function-declaration 11 | ifndef HOSTPROG 12 | LDADD+= -lterminfo -lutil 13 | DPADD+= ${LIBTERMINFO} ${LIBUTIL} 14 | endif 15 | 16 | OBJS = $(SRCS:.c=.o) 17 | 18 | all: $(PROG) 19 | 20 | clean: 21 | rm -f $(OBJS) $(PROG) $(CLEANFILES) 22 | 23 | $(PROG): $(OBJS) 24 | $(CC) $(LDFLAGS) $^ -o $@ 25 | 26 | %.o: %.c 27 | $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $< 28 | 29 | hash.c: ../libterminfo/hash.c 30 | cp ../libterminfo/hash.c hash.c 31 | 32 | ../libterminfo/hash.c: 33 | $(MAKE) -C ../libterminfo hash.c 34 | 35 | -------------------------------------------------------------------------------- /tic/Makefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.2 2012/05/31 20:10:06 joerg Exp $ 2 | 3 | PROG= tic 4 | WARNS= 4 5 | 6 | CPPFLAGS+= -I${.CURDIR}/../../lib/libterminfo 7 | 8 | .ifndef HOSTPROG 9 | LDADD+= -lterminfo -lutil 10 | DPADD+= ${LIBTERMINFO} ${LIBUTIL} 11 | .endif 12 | 13 | .include 14 | -------------------------------------------------------------------------------- /tic/cdbw.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: cdbw.h,v 1.2 2012/06/03 21:21:45 joerg Exp $ */ 2 | /*- 3 | * Copyright (c) 2010 The NetBSD Foundation, Inc. 4 | * All rights reserved. 5 | * 6 | * This code is derived from software contributed to The NetBSD Foundation 7 | * by Joerg Sonnenberger. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 26 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 30 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef _CDBW_H 35 | #define _CDBW_H 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | struct cdbw; 42 | 43 | __BEGIN_DECLS 44 | 45 | struct cdbw *cdbw_open(void); 46 | int cdbw_put(struct cdbw *, const void *, size_t, 47 | const void *, size_t); 48 | int cdbw_put_data(struct cdbw *, const void *, size_t, 49 | uint32_t *); 50 | int cdbw_put_key(struct cdbw *, const void *, size_t, 51 | uint32_t); 52 | uint32_t cdbw_stable_seeder(void); 53 | int cdbw_output(struct cdbw *, int, const char[16], 54 | uint32_t (*)(void)); 55 | void cdbw_close(struct cdbw *); 56 | 57 | __END_DECLS 58 | 59 | #endif /* _CDBW_H */ 60 | -------------------------------------------------------------------------------- /tic/compile.c: -------------------------------------------------------------------------------- 1 | ../libterminfo/compile.c -------------------------------------------------------------------------------- /tic/mi_vector_hash.c: -------------------------------------------------------------------------------- 1 | ../libterminfo/mi_vector_hash.c -------------------------------------------------------------------------------- /tput/GNUmakefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.11 2013/01/24 10:41:28 roy Exp $ 2 | # @(#)Makefile 8.1 (Berkeley) 6/6/93 3 | 4 | PROG= tput 5 | SRCS=tput.c 6 | DPADD= ${LIBTERMINFO} 7 | LDADD= -lterminfo 8 | MLINKS= tput.1 clear.1 9 | SCRIPTS=clear.sh 10 | 11 | #CPPFLAGS+= -I${.CURDIR}/../../lib/libterminfo 12 | 13 | CPPFLAGS+= -I.. -I. -I../libterminfo 14 | CFLAGS+=-Werror-implicit-function-declaration 15 | 16 | OBJS = $(SRCS:.c=.o) 17 | 18 | all: $(PROG) 19 | 20 | clean: 21 | rm -f $(OBJS) $(PROG) $(CLEANFILES) 22 | 23 | $(PROG): $(OBJS) 24 | $(CC) $(LDFLAGS) $^ -o $@ -L ../libterminfo $(LDADD) -static 25 | 26 | %.o: %.c 27 | $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $< 28 | 29 | -------------------------------------------------------------------------------- /tput/Makefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.11 2013/01/24 10:41:28 roy Exp $ 2 | # @(#)Makefile 8.1 (Berkeley) 6/6/93 3 | 4 | PROG= tput 5 | DPADD= ${LIBTERMINFO} 6 | LDADD= -lterminfo 7 | MLINKS= tput.1 clear.1 8 | SCRIPTS=clear.sh 9 | 10 | CPPFLAGS+= -I${.CURDIR}/../../lib/libterminfo 11 | 12 | .include 13 | -------------------------------------------------------------------------------- /tput/clear.1: -------------------------------------------------------------------------------- 1 | tput.1 -------------------------------------------------------------------------------- /tput/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh - 2 | # $NetBSD: clear.sh,v 1.2 1994/12/07 08:49:09 jtc Exp $ 3 | # 4 | # Copyright (c) 1989, 1993 5 | # The Regents of the University of California. All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions 9 | # are met: 10 | # 1. Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright 13 | # notice, this list of conditions and the following disclaimer in the 14 | # documentation and/or other materials provided with the distribution. 15 | # 3. All advertising materials mentioning features or use of this software 16 | # must display the following acknowledgement: 17 | # This product includes software developed by the University of 18 | # California, Berkeley and its contributors. 19 | # 4. Neither the name of the University nor the names of its contributors 20 | # may be used to endorse or promote products derived from this software 21 | # without specific prior written permission. 22 | # 23 | # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 | # SUCH DAMAGE. 34 | # 35 | # @(#)clear.sh 8.1 (Berkeley) 6/6/93 36 | # 37 | 38 | exec tput clear 39 | -------------------------------------------------------------------------------- /tset/GNUmakefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.7 2012/04/21 12:27:30 roy Exp $ 2 | # @(#)Makefile 8.1 (Berkeley) 6/9/93 3 | 4 | PROG= tset 5 | SRCS= map.c misc.c set.c term.c tset.c 6 | 7 | DPADD= ${LIBTERMINFO} 8 | LDADD= -lterminfo 9 | LINKS= ${BINDIR}/tset ${BINDIR}/reset 10 | MLINKS= tset.1 reset.1 11 | CPPFLAGS+= -I.. -I. -I../libterminfo 12 | CFLAGS+=-Werror-implicit-function-declaration 13 | 14 | OBJS = $(SRCS:.c=.o) 15 | 16 | all: $(PROG) 17 | 18 | clean: 19 | rm -f $(OBJS) $(PROG) $(CLEANFILES) 20 | 21 | $(PROG): $(OBJS) 22 | $(CC) $(LDFLAGS) $^ -o $@ -L ../libterminfo $(LDADD) -static 23 | 24 | %.o: %.c 25 | $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $< 26 | 27 | -------------------------------------------------------------------------------- /tset/Makefile: -------------------------------------------------------------------------------- 1 | # $NetBSD: Makefile,v 1.7 2012/04/21 12:27:30 roy Exp $ 2 | # @(#)Makefile 8.1 (Berkeley) 6/9/93 3 | 4 | PROG= tset 5 | SRCS= map.c misc.c set.c term.c tset.c 6 | 7 | DPADD= ${LIBTERMINFO} 8 | LDADD= -lterminfo 9 | LINKS= ${BINDIR}/tset ${BINDIR}/reset 10 | MLINKS= tset.1 reset.1 11 | 12 | .include 13 | -------------------------------------------------------------------------------- /tset/extern.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: extern.h,v 1.14 2011/09/06 18:34:12 joerg Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1991, 1993 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | * 31 | * @(#)extern.h 8.1 (Berkeley) 6/9/93 32 | */ 33 | 34 | extern struct termios mode, oldmode; 35 | extern int ncolumns, isreset, nlines; 36 | 37 | void add_mapping(const char *, char *); 38 | void tset_cat(const char *); 39 | const char *get_terminfo_entry(const char *); 40 | const char *mapped(const char *); 41 | int outc(int); 42 | void reset_mode(void); 43 | void set_control_chars(int, int, int); 44 | void set_conversions(int); 45 | void set_init(void); 46 | void wrtermcap(char *); 47 | -------------------------------------------------------------------------------- /tset/reset.1: -------------------------------------------------------------------------------- 1 | tset.1 --------------------------------------------------------------------------------