| 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.51 2025/02/02 00:00:59 tom Exp $ |
| 31 |
.TH insch 3NCURSES 2025-02-01 "ncurses 6.5" "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 |
.SH NAME |
| 43 |
\fB\%insch\fP, |
| 44 |
\fB\%winsch\fP, |
| 45 |
\fB\%mvinsch\fP, |
| 46 |
\fB\%mvwinsch\fP \- |
| 47 |
insert a \fIcurses\fP character in a window |
| 48 |
.SH SYNOPSIS |
| 49 |
.nf |
| 50 |
\fB#include <curses.h>\fP |
| 51 |
.PP |
| 52 |
\fBint insch(chtype \fIch\fP); |
| 53 |
\fBint winsch(WINDOW * \fIwin\fP, chtype \fIch\fP); |
| 54 |
\fBint mvinsch(int \fIy\fP, int \fIx\fP, chtype \fIch\fP); |
| 55 |
\fBint mvwinsch(WINDOW * \fIwin\fP, int \fIy\fP, int \fIx\fP, chtype \fIch\fP); |
| 56 |
.fi |
| 57 |
.SH DESCRIPTION |
| 58 |
These functions insert the |
| 59 |
.I curses |
| 60 |
character |
| 61 |
.I ch |
| 62 |
at the cursor in the specified window |
| 63 |
.I win |
| 64 |
(or |
| 65 |
.BR \%stdscr ). |
| 66 |
The character previously at the cursor and any to its right move one |
| 67 |
cell to the right; |
| 68 |
the rightmost character on the line is discarded. |
| 69 |
The cursor does not advance. |
| 70 |
.SH "RETURN VALUE" |
| 71 |
These functions return |
| 72 |
.B OK |
| 73 |
on success and |
| 74 |
.B ERR |
| 75 |
on failure. |
| 76 |
.PP |
| 77 |
Functions taking a |
| 78 |
.I \%WINDOW |
| 79 |
pointer argument fail if |
| 80 |
.I win |
| 81 |
is a null pointer. |
| 82 |
.PP |
| 83 |
Functions prefixed with \*(``mv\*('' first perform cursor movement and |
| 84 |
fail if the position |
| 85 |
.RI ( y , |
| 86 |
.IR x ) |
| 87 |
is outside the window boundaries. |
| 88 |
.SH NOTES |
| 89 |
.BR \%insch , |
| 90 |
.BR \%mvinsch , |
| 91 |
and |
| 92 |
.B \%mvwinsch |
| 93 |
may be implemented as macros. |
| 94 |
.PP |
| 95 |
A terminal's |
| 96 |
.B \%insert_character |
| 97 |
.RB ( ich1 ) |
| 98 |
capability |
| 99 |
is not necessarily employed. |
| 100 |
.SH PORTABILITY |
| 101 |
X/Open Curses Issue\ 4 describes these functions. |
| 102 |
.PP |
| 103 |
SVr4 describes a successful return value only as |
| 104 |
\*(``an integer value other than |
| 105 |
.IR ERR \*(''. \" Courier roman in source; SVID 4, vol. 3, p. 509 |
| 106 |
.SH HISTORY |
| 107 |
SVr2 (1984) introduced |
| 108 |
.IR \%winsch "." |
| 109 |
.SH "SEE ALSO" |
| 110 |
\fB\%ins_wch\fP(3NCURSES) describes comparable functions in the |
| 111 |
wide-character |
| 112 |
.I curses |
| 113 |
configuration. |
| 114 |
.PP |
| 115 |
\fB\%ncurses\fP(3NCURSES), |
| 116 |
\fB\%terminfo\fP(5) |