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