1curs_getcchar(3X)                                            curs_getcchar(3X)
2
3
4

NAME

6       getcchar,  setcchar  - Get a wide character string and rendition from a
7       cchar_t or set a cchar_t from a wide-character string
8

SYNOPSIS

10       #include <curses.h>
11
12       int getcchar(
13               const cchar_t *wcval,
14               wchar_t *wch,
15               attr_t *attrs,
16               short *color_pair,
17               void *opts );
18
19       int setcchar(
20               cchar_t *wcval,
21               const wchar_t *wch,
22               const attr_t attrs,
23               short color_pair,
24               const void *opts );
25

DESCRIPTION

27   getcchar
28       The getcchar function gets a wide-character string and rendition from a
29       cchar_t  argument.   When wch is not a null pointer, the getcchar func‐
30       tion does the following:
31
32       ·   Extracts information from a cchar_t value wcval
33
34       ·   Stores the character attributes in the location pointed to by attrs
35
36       ·   Stores the color-pair in the location pointed to by color_pair
37
38       ·   Stores the wide-character string, characters referenced  by  wcval,
39           into the array pointed to by wch.
40
41       When wch is a null pointer, the getcchar function does the following:
42
43       ·   Obtains the number of wide characters pointed to by wcval
44
45       ·   Does not change the data referenced by attrs or color_pair
46
47   setcchar
48       The  setcchar  function initializes the location pointed to by wcval by
49       using:
50
51       ·   The character attributes in attrs
52
53       ·   The color pair in color_pair
54
55       ·   The wide-character string pointed to by wch.  The  string  must  be
56           L'\0' terminated, contain at most one spacing character, which must
57           be the first.
58
59           Up to CCHARW_MAX-1 nonspacing characters  may  follow.   Additional
60           nonspacing characters are ignored.
61
62           The string may contain a single control character instead.  In that
63           case, no nonspacing characters are allowed.
64

EXTENSIONS

66       X/Open Curses documents the opts argument as reserved for  future  use,
67       saying  that  it must be null.  This implementation uses that parameter
68       in ABI 6 for the functions which have a color-pair parameter to support
69       extended color pairs:
70
71       ·   For   functions  which modify the color, e.g., setcchar, if opts is
72           set it is treated as a pointer to int, and used to  set  the  color
73           pair instead of the short pair parameter.
74
75       ·   For  functions which retrieve the color, e.g., getcchar, if opts is
76           set it is treated as a pointer to int, and  used  to  retrieve  the
77           color pair as an int value, in addition retrieving it via the stan‐
78           dard pointer to short parameter.
79

NOTES

81       The wcval argument may be a value generated by a call to setcchar or by
82       a function that has a cchar_t output argument.  If wcval is constructed
83       by any other means, the effect is unspecified.
84

RETURN VALUE

86       When wch is a null pointer, getcchar returns the number of wide charac‐
87       ters referenced by wcval, including one for a trailing null.
88
89       When  wch  is  not  a null pointer, getcchar returns OK upon successful
90       completion, and ERR otherwise.
91
92       Upon successful completion, setcchar returns OK.  Otherwise, it returns
93       ERR.
94

SEE ALSO

96       Functions: curs_attr(3X), curs_color(3X), curses(3X), wcwidth(3).
97
98
99
100                                                             curs_getcchar(3X)
Impressum