]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_addch.3x.html
ncurses 5.1
[ncurses.git] / doc / html / man / curs_addch.3x.html
1 <HTML>
2 <BODY>
3 <PRE>
4 <!-- Manpage converted by man2html 3.0.1 -->
5
6 </PRE>
7 <H2>NAME</H2><PRE>
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
10        advance the cursor
11
12
13 </PRE>
14 <H2>SYNOPSIS</H2><PRE>
15        <B>#include</B> <B>&lt;curses.h&gt;</B>
16
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>
23
24
25 </PRE>
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
34        scrolled up one line.
35
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.
43
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.
49
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
56        into characters.
57
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
64        equivalents.
65
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.
73
74        <I>Name</I>           <I>Default</I>   <I>Description</I>
75        --------------------------------------------------
76        ACS_BLOCK      #         solid square block
77        ACS_BOARD      #         board of squares
78        ACS_BTEE       +         bottom tee
79        ACS_BULLET     o         bullet
80        ACS_CKBOARD    :         checker board (stipple)
81        ACS_DARROW     v         arrow pointing down
82        ACS_DEGREE     '         degree symbol
83        ACS_DIAMOND    +         diamond
84        ACS_GEQUAL     &gt;         greater-than-or-equal-to
85        ACS_HLINE      -         horizontal line
86        ACS_LANTERN    #         lantern symbol
87        ACS_LARROW     &lt;         arrow pointing left
88        ACS_LEQUAL     &lt;         less-than-or-equal-to
89        ACS_LLCORNER   +         lower left-hand corner
90        ACS_LRCORNER   +         lower right-hand corner
91        ACS_LTEE       +         left tee
92        ACS_NEQUAL     !         not-equal
93        ACS_PI         *         greek pi
94        ACS_PLMINUS    #         plus/minus
95        ACS_PLUS       +         plus
96        ACS_RARROW     &gt;         arrow pointing right
97        ACS_RTEE       +         right tee
98        ACS_S1         -         scan line 1
99        ACS_S3         -         scan line 3
100        ACS_S7         -         scan line 7
101        ACS_S9         _         scan line 9
102        ACS_STERLING   f         pound-sterling symbol
103        ACS_TTEE       +         top tee
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
108
109
110
111 </PRE>
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.
117
118
119 </PRE>
120 <H2>NOTES</H2><PRE>
121        Note that <B>addch</B>, <B>mvaddch</B>, <B>mvwaddch</B>, and  <B>echochar</B>  may  be
122        macros.
123
124
125 </PRE>
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.
130
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>.
139
140
141 </PRE>
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>.
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182 </PRE>
183 <HR>
184 <ADDRESS>
185 Man(1) output converted with
186 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
187 </ADDRESS>
188 </BODY>
189 </HTML>