2 .\" $Id: curs_addch.3x,v 1.10 1997/12/13 22:37:23 tom Exp $
5 \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR,
6 \fBechochar\fR, \fBwechochar\fR - add a character (with attributes) to a
7 \fBcurses\fR window, then advance the cursor
9 \fB#include <curses.h>\fR
11 \fBint addch(chtype ch);\fR
13 \fBint waddch(WINDOW *win, chtype ch);\fR
15 \fBint mvaddch(int y, int x, chtype ch);\fR
17 \fBint mvwaddch(WINDOW *win, int y, int x, chtype ch);\fR
19 \fBint echochar(chtype ch);\fR
21 \fBint wechochar(WINDOW *win, chtype ch);\fR
24 The \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR and \fBmvwaddch\fR routines put
25 the character \fIch\fR into the given window at its current window position,
26 which is then advanced. They are analogous to \fBputchar\fR in \fBstdio\fR(3).
27 If the advance is at the right margin, the cursor automatically wraps to the
28 beginning of the next line. At the bottom of the current scrolling region, if
29 \fBscrollok\fR is enabled, the scrolling region is scrolled up one line.
31 If \fIch\fR is a tab, newline, or backspace, the cursor is moved appropriately
32 within the window. Backspace moves the cursor one character left; at the left
33 edge of a window it does nothing. Newline does a \fBclrtoeol\fR, then moves
34 the cursor to the window left margin on the next line, scrolling the window if
35 on the last line). Tabs are considered to be at every eighth column.
37 If \fIch\fR is any control character other than tab, newline, or backspace, it
38 is drawn in \fB^\fR\fIX\fR notation. Calling \fBwinch\fR after adding a
39 control character does not return the character itself, but instead returns
40 the ^-representation of the control character. (To emit control characters
41 literally, use \fBechochar\fR.)
43 Video attributes can be combined with a character argument passed to
44 \fBaddch\fR or related functions by logical-ORing them into the character.
45 (Thus, text, including attributes, can be copied from one place to another
46 using \fBinch\fR and \fBaddch\fR.). See the \fBcurs_attr\fR(3X) page for
47 values of predefined video attribute constants that can be usefully OR'ed
50 The \fBechochar\fR and \fBwechochar\fR routines are equivalent to a call to
51 \fBaddch\fR followed by a call to \fBrefresh\fR, or a call to \fBwaddch\fR
52 followed by a call to \fBwrefresh\fR. The knowledge that only a single
53 character is being output is used and, for non-control characters, a
54 considerable performance gain may be seen by using these routines instead of
57 The following variables may be used to add line drawing characters to the
58 screen with routines of the \fBaddch\fR family. The default character listed
59 below is used if the \fBacsc\fR capability doesn't define a terminal-specific
60 replacement for it (but see the EXTENSIONS section below). The names are
61 taken from VT100 nomenclature.
67 \fIName\fR \fIDefault\fR \fIDescription\fR
68 ACS_ULCORNER + upper left-hand corner
69 ACS_LLCORNER + lower left-hand corner
70 ACS_URCORNER + upper right-hand corner
71 ACS_LRCORNER + lower right-hand corner
76 ACS_HLINE - horizontal line
77 ACS_VLINE | vertical line
80 ACS_S9 \&_ scan line 9
82 ACS_CKBOARD : checker board (stipple)
83 ACS_DEGREE ' degree symbol
84 ACS_PLMINUS # plus/minus
86 ACS_LARROW < arrow pointing left
87 ACS_RARROW > arrow pointing right
88 ACS_DARROW v arrow pointing down
89 ACS_UARROW ^ arrow pointing up
90 ACS_BOARD # board of squares
91 ACS_LANTERN # lantern symbol
92 ACS_BLOCK # solid square block
95 ACS_LEQUAL < less-than-or-equal-to
96 ACS_GEQUAL > greater-than-or-equal-to
98 ACS_NEQUAL ! not-equal
99 ACS_STERLING f pound-sterling symbol
103 All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success
104 (the SVr4 manuals specify only "an integer value other than \fBERR\fR") upon
105 successful completion, unless otherwise noted in the preceding routine
108 Note that \fBaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR, and
109 \fBechochar\fR may be macros.
111 The following extended \fBcurses\fR features are available only on PC-clone
112 consoles and compatible terminals obeying the ANSI.SYS de-facto standard for
113 terminal control sequences. They are not part of XSI curses.
115 The attribute A_ALTCHARSET actually forces literal display of PC ROM characters
116 including the high-half graphics. Your console driver may still capture or
117 translate a few (such as ESC) but this feature should give you access to the
118 card-suit characters, up and down-arrow, and most others in the range 0-32.
119 (In a terminfo entry designed for use with \fBncurses\fR, the high-half
120 characters are obtained using this attribute with an \fBacsc\fR string in
121 which the second of each pair is a high-half character.)
123 Giving \fBwechochar\fR an argument with its high bit set will produce the
124 corresponding high-half ASCII graphic (SVr4 curses also has this feature but
125 does not document it). A control-character argument, however, will not
126 typically produce the corresponding graphic; characters such as CR, NL, FF and
127 TAB are typically interpreted by the console driver itself, and ESC will be
128 interpreted as the leader of a control sequence.
130 All these functions are described in the XSI Curses standard, Issue 4.
131 The defaults specified for forms-drawing characters apply in the POSIX locale.
133 The seven ACS symbols starting with \fBACS_S3\fR were not documented in
134 any publicly released System V. However, many publicly available terminfos
135 include \fBacsc\fR strings in which their key characters (pryz{|}) are
136 embedded, and a second-hand list of their character descriptions has come
137 to light. The ACS-prefixed names for them were invented for \fBncurses\fR(3X).
139 \fBcurses\fR(3X), \fBcurs_attr\fR(3X), \fBcurs_clear\fR(3X),
140 \fBcurs_inch\fR(3X), \fBcurs_outopts\fR(3X), \fBcurs_refresh\fR(3X),
143 .\"# The following sets edit modes for GNU EMACS
144 .\"# Local Variables: