Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses Added separate man pages for curses functions ...



details:   https://anonhg.NetBSD.org/src/rev/748b3afe663c
branches:  trunk
changeset: 538472:748b3afe663c
user:      blymn <blymn%NetBSD.org@localhost>
date:      Mon Oct 21 13:55:12 2002 +0000

description:
Added separate man pages for curses functions to provide better
documentation of the curses functions.

diffstat:

 lib/libcurses/Makefile                |  102 ++++++-
 lib/libcurses/curses_color.3          |  204 ++++++++++++++
 lib/libcurses/curses_cursor.3         |  202 ++++++++++++++
 lib/libcurses/curses_default_colors.3 |   77 +++++
 lib/libcurses/curses_delch.3          |   90 ++++++
 lib/libcurses/curses_deleteln.3       |  110 +++++++
 lib/libcurses/curses_inch.3           |  196 +++++++++++++
 lib/libcurses/curses_input.3          |  487 ++++++++++++++++++++++++++++++++++
 lib/libcurses/curses_insdelln.3       |  115 ++++++++
 lib/libcurses/curses_insertch.3       |  119 ++++++++
 lib/libcurses/curses_insertln.3       |  109 +++++++
 lib/libcurses/curses_line.3           |  159 +++++++++++
 lib/libcurses/curses_print.3          |  124 ++++++++
 lib/libcurses/curses_refresh.3        |  149 ++++++++++
 lib/libcurses/curses_scanw.3          |  115 ++++++++
 lib/libcurses/curses_screen.3         |  168 +++++++++++
 lib/libcurses/curses_scroll.3         |  169 +++++++++++
 lib/libcurses/curses_standout.3       |  107 +++++++
 lib/libcurses/curses_termcap.3        |  104 +++++++
 lib/libcurses/curses_touch.3          |  159 +++++++++++
 lib/libcurses/curses_tty.3            |  332 +++++++++++++++++++++++
 lib/libcurses/curses_underscore.3     |  103 +++++++
 lib/libcurses/curses_window.3         |  227 +++++++++++++++
 23 files changed, 3725 insertions(+), 2 deletions(-)

diffs (truncated from 3836 to 300 lines):

diff -r a95793a0fff1 -r 748b3afe663c lib/libcurses/Makefile
--- a/lib/libcurses/Makefile    Mon Oct 21 13:55:11 2002 +0000
+++ b/lib/libcurses/Makefile    Mon Oct 21 13:55:12 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.37 2002/08/19 09:41:30 lukem Exp $
+#      $NetBSD: Makefile,v 1.38 2002/10/21 13:55:25 blymn Exp $
 #      @(#)Makefile    8.2 (Berkeley) 1/2/94
 
 .include <bsd.own.mk>
@@ -23,7 +23,14 @@
        scanw.c screen.c scroll.c scrollok.c setterm.c standout.c timeout.c \
        toucholap.c touchwin.c tscroll.c tstp.c tty.c unctrl.c underscore.c
 
-MAN=   curses.3
+MAN=   curses.3 curses_addch.3 curses_addstr.3 curses_attributes.3 \
+       curses_background.3 curses_border.3 curses_clear.3 curses_color.3 \
+       curses_cursor.3 curses_default_colors.3 curses_delch.3 \
+       curses_deleteln.3 curses_inch.3 curses_input.3 curses_insertch.3 \
+       curses_insertln.3 curses_insdelln.3 curses_line.3 curses_print.3 \
+       curses_refresh.3 curses_scanw.3 curses_screen.3 curses_scroll.3 \
+       curses_standout.3 curses_termcap.3 curses_touch.3 curses_tty.3 \
+       curses_underscore.3 curses_window.3
 INCS=  curses.h unctrl.h
 INCSDIR=/usr/include
 
@@ -31,6 +38,97 @@
 SRCS+= termcap.c tgoto.c tputs.c
 .PATH: ${NETBSDSRCDIR}/lib/libterm
 
+MLINKS+= curses_addch.3 addch.3 curses_addstr.3 addstr.3 \
+        curses_addstr.3 addnstr.3 \
+        curses_default_colors.3 assume_default_colors.3 \
+        curses_attributes.3 attron.3 curses_attributes.3 attroff.3 \
+        curses_attributes.3 attrset.3 curses_tty.3 beep.3 \
+        curses_background.3 bkgd.3 curses_background.3 bkgdset.3 \
+        curses_border.3 border.3 curses_border.3 box.3 \
+        curses_color.3 can_change_colors.3 curses_tty.3 cbreak.3 \
+        curses_clear.3 clear.3 curses_clear.3 clearok.3 \
+        curses_clear.3 clrtobot.3 curses_clear.3 clrtoeol.3 \
+        curses_color.3 color_content.3 curses_window.3 copywin.3 \
+        curses_tty.3 curs_set.3 curses_tty.3 delay_output.3 \
+        curses_tty.3 def_prog_mode.3 curses_tty.3 def_shell_mode.3 \
+        curses_delch.3 delch.3 curses_deleteln.3 deleteln.3 \
+        curses_screen.3 delscreen.3 curses_window.3 delwin.3 \
+        curses_window.3 derwin.3 curses_refresh.3 doupdate.3 \
+        curses_window.3 dupwin.3 curses_tty.3 echo.3 \
+        curses_screen.3 endwin.3 curses_clear.3 erase.3 \
+        curses_tty.3 erasechar.3 curses_tty.3 flash.3 \
+        curses_tty.3 flushinp.3 curses_refresh.3 flushok.3 \
+        curses_termcap.3 fullname.3 curses_attributes.3 getattrs.3  \
+        curses_background.3 getbkgd.3 curses_termcap.3 getcap.3 \
+        curses_input.3 getch.3 curses_cursor.3 getcury.3 \
+        curses_cursor.3 getcurx.3 curses_cursor.3 getbegy.3 \
+        curses_cursor.3 getbegx.3 curses_cursor.3 getmaxy.3 \
+        curses_cursor.3 getmaxx.3 curses_input.3 getnstr.3 \
+        curses_cursor.3 getpary.3 curses_cursor.3 getparx.3 \
+        curses_cursor.3 getparyx.3 curses_input.3 getstr.3 \
+        curses_tty.3 gettmode.3 curses_cursor.3 getyx.3 \
+        curses_color.3 has_colors.3 curses_tty.3 has_ic.3 \
+        curses_tty.3 has_il.3 curses_line.3 hline.3 \
+        curses_tty.3 idcok.3 curses_tty.3 idlok.3 \
+        curses_inch.3 inch.3 curses_inch.3 inchnstr.3 \
+        curses_inch.3 inchstr.3 curses_inch.3 innstr.3 \
+        curses_color.3 init_color.3 curses_color.3 init_pair.3 \
+        curses_screen.3 initscr.3 curses_insertch.3 insch.3 \
+        curses_insdelln.3 insdelln.3 curses_insertln.3 insertln.3 \
+        curses_inch.3 instr.3 curses_tty.3 intrflush.3 \
+        curses_touch.3 is_linetouched.3 curses_touch.3 is_wintouched.3 \
+        curses_screen.3 isendwin.3 curses_input.3 keypad.3 \
+        curses_tty.3 killchar.3 curses_refresh.3 leaveok.3 \
+        curses_termcap.3 longname.3 curses_tty.3 meta.3 \
+        curses_cursor.3 move.3 curses_cursor.3 mvcur.3 \
+        curses_window.3 mvderwin.3 curses_input.3 mvgetnstr.3 \
+        curses_input.3 mvgetstr.3 curses_line.3 mvhline.3 \
+        curses_line.3 mvvline.3 curses_input.3 mvwgetnstr.3 \
+        curses_input.3 mvwgetstr.3 curses_line.3 mvwhline.3 \
+        curses_line.3 mvwvline.3 curses_tty.3 napms.3 \
+        curses_screen.3 newterm.3 curses_window.3 newwin.3 \
+        curses_tty.3 nl.3 curses_tty.3 nocbreak.3 \
+        curses_input.3 nodelay.3 curses_tty.3 noecho.3 \
+        curses_tty.3 nonl.3 curses_tty.3 noraw.3 \
+        curses_input.3 notimeout.3 curses_window.3 overlay.3 \
+        curses_window.3 overwrite.3 curses_color.3 pair_content.3 \
+        curses_print.3 printw.3 curses_tty.3 raw.3 \
+        curses_refresh.3 refresh.3 curses_tty.3 reset_prog_mode.3 \
+        curses_tty.3 reset_shell_mode.3 curses_tty.3 resetty.3 \
+        curses_screen.3 resizeterm.3 curses_tty.3 savetty.3 \
+        curses_scanw.3 scanw.3 curses_scroll.3 scrl.3 \
+        curses_scroll.3 scroll.3 curses_scroll.3 scrollok.3 \
+        curses_scroll.3 setscrreg.3 curses_screen.3 set_term.3 \
+        curses_screen.3 setterm.3 curses_standout.3 standend.3 \
+        curses_standout.3 standout.3 curses_color.3 start_color.3 \
+        curses_window.3 subwin.3 curses_input.3 timeout.3 \
+        curses_touch.3 touchline.3 curses_touch.3 touchoverlap.3 \
+        curses_touch.3 touchwin.3 curses_print.3 unctrl.3 \
+        curses_underscore.3 underend.3 curses_underscore.3 underscore.3 \
+        curses_input.3 ungetch.3 curses_touch.3 untouchwin.3 \
+        curses_default_colors.3 use_default_colors.3 curses_line.3 vline.3 \
+        curses_addch.3 waddch.3 curses_addstr.3 waddstr.3 \
+        curses_attributes.3 wattron.3 curses_attributes.3 wattroff.3 \
+        curses_attributes.3 wattrset.3 curses_background.3 wbkgd.3 \
+        curses_background.3 wbkgdset.3 curses_border.3 wborder.3 \
+        curses_clear.3 wclear.3 curses_clear.3 wclrtobot.3 \
+        curses_clear.3 wclrtoeol.3 curses_delch.3 wdelch.3 \
+        curses_deleteln.3 wdeleteln.3 curses_clear.3 werase.3 \
+        curses_input.3 wgetch.3 curses_input.3 wgetnstr.3 \
+        curses_input.3 wgetstr.3 curses_line.3 whline.3 \
+        curses_inch.3 winch.3 curses_inch.3 winchnstr.3 \
+        curses_inch.3 winchstr.3 curses_inch.3 winnstr.3 \
+        curses_insertch.3 winsch.3 curses_insdelln.3 winsdelln.3 \
+        curses_insertln.3 winsertln.3 curses_inch.3 winstr.3 \
+        curses_cursor.3 wmove.3 curses_refresh.3 wnoutrefresh.3 \
+        curses_print.3 wprintw.3 curses_refresh.3 wrefresh.3 \
+        curses_window.3 wresize.3 curses_scanw.3 wscanw.3 \
+        curses_scroll.3 wscrl.3 curses_scroll.3 wsetscrreg.3 \
+        curses_standout.3 wstandend.3 curses_standout.3 wstandout.3 \
+        curses_input.3 wtimeout.3 curses_touch.3 wtouchln.3 \
+        curses_underscore.3 wunderend.3 curses_underscore.3 wunderscore.3 \
+        curses_line.3 wvline.3
+
 .if make(install)
 SUBDIR+= PSD.doc
 .endif
diff -r a95793a0fff1 -r 748b3afe663c lib/libcurses/curses_color.3
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libcurses/curses_color.3      Mon Oct 21 13:55:12 2002 +0000
@@ -0,0 +1,204 @@
+.\"    $NetBSD: curses_color.3,v 1.1 2002/10/21 13:55:12 blymn Exp $
+.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Julian Coleman.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of The NetBSD Foundation nor the names of its
+.\"    contributors may be used to endorse or promote products derived
+.\"    from this software without specific prior written permission.
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd October 13, 2002
+.Dt CURSES_COLOR 3
+.Os
+.Sh NAME
+.Nm curses_color ,
+.Nm has_colors ,
+.Nm can_change_colors ,
+.Nm start_color ,
+.Nm init_pair ,
+.Nm pair_content ,
+.Nm COLOR_PAIR ,
+.Nm PAIR_NUMBER ,
+.Nm init_color ,
+.Nm color_content
+.Nd curses color manipulation routines
+.Sh LIBRARY
+.Lb libcurses
+.Sh SYNOPSIS
+.Fd #include \*[Lt]curses.h\*[Gt]
+.Ft bool
+.Fn has_colors void
+.Ft bool
+.Fn can_change_color void
+.Ft int
+.Fn start_color void
+.Ft int
+.Fn init_pair "short pair" "short fore" "short back"
+.Ft int
+.Fn pair_content "short pair" "short *fore" "short *back"
+.Ft int
+.Fn COLOR_PAIR "int n"
+.Ft int
+.Fn PAIR_NUMBER "int val"
+.Ft int
+.Fn init_color "short color" "short red" "short green" "short blue"
+.Ft int
+.Fn color_content "short color" "short *red" "short *green" "short *blue"
+.Ft extern int
+.Dv COLOR_PAIRS
+.Ft extern int
+.Dv COLORS
+.Sh DESCRIPTION
+These functions manipulate color on terminals that support color attributes.
+.Pp
+The function
+.Fn has_colors
+indicates whether a terminal is capable of displaying color attributes.
+It returns
+.Dv TRUE
+if the terminal is capable of displaying color attributes and
+.Dv FALSE
+otherwise.
+.Pp
+The function
+.Fn can_change_colors
+indicates whether a terminal is capable of redefining colors.
+It returns
+.Dv TRUE
+if colors can be redefined and
+.Dv FALSE
+if they can not.
+.Pp
+The function
+.Fn start_color
+initializes the curses color support on a terminal.
+It must be called before any color manipulation functions are called on that
+terminal.
+The function initializes the eight basic colors (black, red, green, yellow,
+blue, magenta, cyan and white) that are specified using the color macros
+(such as
+.Dv COLOR_BLACK )
+defined in
+.Em \*[Lt]curses.h\*[Gt] .
+.Fn start_color
+also initializes the global external variables
+.Dv COLORS
+and
+.Dv COLOR_PAIRS .
+.Dv COLORS
+defines the number of colors that the terminal supports and
+.Dv COLOR_PAIRS
+defines the number of color-pairs that the terminal supports.
+These color-pairs are initialized to white foreground on black background.
+.Fn start_color
+sets the colors on the terminal to the curses defaults of white
+foreground on black background unless the functions
+.Fn assume_default_colors
+or
+.Fn use_default_colors
+have been called previously.
+.Pp
+The function
+.Fn init_pair pair fore back
+sets foreground color
+.Fa fore
+and background color
+.Fa back
+for color-pair number
+.Fa pair .
+.Pp
+The function
+.Fn pair_content pair *fore *back
+stores the foreground and background color numbers of color-pair
+.Fa pair
+in the variables
+.Fa fore
+and
+.Fa back ,
+respectively.
+.Pp
+The macro
+.Fn COLOR_PAIR n
+gives the attribute value of color-pair number
+.Fa n.
+This is the value that is used to set the attribute of a character to this
+color-pair.
+For example,
+.Fo attrset
+.Fo COLOR_PAIR
+.Fa 2
+.Fc
+.Fc
+will display characters using color-pair 2.
+.Pp
+The macro
+.Fn PAIR_NUMBER val
+gives the color-pair number associated with the attribute value
+.Fa val .
+.Pp
+The function
+.Fn init_color color red green blue
+sets the red, green and blue intensity components of color
+.Fa color
+to the values
+.Fa red ,
+.Fa green
+and
+.Fa blue ,
+respectively.
+The minimum intensity value is 0 and the maximum intensity value is 1000.
+.Pp
+The function
+.Fn color_content color *red *green *blue



Home | Main Index | Thread Index | Old Index