Merge branch 'vendor/GDB' into gdb7
[dragonfly.git] / lib / libncurses / man / curs_addch.3
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: curs_addch.3x,v 1.23 2004/01/31 13:16:21 tom Exp $
31 .\" $DragonFly: src/lib/libncurses/man/curs_addch.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
32 .TH curs_addch 3X ""
33 .SH NAME
34 \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR,
35 \fBechochar\fR,
36 \fBwechochar\fR - add a character (with attributes) to a \fBcurses\fR window, then advance the cursor
37 .SH SYNOPSIS
38 \fB#include <curses.h>\fR
39 .PP
40 \fBint addch(const chtype ch);\fR
41 .br
42 \fBint waddch(WINDOW *win, const chtype ch);\fR
43 .br
44 \fBint mvaddch(int y, int x, const chtype ch);\fR
45 .br
46 \fBint mvwaddch(WINDOW *win, int y, int x, const chtype ch);\fR
47 .br
48 \fBint echochar(const chtype ch);\fR
49 .br
50 \fBint wechochar(WINDOW *win, const chtype ch);\fR
51 .br
52 .SH DESCRIPTION
53 The \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR and \fBmvwaddch\fR routines put
54 the character \fIch\fR into the given window at its current window position,
55 which is then advanced.  They are analogous to \fBputchar\fR in \fBstdio\fR(3).
56 If the advance is at the right margin, the cursor automatically wraps to the
57 beginning of the next line.  At the bottom of the current scrolling region, if
58 \fBscrollok\fR is enabled, the scrolling region is scrolled up one line.
59 .PP
60 If \fIch\fR is a tab, newline, or backspace,
61 the cursor is moved appropriately within the window.
62 Backspace moves the cursor one character left; at the left
63 edge of a window it does nothing.
64 Newline does a \fBclrtoeol\fR,
65 then moves the cursor to the window left margin on the next line,
66 scrolling the window if on the last line.
67 Tabs are considered to be at every eighth column.
68 The tab interval may be altered by setting the \fBTABSIZE\fR variable.
69 .PP
70 If \fIch\fR is any control character other than tab, newline, or backspace, it
71 is drawn in \fB^\fR\fIX\fR notation.  Calling \fBwinch\fR after adding a
72 control character does not return the character itself, but instead returns
73 the ^-representation of the control character.
74 .PP
75 Video attributes can be combined with a character argument passed to
76 \fBaddch\fR or related functions by logical-ORing them into the character.
77 (Thus, text, including attributes, can be copied from one place to another
78 using \fBinch\fR and \fBaddch\fR.)  See the \fBcurs_attr\fR(3X) page for
79 values of predefined video attribute constants that can be usefully OR'ed
80 into characters.
81 .PP
82 The \fBechochar\fR and \fBwechochar\fR routines are equivalent to a call to
83 \fBaddch\fR followed by a call to \fBrefresh\fR, or a call to \fBwaddch\fR
84 followed by a call to \fBwrefresh\fR.  The knowledge that only a single
85 character is being output is used and, for non-control characters, a
86 considerable performance gain may be seen by using these routines instead of
87 their equivalents.
88 .SS Line Graphics
89 The following variables may be used to add line drawing characters to the
90 screen with routines of the \fBaddch\fR family.  The default character listed
91 below is used if the \fBacsc\fR capability doesn't define a terminal-specific
92 replacement for it (but see the EXTENSIONS section below).  The names are
93 taken from VT100 nomenclature.
94 .PP
95 .TS
96 l l l
97 _ _ _
98 l l l.
99 \fIName\fR      \fIDefault\fR   \fIDescription\fR
100 ACS_BLOCK       #       solid square block
101 ACS_BOARD       #       board of squares
102 ACS_BTEE        +       bottom tee
103 ACS_BULLET      o       bullet
104 ACS_CKBOARD     :       checker board (stipple)
105 ACS_DARROW      v       arrow pointing down
106 ACS_DEGREE      '       degree symbol
107 ACS_DIAMOND     +       diamond
108 ACS_GEQUAL      >       greater-than-or-equal-to
109 ACS_HLINE       -       horizontal line
110 ACS_LANTERN     #       lantern symbol
111 ACS_LARROW      <       arrow pointing left
112 ACS_LEQUAL      <       less-than-or-equal-to
113 ACS_LLCORNER    +       lower left-hand corner
114 ACS_LRCORNER    +       lower right-hand corner
115 ACS_LTEE        +       left tee
116 ACS_NEQUAL      !       not-equal
117 ACS_PI  *       greek pi
118 ACS_PLMINUS     #       plus/minus
119 ACS_PLUS        +       plus
120 ACS_RARROW      >       arrow pointing right
121 ACS_RTEE        +       right tee
122 ACS_S1  -       scan line 1
123 ACS_S3  -       scan line 3
124 ACS_S7  -       scan line 7
125 ACS_S9  \&_     scan line 9
126 ACS_STERLING    f       pound-sterling symbol
127 ACS_TTEE        +       top tee
128 ACS_UARROW      ^       arrow pointing up
129 ACS_ULCORNER    +       upper left-hand corner
130 ACS_URCORNER    +       upper right-hand corner
131 ACS_VLINE       |       vertical line
132 .TE
133 .SH RETURN VALUE
134 All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success
135 (the SVr4 manuals specify only "an integer value other than \fBERR\fR") upon
136 successful completion, unless otherwise noted in the preceding routine
137 descriptions.
138 .SH NOTES
139 Note that \fBaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR, and
140 \fBechochar\fR may be macros.
141 .SH PORTABILITY
142 All these functions are described in the XSI Curses standard, Issue 4.
143 The defaults specified for forms-drawing characters apply in the POSIX locale.
144 .LP
145 Some ACS symbols
146 (ACS_S3,
147 ACS_S7,
148 ACS_LEQUAL,
149 ACS_GEQUAL,
150 ACS_PI,
151 ACS_NEQUAL,
152 ACS_STERLING)
153 were not documented in
154 any publicly released System V.  However, many publicly available terminfos
155 include \fBacsc\fR strings in which their key characters (pryz{|}) are
156 embedded, and a second-hand list of their character descriptions has come
157 to light.  The ACS-prefixed names for them were invented for \fBncurses\fR(3X).
158 .LP
159 The \fBTABSIZE\fR variable is implemented in some versions of curses,
160 but is not part of X/Open curses.
161 .LP
162 If \fIch\fR is a carriage return,
163 the cursor is moved to the beginning of the current row of the window.
164 This is true of other implementations, but is not documented.
165 .SH SEE ALSO
166 \fBcurses\fR(3X), \fBcurs_attr\fR(3X), \fBcurs_clear\fR(3X),
167 \fBcurs_inch\fR(3X), \fBcurs_outopts\fR(3X), \fBcurs_refresh\fR(3X),
168 \fBputc\fR(3S).
169 .\"#
170 .\"# The following sets edit modes for GNU EMACS
171 .\"# Local Variables:
172 .\"# mode:nroff
173 .\"# fill-column:79
174 .\"# End: