xref: /netbsd-src/lib/libcurses/curses_addchstr.3 (revision aaf4ece63a859a04e37cf3a7229b5fab0157cc06)
1.\"	$NetBSD: curses_addchstr.3,v 1.2 2003/05/22 09:25:52 wiz Exp $
2.\"
3.\" Copyright (c) 2003
4.\"	Douwe Kiela (virtus@wanadoo.nl)
5.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
6.\" All rights reserved.
7.\"
8.\" This code is derived from software contributed to The NetBSD Foundation
9.\" by Douwe Kiela (virtus@wanadoo.nl).
10.\"
11.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions
13.\" are met:
14.\" 1. Redistributions of source code must retain the above copyright
15.\"    notice, this list of conditions and the following disclaimer.
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\"    notice, this list of conditions and the following disclaimer in the
18.\"    documentation and/or other materials provided with the distribution.
19.\" 3. Neither the name of The NetBSD Foundation nor the names of its
20.\"    contributors may be used to endorse or promote products derived
21.\"    from this software without specific prior written permission.
22.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
23.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
26.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32.\" POSSIBILITY OF SUCH DAMAGE.
33.\"
34.\"
35.Dd May 21, 2003
36.Dt CURSES_ADDCHSTR 3
37.Os
38.Sh NAME
39.Nm curses_addchstr ,
40.Nm addchstr ,
41.Nm waddchstr ,
42.Nm addchnstr ,
43.Nm waddchnstr ,
44.Nm mvaddchstr ,
45.Nm mvwaddchstr ,
46.Nm mvaddchnstr ,
47.Nm mvwaddchnstr
48.Nd curses add character strings to windows routines
49.Sh LIBRARY
50.Lb libcurses
51.Sh SYNOPSIS
52.In curses.h
53.Ft int
54.Fn addchstr "const chtype *chstr"
55.Ft int
56.Fn waddchstr "WINDOW *win" "const chtype *chstr"
57.Ft int
58.Fn mvaddchstr "int y" "int x" "const chtype *chstr"
59.Ft int
60.Fn mvwaddchstr "WINDOW *win" "int y" "int x" "const chtype *chstr"
61.Ft int
62.Fn addchnstr "const chtype *chstr" "int n"
63.Ft int
64.Fn waddchnstr "WINDOW *win" "const chtype *chstr" "int n"
65.Ft int
66.Fn mvaddchnstr "int y" "int x" "const chtype *chstr" "int n"
67.Ft int
68.Fn mvwaddchnstr "WINDOW *win" "int y" "int x" "const chtype *chstr" "int n"
69.Sh DESCRIPTION
70These functions add character strings and attributes to
71.Dv stdscr
72or to the specified window.
73.Pp
74The
75.Fn addchstr
76function will add the characters and their attributes passed in
77.Fa chstr
78to
79.Dv stdscr
80starting at the current cursor position.
81Any character attributes set in
82.Fa chstr
83will be merged with the background attributes currently set on
84.Dv stdscr .
85The
86.Fn waddstr
87function does the same as
88.Fn addchstr
89but adds the string to the window specified by
90.Fn win .
91.Pp
92The
93.Fn addchnstr
94function will add the contents of
95.Fa string
96to
97.Dv stdscr
98but will limit the number of characters added to be, at most,
99.Fa n .
100If
101.Fa n
102is \-1 then
103.Fa addchnstr
104will add the number of characters contained in the null terminated string
105.Fa chstr .
106Any character attributes set in
107.Fa chstr
108will be merged with the background attributes currently set on
109.Dv stdscr .
110.Pp
111The
112.Fn waddchnstr
113function does the same as
114.Fa addchnstr
115but adds the string to the window specified by
116.Fa win .
117.Pp
118The functions
119.Fn mvaddchstr ,
120.Fn mwaddchnstr ,
121.Fn mvwaddchstr
122and
123.Fn mvwaddchnstr
124are the same as the functions
125.Fn addchstr ,
126.Fn waddchstr ,
127.Fn waddchstr
128and
129.Fn waddchnstr ,
130respectively, except that
131.Fn wmove
132is called to move the cursor to the position specified by
133.Fa y ,
134.Fa x
135before the string is added to the window.
136.Sh RETURN VALUES
137The functions will return one of the following values:
138.Pp
139.Bl -tag -width ERR -compact
140.It Er OK
141The function completed successfully.
142.It Er ERR
143An error occurred in the function.
144.El
145.Sh SEE ALSO
146.Xr curses_addch 3 ,
147.Xr curses_addstr 3 ,
148.Xr curses_attributes 3 ,
149.Xr curses_cursor 3 ,
150.Xr curses_inch 3
151.Sh STANDARDS
152The
153.Nx
154Curses library complies with the X/Open Curses specification, part of the
155Single Unix Specification.
156.Sh HISTORY
157These functions first appeared in
158.Nx 2.0 .
159