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.
23 /* TODO: move in config.h */
24 #include <sys/queue.h>
25 #include <sys/types.h>
30 #define GEMINI_URL_LEN 1024
33 IMSG_GET, /* data is URL, peerid the tab id */
63 TAILQ_ENTRY(line) lines;
69 /* typedef void (*initparserfn)(struct parser*); */
71 typedef int (*parsechunkfn)(struct parser*, const char*, size_t);
72 typedef int (*parserfreefn)(struct parser*);
74 typedef void (imsg_handlerfn)(struct imsg*, size_t);
84 TAILQ_HEAD(, line) head;
89 extern TAILQ_HEAD(tabshead, tab) tabshead;
92 TAILQ_ENTRY(tab) tabs;
97 char meta[GEMINI_URL_LEN];
103 extern struct event imsgev;
106 int client_main(struct imsgbuf *b);
109 void gemtext_initparser(struct parser*);
112 extern const char *about_new;
114 #define CANNOT_FETCH 0
115 #define TOO_MUCH_REDIRECTS 1
116 extern const char *err_pages[70];
120 int ui_on_new_tab(struct tab*);
121 void ui_on_tab_refresh(struct tab*);
125 int mark_nonblock(int);
126 char *telescope_strnchr(char*, char, size_t);
128 #endif /* TELESCOPE_H */