3.1 Data Structures

/* Terminal configuration */
typedef struct {
    uint16_t width;           /* Terminal width in characters */
    uint16_t height;          /* Terminal height in characters */
    uint16_t scrollback_lines; /* Number of scrollback lines */
    uint8_t  default_fg;       /* Default foreground color index */
    uint8_t  default_bg;       /* Default background color index */
    bool     cursor_blink;     /* Cursor blink enabled */
    uint16_t cursor_blink_ms;  /* Cursor blink interval in ms */
} d3tui_term_config_t;

/* Character cell */
typedef struct {
    uint32_t codepoint;        /* Unicode codepoint (or ASCII) */
    uint8_t  fg_color;         /* Foreground color index */
    uint8_t  bg_color;         /* Background color index */
    uint8_t  attributes;       /* Bold, underline, reverse, etc. */
} d3tui_cell_t;

/* Terminal state */
typedef struct d3tui_terminal d3tui_terminal_t;