Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2 | .\" Copyright 2018-2023,2024 Thomas E. Dickey * |
| 3 | .\" Copyright 2002-2012,2017 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | .\" |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 30 | .\" $Id: curs_in_wchstr.3x,v 1.39 2024/04/20 21:24:19 tom Exp $ |
| 31 | .TH curs_in_wchstr 3X 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "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 | .. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 47 | .SH NAME |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 48 | \fB\%in_wchstr\fP, |
| 49 | \fB\%in_wchnstr\fP, |
| 50 | \fB\%win_wchstr\fP, |
| 51 | \fB\%win_wchnstr\fP, |
| 52 | \fB\%mvin_wchstr\fP, |
| 53 | \fB\%mvin_wchnstr\fP, |
| 54 | \fB\%mvwin_wchstr\fP, |
| 55 | \fB\%mvwin_wchnstr\fP \- |
| 56 | get a \fIcurses\fR complex character string from a window |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 57 | .SH SYNOPSIS |
| 58 | .nf |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 59 | \fB#include <curses.h> |
| 60 | .PP |
| 61 | \fBint in_wchstr(cchar_t *\fIwchstr\fP); |
| 62 | \fBint win_wchstr(WINDOW *\fIwin\fP, cchar_t *\fIwchstr\fP); |
| 63 | \fBint mvin_wchstr(int \fIy\fP, int \fIx\fP, cchar_t *\fIwchstr\fP); |
| 64 | \fBint mvwin_wchstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, cchar_t *\fIwchstr\fP); |
| 65 | .PP |
| 66 | \fBint in_wchnstr(cchar_t *\fIwchstr\fP, int \fIn\fP); |
| 67 | \fBint win_wchnstr(WINDOW *\fIwin\fP, cchar_t *\fIwchstr\fP, int \fIn\fP); |
| 68 | \fBint mvin_wchnstr(int \fIy\fP, int \fIx\fP, cchar_t *\fIwchstr\fP, int \fIn\fP); |
| 69 | \fBint mvwin_wchnstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, cchar_t *\fIwchstr\fP, int \fIn\fP); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 70 | .fi |
| 71 | .SH DESCRIPTION |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 72 | These functions return an array of complex characters in \fIwchstr\fP, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 73 | starting at the current cursor position in the named window. |
| 74 | Attributes (rendition) are stored with the characters. |
| 75 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 76 | The four functions with \fIn\fP as the last argument return |
| 77 | a leading substring at most \fIn\fP characters long |
| 78 | (exclusive of the trailing zeroed \fBcchar_t\fR. |
| 79 | Transfer stops at the end of the current line, or when \fIn\fP characters have |
| 80 | been stored at the location referenced by \fIwchstr\fP. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 81 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 82 | Constants defined in \fB<curses.h>\fP can be used with the \fB&\fP (logical |
| 83 | AND) operator to extract the character or the attribute alone from any position |
| 84 | in the \fIwchstr\fP [see \fBgetcchar\fP(3X)]. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 85 | .SH RETURN VALUE |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 86 | Upon successful completion, these functions return |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 87 | \fBOK\fP. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 88 | Otherwise, they return |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 89 | \fBERR\fP. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 90 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 91 | X/Open Curses defines no error conditions. |
| 92 | This implementation returns an error |
| 93 | .bP |
| 94 | if the \fIwin\fP parameter is null or |
| 95 | .bP |
| 96 | if the \fIwchstr\fP parameter is null. |
| 97 | .PP |
| 98 | Functions prefixed with \*(``mv\*('' first perform cursor movement and |
| 99 | fail if the position |
| 100 | .RI ( y , |
| 101 | .IR x ) |
| 102 | is outside the window boundaries. |
| 103 | .SH NOTES |
| 104 | All routines except \fBwin_wchnstr\fP may be macros. |
| 105 | .PP |
| 106 | Reading a line that overflows the array pointed to by |
| 107 | \fIwchstr\fP |
| 108 | with |
| 109 | \fBin_wchstr\fP, |
| 110 | \fBmvin_wchstr\fP, |
| 111 | \fBmvwin_wchstr\fP |
| 112 | or |
| 113 | \fBwin_wchstr\fP |
| 114 | causes undefined results. |
| 115 | Therefore, the use of |
| 116 | \fBin_wchnstr\fP, |
| 117 | \fBmvin_wchnstr\fP, |
| 118 | \fBmvwin_wchnstr\fP, or |
| 119 | \fBwin_wchnstr\fP |
| 120 | is recommended. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 121 | .SH PORTABILITY |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 122 | X/Open Curses defines no error conditions. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 123 | This implementation checks for null pointers, |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 124 | returning \fBERR\fP in that case. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 125 | .SH SEE ALSO |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 126 | \fB\%curs_inchstr\fP(3X) describes comparable functions of the |
| 127 | .I \%ncurses |
| 128 | library in its non-wide-character configuration. |
| 129 | .PP |
| 130 | \fB\%curses\fP(3X), |
| 131 | \fB\%curs_inwstr\fP(3X), |
| 132 | \fB\%curs_in_wch\fP(3X) |