]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_add_wchstr.3x
ncurses 6.5 - patch 20240511
[ncurses.git] / man / curs_add_wchstr.3x
index 27a8633748a95ba131e0e0bb16ebbbd3ac6a7a72..4a0d06e9d93252edb507b11c4c8396b907ef3c74 100644 (file)
@@ -1,5 +1,6 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2005,2010 Free Software Foundation, Inc.              *
+.\" 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  *
 .\" copy of this software and associated documentation files (the            *
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_add_wchstr.3x,v 1.7 2010/07/31 16:12:01 tom Exp $
-.TH curs_add_wchstr 3X ""
+.\" $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
+..
 .SH NAME
-\fBadd_wchstr\fR,
-\fBadd_wchnstr\fR,
-\fBwadd_wchstr\fR,
-\fBwadd_wchnstr\fR,
-\fBmvadd_wchstr\fR,
-\fBmvadd_wchnstr\fR,
-\fBmvwadd_wchstr\fR,
-\fBmvwadd_wchnstr\fR \- add an array of complex characters (and attributes) to a curses window
+\fB\%add_wchstr\fP,
+\fB\%add_wchnstr\fP,
+\fB\%wadd_wchstr\fP,
+\fB\%wadd_wchnstr\fP,
+\fB\%mvadd_wchstr\fP,
+\fB\%mvadd_wchnstr\fP,
+\fB\%mvwadd_wchstr\fP,
+\fB\%mvwadd_wchnstr\fP \-
+add a \fIcurses\fR complex character string to a window
 .SH SYNOPSIS
-.B #include <curses.h>
-.PP
 .nf
-\fBint add_wchstr(const cchar_t *\fR\fIwchstr\fR\fB);\fR
-.br
-\fBint add_wchnstr(const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR
-.br
-\fBint wadd_wchstr(WINDOW *\fR \fIwin\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR
-.br
-\fBint wadd_wchnstr(WINDOW *\fR \fIwin\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR
-.br
-\fBint mvadd_wchstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR
-.br
-\fBint mvadd_wchnstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR
-.br
-\fBint mvwadd_wchstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR
-.br
-\fBint mvwadd_wchnstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR
+\fB#include <curses.h>
+.PP
+\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 routines copy the array of complex characters \fIwchstr\fR
-into the window image structure at and after the current cursor position.
-The four routines with \fIn\fR as the last
-argument copy at most \fIn\fR elements, but no more than will fit on the line.
-If \fBn\fR=\fB\-1\fR 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\fR advanced.
-These routines work faster than \fBwaddnstr\fR.
-On the other hand, they do not perform checking
-(such as for the newline, backspace, or carriage return characters),
-they do not advance the current cursor position,
-they do not expand other control characters to ^-escapes,
-and they truncate the string if it crosses the right margin,
-rather than wrapping it around to the new line.
+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
+do not treat the backspace,
+carriage return,
+or line feed characters specially;
+.bP
+do not represent unprintable characters with \fB\%wunctrl\fP(3X);
+.bP
+do not update the cursor position to follow the last character written;
+.bP
+truncate the string at the window's right margin,
+rather than wrapping it to the next line and potentially scrolling.
+.SH RETURN VALUE
+These functions return
+.B OK
+on success and
+.B ERR
+on failure.
 .PP
-These routines end successfully
-on encountering a null \fIcchar_t\fR, 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.
+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 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\fR may be macros.
-.SH RETURN VALUES
-All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
+All of these functions except
+.B \%wadd_wchnstr
+may be implemented as macros.
 .SH PORTABILITY
-All these entry points are described in the XSI Curses standard, Issue 4.
+X/Open Curses,
+Issue 4 describes these functions.
 .SH SEE ALSO
-\fBcurses\fR(3X),
-\fBcurs_addchstr\fR(3X),
-\fBcurs_addwstr\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fB\%curs_addchstr\fP(3X) describes comparable functions of the
+.I \%ncurses
+library in its non-wide-character configuration.
+.PP
+\fB\%curses\fP(3X),
+\fB\%curs_addwstr\fP(3X),
+\fB\%curs_add_wch\fP(3X)