]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_inchstr.3x
ncurses 6.1 - patch 20190121
[ncurses.git] / man / curs_inchstr.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
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 .\"
29 .\" $Id: curs_inchstr.3x,v 1.18 2018/07/28 21:34:06 tom Exp $
30 .TH curs_inchstr 3X ""
31 .ie \n(.g .ds `` \(lq
32 .el       .ds `` ``
33 .ie \n(.g .ds '' \(rq
34 .el       .ds '' ''
35 .de bP
36 .ie n  .IP \(bu 4
37 .el    .IP \(bu 2
38 ..
39 .na
40 .hy 0
41 .SH NAME
42 \fBinchstr\fR,
43 \fBinchnstr\fR,
44 \fBwinchstr\fR,
45 \fBwinchnstr\fR,
46 \fBmvinchstr\fR,
47 \fBmvinchnstr\fR,
48 \fBmvwinchstr\fR,
49 \fBmvwinchnstr\fR \- get a string of characters (and attributes) from a \fBcurses\fR window
50 .ad
51 .hy
52 .SH SYNOPSIS
53 \fB#include <curses.h>\fR
54 .sp
55 \fBint inchstr(chtype *chstr);\fR
56 .br
57 \fBint inchnstr(chtype *chstr, int n);\fR
58 .br
59 \fBint winchstr(WINDOW *win, chtype *chstr);\fR
60 .br
61 \fBint winchnstr(WINDOW *win, chtype *chstr, int n);\fR
62 .br
63 \fBint mvinchstr(int y, int x, chtype *chstr);\fR
64 .br
65 \fBint mvinchnstr(int y, int x, chtype *chstr, int n);\fR
66 .br
67 \fBint mvwinchstr(WINDOW *win, int y, int x, chtype *chstr);\fR
68 .br
69 \fBint mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr, int n);\fR
70 .br
71 .SH DESCRIPTION
72 These routines return a NULL-terminated array of \fBchtype\fR quantities,
73 starting at the current cursor position in the named window and ending at the
74 right margin of the window.
75 The four functions with \fIn\fR as
76 the last argument, return a leading substring at most \fIn\fR characters long
77 (exclusive of the trailing (chtype)0).
78 Constants defined in \fB<curses.h>\fR can be used with the \fB&\fR (logical
79 AND) operator to extract the character or the attribute alone from any position
80 in the \fIchstr\fR [see \fBcurs_inch\fR(3X)].
81 .SH RETURN VALUE
82 All routines return the integer \fBERR\fR upon failure and an integer value
83 other than \fBERR\fR upon successful completion (the number of characters
84 retrieved, exclusive of the trailing 0).
85 .PP
86 X/Open Curses defines no error conditions.
87 In this implementation:
88 .bP
89 If the \fIwin\fP parameter is null, an error is returned,
90 .bP
91 If the \fIchstr\fP parameter is null, an error is returned,
92 .PP
93 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
94 \fBwmove\fP, and return an error if the position is outside the window,
95 or if the window pointer is null.
96 .SH NOTES
97 Note that all routines except \fBwinchnstr\fR may be macros.
98 SVr4 does not
99 document whether the result string is zero-terminated; it does not document
100 whether a length limit argument includes any trailing 0; and it does not
101 document the meaning of the return value.
102 .SH PORTABILITY
103 These functions are described in the XSI Curses standard, Issue 4.
104 It is no
105 more specific than the SVr4 documentation on the trailing 0.
106 It does specify
107 that the successful return of the functions is \fBOK\fR.
108 .SH SEE ALSO
109 \fBcurses\fR(3X), \fBcurs_inch\fR(3X).
110 .PP
111 Comparable functions in the wide-character (ncursesw) library are
112 described in
113 \fBcurs_in_wchstr\fR(3X).