我正在使用绑定(bind) ncurses 的 crt.cr
Crystal 碎片。它缺少一些我想要的东西,比如 mvhline()
。所以我要添加我想要的东西。
我想要的一件事是 ncurses 替代字符表,这样我就可以制作漂亮的盒子。
据我所知,这非常难(但我不是 Crystal 或 C 方面的专家)。 From what I can tell, the alternative character sheet characters are all unsigned chars, defined by the preprocessor.
谁能解释一下我如何才能访问替代字符表字符?
最佳答案
您无法在共享库文件中访问仅存在于 C 头文件中的内容(以及通过预处理器完成的内容),因为它们根本就没有放在那里。
由于 Crystal 仅绑定(bind)到共享库文件,因此除了手动(有时是 automatically )将它们复制为 Crystal 代码中的常量外别无选择。
关于c - 将 C 绑定(bind)到 Crystal : preprocessor directives,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43646456/