]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_inchstr.3x
ncurses 6.4 - patch 20231118
[ncurses.git] / man / curs_inchstr.3x
index fa263ba3dc4151d41eec921030fdb5edba2d62af..89d4bd1e3d1fa272f8115331eceed66903322d6a 100644 (file)
@@ -27,8 +27,8 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_inchstr.3x,v 1.35 2023/10/07 21:19:07 tom Exp $
-.TH curs_inchstr 3X 2023-10-07 "ncurses 6.4" "Library calls"
+.\" $Id: curs_inchstr.3x,v 1.40 2023/11/19 00:08:58 tom Exp $
+.TH curs_inchstr 3X 2023-11-18 "ncurses 6.4" "Library calls"
 .ie \n(.g \{\
 .ds `` \(lq
 .ds '' \(rq
 .ie \n(.g \{\
 .ds `` \(lq
 .ds '' \(rq
@@ -72,9 +72,13 @@ get a \fIcurses\fR character string from a window
 These routines return a NULL-terminated array of \fBchtype\fP quantities,
 starting at the current cursor position in the named window and ending at the
 right margin of the window.
 These routines return a NULL-terminated array of \fBchtype\fP quantities,
 starting at the current cursor position in the named window and ending at the
 right margin of the window.
-The four functions with \fIn\fP as
-the last argument, return a leading substring at most \fIn\fP characters long
+.PP
+The four functions with \fIn\fP as the last argument, return
+a leading substring at most \fIn\fP characters long
 (exclusive of the trailing (chtype)0).
 (exclusive of the trailing (chtype)0).
+Transfer stops at the end of the current line, or when \fIn\fP characters have
+been stored at the location referenced by \fIchstr\fP.
+.PP
 Constants defined in \fB<curses.h>\fP can be used with the \fB&\fP (logical
 AND) operator to extract the character or the attribute alone from any position
 in the \fIchstr\fP [see \fBcurs_inch\fP(3X)].
 Constants defined in \fB<curses.h>\fP can be used with the \fB&\fP (logical
 AND) operator to extract the character or the attribute alone from any position
 in the \fIchstr\fP [see \fBcurs_inch\fP(3X)].
@@ -84,21 +88,38 @@ other than \fBERR\fP upon successful completion (the number of characters
 retrieved, exclusive of the trailing 0).
 .PP
 X/Open Curses defines no error conditions.
 retrieved, exclusive of the trailing 0).
 .PP
 X/Open Curses defines no error conditions.
-In this implementation:
+This implementation returns an error
 .bP
 .bP
-If the \fIwin\fP parameter is null, an error is returned,
+if the \fIwin\fP parameter is null or
 .bP
 .bP
-If the \fIchstr\fP parameter is null, an error is returned,
+if the \fIchstr\fP parameter is null.
 .PP
 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
 \fBwmove\fP, and return an error if the position is outside the window,
 or if the window pointer is null.
 .SH NOTES
 .PP
 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
 \fBwmove\fP, and return an error if the position is outside the window,
 or if the window pointer is null.
 .SH NOTES
-Note that all routines except \fBwinchnstr\fP may be macros.
+All routines except \fBwinchnstr\fP may be macros.
+.PP
 SVr4 does not
 document whether the result string is zero-terminated; it does not document
 whether a length limit argument includes any trailing 0; and it does not
 document the meaning of the return value.
 SVr4 does not
 document whether the result string is zero-terminated; it does not document
 whether a length limit argument includes any trailing 0; and it does not
 document the meaning of the return value.
+.PP
+Reading a line that overflows the array pointed to by
+\fIchstr\fP
+with
+\fBinchstr\fP,
+\fBmvinchstr\fP,
+\fBmvwinchstr\fP
+or
+\fBwinchstr\fP
+causes undefined results.
+Therefore, the use of
+\fBinchnstr\fP,
+\fBmvinchnstr\fP,
+\fBmvwinchnstr\fP, or
+\fBwinchnstr\fP
+is recommended.
 .SH PORTABILITY
 These functions are described in the XSI Curses standard, Issue 4.
 It is no
 .SH PORTABILITY
 These functions are described in the XSI Curses standard, Issue 4.
 It is no
@@ -107,8 +128,6 @@ It does specify
 that the successful return of the functions is \fBOK\fP.
 .SH SEE ALSO
 \fB\%curses\fP(3X),
 that the successful return of the functions is \fBOK\fP.
 .SH SEE ALSO
 \fB\%curses\fP(3X),
-\fB\%curs_inch\fP(3X)
-.PP
-Comparable functions in the wide-character (ncursesw) library are
-described in
-\fB\%curs_in_wchstr\fP(3X).
+\fB\%curs_inch\fP(3X),
+\fB\%curs_inwstr\fP(3X),
+\fB\%curs_in_wchstr\fP(3X)