1curs_insstr(3X) curs_insstr(3X)
2
3
4
6 insstr, insnstr, winsstr, winsnstr, mvinsstr, mvinsnstr, mvwinsstr,
7 mvwinsnstr - insert string before cursor in a curses window
8
10 #include <curses.h>
11 int insstr(const char *str);
12 int insnstr(const char *str, int n);
13 int winsstr(WINDOW *win, const char *str);
14 int winsnstr(WINDOW *win, const char *str, int n);
15 int mvinsstr(int y, int x, const char *str);
16 int mvinsnstr(int y, int x, const char *str, int n);
17 int mvwinsstr(WINDOW *win, int y, int x, const char *str);
18 int mvwinsnstr(WINDOW *win, int y, int x, const char *str, int n);
19
21 These routines insert a character string (as many characters as will
22 fit on the line) before the character under the cursor. All characters
23 to the right of the cursor are shifted right with the possibility of
24 the rightmost characters on the line being lost. The cursor position
25 does not change (after moving to y, x, if specified). The functions
26 with n as the last argument insert a leading substring of at most n
27 characters. If n<=0, then the entire string is inserted.
28
29 Special characters are handled as in addch.
30
32 All routines that return an integer return ERR upon failure and OK
33 (SVr4 specifies only "an integer value other than ERR") upon successful
34 completion, unless otherwise noted in the preceding routine descrip‐
35 tions.
36
37 X/Open defines no error conditions. In this implementation, if the
38 window parameter is null or the str parameter is null, an error is
39 returned.
40
41 Functions with a "mv" prefix first perform a cursor movement using
42 wmove, and return an error if the position is outside the window, or if
43 the window pointer is null.
44
46 Note that all but winsnstr may be macros.
47
49 These functions are described in the XSI Curses standard, Issue 4,
50 which adds const qualifiers to the arguments.
51
52 The Single Unix Specification, Version 2 states that insnstr and win‐
53 snstr perform wrapping. This is probably an error, since it makes this
54 group of functions inconsistent. Also, no implementation of curses
55 documents this inconsistency.
56
58 curses(3X), curs_util(3X), curs_clear(3X), curs_inch(3X).
59
60
61
62 curs_insstr(3X)