32 ft_putendl_fd(
"Error: output buffer allocation failure", STDERR_FILENO);
UI mode structures, macros & function prototypes.
void out_free(t_out *out)
Clear all output lines and free the lines pointer array.
int cursor
Cursor position.
char buf[MAX_CMD_LEN]
Fixed size buffer.
int len
Current input length.
char ** lines
Array of output lines.
int scroll
Current scroll's offset.
int exit_code
Last command exit code.
int count
Nbr of stored lines.
int running
Event loop flag.
t_waifu waifu
Waifu state.
t_term term
Terminal state.
void set_raw_mode(t_term *term)
Switch the terminal into non canonical and no echo mode.
void restore_term_mode(t_term *term)
Restore the terminal to the saved settings.
void get_term_size(t_term *term)
Get the terinal dimensions via ioctl and store them.
void init_term(t_ui *ui)
Prepare the terminal and UI state for the main event.
void cleanup_term(t_ui *ui)
Clean up the UI terminal state and free output memory.
static void init_ui_state(t_ui *ui)
Intializes the command buffer, output state and waifu mood.