aboutsummaryrefslogtreecommitdiff
path: root/include/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/config.h')
-rwxr-xr-xinclude/config.h56
1 files changed, 56 insertions, 0 deletions
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 <ncurses.h>
+#include <openssl/ssl.h>
+
+#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