From dc0f2ce9ba97ebb47e05b80a511da6eb29818b63 Mon Sep 17 00:00:00 2001 From: Shav Kinderlehrer Date: Tue, 23 Jul 2024 17:48:28 -0400 Subject: Merge old-molehole --- include/config.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 include/config.h (limited to 'include/config.h') diff --git a/include/config.h b/include/config.h new file mode 100755 index 0000000..b90c5bd --- /dev/null +++ b/include/config.h @@ -0,0 +1,56 @@ +#ifndef _CONFIG_H_ +#define _CONFIG_H_ +#include +#include + +#include "response.h" +#include "url.h" + +/** + * Molehole internal setting. + * + * Holds important information for the molehole runtime like terminal + * dimensions, and active ncurses windows. + */ +struct config_internal { + int height; + int width; + + WINDOW *page_win; + WINDOW *status_win; +}; + +/** + * Molehole current state information. + * + * Holds information pertaining to the content displayed such as the current + * page url. + */ +struct config_state { + char *url_string; + struct url *url; + struct connection *conn; + struct response *res; +}; + +/** + * Molehole configuration. + * + * Holds the state of the program including user configuration. + */ +struct config { + struct config_internal i; + struct config_state s; +}; + +/** + * Initializes a config with default parameters. + */ +void init_config(struct config *conf); + + +/** + * Cleans up a config state and internal. + */ +void conf_cleanup(struct config *conf); +#endif -- cgit v1.2.3