2

Who has used the S-lang library - how the system used this structure? Does each byte of the screen is represented by this struct? I use the library newt and the last one used S-lang.

typedef struct
{
    unsigned int nchars;
    SLwchar_Type wchars[SLSMG_MAX_CHARS_PER_CELL]; 
    SLsmg_Color_Type color;
} SLsmg_Char_Type;
Maxim Gusev
  • 213
  • 3
  • 10

1 Answers1

1

Each cell of the screen (not "byte") is represented by SLsmg_Char_Type.

  • A "cell" is the data at a given row and column.
  • A "byte" is typically 8-bits (much smaller than this structure).

The documentation for SLsmg_char_at says this:

 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;
Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105