]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_add_wchstr.3x
ncurses 6.5 - patch 20240519
[ncurses.git] / man / curs_add_wchstr.3x
index ac24b36d2e1ba46fb2708ae6db5e009dfb8b5b85..4a0d06e9d93252edb507b11c4c8396b907ef3c74 100644 (file)
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright 2019-2022,2023 Thomas E. Dickey                                *
+.\" Copyright 2019-2023,2024 Thomas E. Dickey                                *
 .\" Copyright 2002-2012,2017 Free Software Foundation, Inc.                  *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_add_wchstr.3x,v 1.25 2023/09/16 23:34:43 tom Exp $
-.TH curs_add_wchstr 3X 2023-09-16 "ncurses 6.4" "Library calls"
-.ie \n(.g .ds `` \(lq
-.el       .ds `` ``
-.ie \n(.g .ds '' \(rq
-.el       .ds '' ''
+.\" $Id: curs_add_wchstr.3x,v 1.40 2024/05/11 20:39:53 tom Exp $
+.TH curs_add_wchstr 3X 2024-05-11 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
+.ie \n(.g \{\
+.ds `` \(lq
+.ds '' \(rq
+.\}
+.el \{\
+.ie t .ds `` ``
+.el   .ds `` ""
+.ie t .ds '' ''
+.el   .ds '' ""
+.\}
+.
 .de bP
 .ie n  .IP \(bu 4
 .el    .IP \(bu 2
 add a \fIcurses\fR complex character string to a window
 .SH SYNOPSIS
 .nf
-\fB#include <curses.h>\fP
+\fB#include <curses.h>
 .PP
-\fBint add_wchstr(const cchar_t *\fIwchstr\fB);\fR
-.br
-\fBint add_wchnstr(const cchar_t *\fIwchstr\fB, int \fIn\fB);\fR
-.br
-\fBint wadd_wchstr(WINDOW *\fR \fIwin\fB, const cchar_t *\fIwchstr\fB);\fR
-.br
-\fBint wadd_wchnstr(WINDOW *\fR \fIwin\fB, const cchar_t *\fIwchstr\fB, int \fIn\fB);\fR
-.sp
-\fBint mvadd_wchstr(int \fIy\fB, int \fIx\fB, const cchar_t *\fIwchstr\fB);\fR
-.br
-\fBint mvadd_wchnstr(int \fIy\fB, int \fIx\fB, const cchar_t *\fIwchstr\fB, int \fIn\fB);\fR
-.br
-\fBint mvwadd_wchstr(WINDOW *\fIwin\fB, int \fIy\fB, int \fIx\fB, const cchar_t *\fIwchstr\fB);\fR
-.br
-\fBint mvwadd_wchnstr(WINDOW *\fIwin\fB, int \fIy\fB, int \fIx\fB, const cchar_t *\fIwchstr\fB, int \fIn\fB);\fR
+\fBint add_wchstr(const cchar_t *\fIwchstr\fP);
+\fBint wadd_wchstr(WINDOW * \fIwin\fP, const cchar_t *\fIwchstr\fP);
+\fBint mvadd_wchstr(int \fIy\fP, int \fIx\fP, const cchar_t *\fIwchstr\fP);
+\fBint mvwadd_wchstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const cchar_t *\fIwchstr\fP);
+.PP
+\fBint add_wchnstr(const cchar_t *\fIwchstr\fP, int \fIn\fP);
+\fBint wadd_wchnstr(WINDOW * \fIwin\fP, const cchar_t *\fIwchstr\fP, int \fIn\fP);
+\fBint mvadd_wchnstr(int \fIy\fP, int \fIx\fP, const cchar_t *\fIwchstr\fP, int \fIn\fP);
+\fBint mvwadd_wchnstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const cchar_t *\fIwchstr\fP, int \fIn\fP);
 .fi
 .SH DESCRIPTION
-These functions copy the (null-terminated)
-array of complex characters \fIwchstr\fP
-into the window image structure
-starting at the current cursor position.
-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.
+.B \%wadd_wchstr
+copies the string of complex characters
+.I \%wchstr
+to the window
+.IR win "."
+A null complex character terminates the string.
+If a complex character does completely fit at the end of the line,
+.I curses
+fills the remaining columns with the window background;
+see \fB\%bkgrnd\fP(3X).
+.B \%wadd_wchnstr
+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 window cursor is \fInot\fP advanced.
-These functions work faster than \fBwaddnstr\fP.
-On the other hand:
+Because these functions do not call \fB\%wadd_wch\fP(3X) internally,
+they are faster than \fB\%waddwstr\fP(3X) and \fB\%waddnwstr\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\%wunctrl\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.
-.PP
-These functions end successfully
-on encountering a null \fBcchar_t\fP, or
-when they have filled the current line.
-If a complex character cannot completely fit at the end of the current line,
-the remaining columns are filled with the background character and rendition.
+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
-if the window pointer is null.
+X/Open Curses does not specify any error conditions.
+.I \%ncurses
+returns
+.B ERR
+if
+.bP
+.I win
+is
+.B NULL
+or
+.bP
+.I wchstr
+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 \fBwadd_wchnstr\fP may be macros.
+All of these functions except
+.B \%wadd_wchnstr
+may be implemented as macros.
 .SH PORTABILITY
-These entry points are described in the XSI Curses standard, Issue 4.
+X/Open Curses,
+Issue 4 describes these functions.
 .SH SEE ALSO
-\fBcurses\fP(3X),
-\fBcurs_addwstr\fP(3X).
+\fB\%curs_addchstr\fP(3X) describes comparable functions of the
+.I \%ncurses
+library in its non-wide-character configuration.
 .PP
-Comparable functions in the narrow-character (ncurses) library are
-described in
-\fBcurs_addchstr\fP(3X).
+\fB\%curses\fP(3X),
+\fB\%curs_addwstr\fP(3X),
+\fB\%curs_add_wch\fP(3X)