Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | .\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 3 | .\" * |
| 4 | .\" Permission is hereby granted, free of charge, to any person obtaining a * |
| 5 | .\" copy of this software and associated documentation files (the * |
| 6 | .\" "Software"), to deal in the Software without restriction, including * |
| 7 | .\" without limitation the rights to use, copy, modify, merge, publish, * |
| 8 | .\" distribute, distribute with modifications, sublicense, and/or sell * |
| 9 | .\" copies of the Software, and to permit persons to whom the Software is * |
| 10 | .\" furnished to do so, subject to the following conditions: * |
| 11 | .\" * |
| 12 | .\" The above copyright notice and this permission notice shall be included * |
| 13 | .\" in all copies or substantial portions of the Software. * |
| 14 | .\" * |
| 15 | .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 16 | .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 17 | .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 18 | .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 19 | .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 20 | .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 21 | .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 22 | .\" * |
| 23 | .\" Except as contained in this notice, the name(s) of the above copyright * |
| 24 | .\" holders shall not be used in advertising or otherwise to promote the * |
| 25 | .\" sale, use or other dealings in this Software without prior written * |
| 26 | .\" authorization. * |
| 27 | .\"*************************************************************************** |
| 28 | .\" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 29 | .\" $Id: curs_insstr.3x,v 1.21 2010/12/04 18:38:55 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | .TH curs_insstr 3X "" |
| 31 | .SH NAME |
| 32 | \fBinsstr\fR, |
| 33 | \fBinsnstr\fR, |
| 34 | \fBwinsstr\fR, |
| 35 | \fBwinsnstr\fR, |
| 36 | \fBmvinsstr\fR, |
| 37 | \fBmvinsnstr\fR, |
| 38 | \fBmvwinsstr\fR, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 39 | \fBmvwinsnstr\fR \- insert string before cursor in a \fBcurses\fR window |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 40 | .SH SYNOPSIS |
| 41 | \fB#include <curses.h>\fR |
| 42 | .br |
| 43 | \fBint insstr(const char *str);\fR |
| 44 | .br |
| 45 | \fBint insnstr(const char *str, int n);\fR |
| 46 | .br |
| 47 | \fBint winsstr(WINDOW *win, const char *str);\fR |
| 48 | .br |
| 49 | \fBint winsnstr(WINDOW *win, const char *str, int n);\fR |
| 50 | .br |
| 51 | \fBint mvinsstr(int y, int x, const char *str);\fR |
| 52 | .br |
| 53 | \fBint mvinsnstr(int y, int x, const char *str, int n);\fR |
| 54 | .br |
| 55 | \fBint mvwinsstr(WINDOW *win, int y, int x, const char *str);\fR |
| 56 | .br |
| 57 | \fBint mvwinsnstr(WINDOW *win, int y, int x, const char *str, int n);\fR |
| 58 | .br |
| 59 | .SH DESCRIPTION |
| 60 | These routines insert a character string |
| 61 | (as many characters as will fit on the line) |
| 62 | before the character under the cursor. |
| 63 | All characters to the right of the cursor are shifted right |
| 64 | with the possibility of the rightmost characters on the line being lost. |
| 65 | The cursor position does not change |
| 66 | (after moving to \fIy\fR, \fIx\fR, if specified). |
| 67 | The functions with \fIn\fR as the last argument |
| 68 | insert a leading substring of at most \fIn\fR characters. |
| 69 | If \fIn\fR<=0, then the entire string is inserted. |
| 70 | .PP |
| 71 | Special characters are handled as in \fBaddch\fP. |
| 72 | .SH RETURN VALUE |
| 73 | All routines that return an integer return \fBERR\fR upon failure and OK (SVr4 |
| 74 | specifies only "an integer value other than \fBERR\fR") upon successful |
| 75 | completion, unless otherwise noted in the preceding routine descriptions. |
| 76 | .PP |
| 77 | X/Open defines no error conditions. |
| 78 | In this implementation, |
| 79 | if the window parameter is null or the str parameter is null, |
| 80 | an error is returned. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 81 | .PP |
| 82 | Functions with a "mv" prefix first perform a cursor movement using |
| 83 | \fBwmove\fP, and return an error if the position is outside the window, |
| 84 | or if the window pointer is null. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 85 | .SH NOTES |
| 86 | Note that all but \fBwinsnstr\fR may be macros. |
| 87 | .SH PORTABILITY |
| 88 | These functions are described in the XSI Curses standard, Issue 4, which adds |
| 89 | const qualifiers to the arguments. |
| 90 | .LP |
| 91 | The Single Unix Specification, Version 2 states that |
| 92 | \fBinsnstr\fP and \fBwinsnstr\fP perform wrapping. |
| 93 | This is probably an error, since it makes this group of functions inconsistent. |
| 94 | Also, no implementation of curses documents this inconsistency. |
| 95 | .SH SEE ALSO |
| 96 | \fBcurses\fR(3X), |
| 97 | \fBcurs_util\fR(3X), |
| 98 | \fBcurs_clear\fR(3X), |
| 99 | \fBcurs_inch\fR(3X). |