aboutsummaryrefslogtreecommitdiff
path: root/include/config.h
blob: b90c5bd43ed4b2618067ab06c1b8c10cd8bafe06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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