1 #ifndef EL__BFU_INPHIST_H
2 #define EL__BFU_INPHIST_H
4 #include "util/lists.h"
9 struct input_history_entry
{
10 LIST_HEAD(struct input_history_entry
);
11 unsigned char data
[1]; /* Must be last. */
14 struct input_history
{
15 struct list_head entries
;
18 unsigned int nosave
:1;
21 #define INIT_INPUT_HISTORY(history) \
22 struct input_history history = { \
23 /* items: */ { D_LIST_HEAD(history.entries) }, \
29 #define add_to_history_list(history, entry) \
31 add_to_list((history)->entries, entry); \
33 if (!(history)->nosave) (history)->dirty = 1; \
36 #define del_from_history_list(history, entry) \
38 del_from_list((entry)); \
40 if (!(history)->nosave) (history)->dirty = 1; \
43 void add_to_input_history(struct input_history
*, unsigned char *, int);
45 void do_tab_compl(struct dialog_data
*, struct list_head
*);
46 void do_tab_compl_file(struct dialog_data
*, struct list_head
*);
47 void do_tab_compl_unambiguous(struct dialog_data
*, struct list_head
*);
49 /* Load history file from elinks home. */
50 int load_input_history(struct input_history
*history
, unsigned char *filename
);
52 /* Write history list to @filebane in elinks home. It returns a value different
53 * from 0 in case of failure, 0 on success. */
54 int save_input_history(struct input_history
*history
, unsigned char *filename
);
56 void dlg_set_history(struct widget_data
*);