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