2

谁使用过S-lang图书馆 - 系统如何使用这种结构?屏幕的每个字节是否都由这个结构表示?我使用图书馆newt,最后一个使用S-lang.

typedef struct
{
    unsigned int nchars;
    SLwchar_Type wchars[SLSMG_MAX_CHARS_PER_CELL]; 
    SLsmg_Color_Type color;
} SLsmg_Char_Type;
4

1 回答 1

1

屏幕的每个单元格(不是“字节”)由 表示SLsmg_Char_Type

  • “单元格”是给定行和列的数据。
  • 一个“字节”通常是 8 位(比这个结构小得多)。

SLsmg_char_at的文档是这样说的:

 int SLsmg_char_at(SLsmg_Char_Type *ch);
    Returns the character and its attributes at the current
    position.  The SLsmg_Char_Type object is a structure
    representing the character cell:

          #define SLSMG_MAX_CHARS_PER_CELL 5
          typedef struct
           {
              unsigned int nchars;
              SLwchar_Type wchars[SLSMG_MAX_CHARS_PER_CELL];
              SLsmg_Color_Type color;
           }
           SLsmg_Char_Type;
于 2015-11-03T22:51:56.393 回答