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