commit 395b9f4e3ca29a4a162e3ce47a1bd9db738ff5a1 from: Omar Polo date: Mon Jul 12 17:18:19 2021 UTC move parser declarations so parser.h commit - 19f7f20c9b2a6daf00e79d941163a2e3a1f2ba8d commit + 395b9f4e3ca29a4a162e3ce47a1bd9db738ff5a1 blob - bef15e6af5060568c77da82896559fc8e06c6f17 blob + c14955f0b1ec05d44809fae4b802557a90427915 --- gemtext.c +++ gemtext.c @@ -22,6 +22,7 @@ * - UTF8 */ +#include "parser.h" #include "telescope.h" #include blob - d21a21d5993abce864bc3a0fe4fab31a6421164f blob + b636e43a8a9cecf20b6b4a353d2cd16556672fa3 --- mime.c +++ mime.c @@ -14,12 +14,13 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "telescope.h" - #include #include #include +#include "parser.h" +#include "telescope.h" + static int check_for_utf8(char*); static struct parser_table { blob - ff6e96006043734d2287e6f8b03e476e9280c979 blob + 4f7fffa7a4dd7b311bd2586f3bbcf861af32c28a --- parser.c +++ parser.c @@ -14,6 +14,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "parser.h" #include "telescope.h" #include blob - /dev/null blob + fa99484fe94c6c626b80213bfb9f285d8d3873e4 (mode 644) --- /dev/null +++ parser.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Omar Polo + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef PARSER_H +#define PARSER_H + +#include "telescope.h" + +/* gemtext.c */ +void gemtext_initparser(struct parser*); + +/* parser.c */ +int parser_append(struct parser*, const char*, size_t); +int parser_set_buf(struct parser*, const char*, size_t); +int parser_foreach_line(struct parser*, const char*, size_t, parsechunkfn); + +/* textplain.c */ +void textplain_initparser(struct parser*); + +#endif blob - aeaa6ffd25159747553fadf417113425666327ee blob + 1023614c7626fc769995dc7583ab0b649b67d568 --- telescope.c +++ telescope.c @@ -1,5 +1,3 @@ -#include "telescope.h" - #include #include @@ -10,6 +8,9 @@ #include #include +#include "parser.h" +#include "telescope.h" + struct event netev, fsev; struct tabshead tabshead = TAILQ_HEAD_INITIALIZER(tabshead); struct proxylist proxies = TAILQ_HEAD_INITIALIZER(proxies); blob - 936bbbbc66130b1cd5e40d11d07d3b92796f0832 blob + f6026c70b315c71149f6948ce233491ce03fe55d --- telescope.h +++ telescope.h @@ -328,9 +328,6 @@ int load_last_session(void(*)(const char*)); /* gemini.c */ int client_main(void); -/* gemtext.c */ -void gemtext_initparser(struct parser*); - /* hist.c */ void hist_clear_forward(struct histhead*, struct hist*); void hist_push(struct histhead*, struct hist*); @@ -358,11 +355,6 @@ extern const char *err_pages[70]; /* parse.y */ void parseconfig(const char *, int); -/* parser.c */ -int parser_append(struct parser*, const char*, size_t); -int parser_set_buf(struct parser*, const char*, size_t); -int parser_foreach_line(struct parser*, const char*, size_t, parsechunkfn); - /* sandbox.c */ void sandbox_network_process(void); void sandbox_ui_process(void); @@ -379,9 +371,6 @@ void stop_tab(struct tab*); void add_to_bookmarks(const char*); void save_session(void); -/* textplain.c */ -void textplain_initparser(struct parser*); - /* tofu.c */ void tofu_init(struct ohash*, unsigned int, ptrdiff_t); struct tofu_entry *tofu_lookup(struct ohash*, const char*, const char*);