-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h.in
109 lines (91 loc) · 3.69 KB
/
config.h.in
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
* Copyright (c) 2012-2019 Josef 'Jeff' Sipek <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef __CONFIG_H
#define __CONFIG_H
#cmakedefine HAVE_PRIV_H 1
/* settings */
#cmakedefine DEFAULT_SCGI_PORT ${DEFAULT_SCGI_PORT}
#cmakedefine DEFAULT_HTML_INDEX_STORIES ${DEFAULT_HTML_INDEX_STORIES}
#cmakedefine DEFAULT_FEED_INDEX_STORIES ${DEFAULT_FEED_INDEX_STORIES}
#cmakedefine DEFAULT_COMMENT_MAX_THINK ${DEFAULT_COMMENT_MAX_THINK}
#cmakedefine DEFAULT_COMMENT_MIN_THINK ${DEFAULT_COMMENT_MIN_THINK}
#cmakedefine DEFAULT_DATA_DIR "${DEFAULT_DATA_DIR}"
#cmakedefine DEFAULT_WEB_DIR "${DEFAULT_WEB_DIR}"
#cmakedefine DEFAULT_TEMPLATE_DIR "${DEFAULT_TEMPLATE_DIR}"
#cmakedefine VAR_MAX_SCOPES ${VAR_MAX_SCOPES}
#cmakedefine VAR_NAME_MAXLEN ${VAR_NAME_MAXLEN}
#cmakedefine COND_STACK_DEPTH ${COND_STACK_DEPTH}
#cmakedefine DEFAULT_TAGCLOUD_MIN_SIZE ${DEFAULT_TAGCLOUD_MIN_SIZE}
#cmakedefine DEFAULT_TAGCLOUD_MAX_SIZE ${DEFAULT_TAGCLOUD_MAX_SIZE}
#cmakedefine PREVIEW_SECRET ${PREVIEW_SECRET}
/*
* config alist symbol names
*/
#define CONFIG_SCGI_PORT "scgi-port"
#define CONFIG_SCGI_THREADS "scgi-threads"
#define CONFIG_HTML_INDEX_STORIES "html-index-stories"
#define CONFIG_FEED_INDEX_STORIES "feed-index-stories"
#define CONFIG_COMMENT_MAX_THINK "comment-max-think"
#define CONFIG_COMMENT_MIN_THINK "comment-min-think"
#define CONFIG_COMMENT_CAPTCHA_A "comment-captcha-a"
#define CONFIG_COMMENT_CAPTCHA_B "comment-captcha-b"
#define CONFIG_DATA_DIR "data-dir"
#define CONFIG_WEB_DIR "web-dir"
#define CONFIG_TEMPLATE_DIR "template-dir"
#define CONFIG_BASE_URL "base-url"
#define CONFIG_BUG_BASE_URL "bug-base-url"
#define CONFIG_WIKI_BASE_URL "wiki-base-url"
#define CONFIG_PHOTO_BASE_URL "photo-base-url"
#define CONFIG_TAGCLOUD_MIN_SIZE "tagcloud-min-size"
#define CONFIG_TAGCLOUD_MAX_SIZE "tagcloud-max-size"
#define CONFIG_TWITTER_USERNAME "twitter-username"
#define CONFIG_TWITTER_DESCRIPTION "twitter-description"
#define CONFIG_CATEGORY_TO_TAG "category-to-tag"
/*
* prototypes, etc. for config.c
*/
#include <stdint.h>
struct config {
uint16_t scgi_port;
int scgi_threads;
uint64_t html_index_stories;
uint64_t feed_index_stories;
uint64_t comment_max_think;
uint64_t comment_min_think;
uint64_t comment_captcha_a;
uint64_t comment_captcha_b;
struct str *data_dir;
struct str *web_dir;
struct str *template_dir;
struct str *base_url;
struct str *bug_base_url;
struct str *wiki_base_url;
struct str *photo_base_url;
uint64_t tagcloud_min_size;
uint64_t tagcloud_max_size;
struct str *twitter_username;
struct str *twitter_description;
struct val *category_to_tag;
};
extern struct config config;
extern int config_load(const char *fname);
#endif