ncurses 在 cchar_t 上找不到任何文档 [英] ncurses can't find any documentation on cchar_t

查看:75
本文介绍了ncurses 在 cchar_t 上找不到任何文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to read a char from my ncurses terminal with mvin_wch() which returns a cchar_t, I know this is a struct with stuff like color information and a wchar_t. I can't seem to find any information about this cchar_t. I just wan't to know what it's members are named. I don't get why such an important part of the ncursesw library isn't documented anywhere.

推荐答案

如果您知道,请阅读curses.h,但如前所述,您应该使用库调用来操作 cchar_t,例如 setcchargetcchar.Curses 的每个实现都为此结构使用不同的细节.ncurses 手册页 告诉了您需要知道的一切关于它的内容:

If you have to know, read curses.h, but as noted, you are expected to manipulate cchar_t using the library calls, e.g., setcchar and getcchar. Each implementation of curses uses different details for this structure. The ncurses manual page tells all that you need to know about its content:

           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.

对于视频属性,请注意属性手册页的可移植性部分.

For the video attributes, pay attention to the PORTABILITY section of the attributes manual page.

在评论中,有人指向 datatypes 上的 X/Open Curses 页面.其中cchar_t的描述不准确:

In the comments, one pointed to X/Open Curses page on datatypes. The description of cchar_t therein is inaccurate:

cchar_t
引用一串宽字符

cchar_t
References a string of wide characters

(它不是对字符串的引用,而是一个完整的宽"字符本身).

(it is not a reference to a string, but a complete "wide" character in itself).

这篇关于ncurses 在 cchar_t 上找不到任何文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆