1curs_addstr(3X)                                                curs_addstr(3X)
2
3
4

NAME

6       addstr, addnstr, waddstr, waddnstr, mvaddstr, mvaddnstr, mvwaddstr,
7       mvwaddnstr - add a string of characters to a curses window and advance
8       cursor
9

SYNOPSIS

11       #include <curses.h>
12
13       int addstr(const char *str);
14       int addnstr(const char *str, int n);
15       int waddstr(WINDOW *win, const char *str);
16       int waddnstr(WINDOW *win, const char *str, int n);
17
18       int mvaddstr(int y, int x, const char *str);
19       int mvaddnstr(int y, int x, const char *str, int n);
20       int mvwaddstr(WINDOW *win, int y, int x, const char *str);
21       int mvwaddnstr(WINDOW *win, int y, int x, const char *str, int n);
22

DESCRIPTION

24       These functions write the (null-terminated) character string str on the
25       given window.  It is similar to calling waddch once for  each  byte  in
26       the string.
27
28       The mv functions perform cursor movement once, before writing any char‐
29       acters.  Thereafter, the cursor is advanced as a side-effect of writing
30       to the window.
31
32       The  four  functions with n as the last argument write at most n bytes,
33       or until a terminating null is reached.  If n is -1,  then  the  entire
34       string will be added.
35

RETURN VALUE

37       All functions return the integer ERR upon failure and OK on success.
38
39       X/Open  does  not define any error conditions.  This implementation re‐
40       turns an error
41
42       •   if the window pointer is null or
43
44       •   if the string pointer is null or
45
46       •   if the corresponding calls to waddch return an error.
47
48       Functions with a “mv” prefix first  perform  a  cursor  movement  using
49       wmove, and return an error if the position is outside the window, or if
50       the window pointer is null.  If an error is returned by the  wmove,  no
51       characters are added to the window.
52
53       If  an  error  is  returned  by waddch (e.g., because the window is not
54       large enough, or an illegal byte sequence was detected)  only  part  of
55       the  string  may be added.  Aside from that, there is a special case in
56       waddch where an error may be  returned  after  successfully  writing  a
57       character  to  the  lower-right corner of a window when scrollok(3X) is
58       disabled.
59

NOTES

61       All of these functions except waddnstr may be macros.
62

PORTABILITY

64       These functions are described in the XSI Curses standard, Issue 4.
65

SEE ALSO

67       curses(3X), curs_addch(3X).
68
69
70
71                                                               curs_addstr(3X)
Impressum