blob: 08536e3302601724e358f5a9a2f0dd428e5c7631 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
Steve Kondikae271bc2015-11-15 02:50:53 +01002.\" Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303.\" *
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.\"
Steve Kondikae271bc2015-11-15 02:50:53 +010029.\" $Id: curs_addchstr.3x,v 1.16 2012/11/03 22:54:43 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053030.TH curs_addchstr 3X ""
Steve Kondikae271bc2015-11-15 02:50:53 +010031.de bP
32.IP \(bu 4
33..
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053034.na
35.hy 0
36.SH NAME
37\fBaddchstr\fR,
38\fBaddchnstr\fR,
39\fBwaddchstr\fR,
40\fBwaddchnstr\fR,
41\fBmvaddchstr\fR,
42\fBmvaddchnstr\fR,
43\fBmvwaddchstr\fR,
Steve Kondikae271bc2015-11-15 02:50:53 +010044\fBmvwaddchnstr\fR \- add a string of characters (and attributes) to a \fBcurses\fR window
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053045.ad
46.hy
47.SH SYNOPSIS
Steve Kondikae271bc2015-11-15 02:50:53 +010048.nf
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053049\fB#include <curses.h>\fR
50.PP
51\fBint addchstr(const chtype *chstr);\fR
52.br
53\fBint addchnstr(const chtype *chstr, int n);\fR
54.br
55\fBint waddchstr(WINDOW *win, const chtype *chstr);\fR
56.br
57\fBint waddchnstr(WINDOW *win, const chtype *chstr, int n);\fR
58.br
59\fBint mvaddchstr(int y, int x, const chtype *chstr);\fR
60.br
61\fBint mvaddchnstr(int y, int x, const chtype *chstr, int n);\fR
62.br
63\fBint mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr);\fR
64.br
65\fBint mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n);\fR
Steve Kondikae271bc2015-11-15 02:50:53 +010066.fi
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053067.SH DESCRIPTION
Steve Kondikae271bc2015-11-15 02:50:53 +010068These functions copy the (null-terminated)
69\fIchstr\fR array
70into the window image structure
71starting at the current cursor position.
72The four functions with \fIn\fR as the last
73argument copy at most \fIn\fR elements,
74but no more than will fit on the line.
75If \fBn\fR=\fB\-1\fR then the whole array is copied,
76to the maximum number of characters that will fit on the line.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053077.PP
Steve Kondikae271bc2015-11-15 02:50:53 +010078The window cursor is \fInot\fR advanced.
79These functions work faster than \fBwaddnstr\fR.
80On the other hand:
81.bP
82they do not perform checking
83(such as for the newline, backspace, or carriage return characters),
84.bP
85they do not advance the current cursor position,
86.bP
87they do not expand other control characters to ^-escapes, and
88.bP
89they truncate the string if it crosses the right margin,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053090rather than wrapping it around to the new line.
Steve Kondikae271bc2015-11-15 02:50:53 +010091.SH RETURN VALUE
92All functions return the integer \fBERR\fR upon failure and \fBOK\fR on success.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053093.PP
94X/Open does not define any error conditions.
95This implementation returns an error
96if the window pointer is null.
Steve Kondikae271bc2015-11-15 02:50:53 +010097.PP
98Functions with a "mv" prefix first perform a cursor movement using
99\fBwmove\fP, and return an error if the position is outside the window,
100or if the window pointer is null.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530101.SH NOTES
Steve Kondikae271bc2015-11-15 02:50:53 +0100102All functions except \fBwaddchnstr\fR may be macros.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530103.SH PORTABILITY
104These entry points are described in the XSI Curses standard, Issue 4.
105.SH SEE ALSO
Steve Kondikae271bc2015-11-15 02:50:53 +0100106\fBcurs_addstr\fR(3X),
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530107\fBcurses\fR(3X).
108.PP
109Comparable functions in the wide-character (ncursesw) library are
110described in
111\fBcurs_add_wchstr\fR(3X).