1 /* Manipulation with file containing URL history */
9 #include "bfu/dialog.h"
10 #include "config/urlhist.h"
11 #include "intl/gettext/libintl.h"
12 #include "main/event.h"
13 #include "main/module.h"
14 #include "util/lists.h"
15 #include "util/memory.h"
17 #define GOTO_HISTORY_FILENAME "gotohist"
20 INIT_INPUT_HISTORY(goto_url_history
);
23 load_url_history(void)
25 load_input_history(&goto_url_history
, GOTO_HISTORY_FILENAME
);
29 save_url_history(void)
31 save_input_history(&goto_url_history
, GOTO_HISTORY_FILENAME
);
34 static enum evhook_status
35 goto_url_history_write_hook(va_list ap
, void *data
)
38 return EVENT_HOOK_STATUS_NEXT
;
41 static struct event_hook_info goto_url_history_hooks
[] = {
42 { "periodic-saving", 0, goto_url_history_write_hook
, NULL
},
48 init_url_history(struct module
*module
)
54 done_url_history(struct module
*module
)
57 free_list(goto_url_history
.entries
);
60 struct module goto_url_history_module
= struct_module(
61 /* name: */ N_("Goto URL History"),
63 /* hooks: */ goto_url_history_hooks
,
64 /* submodules: */ NULL
,
66 /* init: */ init_url_history
,
67 /* done: */ done_url_history