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 LIST_OF(struct input_history_entry
) 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
*,
46 LIST_OF(struct input_history_entry
) *);
47 void do_tab_compl_file(struct dialog_data
*,
48 LIST_OF(struct input_history_entry
) *);
49 void do_tab_compl_unambiguous(struct dialog_data
*,
50 LIST_OF(struct input_history_entry
) *);
52 /* Load history file from elinks home. */
53 int load_input_history(struct input_history
*history
, unsigned char *filename
);
55 /* Write history list to @filebane in elinks home. It returns a value different
56 * from 0 in case of failure, 0 on success. */
57 int save_input_history(struct input_history
*history
, unsigned char *filename
);
59 void dlg_set_history(struct widget_data
*);