input.h (532B)
1#ifndef INPUT_H 2#define INPUT_H 3 4#include "view.h" 5 6struct input { 7 struct view *view; 8 9 enum mode { 10 INPUT, 11 SELECT, 12 } mode; 13 struct { 14 bool insert: 1; 15 bool ascii: 1; 16 } input_mode; 17 18 size_t cur, sel; 19 bool low_nibble; 20 byte cur_val; 21 22 struct { 23 size_t len; 24 byte *needle; 25 } search; 26 27 bool quit; 28}; 29 30void input_init(struct input *input, struct view *view); 31void input_free(struct input *input); 32 33void input_get(struct input *input, bool *quit); 34 35#endif