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-2010,2012 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_addchstr.3x,v 1.16 2012/11/03 22:54:43 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | .TH curs_addchstr 3X "" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 31 | .de bP |
| 32 | .IP \(bu 4 |
| 33 | .. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 34 | .na |
| 35 | .hy 0 |
| 36 | .SH NAME |
| 37 | \fBaddchstr\fR, |
| 38 | \fBaddchnstr\fR, |
| 39 | \fBwaddchstr\fR, |
| 40 | \fBwaddchnstr\fR, |
| 41 | \fBmvaddchstr\fR, |
| 42 | \fBmvaddchnstr\fR, |
| 43 | \fBmvwaddchstr\fR, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 44 | \fBmvwaddchnstr\fR \- add a string of characters (and attributes) to a \fBcurses\fR window |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 45 | .ad |
| 46 | .hy |
| 47 | .SH SYNOPSIS |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 48 | .nf |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 49 | \fB#include <curses.h>\fR |
| 50 | .PP |
| 51 | \fBint addchstr(const chtype *chstr);\fR |
| 52 | .br |
| 53 | \fBint addchnstr(const chtype *chstr, int n);\fR |
| 54 | .br |
| 55 | \fBint waddchstr(WINDOW *win, const chtype *chstr);\fR |
| 56 | .br |
| 57 | \fBint waddchnstr(WINDOW *win, const chtype *chstr, int n);\fR |
| 58 | .br |
| 59 | \fBint mvaddchstr(int y, int x, const chtype *chstr);\fR |
| 60 | .br |
| 61 | \fBint mvaddchnstr(int y, int x, const chtype *chstr, int n);\fR |
| 62 | .br |
| 63 | \fBint mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr);\fR |
| 64 | .br |
| 65 | \fBint mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n);\fR |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 66 | .fi |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 67 | .SH DESCRIPTION |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 68 | These functions copy the (null-terminated) |
| 69 | \fIchstr\fR array |
| 70 | into the window image structure |
| 71 | starting at the current cursor position. |
| 72 | The four functions with \fIn\fR as the last |
| 73 | argument copy at most \fIn\fR elements, |
| 74 | but no more than will fit on the line. |
| 75 | If \fBn\fR=\fB\-1\fR then the whole array is copied, |
| 76 | to the maximum number of characters that will fit on the line. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 77 | .PP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 78 | The window cursor is \fInot\fR advanced. |
| 79 | These functions work faster than \fBwaddnstr\fR. |
| 80 | On the other hand: |
| 81 | .bP |
| 82 | they do not perform checking |
| 83 | (such as for the newline, backspace, or carriage return characters), |
| 84 | .bP |
| 85 | they do not advance the current cursor position, |
| 86 | .bP |
| 87 | they do not expand other control characters to ^-escapes, and |
| 88 | .bP |
| 89 | they truncate the string if it crosses the right margin, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 90 | rather than wrapping it around to the new line. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 91 | .SH RETURN VALUE |
| 92 | All functions return the integer \fBERR\fR upon failure and \fBOK\fR on success. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 93 | .PP |
| 94 | X/Open does not define any error conditions. |
| 95 | This implementation returns an error |
| 96 | if the window pointer is null. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 97 | .PP |
| 98 | Functions with a "mv" prefix first perform a cursor movement using |
| 99 | \fBwmove\fP, and return an error if the position is outside the window, |
| 100 | or if the window pointer is null. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 101 | .SH NOTES |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 102 | All functions except \fBwaddchnstr\fR may be macros. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 103 | .SH PORTABILITY |
| 104 | These entry points are described in the XSI Curses standard, Issue 4. |
| 105 | .SH SEE ALSO |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 106 | \fBcurs_addstr\fR(3X), |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 107 | \fBcurses\fR(3X). |
| 108 | .PP |
| 109 | Comparable functions in the wide-character (ncursesw) library are |
| 110 | described in |
| 111 | \fBcurs_add_wchstr\fR(3X). |