ncurses 找不到任何关于cchar_t的文档

ncurses can't find any documentation on cchar_t

本文关键字:文档 cchar 找不到 任何关 ncurses      更新时间:2023-10-16

我正在尝试使用 mvin_wch(( 从我的 ncurses 终端读取一个字符,它返回一个cchar_t,我知道这是一个带有颜色信息和wchar_t等内容的结构。我似乎找不到有关此cchar_t的任何信息。我只是不知道它的成员叫什么名字。我不明白为什么ncursesw库如此重要的部分没有在任何地方记录。

如果你必须知道,请阅读curses.h,但如前所述,你应该使用库调用来操纵cchar_t,例如,setcchar 和 getcchar。 curses 的每个实现都为此结构使用不同的细节。 ncurses 手册页告诉您有关其内容的所有信息:

cchar_t
corresponds to chtype.  However it is a structure, because
more data is stored than can fit  into  an  integer.   The
characters  are  large  enough  to  require a full integer
value - and there may be more than one character per cell.
The  video  attributes  and  color  are stored in separate
fields of the structure.
Each cell (row and column) in a  WINDOW  is  stored  as  a
cchar_t.

有关视频属性,请注意属性手册页的"可移植性"部分。

在评论中,有人指向数据类型的X/Open Curses页面。 其中对cchar_t的描述是不准确的:


cchar_t引用宽字符字符串

(它不是对字符串的引用,而是本身的完整"宽"字符(。