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) 2002-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_add_wchstr.3x,v 1.10 2012/11/03 22:54:43 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | .TH curs_add_wchstr 3X "" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 31 | .de bP |
| 32 | .IP \(bu 4 |
| 33 | .. |
| 34 | .na |
| 35 | .hy 0 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 36 | .SH NAME |
| 37 | \fBadd_wchstr\fR, |
| 38 | \fBadd_wchnstr\fR, |
| 39 | \fBwadd_wchstr\fR, |
| 40 | \fBwadd_wchnstr\fR, |
| 41 | \fBmvadd_wchstr\fR, |
| 42 | \fBmvadd_wchnstr\fR, |
| 43 | \fBmvwadd_wchstr\fR, |
| 44 | \fBmvwadd_wchnstr\fR \- add an array of complex characters (and attributes) to a curses window |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 45 | .ad |
| 46 | .hy |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 47 | .SH SYNOPSIS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 48 | .nf |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 49 | \fB#include <curses.h>\fR |
| 50 | .PP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 51 | \fBint add_wchstr(const cchar_t *\fR\fIwchstr\fR\fB);\fR |
| 52 | .br |
| 53 | \fBint add_wchnstr(const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR |
| 54 | .br |
| 55 | \fBint wadd_wchstr(WINDOW *\fR \fIwin\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR |
| 56 | .br |
| 57 | \fBint wadd_wchnstr(WINDOW *\fR \fIwin\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR |
| 58 | .br |
| 59 | \fBint mvadd_wchstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR |
| 60 | .br |
| 61 | \fBint mvadd_wchnstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR |
| 62 | .br |
| 63 | \fBint mvwadd_wchstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR |
| 64 | .br |
| 65 | \fBint mvwadd_wchnstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR |
| 66 | .fi |
| 67 | .SH DESCRIPTION |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 68 | These functions copy the (null-terminated) |
| 69 | array of complex characters \fIwchstr\fR |
| 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, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 76 | to the maximum number of characters that will fit on the line. |
| 77 | .PP |
| 78 | The window cursor is \fInot\fR advanced. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 79 | These functions work faster than \fBwaddnstr\fR. |
| 80 | On the other hand: |
| 81 | .bP |
| 82 | they do not perform checking |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 83 | (such as for the newline, backspace, or carriage return characters), |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 84 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 85 | they do not advance the current cursor position, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 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. |
| 91 | .PP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 92 | These functions end successfully |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 93 | on encountering a null \fIcchar_t\fR, or |
| 94 | when they have filled the current line. |
| 95 | If a complex character cannot completely fit at the end of the current line, |
| 96 | the remaining columns are filled with the background character and rendition. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 97 | .SH RETURN VALUE |
| 98 | All functions return the integer \fBERR\fR upon failure and \fBOK\fR on success. |
| 99 | .PP |
| 100 | X/Open does not define any error conditions. |
| 101 | This implementation returns an error |
| 102 | if the window pointer is null. |
| 103 | .PP |
| 104 | Functions with a "mv" prefix first perform a cursor movement using |
| 105 | \fBwmove\fP, and return an error if the position is outside the window, |
| 106 | or if the window pointer is null. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 107 | .SH NOTES |
| 108 | All functions except \fBwadd_wchnstr\fR may be macros. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 109 | .SH PORTABILITY |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 110 | These entry points are described in the XSI Curses standard, Issue 4. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 111 | .SH SEE ALSO |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 112 | \fBcurs_addwstr\fR(3X), |
| 113 | \fBcurses\fR(3X). |
| 114 | .PP |
| 115 | Comparable functions in the narrow-character (ncurses) library are |
| 116 | described in |
| 117 | \fBcurs_addchstr\fR(3X). |