#include <curses.h>
int add_wch( const
cchar_t *wch );
int wadd_wch( WINDOW *win, const cchar_t *wch );
int mvadd_wch( int y, int x, const cchar_t *wch );
int mvwadd_wch( WINDOW *win, int y, int x, const cchar_t *wch );
int echo_wchar( const cchar_t *wch );
int wecho_wchar( WINDOW *win, const cchar_t *wch );
Description
The add_wch, wadd_wch, mvadd_wch, and mvwadd_wch functions put the complex character wch into the given window at its current position, which is then advanced. These functions perform wrapping and special-character processing as follows:
The echo_wchar function is functionally equivalent to a call to add_wch followed by a call to refresh. Similarly, the wecho_wchar is functionally equivalent to a call to wadd_wch followed by a call to wrefresh. 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 the *echo* functions instead of their equivalents.
Name | Unicode | Default | Description |
WACS_BLOCK | 0x25ae | # | solid square block |
WACS_BOARD | |||
WACS_BTEE | |||
WACS_BULLET | |||
WACS_CKBOARD | |||
WACS_DARROW | |||
WACS_DEGREE | |||
WACS_DIAMOND | |||
WACS_GEQUAL | |||
WACS_HLINE | |||
WACS_LANTERN | |||
WACS_LARROW | |||
WACS_LEQUAL | |||
WACS_LLCORNER | |||
WACS_LRCORNER | |||
WACS_LTEE | |||
WACS_NEQUAL | |||
WACS_PI | |||
WACS_PLMINUS | |||
WACS_PLUS | |||
WACS_RARROW | |||
WACS_RTEE | |||
WACS_S1 | |||
WACS_S3 | |||
WACS_S7 | |||
WACS_S9 | |||
WACS_STERLING | |||
WACS_TTEE | |||
WACS_UARROW | |||
WACS_ULCORNER | |||
WACS_URCORNER | |||
WACS_VLINE |
The wide-character configuration of ncurses also defines symbols for thick- and double-lines:
Name | Unicode | Default | Description |
WACS_T_ULCORNER | 0x250f | + | thick upper left corner |
WACS_T_LLCORNER | |||
WACS_T_URCORNER | |||
WACS_T_LRCORNER | |||
WACS_T_LTEE | |||
WACS_T_RTEE | |||
WACS_T_BTEE | |||
WACS_T_TTEE | |||
WACS_T_HLINE | |||
WACS_T_VLINE | |||
WACS_T_PLUS | |||
WACS_D_ULCORNER | |||
WACS_D_LLCORNER | |||
WACS_D_URCORNER | |||
WACS_D_LRCORNER | |||
WACS_D_RTEE | |||
WACS_D_LTEE | |||
WACS_D_BTEE | |||
WACS_D_TTEE | |||
WACS_D_HLINE | |||
WACS_D_VLINE | |||
WACS_D_PLUS |
All routines return the integer ERR upon failure and OK on success.
Functions with a "mv" prefix first perform a cursor movement using wmove, and return an error if the position is outside the window, or if the window pointer is null.
Note that add_wch, mvadd_wch, mvwadd_wch, and echo_wchar may be macros.
All of these functions are described in the XSI Curses standard, Issue 4. The defaults specified for line-drawing characters apply in the POSIX locale.
X/Open Curses makes it clear that the WACS_ symbols should be defined as a pointer to cchar_t data, e.g., in the discussion of border_set. A few implementations are problematic:
X/Open Curses does not define symbols for thick- or double-lines. SVr4 curses implementations defined their line-drawing symbols in terms of intermediate symbols. This implementation extends those symbols, providing new definitions which are not in the SVr4 implementations.
curses(3X) , curs_addch(3X) , curs_attr(3X) , curs_clear(3X) , curs_outopts(3X) , curs_refresh(3X) , putwc(3)