]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_addchstr.3x
ncurses 6.0 - patch 20171209
[ncurses.git] / man / curs_addchstr.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2012,2017 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_addchstr.3x,v 1.17 2017/11/18 23:56:00 tom Exp $
30 .TH curs_addchstr 3X ""
31 .de bP
32 .ie n  .IP \(bu 4
33 .el    .IP \(bu 2
34 ..
35 .na
36 .hy 0
37 .SH NAME
38 \fBaddchstr\fR,
39 \fBaddchnstr\fR,
40 \fBwaddchstr\fR,
41 \fBwaddchnstr\fR,
42 \fBmvaddchstr\fR,
43 \fBmvaddchnstr\fR,
44 \fBmvwaddchstr\fR,
45 \fBmvwaddchnstr\fR \- add a string of characters (and attributes) to a \fBcurses\fR window
46 .ad
47 .hy
48 .SH SYNOPSIS
49 .nf
50 \fB#include <curses.h>\fR
51 .PP
52 \fBint addchstr(const chtype *chstr);\fR
53 .br
54 \fBint addchnstr(const chtype *chstr, int n);\fR
55 .br
56 \fBint waddchstr(WINDOW *win, const chtype *chstr);\fR
57 .br
58 \fBint waddchnstr(WINDOW *win, const chtype *chstr, int n);\fR
59 .br
60 \fBint mvaddchstr(int y, int x, const chtype *chstr);\fR
61 .br
62 \fBint mvaddchnstr(int y, int x, const chtype *chstr, int n);\fR
63 .br
64 \fBint mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr);\fR
65 .br
66 \fBint mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n);\fR
67 .fi
68 .SH DESCRIPTION
69 These functions copy the (null-terminated)
70 \fIchstr\fR array
71 into the window image structure
72 starting at the current cursor position.
73 The four functions with \fIn\fR as the last
74 argument copy at most \fIn\fR elements,
75 but no more than will fit on the line.
76 If \fBn\fR=\fB\-1\fR then the whole array is copied,
77 to the maximum number of characters that will fit on the line.
78 .PP
79 The window cursor is \fInot\fR advanced.
80 These functions work faster than \fBwaddnstr\fR.
81 On the other hand:
82 .bP
83 they do not perform checking
84 (such as for the newline, backspace, or carriage return characters),
85 .bP
86 they do not advance the current cursor position,
87 .bP
88 they do not expand other control characters to ^-escapes, and
89 .bP
90 they truncate the string if it crosses the right margin,
91 rather than wrapping it around to the new line.
92 .SH RETURN VALUE
93 All functions return the integer \fBERR\fR upon failure and \fBOK\fR on success.
94 .PP
95 X/Open does not define any error conditions.
96 This implementation returns an error
97 if the window pointer is null.
98 .PP
99 Functions with a "mv" prefix first perform a cursor movement using
100 \fBwmove\fP, and return an error if the position is outside the window,
101 or if the window pointer is null.
102 .SH NOTES
103 All functions except \fBwaddchnstr\fR may be macros.
104 .SH PORTABILITY
105 These entry points are described in the XSI Curses standard, Issue 4.
106 .SH SEE ALSO
107 \fBcurs_addstr\fR(3X),
108 \fBcurses\fR(3X).
109 .PP
110 Comparable functions in the wide-character (ncursesw) library are
111 described in
112 \fBcurs_add_wchstr\fR(3X).