Merge from vendor branch NTPD:
[dragonfly.git] / lib / libncurses / man / curs_add_wch.3
1 .\"***************************************************************************
2 .\" Copyright (c) 2001,2002 Free Software Foundation, Inc.                   *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_add_wch.3x,v 1.4 2002/02/16 22:28:43 tom Exp $
30 .\" $DragonFly: src/lib/libncurses/man/curs_add_wch.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH curs_add_wch 3X ""
32 .SH NAME
33 \fBadd_wch\fP,
34 \fBwadd_wch\fP,
35 \fBmvadd_wch\fP,
36 \fBmvwadd_wch\fP,
37 \fBecho_wchar\fP,
38 \fBwecho_wchar\fP - add a complex character and rendition to a \fBcurses\fR window, then advance the cursor
39 .SH SYNOPSIS
40 .PP
41 \fB#include <curses.h>\fP
42 .sp
43 .B "int add_wch( const cchar_t *\fIwch\fB );"
44 .br
45 .B "int wadd_wch( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );"
46 .br
47 .B "int mvadd_wch( int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );"
48 .br
49 .B "int mvwadd_wch( WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );"
50 .br
51 .B "int echo_wchar( const cchar_t *\fIwch\fB );"
52 .br
53 .B "int wecho_wchar( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );"
54 .br
55 .SH DESCRIPTION
56 .PP
57 The
58 \fBadd_wch\fP,
59 \fBwadd_wch\fP,
60 \fBmvadd_wch\fP, and
61 \fBmvwadd_wch\fP
62 functions put the complex character \fIwch\fP into the given
63 window at its current position,
64 which is then advanced.
65 These functions perform
66 wrapping and special-character processing as follows:
67 .TP 5
68 -
69 If \fIwch\fP refers to a spacing character,
70 then any previous character at that location is removed.
71 A new character specified by \fIwch\fP is
72 placed at that location with rendition specified by \fIwch\fP.
73 The cursor then advances to
74 the next spacing character on the screen.
75 .TP 5
76 -
77 If \fIwch\fP refers to a non-spacing character,
78 all previous characters at that location are preserved.
79 The non-spacing characters of \fIwch\fP
80 are added to the spacing complex character,
81 and the rendition specified by \fIwch\fP is ignored.
82 .TP 5
83 -
84 If the character part of \fIwch\fP is
85 a tab, newline, backspace or other control character,
86 the window is updated and the cursor moves as if \fBaddch\fR(3X) were called.
87 .PP
88 The \fBecho_wchar\fP
89 function is functionally equivalent to a call to
90 \fBadd_wch\fP
91 followed by a call to
92 \fBrefresh\fP.
93 Similarly, the
94 \fBwecho_wchar\fP
95 is functionally equivalent to a call to
96 \fBwadd_wch\fP
97 followed by a call to
98 \fBwrefresh\fP.
99 The knowledge
100 that only a single character is being output is taken into consideration and,
101 for non-control characters, a considerable performance gain might be seen
102 by using the *\fBecho\fP* functions instead of their equivalents.
103 .SH RETURN VALUES
104 .PP
105 All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
106 .SH NOTES
107 .PP
108 Note that
109 \fBadd_wch\fP,
110 \fBmvadd_wch\fP,
111 \fBmvwadd_wch\fP, and
112 \fBecho_wchar\fP
113 may be macros.
114 .SH PORTABILITY
115 .PP
116 All these functions are described in the XSI Curses standard, Issue 4.
117 The defaults specified for forms-drawing characters apply in the POSIX locale.
118 .PP
119 XSI documents constants beginning with \fBWACS_\fP which are used for
120 line-drawing.
121 Those are not currently implemented in \fBncurses\fP.
122 .SH SEE ALSO
123 .PP
124 \fBcurses\fR(3X),
125 \fBcurs_attr_get\fR(3X),
126 \fBcurs_clear\fR(3X),
127 \fBcurs_outopts\fR(3X),
128 \fBcurs_refresh\fR(3X),
129 \fBputwc\fR(3)
130 .\"#
131 .\"# The following sets edit modes for GNU EMACS
132 .\"# Local Variables:
133 .\"# mode:nroff
134 .\"# fill-column:79
135 .\"# End: