]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_addch.3x.html
64bff4755569d9719103f202bc9ecb2d61a98075
[ncurses.git] / doc / html / man / curs_addch.3x.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <!-- 
3   * t
4   ****************************************************************************
5   * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
6   *                                                                          *
7   * Permission is hereby granted, free of charge, to any person obtaining a  *
8   * copy of this software and associated documentation files (the            *
9   * "Software"), to deal in the Software without restriction, including      *
10   * without limitation the rights to use, copy, modify, merge, publish,      *
11   * distribute, distribute with modifications, sublicense, and/or sell       *
12   * copies of the Software, and to permit persons to whom the Software is    *
13   * furnished to do so, subject to the following conditions:                 *
14   *                                                                          *
15   * The above copyright notice and this permission notice shall be included  *
16   * in all copies or substantial portions of the Software.                   *
17   *                                                                          *
18   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
19   * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
20   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
21   * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
22   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
23   * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
24   * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
25   *                                                                          *
26   * Except as contained in this notice, the name(s) of the above copyright   *
27   * holders shall not be used in advertising or otherwise to promote the     *
28   * sale, use or other dealings in this Software without prior written       *
29   * authorization.                                                           *
30   ****************************************************************************
31   * @Id: curs_addch.3x,v 1.25 2006/12/02 17:02:22 tom Exp @
32 -->
33 <HTML>
34 <HEAD>
35 <TITLE>curs_addch 3x</TITLE>
36 <link rev=made href="mailto:bug-ncurses@gnu.org">
37 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
38 </HEAD>
39 <BODY>
40 <H1>curs_addch 3x</H1>
41 <HR>
42 <PRE>
43 <!-- Manpage converted by man2html 3.0.1 -->
44 <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>                                           <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>
45
46
47
48
49 </PRE>
50 <H2>NAME</H2><PRE>
51        <STRONG>addch</STRONG>,  <STRONG>waddch</STRONG>,  <STRONG>mvaddch</STRONG>,  <STRONG>mvwaddch</STRONG>, <STRONG>echochar</STRONG>, <STRONG>wechochar</STRONG> -
52        add a character (with attributes) to a <STRONG>curses</STRONG> window, then
53        advance the cursor
54
55
56 </PRE>
57 <H2>SYNOPSIS</H2><PRE>
58        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
59
60        <STRONG>int</STRONG> <STRONG>addch(const</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
61        <STRONG>int</STRONG> <STRONG>waddch(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
62        <STRONG>int</STRONG> <STRONG>mvaddch(int</STRONG> <STRONG>y,</STRONG> <STRONG>int</STRONG> <STRONG>x,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
63        <STRONG>int</STRONG> <STRONG>mvwaddch(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>int</STRONG> <STRONG>y,</STRONG> <STRONG>int</STRONG> <STRONG>x,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
64        <STRONG>int</STRONG> <STRONG>echochar(const</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
65        <STRONG>int</STRONG> <STRONG>wechochar(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
66
67
68 </PRE>
69 <H2>DESCRIPTION</H2><PRE>
70        The  <STRONG>addch</STRONG>,  <STRONG>waddch</STRONG>, <STRONG>mvaddch</STRONG> and <STRONG>mvwaddch</STRONG> routines put the
71        character <EM>ch</EM> into the given window at its  current  window
72        position,  which  is then advanced.  They are analogous to
73        <STRONG>putchar</STRONG> in <STRONG><A HREF="stdio.3.html">stdio(3)</A></STRONG>.  If the advance is at the right  mar-
74        gin,  the  cursor  automatically wraps to the beginning of
75        the next line.  At the bottom  of  the  current  scrolling
76        region,  if  <STRONG>scrollok</STRONG>  is enabled, the scrolling region is
77        scrolled up one line.
78
79        If <EM>ch</EM> is a tab, newline, or backspace, the cursor is moved
80        appropriately within the window.  Backspace moves the cur-
81        sor one character left; at the left edge of  a  window  it
82        does  nothing.   Newline  does  a <STRONG>clrtoeol</STRONG>, then moves the
83        cursor to  the  window  left  margin  on  the  next  line,
84        scrolling  the  window if on the last line.  Tabs are con-
85        sidered to be at every eighth column.   The  tab  interval
86        may be altered by setting the <STRONG>TABSIZE</STRONG> variable.
87
88        If <EM>ch</EM> is any control character other than tab, newline, or
89        backspace, it is drawn  in  <STRONG>^</STRONG><EM>X</EM>  notation.   Calling  <STRONG>winch</STRONG>
90        after adding a control character does not return the char-
91        acter itself, but instead returns the ^-representation  of
92        the control character.
93
94        Video attributes can be combined with a character argument
95        passed to <STRONG>addch</STRONG> or related functions by logical-ORing them
96        into  the  character.   (Thus, text, including attributes,
97        can be copied from one place to  another  using  <STRONG>inch</STRONG>  and
98        <STRONG>addch</STRONG>.)   See  the <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> page for values of prede-
99        fined video attribute constants that can be usefully OR'ed
100        into characters.
101
102        The  <STRONG>echochar</STRONG>  and  <STRONG>wechochar</STRONG> routines are equivalent to a
103        call to <STRONG>addch</STRONG> followed by a call to <STRONG>refresh</STRONG>, or a call  to
104        <STRONG>waddch</STRONG> followed by a call to <STRONG>wrefresh</STRONG>.  The knowledge that
105        only a single character is being output is used  and,  for
106        non-control  characters,  a  considerable performance gain
107        may be seen by  using  these  routines  instead  of  their
108        equivalents.
109
110    <STRONG>Line</STRONG> <STRONG>Graphics</STRONG>
111        The  following  variables  may be used to add line drawing
112        characters to the screen with routines of the  <STRONG>addch</STRONG>  fam-
113        ily.   The  default  character listed below is used if the
114        <STRONG>acsc</STRONG>  capability  doesn't   define   a   terminal-specific
115        replacement  for  it.   The  names  are  taken  from VT100
116        nomenclature.
117
118
119        <EM>Name</EM>           <EM>Default</EM>   <EM>Description</EM>
120        --------------------------------------------------
121        ACS_BLOCK      #         solid square block
122        ACS_BOARD      #         board of squares
123        ACS_BTEE       +         bottom tee
124        ACS_BULLET     o         bullet
125        ACS_CKBOARD    :         checker board (stipple)
126        ACS_DARROW     v         arrow pointing down
127        ACS_DEGREE     '         degree symbol
128        ACS_DIAMOND    +         diamond
129        ACS_GEQUAL     &gt;         greater-than-or-equal-to
130        ACS_HLINE      -         horizontal line
131        ACS_LANTERN    #         lantern symbol
132        ACS_LARROW     &lt;         arrow pointing left
133        ACS_LEQUAL     &lt;         less-than-or-equal-to
134        ACS_LLCORNER   +         lower left-hand corner
135        ACS_LRCORNER   +         lower right-hand corner
136        ACS_LTEE       +         left tee
137        ACS_NEQUAL     !         not-equal
138        ACS_PI         *         greek pi
139        ACS_PLMINUS    #         plus/minus
140        ACS_PLUS       +         plus
141        ACS_RARROW     &gt;         arrow pointing right
142        ACS_RTEE       +         right tee
143        ACS_S1         -         scan line 1
144        ACS_S3         -         scan line 3
145        ACS_S7         -         scan line 7
146        ACS_S9         _         scan line 9
147        ACS_STERLING   f         pound-sterling symbol
148        ACS_TTEE       +         top tee
149        ACS_UARROW     ^         arrow pointing up
150        ACS_ULCORNER   +         upper left-hand corner
151        ACS_URCORNER   +         upper right-hand corner
152        ACS_VLINE      |         vertical line
153
154
155 </PRE>
156 <H2>RETURN VALUE</H2><PRE>
157        All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on
158        success  (the  SVr4 manuals specify only "an integer value
159        other than <STRONG>ERR</STRONG>") upon successful completion, unless other-
160        wise noted in the preceding routine descriptions.
161
162
163 </PRE>
164 <H2>NOTES</H2><PRE>
165        Note  that  <STRONG>addch</STRONG>,  <STRONG>mvaddch</STRONG>, <STRONG>mvwaddch</STRONG>, and <STRONG>echochar</STRONG> may be
166        macros.
167
168
169 </PRE>
170 <H2>PORTABILITY</H2><PRE>
171        All these functions are described in the XSI Curses  stan-
172        dard,  Issue  4.  The defaults specified for forms-drawing
173        characters apply in the POSIX locale.
174
175        Some ACS symbols (ACS_S3, ACS_S7, ACS_LEQUAL,  ACS_GEQUAL,
176        ACS_PI,  ACS_NEQUAL,  ACS_STERLING) were not documented in
177        any publicly released System V.   However,  many  publicly
178        available  terminfos  include  <STRONG>acsc</STRONG> strings in which their
179        key characters (pryz{|}) are embedded, and  a  second-hand
180        list  of  their  character descriptions has come to light.
181        The  ACS-prefixed  names  for  them  were   invented   for
182        <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>.
183
184        The  <STRONG>TABSIZE</STRONG>  variable  is implemented in some versions of
185        curses, but is not part of X/Open curses.
186
187        If <EM>ch</EM> is a carriage return, the cursor  is  moved  to  the
188        beginning  of the current row of the window.  This is true
189        of other implementations, but is not documented.
190
191
192 </PRE>
193 <H2>SEE ALSO</H2><PRE>
194        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>,  <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>,
195        <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="putc.3S.html">putc(3S)</A></STRONG>.
196
197        Comparable  functions  in  the  wide-character  (ncursesw)
198        library are described in <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>.
199
200
201
202                                                          <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>
203 </PRE>
204 <HR>
205 <ADDRESS>
206 Man(1) output converted with
207 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
208 </ADDRESS>
209 </BODY>
210 </HTML>