4 <!-- Manpage converted by man2html 3.0.1 -->
8 <B>addch</B>, <B>waddch</B>, <B>mvaddch</B>, <B>mvwaddch</B>, <B>echochar</B>, <B>wechochar</B> -
9 add a character (with attributes) to a <B>curses</B> window, then
14 <H2>SYNOPSIS</H2><PRE>
15 <B>#include</B> <B><curses.h></B>
17 <B>int</B> <B>addch(chtype</B> <B>ch);</B>
18 <B>int</B> <B>waddch(WINDOW</B> <B>*win,</B> <B>chtype</B> <B>ch);</B>
19 <B>int</B> <B>mvaddch(int</B> <B>y,</B> <B>int</B> <B>x,</B> <B>chtype</B> <B>ch);</B>
20 <B>int</B> <B>mvwaddch(WINDOW</B> <B>*win,</B> <B>int</B> <B>y,</B> <B>int</B> <B>x,</B> <B>chtype</B> <B>ch);</B>
21 <B>int</B> <B>echochar(chtype</B> <B>ch);</B>
22 <B>int</B> <B>wechochar(WINDOW</B> <B>*win,</B> <B>chtype</B> <B>ch);</B>
26 <H2>DESCRIPTION</H2><PRE>
27 The <B>addch</B>, <B>waddch</B>, <B>mvaddch</B> and <B>mvwaddch</B> routines put the
28 character <I>ch</I> into the given window at its current window
29 position, which is then advanced. They are analogous to
30 <B>putchar</B> in <B><A HREF="stdio.3.html">stdio(3)</A></B>. If the advance is at the right mar-
31 gin, the cursor automatically wraps to the beginning of
32 the next line. At the bottom of the current scrolling
33 region, if <B>scrollok</B> is enabled, the scrolling region is
36 If <I>ch</I> is a tab, newline, or backspace, the cursor is moved
37 appropriately within the window. Backspace moves the cur-
38 sor one character left; at the left edge of a window it
39 does nothing. Newline does a <B>clrtoeol</B>, then moves the
40 cursor to the window left margin on the next line,
41 scrolling the window if on the last line). Tabs are con-
42 sidered to be at every eighth column.
44 If <I>ch</I> is any control character other than tab, newline, or
45 backspace, it is drawn in <B>^</B><I>X</I> notation. Calling <B>winch</B>
46 after adding a control character does not return the char-
47 acter itself, but instead returns the ^-representation of
48 the control character.
50 Video attributes can be combined with a character argument
51 passed to <B>addch</B> or related functions by logical-ORing them
52 into the character. (Thus, text, including attributes,
53 can be copied from one place to another using <B>inch</B> and
54 <B>addch</B>.). See the <B><A HREF="curs_attr.3x.html">curs_attr(3x)</A></B> page for values of prede-
55 fined video attribute constants that can be usefully OR'ed
58 The <B>echochar</B> and <B>wechochar</B> routines are equivalent to a
59 call to <B>addch</B> followed by a call to <B>refresh</B>, or a call to
60 <B>waddch</B> followed by a call to <B>wrefresh</B>. The knowledge that
61 only a single character is being output is used and, for
62 non-control characters, a considerable performance gain
63 may be seen by using these routines instead of their
66 <B>Line</B> <B>Graphics</B>
67 The following variables may be used to add line drawing
68 characters to the screen with routines of the <B>addch</B> fam-
69 ily. The default character listed below is used if the
70 <B>acsc</B> capability doesn't define a terminal-specific
71 replacement for it (but see the EXTENSIONS section below).
72 The names are taken from VT100 nomenclature.
74 <I>Name</I> <I>Default</I> <I>Description</I>
75 --------------------------------------------------
76 ACS_BLOCK # solid square block
77 ACS_BOARD # board of squares
80 ACS_CKBOARD : checker board (stipple)
81 ACS_DARROW v arrow pointing down
82 ACS_DEGREE ' degree symbol
84 ACS_GEQUAL > greater-than-or-equal-to
85 ACS_HLINE - horizontal line
86 ACS_LANTERN # lantern symbol
87 ACS_LARROW < arrow pointing left
88 ACS_LEQUAL < less-than-or-equal-to
89 ACS_LLCORNER + lower left-hand corner
90 ACS_LRCORNER + lower right-hand corner
92 ACS_NEQUAL ! not-equal
94 ACS_PLMINUS # plus/minus
96 ACS_RARROW > arrow pointing right
102 ACS_STERLING f pound-sterling symbol
104 ACS_UARROW ^ arrow pointing up
105 ACS_ULCORNER + upper left-hand corner
106 ACS_URCORNER + upper right-hand corner
107 ACS_VLINE | vertical line
112 <H2>RETURN VALUE</H2><PRE>
113 All routines return the integer <B>ERR</B> upon failure and <B>OK</B> on
114 success (the SVr4 manuals specify only "an integer value
115 other than <B>ERR</B>") upon successful completion, unless other-
116 wise noted in the preceding routine descriptions.
121 Note that <B>addch</B>, <B>mvaddch</B>, <B>mvwaddch</B>, and <B>echochar</B> may be
126 <H2>PORTABILITY</H2><PRE>
127 All these functions are described in the XSI Curses stan-
128 dard, Issue 4. The defaults specified for forms-drawing
129 characters apply in the POSIX locale.
131 Some ACS symbols (ACS_S3, ACS_S7, ACS_LEQUAL, ACS_GEQUAL,
132 ACS_PI, ACS_NEQUAL, ACS_STERLING) were not documented in
133 any publicly released System V. However, many publicly
134 available terminfos include <B>acsc</B> strings in which their
135 key characters (pryz{|}) are embedded, and a second-hand
136 list of their character descriptions has come to light.
137 The ACS-prefixed names for them were invented for
138 <B><A HREF="ncurses.3x.html">ncurses(3x)</A></B>.
142 <H2>SEE ALSO</H2><PRE>
143 <B><A HREF="ncurses.3x.html">curses(3x)</A></B>, <B><A HREF="curs_attr.3x.html">curs_attr(3x)</A></B>, <B><A HREF="curs_clear.3x.html">curs_clear(3x)</A></B>, <B><A HREF="curs_inch.3x.html">curs_inch(3x)</A></B>,
144 <B><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></B>, <B><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></B>, <B><A HREF="putc.3S.html">putc(3S)</A></B>.
185 Man(1) output converted with
186 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>