aboutsummaryrefslogtreecommitdiff
path: root/include/config.h
blob: 3045878edd2f1d1f773b6a58f171492f9900ebd6 (plain) (blame)
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
#ifndef CONFIG_H
#define CONFIG_H

#include <stdbool.h>

#define RSSMAIL_CONFIGURE_SUCCESS 0
#define RSSMAIL_CONFIGURE_FAILURE -1

typedef struct smtp_config_t {
  int recipient_count;
  int port;
  char* from;
  char* to;
  char* subject;
  char* username;
  char* password;
  char* host;
  char* cert_path;
  char** recipients;
} smtp_config_t;

typedef struct rss_config_t {
  int max_age;
  int uri_count;
  char** uris;
  char* useragent;
} rss_config_t;

int read_config_file(const char* path, smtp_config_t* s, rss_config_t* r);

void init_config(smtp_config_t* s, rss_config_t* r);

void generate_config_file(void);

void free_smtp_config(smtp_config_t* smtp);

void free_rss_config(rss_config_t* rss);

#endif