1addch(3XCURSES) X/Open Curses Library Functions addch(3XCURSES)
2
3
4
6 addch, mvaddch, mvwaddch, waddch - add a character (with rendition) to
7 a window
8
10 cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib \
11 -R /usr/xpg4/lib -lcurses [ library... ]
12
13 c89 [ flag... ] file... -lcurses [ library ... ]
14
15 #include <curses.h>
16
17 int addch(const chtype ch);
18
19
20 int mvaddch(int y, int x, const chtype ch);
21
22
23 int mvwaddch(WINDOW *win, int y, int x, const chtype ch);
24
25
26 int waddch(WINDOW *win, const chtype ch);
27
28
30 The addch() function writes a character to the stdscr window at the
31 current cursor position. The mvaddch() and mvwaddch() functions write
32 the character to the position indicated by the x (column) and y (row)
33 parameters. The mvaddch() function writes the character to the stdscr
34 window, while mvwaddch() writes the character to the window specified
35 by win. The waddch() function is identical to addch(), but writes the
36 character to the window specified by win.
37
38
39 These functions advance the cursor after writing the character. Charac‐
40 ters that do not fit on the end of the current line are wrapped to the
41 beginning of the next line unless the current line is the last line of
42 the window and scrolling is disabled. In that situation, characters
43 which extend beyond the end of the line are discarded.
44
45
46 When ch is a backspace, carriage return, newline, or tab, X/Open Curses
47 moves the cursor appropriately. Each tab character moves the cursor to
48 the next tab stop. By default, tab stops occur every eight columns.
49 When ch is a control character other than backspace, carriage return,
50 newline, or tab, it is written using ^x notation, where x is a print‐
51 able character. When X/Open Curses writes ch to the last character
52 position on a line, it automatically generates a newline. When ch is
53 written to the last character position of a scrolling region and scrol‐
54 lok() is enabled, X/Open Curses scrolls the scrolling region up one
55 line (see clearok(3XCURSES)).
56
58 wchstr Is a pointer to the cchar_t string to be copied to the win‐
59 dow.
60
61
62 n Is the maximum number of characters to be copied from wchstr.
63 If n is less than 0, the entire string is written or as much
64 of it as fits on the line.
65
66
67 y Is the y (row) coordinate of the starting position of wchstr
68 in the window.
69
70
71 x Is the x (column) coordinate of the starting position of wch‐
72 str in the window.
73
74
75 win Is a pointer to the window to which the string is to be
76 copied.
77
78
80 On success, these functions return OK. Otherwise, they return ERR.
81
83 None.
84
86 See attributes(5) for descriptions of the following attributes:
87
88
89
90
91 ┌─────────────────────────────┬─────────────────────────────┐
92 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
93 ├─────────────────────────────┼─────────────────────────────┤
94 │Interface Stability │Standard │
95 ├─────────────────────────────┼─────────────────────────────┤
96 │MT-Level │Unsafe │
97 └─────────────────────────────┴─────────────────────────────┘
98
100 attroff(3XCURSES), bkgdset(3XCURSES), doupdate(3XCURSES),
101 inch(3XCURSES), insch(3XCURSES), libcurses(3XCURSES), nl(3XCURSES),
102 printw(3XCURSES), scrollok(3XCURSES), scrl(3XCURSES), terminfo(4),
103 attributes(5), standards(5)
104
105
106
107SunOS 5.11 5 Jun 2002 addch(3XCURSES)