NAME
curses_addch
,
addch
, waddch
,
mvaddch
, mvwaddch
—
curses add characters to windows
routines
LIBRARY
library “libcurses”
SYNOPSIS
#include
<curses.h>
int
addch
(chtype
ch);
int
waddch
(WINDOW
*win, chtype
ch);
int
mvaddch
(int
y, int x,
chtype ch);
int
mvwaddch
(WINDOW
*win, int y,
int x,
chtype ch);
DESCRIPTION
These functions add characters tostdscr
or to the
specified window.
The
addch
()
function adds the character given in ch to
stdscr
at the current cursor position and advances
the current cursor position by one. Any character attributes set in
ch will be merged with the background attributes
currently set on stdscr
.
The
waddch
()
function is the same as the addch
() function,
excepting that the character is added to the window specified by
win.
The
mvaddch
()
and
mvwaddch
()
functions are the same as the addch
() and
waddch
() functions, respectively, excepting that
wmove
()
is called to move the cursor to the position specified by
y, x before the character is
added to the window.
LINE DRAWING CHARACTERS
Some terminals support the display of line drawing and graphics characters. These characters can be added using their defined names, as shown in the table below. Where the terminal does not support a specific character, the default (non-graphics) character is displayed instead.
Name | Default | Description |
ACS_RARROW | > | Arrow pointing right |
ACS_LARROW | < | Arrow pointing left |
ACS_UARROW | ^ | Arrow pointing up |
ACS_DARROW | v | Arrow pointing down |
ACS_BLOCK | # | Solid square block |
ACS_DIAMOND | + | Diamond |
ACS_CKBOARD | : | Checker board (stipple) |
ACS_DEGREE | ' | Degree symbol |
ACS_PLMINUS | # | Plus/minus |
ACS_BOARD | # | Board of squares |
ACS_LANTERN | # | Lantern symbol |
ACS_LRCORNER | + | Lower right-hand corner |
ACS_URCORNER | + | Upper right-hand corner |
ACS_ULCORNER | + | Upper left-hand corner |
ACS_LLCORNER | + | Lower left-hand corner |
ACS_PLUS | + | Plus |
ACS_HLINE | - | Horizontal line |
ACS_S1 | - | Scan line 1 |
ACS_S9 | - | Scan line 9 |
ACS_LTEE | + | Left tee |
ACS_RTEE | + | Right tee |
ACS_BTEE | + | Bottom tee |
ACS_TTEE | + | Top tee |
ACS_VLINE | | | Vertical line |
ACS_BULLET | o | Bullet |
The following additional, ncurses compatible, characters are also supported.
Name | Default | Description |
ACS_S3 | - | Scan line 3 |
ACS_S7 | - | Scan line 7 |
ACS_LEQUAL | < | Less than or equal to |
ACS_GEQUAL | > | Greater than or equal to |
ACS_PI | * | Pi symbol |
ACS_NEQUAL | ! | Not equal to |
ACS_STERLING | f | Sterling symbol |
For compatibility with some System V implementations, the following definitions are also supported.
System V Name | NetBSD Curses Name |
ACS_SBBS | ACS_LRCORNER |
ACS_BBSS | ACS_URCORNER |
ACS_BSSB | ACS_ULCORNER |
ACS_SSBB | ACS_LLCORNER |
ACS_SSSS | ACS_PLUS |
ACS_BSBS | ACS_HLINE |
ACS_SSSB | ACS_LTEE |
ACS_SBSS | ACS_RTEE |
ACS_SSBS | ACS_BTEE |
ACS_BSSS | ACS_TTEE |
ACS_SBSB | ACS_VLINE |
RETURN VALUES
Functions returning pointers will return
NULL
if an error is detected. The functions that
return an int will return one of the following values:
OK
- The function completed successfully.
ERR
- An error occurred in the function.
SEE ALSO
curses_addchstr(3), curses_addstr(3), curses_attributes(3), curses_cursor(3), curses_delch(3), curses_inch(3), curses_insch(3)
STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification.
HISTORY
The Curses package appeared in 4.0BSD.