2003-02-14 19:29:11 +03:00
|
|
|
.\" $NetBSD: curses_add.3,v 1.6 2003/02/14 16:29:11 grant Exp $
|
2002-10-21 17:55:07 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2002
|
2003-02-14 19:29:11 +03:00
|
|
|
.\" Brett Lymn (blymn@NetBSD.org, brett_lymn@yahoo.com.au)
|
2002-10-21 17:55:07 +04:00
|
|
|
.\"
|
|
|
|
.\" 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
|
2002-10-21 18:06:17 +04:00
|
|
|
position by one.
|
|
|
|
Any character attributes currently set will be
|
|
|
|
applied to the added character.
|
|
|
|
The
|
2002-10-21 17:55:07 +04:00
|
|
|
.Fn waddch
|
2002-10-21 17:59:52 +04:00
|
|
|
function is the same as the
|
2002-10-21 17:55:07 +04:00
|
|
|
.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
|
2002-10-21 17:59:52 +04:00
|
|
|
will add the contents of
|
2002-10-21 17:55:07 +04:00
|
|
|
.Fa string
|
2002-10-21 17:59:52 +04:00
|
|
|
to
|
2002-10-21 17:55:07 +04:00
|
|
|
.Dv stdscr
|
|
|
|
but will limit the number of characters added to be, at most,
|
|
|
|
.Fa len .
|
2002-10-21 17:59:52 +04:00
|
|
|
If
|
2002-10-21 17:55:07 +04:00
|
|
|
.Fa len
|
2002-10-21 18:31:36 +04:00
|
|
|
is \-1 then
|
2002-10-21 17:55:07 +04:00
|
|
|
.Fa addnstr
|
|
|
|
will add the number of bytes contained in the null terminated string
|
|
|
|
.Fa string .
|
|
|
|
.Sh RETURN VALUES
|
2002-10-21 18:24:53 +04:00
|
|
|
The functions will return one of the following values:
|
2002-10-21 17:55:07 +04:00
|
|
|
.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 .
|