curs_addchstr3
Add a curses character string to a window
Part of addchnstr(3).
Usage
const chtype
*
chstr);
Overview
waddchstr copies the string of curses characters chstr to the window win. A null curses character terminates the string. waddchnstr does the same, but copies at most n characters, or as many as possible if n is -1. ncurses(3X) describes the variants of these functions.
Because these functions do not call waddch(3X) internally, they are faster than waddstr(3X) and waddnstr(3X). On the other hand, they
- •
-
do not treat the backspace, carriage return, or line feed characters specially;
- •
-
do not represent unprintable characters with unctrl(3X);
- •
-
do not update the cursor position to follow the last character written;
and
- •
-
truncate the string at the window's right margin, rather than wrapping it to the next line and potentially scrolling.
Return value
These functions return OK on success and ERR on failure.
In ncurses, these functions fail if
- •
-
thecurses screen has not been initialized,
- •
-
chstr is a null pointer,
or
- •
-
(for functions taking a WINDOW pointer argument) win is a null pointer.
Functions prefixed with “mv” first perform cursor movement and fail if the position (y, x) is outside the window boundaries.
Notes
All of these functions except waddchnstr may be implemented as macros.
Portability
X/Open Curses Issue 4 describes these functions. It specifies no error conditions for them.
SVr4 describes a successful return value only as “an integer value other than ERR”.
History
- FreeBSD 16.0-CURRENT (2026-10-27) to FreeBSD 15.1-RELEASE: the text shown here
- FreeBSD 15.0-RELEASE
- FreeBSD 14.5-RELEASE
- FreeBSD 14.4-RELEASE to FreeBSD 14.2-RELEASE
- FreeBSD 14.1-RELEASE to FreeBSD 14.0-RELEASE
- FreeBSD 13.5-RELEASE to FreeBSD 13.0-RELEASE
- FreeBSD 12.4-RELEASE to FreeBSD 11.0-RELEASE
- FreeBSD 10.4-RELEASE to FreeBSD 6.3-RELEASE
- FreeBSD 6.2-RELEASE to FreeBSD 4.1-RELEASE
- FreeBSD 4.0-RELEASE