]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_ins_wstr.3x
37a583027f2786bc9c35a881ed5c30a5ccb49599
[ncurses.git] / man / curs_ins_wstr.3x
1 .\"***************************************************************************
2 .\" Copyright 2019-2023,2024 Thomas E. Dickey                                *
3 .\" Copyright 2002-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_ins_wstr.3x,v 1.42 2024/06/08 21:04:04 tom Exp $
31 .TH curs_ins_wstr 3X 2024-06-08 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
32 .ie \n(.g \{\
33 .ds `` \(lq
34 .ds '' \(rq
35 .\}
36 .el \{\
37 .ie t .ds `` ``
38 .el   .ds `` ""
39 .ie t .ds '' ''
40 .el   .ds '' ""
41 .\}
42 .
43 .de bP
44 .ie n  .IP \(bu 4
45 .el    .IP \(bu 2
46 ..
47 .SH NAME
48 \fB\%ins_wstr\fP,
49 \fB\%ins_nwstr\fP,
50 \fB\%wins_wstr\fP,
51 \fB\%wins_nwstr\fP,
52 \fB\%mvins_wstr\fP,
53 \fB\%mvins_nwstr\fP,
54 \fB\%mvwins_wstr\fP,
55 \fB\%mvwins_nwstr\fP \-
56 insert a wide-character string in a \fIcurses\fR window
57 .SH SYNOPSIS
58 .nf
59 \fB#include <curses.h>
60 .PP
61 \fBint ins_wstr(const wchar_t *\fIwstr\fP);
62 \fBint ins_nwstr(const wchar_t *\fIwstr\fP, int \fIn\fP);
63 \fBint wins_wstr(WINDOW *\fIwin\fP, const wchar_t *\fIwstr\fP);
64 \fBint wins_nwstr(WINDOW *\fIwin\fP, const wchar_t *\fIwstr\fP, int \fIn\fP);
65 .PP
66 \fBint mvins_wstr(int \fIy\fP, int \fIx\fP, const wchar_t *\fIwstr\fP);
67 \fBint mvins_nwstr(int \fIy\fP, int \fIx\fP, const wchar_t *\fIwstr\fP, int \fIn\fP);
68 \fBint mvwins_wstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const wchar_t *\fIwstr\fP);
69 \fBint mvwins_nwstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const wchar_t *\fIwstr\fP, int \fIn\fP);
70 .fi
71 .SH DESCRIPTION
72 These routines insert a \fBwchar_t\fP character string
73 (as many characters as will fit on the line)
74 before the character under the cursor,
75 as if calling \fBwins_wch\fP(3X).
76 All characters to the right of the cursor are shifted right,
77 with the possibility of the rightmost characters on the line being lost.
78 No wrapping is performed.
79 .PP
80 The cursor position does not change
81 (after moving to \fIy\fP, \fIx\fP, if specified).
82 .PP
83 The functions with \fIn\fP as the last argument
84 insert a leading substring of at most \fIn\fP \fBwchar_t\fP characters.
85 If \fIn\fP is less than zero, the entire string is inserted
86 (stopping on a L'\e0' character).
87 .PP
88 Special characters are handled as in \fBwadd_wch\fP(3X).
89 .SH RETURN VALUE
90 These functions return
91 .B OK
92 on success and
93 .B ERR
94 on failure.
95 .PP
96 X/Open Curses does not specify any error conditions.
97 In
98 .IR \%ncurses ","
99 they return
100 .B ERR
101 if
102 .bP
103 .I win
104 is
105 .BR NULL ","
106 .bP
107 .I wstr
108 is
109 .BR NULL ","
110 or
111 .bP
112 an internal \fB\%wins_wch\fP(3X) call returns
113 .BR ERR "."
114 .PP
115 Functions prefixed with \*(``mv\*('' first perform cursor movement and
116 fail if the position
117 .RI ( y ,
118 .IR x )
119 is outside the window boundaries.
120 .SH NOTES
121 All of these functions except
122 .B \%wins_nwstr
123 may be implemented as macros.
124 .PP
125 If the first character in the string is a non-spacing character,
126 these functions return
127 .BR ERR "."
128 X/Open Curses does not specify what happens
129 if a non-spacing character follows a control character.
130 .SH PORTABILITY
131 X/Open Curses,
132 Issue 4 describes these functions.
133 It specifies no error conditions for them.
134 .PP
135 Issue 4 states that the entire string is inserted if
136 .I n
137 is less than 1.
138 This is probably an error,
139 because it is inconsistent with other functions,
140 and differs from the SVr4
141 .I curses
142 and Solaris
143 .I xcurses
144 implementations.
145 Nevertheless,
146 Issue 7 retains it.
147 .SH SEE ALSO
148 \fB\%curs_insstr\fP(3X) describes comparable functions of the
149 .I \%ncurses
150 library in its non-wide-character configuration.
151 .PP
152 \fB\%curses\fP(3X),
153 \fB\%curs_ins_wch\fP(3X),
154 \fB\%curs_in_wch\fP(3X)