2 * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 char uri[GEMINI_URL_LEN];
25 char title[TITLE_MAX];
30 struct session_tab_hist {
31 char uri[GEMINI_URL_LEN];
37 char uri[GEMINI_URL_LEN];
46 #define HISTORY_CAP 1000
48 struct history_item items[HISTORY_CAP];
53 extern struct history history;
55 void switch_to_tab(struct tab *);
56 unsigned int tab_new_id(void);
57 struct tab *new_tab(const char *, const char *base, struct tab *);
58 void kill_tab(struct tab *, int);
59 struct tab *unkill_tab(void);
60 void free_tab(struct tab *);
61 void stop_tab(struct tab*);
63 void save_session(void);
65 void history_push(struct histitem *);
66 void history_sort(void);
67 void history_add(const char *);
69 void autosave_init(void);
70 void autosave_timer(int, int, void *);
71 void autosave_hook(void);
73 int load_session(struct ohash *);
74 int lock_session(void);