fzy

terminal fuzzy finder picker

git clone https://9o.is/git/fzy.git

tty_interface.h

(650B)


      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 #ifdef __cplusplus 
      9 extern "C" {
     10 #endif
     11 
     12 #define SEARCH_SIZE_MAX 4096
     13 
     14 typedef struct {
     15 	tty_t *tty;
     16 	choices_t *choices;
     17 	options_t *options;
     18 
     19 	char search[SEARCH_SIZE_MAX + 1];
     20 	char last_search[SEARCH_SIZE_MAX + 1];
     21 	size_t cursor;
     22 
     23 	int ambiguous_key_pending;
     24 	char input[32]; /* Pending input buffer */
     25 
     26 	int exit;
     27 } tty_interface_t;
     28 
     29 void tty_interface_init(tty_interface_t *state, tty_t *tty, choices_t *choices, options_t *options);
     30 int tty_interface_run(tty_interface_t *state);
     31 
     32 #ifdef __cplusplus
     33 }
     34 #endif
     35 
     36 #endif