tty_interface.h (580B)
1 #ifndef TTY_INTERFACE_H 2 #define TTY_INTERFACE_H TTY_INTERFACE_H 3 4 #include "choices.h" 5 #include "options.h" 6 #include "tty.h" 7 8 #define SEARCH_SIZE_MAX 4096 9 10 typedef struct { 11 tty_t *tty; 12 choices_t *choices; 13 options_t *options; 14 15 char search[SEARCH_SIZE_MAX + 1]; 16 char last_search[SEARCH_SIZE_MAX + 1]; 17 size_t cursor; 18 19 int ambiguous_key_pending; 20 char input[32]; /* Pending input buffer */ 21 22 int exit; 23 } tty_interface_t; 24 25 void tty_interface_init(tty_interface_t *state, tty_t *tty, choices_t *choices, options_t *options); 26 int tty_interface_run(tty_interface_t *state); 27 28 #endif