]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_addchstr.3x
ncurses 6.5 - patch 20240518
[ncurses.git] / man / curs_addchstr.3x
index 9e8db9860b50a06deec6660eebc5eb049d524cee..19c47fc59ff91e961d1a318fea3c8e72448216eb 100644 (file)
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright 2019-2022,2023 Thomas E. Dickey                                *
+.\" Copyright 2019-2023,2024 Thomas E. Dickey                                *
 .\" Copyright 1998-2012,2017 Free Software Foundation, Inc.                  *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,8 +27,8 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_addchstr.3x,v 1.38 2023/11/25 14:01:49 tom Exp $
-.TH curs_addchstr 3X 2023-11-25 "ncurses 6.4" "Library calls"
+.\" $Id: curs_addchstr.3x,v 1.46 2024/05/11 20:39:53 tom Exp $
+.TH curs_addchstr 3X 2024-05-11 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
 .ie \n(.g \{\
 .ds `` \(lq
 .ds '' \(rq
@@ -59,60 +59,92 @@ add a \fIcurses\fR character string to a window
 \fB#include <curses.h>
 .PP
 \fBint addchstr(const chtype *\fIchstr\fP);
-\fBint addchnstr(const chtype *\fIchstr\fP, int \fIn\fP);
 \fBint waddchstr(WINDOW *\fIwin\fP, const chtype *\fIchstr\fP);
-\fBint waddchnstr(WINDOW *\fIwin\fP, const chtype *\fIchstr\fP, int \fIn\fP);
-.PP
 \fBint mvaddchstr(int \fIy\fP, int \fIx\fP, const chtype *\fIchstr\fP);
-\fBint mvaddchnstr(int \fIy\fP, int \fIx\fP, const chtype *\fIchstr\fP, int \fIn\fP);
 \fBint mvwaddchstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const chtype *\fIchstr\fP);
+.PP
+\fBint addchnstr(const chtype *\fIchstr\fP, int \fIn\fP);
+\fBint waddchnstr(WINDOW *\fIwin\fP, const chtype *\fIchstr\fP, int \fIn\fP);
+\fBint mvaddchnstr(int \fIy\fP, int \fIx\fP, const chtype *\fIchstr\fP, int \fIn\fP);
 \fBint mvwaddchnstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const chtype *\fIchstr\fP, int \fIn\fP);
 .fi
 .SH DESCRIPTION
-These functions copy the (null-terminated)
-\fIchstr\fP array
-into the window image structure
-starting at the current cursor position.
+.B \%waddchstr
+copies the string of
+.I curses
+characters
+.I \%chstr
+to the window
+.IR win "."
+A null
+.I curses
+character terminates the string.
+.B \%waddchnstr
+does the same,
+but copies at most
+.I n
+characters,
+or as many as possible if
+.I n
+is
+.BR \-1 "."
+\fB\%ncurses\fP(3X) describes the variants of these functions.
 .PP
-The four functions with \fIn\fP as the last
-argument copy at most \fIn\fP elements,
-but no more than will fit on the line.
-If \fBn\fP=\fB\-1\fP then the whole array is copied,
-to the maximum number of characters that will fit on the line.
-.PP
-The window cursor is \fInot\fP advanced.
-These functions are faster than \fBwaddnstr\fP.
-On the other hand:
+Because these functions do not call \fB\%waddch\fP(3X) internally,
+they are faster than \fB\%waddstr\fP(3X) and \fB\%waddnstr\fP(3X).
+On the other hand,
+they
 .bP
-they do not perform checking
-(such as for the newline, backspace, or carriage return characters),
+do not treat the backspace,
+carriage return,
+or line feed characters specially;
 .bP
-they do not advance the current cursor position,
+do not represent unprintable characters with \fB\%unctrl\fP(3X);
 .bP
-they do not expand other control characters to ^-escapes, and
+do not update the cursor position to follow the last character written;
 .bP
-they truncate the string if it crosses the right margin,
-rather than wrapping it around to the new line.
+truncate the string at the window's right margin,
+rather than wrapping it to the next line and potentially scrolling.
 .SH RETURN VALUE
-All functions return the integer \fBERR\fP upon failure and \fBOK\fP on success.
+These functions return
+.B OK
+on success and
+.B ERR
+on failure.
 .PP
-X/Open does not define any error conditions.
-This implementation returns an error
+X/Open Curses does not specify any error conditions.
+.I \%ncurses
+returns
+.B ERR
+if
 .bP
-if the \fIwin\fP parameter is null or
+.I win
+is
+.B NULL
+or
 .bP
-if the \fIwchstr\fP parameter is null.
+.I chstr
+is
+.BR 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.
+Functions prefixed with \*(``mv\*('' first perform cursor movement and
+fail if the position
+.RI ( y ,
+.IR x )
+is outside the window boundaries.
 .SH NOTES
-All functions except \fBwaddchnstr\fP may be macros.
+All of these functions except
+.B \%waddchnstr
+may be implemented as macros.
 .SH PORTABILITY
-These functions are described in the XSI Curses standard, Issue 4.
+X/Open Curses,
+Issue 4 describes these functions.
 .SH SEE ALSO
+\fB\%curs_add_wchstr\fP(3X) describes comparable functions of the
+.I \%ncurses
+library in its wide-character configuration
+.RI ( \%ncursesw ).
+.PP
 \fB\%curses\fP(3X),
 \fB\%curs_addch\fP(3X),
-\fB\%curs_addstr\fP(3X),
-\fB\%curs_addwstr\fP(3X),
-\fB\%curs_add_wchstr\fP(3X)
+\fB\%curs_addstr\fP(3X)