NetBSD/lib/libcurses/curses_add.3

114 lines
3.3 KiB
Groff

.\" $NetBSD: curses_add.3,v 1.6 2003/02/14 16:29:11 grant Exp $
.\"
.\" Copyright (c) 2002
.\" Brett Lymn (blymn@NetBSD.org, brett_lymn@yahoo.com.au)
.\"
.\" This code is donated to the NetBSD Foundation by the Author.
.\"
.\" 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. The name of the Author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 August 12, 2002
.Dt CURSES 3
.Os
.Sh NAME
.Nm addch ,
.Nm addstr ,
.Nm addnstr ,
.Nm waddch ,
.Nm waddstr
.Nd add characters
.Sh LIBRARY
.Lb libcurses
.Sh SYNOPSIS
.Fd #include \*[Lt]curses.h\*[Gt]
.Ft int
.Fn addch "chtype c"
.Ft int
.Fn waddch "WINDOW *win" "chtype c"
.Ft int
.Fn addstr "const char *string"
.Ft int
.Fn waddstr "WINDOW *win" "const char *string"
.Ft int
.Fn addnstr "const char *string" "int len"
.Sh DESCRIPTION
The
.Fn addch
function adds the character given in
.Fa c
to
.Dv stdscr
at the current cursor position and advances the current cursor
position by one.
Any character attributes currently set will be
applied to the added character.
The
.Fn waddch
function is the same as the
.Fn addch
function excepting that the character is added to the window specified.
.Pp
.Fn addstr
will add the string passed in
.Fa string
to
.Dv stdscr
starting at the current cursor location, any character attributes in
effect at the time will be applied to the added string,
.Fn waddstr
does the same thing but adds the string to the specified window.
Similarly,
.Fn addnstr
will add the contents of
.Fa string
to
.Dv stdscr
but will limit the number of characters added to be, at most,
.Fa len .
If
.Fa len
is \-1 then
.Fa addnstr
will add the number of bytes contained in the null terminated string
.Fa string .
.Sh RETURN VALUES
The functions will return one of the following values:
.Pp
.Bl -tag -width ERR -compact
.It Er OK
The function completed successfully.
.It Er ERR
An error occurred in the function.
.El
.Sh STANDARDS
The
.Nx
Curses library complies with the X/Open Curses specification, part of the
Single Unix Specification.
.Sh HISTORY
The Curses package appeared in
.Bx 4.0 .