| 1 |
.\"*************************************************************************** |
| 2 |
.\" Copyright 2018-2024,2025 Thomas E. Dickey * |
| 3 |
.\" Copyright 1998-2010,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_insch.3x,v 1.56 2025/03/08 23:10:02 tom Exp $ |
| 31 |
.TH insch 3NCURSES 2025-03-08 "ncurses 6.6" "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\%insch\fP, |
| 49 |
\fB\%winsch\fP, |
| 50 |
\fB\%mvinsch\fP, |
| 51 |
\fB\%mvwinsch\fP \- |
| 52 |
insert a \fIcurses\fP character in a window |
| 53 |
.SH SYNOPSIS |
| 54 |
.nf |
| 55 |
\fB#include <curses.h>\fP |
| 56 |
.PP |
| 57 |
\fBint insch(chtype \fIch\fP); |
| 58 |
\fBint winsch(WINDOW * \fIwin\fP, chtype \fIch\fP); |
| 59 |
\fBint mvinsch(int \fIy\fP, int \fIx\fP, chtype \fIch\fP); |
| 60 |
\fBint mvwinsch(WINDOW * \fIwin\fP, int \fIy\fP, int \fIx\fP, chtype \fIch\fP); |
| 61 |
.fi |
| 62 |
.SH DESCRIPTION |
| 63 |
.B \%winsch |
| 64 |
inserts the |
| 65 |
.I curses |
| 66 |
character |
| 67 |
.I ch |
| 68 |
at the cursor position in the window |
| 69 |
.IR win "." |
| 70 |
The character previously at the cursor and any to its right move one |
| 71 |
cell to the right; |
| 72 |
the formerly rightmost character on the line is discarded. |
| 73 |
Unlike \fB\%addch\fP(3NCURSES), |
| 74 |
.B \%winsch |
| 75 |
does not advance the cursor. |
| 76 |
\fB\%ncurses\fP(3NCURSES) describes the variants of this function. |
| 77 |
.SH "RETURN VALUE" |
| 78 |
These functions return |
| 79 |
.B OK |
| 80 |
on success and |
| 81 |
.B ERR |
| 82 |
on failure. |
| 83 |
.PP |
| 84 |
In |
| 85 |
.IR \%ncurses , |
| 86 |
they return |
| 87 |
.B ERR |
| 88 |
if |
| 89 |
.bP |
| 90 |
the |
| 91 |
.I curses |
| 92 |
screen has not been initialized, |
| 93 |
or |
| 94 |
.bP |
| 95 |
(for functions taking a |
| 96 |
.I \%WINDOW |
| 97 |
pointer argument) |
| 98 |
.I win |
| 99 |
is a null pointer. |
| 100 |
.PP |
| 101 |
Functions prefixed with \*(``mv\*('' first perform cursor movement and |
| 102 |
fail if the position |
| 103 |
.RI ( y , |
| 104 |
.IR x ) |
| 105 |
is outside the window boundaries. |
| 106 |
.SH NOTES |
| 107 |
.BR \%insch "," |
| 108 |
.BR \%mvinsch "," |
| 109 |
and |
| 110 |
.B \%mvwinsch |
| 111 |
may be implemented as macros. |
| 112 |
.PP |
| 113 |
.I curses |
| 114 |
does not necessarily employ the terminal's |
| 115 |
.B \%insert_character |
| 116 |
.RB ( ich1 ) |
| 117 |
capability to achieve insertion. |
| 118 |
.SH PORTABILITY |
| 119 |
X/Open Curses Issue\ 4 describes these functions. |
| 120 |
It specifies no error conditions for them. |
| 121 |
.PP |
| 122 |
SVr4 describes a successful return value only as |
| 123 |
\*(``an integer value other than |
| 124 |
.IR ERR \*(''. \" Courier roman in source; SVID 4, vol. 3, p. 509 |
| 125 |
.SH HISTORY |
| 126 |
SVr2 (1984) introduced these functions. |
| 127 |
.SH "SEE ALSO" |
| 128 |
\fB\%ins_wch\fP(3NCURSES) describes comparable functions in the |
| 129 |
wide-character |
| 130 |
.I curses |
| 131 |
configuration. |
| 132 |
.PP |
| 133 |
\fB\%ncurses\fP(3NCURSES), |
| 134 |
\fB\%terminfo\fP(5) |