'\"!  tbl | mmdoc
'\"macro stdmacro
.if n .pH g3x.curs_addch @(#)curs_addch	40.3 of 12/15/89
.\" Copyright 1989 AT&T
.\" ident	"@(#)svid_ti:ti_lib/curs_addch	1.2"
.nr X
.if \nX=0 .ds x} curs_addch 3X "" "\&"
.if \nX=1 .ds x} curs_addch 3X ""
.if \nX=2 .ds x} curs_addch 3X "" "\&"
.if \nX=3 .ds x} curs_addch "" "" "\&"
.TH \*(x}
.SH NAME
\f4curs_addch\f2: \f4 addch\f1, \f4waddch\f1, \f4mvaddch\f1, \f4mvwaddch\f1, \f4echochar\f1, \f4wechochar\f1 \- add a character (with attributes) to a \f4curses\fP window and advance cursor
.SH SYNOPSIS
.nf
.ft 4
#include <curses.h>
.sp
addch(chtype ch);
.sp 0.5
waddch(WINDOW *win, chtype ch);
.sp 0.5
mvaddch(int y, int x, chtype ch);
.sp 0.5
mvwaddch(WINDOW *win, int y, int x, chtype ch);
.sp 0.5
echochar(chtype ch);
.sp 0.5
wechochar(WINDOW *win, chtype ch);
.ft 1
.fi
.SH DESCRIPTION
With the \f4addch\f1, \f4waddch\f1, \f4mvaddch\f1 and
\f4mvwaddch\f1 routines, the character \f2ch\f1
is put into the window at the current cursor position of the window and
the position of the window cursor is advanced.
Its function is similar to that of \f4putchar\f1.
At the right margin, an automatic newline is performed.
At the bottom of the scrolling region, if \f4scrollok\f1
is enabled, the scrolling region is scrolled up one line.
.PP
If \f2ch\f1 is a tab, newline, or backspace, the cursor is moved appropriately
within the window.
A newline also does a \f4clrtoeol\f1 before moving.
Tabs are considered to be at every eighth column.
If \f2ch\f1
is another control character, it is drawn in the \f4^\f2X\f1 notation.
Calling \f4winch\f1
after adding a control character does not return the control character, but
instead returns the representation of the control character.
.PP
Video attributes can be combined with a character by OR-ing them
into the parameter.
This results in these attributes also being set.
(The intent here is that text, including attributes, can be
copied from one place to another using \f4inch\f1 and \f4addch\f1.)
[see \f4standout\f1, predefined video attribute constants, on
the curs_attr(3X) page].
.PP
The \f4echochar\f1 and \f4wechochar\f1 routines are
functionally equivalent to a call to \f4addch\f1 followed by a call to
\f4refresh\f1, or a call to \f4waddch\f1 followed by a call to
\f4wrefresh\f1.
The knowledge that only a single character is being output is
taken into consideration and, for non-control characters, a considerable
performance gain might be seen by using these routines instead of their
equivalents.
.SS Line Graphics
The following variables may be used to add line drawing characters to the
screen with routines of the \f4addch\f1 family.
When variables are defined for the terminal, the \f4A_ALTCHARSET\f1 bit
is turned on [see curs_attr(3X)].
Otherwise, the default character listed below is stored in the variable.
The names chosen are consistent with the VT100 nomenclature.
.PP
.ne 10v
.TS
center;
l c l
lfCW fCW5 l.
_
.sp .5
\f2Name	Default	Glyph Description\f1
.sp .5
_
ACS_ULCORNER	+	upper left-hand corner
ACS_LLCORNER	+	lower left-hand corner
ACS_URCORNER	+	upper right-hand corner
ACS_LRCORNER	+	lower right-hand corner
ACS_RTEE	+	right tee (\|\-\(br\|)
ACS_LTEE	+	left tee (\|\z\(br\-\|)
ACS_BTEE	+	bottom tee (\|\o'\(ul\(br'\|)
ACS_TTEE	+	top tee (\|\o'\(rn\(br'\|)
ACS_HLINE	\-	horizontal line
ACS_VLINE	|	vertical line
ACS_PLUS	+	plus
ACS_S1	\-	scan line 1
ACS_S9	\(ul	scan line 9
ACS_DIAMOND	+	diamond
ACS_CKBOARD	:	checker board (stipple)
ACS_DEGREE	'	degree symbol
ACS_PLMINUS	#	plus/minus
ACS_BULLET	o	bullet
ACS_LARROW	<	arrow pointing left
ACS_RARROW	>	arrow pointing right
ACS_DARROW	v	arrow pointing down
ACS_UARROW	\d^\u	arrow pointing up
ACS_BOARD	#	board of squares
ACS_LANTERN	#	lantern symbol
ACS_BLOCK	#	solid square block
_
.TE
.SH RETURN VALUE
All routines return the integer \f4ERR\f1 upon
failure and an integer value other than \f4ERR\f1
upon successful completion,
unless otherwise noted in the preceding routine descriptions.
.SH NOTES
.P
The header file \f4<curses.h>\f1 automatically includes the header files
\f4<stdio.h>\f1 and \f4<unctrl.h>\f1.
.PP
Note that \f4addch\f1, \f4mvaddch\f1, \f4mvwaddch\f1,
and \f4echochar\f1 may be macros. 
.SH SEE ALSO
.na
\f4curses\fP(3X),
\f4curs_attr\fP(3X),
\f4curs_clear\fP(3X),
\f4curs_inch\fP(3X),
\f4curs_outopts\fP(3X),
\f4curs_refresh\fP(3X)
\f4putc\fP(3S).
.ad
