forked from dogeystamp/MinRSS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.def.h
92 lines (71 loc) · 2.2 KB
/
config.def.h
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
© 2021 dogeystamp <[email protected]>
*/
#include <curl/curl.h>
typedef struct {
const char *url;
const char *feedName;
const time_t update;
} linkStruct;
/* Example link:
{
.url = "https://example.com/rss/feed.rss",
// This will be used as the folder name for the feed.
.feedName = "examplefeed",
// The time in seconds between checks for updates.
.update = 3600,
},
*/
static const linkStruct links[] = {
{
.url = "",
.feedName = "",
.update = 0,
},
};
enum logLevels {
LOG_FATAL,
LOG_ERROR,
LOG_OUTPUT,
LOG_INFO,
LOG_VERBOSE,
};
// Print all messages at least as important as this level.
static const int logLevel = LOG_OUTPUT;
// Set the maximum amount of redirects curl will follow.
// Use 0 to disable redirects, and -1 for no limit.
static const int maxRedirs = 10;
// Restrict allowed protocols for curl.
// For more information: https://curl.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html
static const char curlProtocols[] = "http,https";
enum outputFormats {
OUTPUT_HTML,
#ifdef JSON
OUTPUT_JSON,
#endif // JSON
};
// When saving, sets the format of the saved file.
static const enum outputFormats outputFormat = OUTPUT_HTML;
// Controls what is printed to stdout after each update.
enum summaryFormats {
/*
Prints the number of new articles for each feed.
Example:
feed1: 2 new articles
feed2: 2 new articles
*/
SUMMARY_HUMAN_READABLE,
/*
Prints relative paths of new articles.
Example:
feed1/article1.json
feed1/article2.json
feed2/something.json
feed2/otherthing.json
*/
SUMMARY_FILES,
};
static const enum summaryFormats summaryFormat = SUMMARY_HUMAN_READABLE;