blob: 4ebd3ace2c5af98f02bc60f542733376d9c5765b [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002.\" Copyright 2019-2023,2024 Thomas E. Dickey *
3.\" Copyright 2002-2012,2017 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05304.\" *
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.\"
micky3879b9f5e72025-07-08 18:04:53 -040030.\" $Id: curs_ins_wstr.3x,v 1.38 2024/04/20 21:23:08 tom Exp $
31.TH curs_ins_wstr 3X 2024-04-20 "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..
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053047.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040048\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 \-
56insert a wide-character string in a \fIcurses\fR window
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053057.SH SYNOPSIS
58.nf
micky3879b9f5e72025-07-08 18:04:53 -040059\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);
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053070.fi
71.SH DESCRIPTION
micky3879b9f5e72025-07-08 18:04:53 -040072These routines insert a \fBwchar_t\fP character string
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053073(as many characters as will fit on the line)
micky3879b9f5e72025-07-08 18:04:53 -040074before the character under the cursor,
75as if calling \fBwins_wch\fP(3X).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053076All characters to the right of the cursor are shifted right,
77with the possibility of the rightmost characters on the line being lost.
78No wrapping is performed.
micky3879b9f5e72025-07-08 18:04:53 -040079.PP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053080The cursor position does not change
micky3879b9f5e72025-07-08 18:04:53 -040081(after moving to \fIy\fP, \fIx\fP, if specified).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053082.PP
micky3879b9f5e72025-07-08 18:04:53 -040083The functions with \fIn\fP as the last argument
84insert a leading substring of at most \fIn\fP \fBwchar_t\fP characters.
85If \fIn\fP is less than zero, the entire string is inserted
86(stopping on a L'\e0' character).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053087.PP
micky3879b9f5e72025-07-08 18:04:53 -040088Special characters are handled as in \fBwadd_wch\fP(3X).
Steve Kondikae271bc2015-11-15 02:50:53 +010089.SH RETURN VALUE
micky3879b9f5e72025-07-08 18:04:53 -040090All functions return the integer \fBERR\fP upon failure and \fBOK\fP on success.
Steve Kondikae271bc2015-11-15 02:50:53 +010091.PP
micky3879b9f5e72025-07-08 18:04:53 -040092X/Open Curses does not specify any error conditions.
93This implementation returns an error
94.bP
95if the \fIwin\fP parameter is null or
96.bP
97if the \fIwstr\fP parameter is null or
98.bP
99if the \fBwins_wch\fP function returns an error.
100.PP
101Functions prefixed with \*(``mv\*('' first perform cursor movement and
102fail if the position
103.RI ( y ,
104.IR x )
105is outside the window boundaries.
106.SH NOTES
107All but \fBwins_nwstr\fP may be macros.
108.PP
109If the first character in the string is a non-spacing character, these
110functions will fail.
111X/Open Curses does not define what will happen
112if a non-spacing character follows a control character.
113.SH PORTABILITY
114These functions are described in X/Open Curses, Issue 4,
115which adds \fI\%const\fP qualifiers to the arguments.
116.PP
117X/Open states that the entire string is inserted if \fIn\fP is less than 1.
118This is probably an error,
119because it is inconsistent with other functions,
120and differs from the X/Open implementation on Solaris.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530121.SH SEE ALSO
micky3879b9f5e72025-07-08 18:04:53 -0400122\fB\%curs_insstr\fP(3X) describes comparable functions of the
123.I \%ncurses
124library in its non-wide-character configuration.
125.PP
126\fB\%curses\fP(3X),
127\fB\%curs_ins_wch\fP(3X),
128\fB\%curs_in_wch\fP(3X)