Does SLsmg_Char_Type represent bytes of the screen?

43 Views Asked by At

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;
1

There are 1 best solutions below

0
Thomas Dickey On BEST ANSWER

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;