aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.h
diff options
context:
space:
mode:
authorLars Hjemli2008-02-16 13:07:13 +0100
committerLars Hjemli2008-02-16 13:10:50 +0100
commitb228d4ff82a65fdcd4a7364759fe36a0bdda5978 (patch)
tree33b8cc2ff48113f8d7ad3ba88c7ea19a7cac570a /cgit.h
parentd14d77fe95c3b6224b40df9b101dded0deea913c (diff)
downloadcgit-b228d4ff82a65fdcd4a7364759fe36a0bdda5978.tar.gz
cgit-b228d4ff82a65fdcd4a7364759fe36a0bdda5978.tar.bz2
cgit-b228d4ff82a65fdcd4a7364759fe36a0bdda5978.zip
Add all config variables into struct cgit_context
This removes another big set of global variables, and introduces the cgit_prepare_context() function which populates a context-variable with compile-time default values. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.h')
-rw-r--r--cgit.h72
1 files changed, 37 insertions, 35 deletions
diff --git a/cgit.h b/cgit.h
index 4576efb..0338ebd 100644
--- a/cgit.h
+++ b/cgit.h
@@ -139,8 +139,44 @@ struct cgit_query {
139 int ofs; 139 int ofs;
140}; 140};
141 141
142struct cgit_config {
143 char *agefile;
144 char *cache_root;
145 char *clone_prefix;
146 char *css;
147 char *index_header;
148 char *index_info;
149 char *logo;
150 char *logo_link;
151 char *module_link;
152 char *repo_group;
153 char *robots;
154 char *root_title;
155 char *script_name;
156 char *virtual_root;
157 int cache_dynamic_ttl;
158 int cache_max_create_time;
159 int cache_repo_ttl;
160 int cache_root_ttl;
161 int cache_static_ttl;
162 int enable_index_links;
163 int enable_log_filecount;
164 int enable_log_linecount;
165 int max_commit_count;
166 int max_lock_attempts;
167 int max_msg_len;
168 int max_repodesc_len;
169 int nocache;
170 int renamelimit;
171 int snapshots;
172 int summary_branches;
173 int summary_log;
174 int summary_tags;
175};
176
142struct cgit_context { 177struct cgit_context {
143 struct cgit_query qry; 178 struct cgit_query qry;
179 struct cgit_config cfg;
144}; 180};
145 181
146extern const char *cgit_version; 182extern const char *cgit_version;
@@ -150,43 +186,9 @@ extern struct repoinfo *cgit_repo;
150extern struct cgit_context ctx; 186extern struct cgit_context ctx;
151extern int cgit_cmd; 187extern int cgit_cmd;
152 188
153extern char *cgit_root_title;
154extern char *cgit_css;
155extern char *cgit_logo;
156extern char *cgit_index_header;
157extern char *cgit_index_info;
158extern char *cgit_logo_link;
159extern char *cgit_module_link;
160extern char *cgit_agefile;
161extern char *cgit_virtual_root;
162extern char *cgit_script_name;
163extern char *cgit_cache_root;
164extern char *cgit_repo_group;
165extern char *cgit_robots;
166extern char *cgit_clone_prefix;
167
168extern int cgit_nocache;
169extern int cgit_snapshots;
170extern int cgit_enable_index_links;
171extern int cgit_enable_log_filecount;
172extern int cgit_enable_log_linecount;
173extern int cgit_max_lock_attempts;
174extern int cgit_cache_root_ttl;
175extern int cgit_cache_repo_ttl;
176extern int cgit_cache_dynamic_ttl;
177extern int cgit_cache_static_ttl;
178extern int cgit_cache_max_create_time;
179extern int cgit_summary_log;
180extern int cgit_summary_tags;
181extern int cgit_summary_branches;
182
183extern int cgit_max_msg_len;
184extern int cgit_max_repodesc_len;
185extern int cgit_max_commit_count;
186
187
188extern int htmlfd; 189extern int htmlfd;
189 190
191extern void cgit_prepare_context(struct cgit_context *ctx);
190extern int cgit_get_cmd_index(const char *cmd); 192extern int cgit_get_cmd_index(const char *cmd);
191extern struct repoinfo *cgit_get_repoinfo(const char *url); 193extern struct repoinfo *cgit_get_repoinfo(const char *url);
192extern void cgit_global_config_cb(const char *name, const char *value); 194extern void cgit_global_config_cb(const char *name, const char *value);