diff options
author | Lars Hjemli | 2008-02-16 13:07:13 +0100 |
---|---|---|
committer | Lars Hjemli | 2008-02-16 13:10:50 +0100 |
commit | b228d4ff82a65fdcd4a7364759fe36a0bdda5978 (patch) | |
tree | 33b8cc2ff48113f8d7ad3ba88c7ea19a7cac570a /cgit.h | |
parent | d14d77fe95c3b6224b40df9b101dded0deea913c (diff) | |
download | cgit-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.h | 72 |
1 files changed, 37 insertions, 35 deletions
@@ -139,8 +139,44 @@ struct cgit_query { | |||
139 | int ofs; | 139 | int ofs; |
140 | }; | 140 | }; |
141 | 141 | ||
142 | struct 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 | |||
142 | struct cgit_context { | 177 | struct cgit_context { |
143 | struct cgit_query qry; | 178 | struct cgit_query qry; |
179 | struct cgit_config cfg; | ||
144 | }; | 180 | }; |
145 | 181 | ||
146 | extern const char *cgit_version; | 182 | extern const char *cgit_version; |
@@ -150,43 +186,9 @@ extern struct repoinfo *cgit_repo; | |||
150 | extern struct cgit_context ctx; | 186 | extern struct cgit_context ctx; |
151 | extern int cgit_cmd; | 187 | extern int cgit_cmd; |
152 | 188 | ||
153 | extern char *cgit_root_title; | ||
154 | extern char *cgit_css; | ||
155 | extern char *cgit_logo; | ||
156 | extern char *cgit_index_header; | ||
157 | extern char *cgit_index_info; | ||
158 | extern char *cgit_logo_link; | ||
159 | extern char *cgit_module_link; | ||
160 | extern char *cgit_agefile; | ||
161 | extern char *cgit_virtual_root; | ||
162 | extern char *cgit_script_name; | ||
163 | extern char *cgit_cache_root; | ||
164 | extern char *cgit_repo_group; | ||
165 | extern char *cgit_robots; | ||
166 | extern char *cgit_clone_prefix; | ||
167 | |||
168 | extern int cgit_nocache; | ||
169 | extern int cgit_snapshots; | ||
170 | extern int cgit_enable_index_links; | ||
171 | extern int cgit_enable_log_filecount; | ||
172 | extern int cgit_enable_log_linecount; | ||
173 | extern int cgit_max_lock_attempts; | ||
174 | extern int cgit_cache_root_ttl; | ||
175 | extern int cgit_cache_repo_ttl; | ||
176 | extern int cgit_cache_dynamic_ttl; | ||
177 | extern int cgit_cache_static_ttl; | ||
178 | extern int cgit_cache_max_create_time; | ||
179 | extern int cgit_summary_log; | ||
180 | extern int cgit_summary_tags; | ||
181 | extern int cgit_summary_branches; | ||
182 | |||
183 | extern int cgit_max_msg_len; | ||
184 | extern int cgit_max_repodesc_len; | ||
185 | extern int cgit_max_commit_count; | ||
186 | |||
187 | |||
188 | extern int htmlfd; | 189 | extern int htmlfd; |
189 | 190 | ||
191 | extern void cgit_prepare_context(struct cgit_context *ctx); | ||
190 | extern int cgit_get_cmd_index(const char *cmd); | 192 | extern int cgit_get_cmd_index(const char *cmd); |
191 | extern struct repoinfo *cgit_get_repoinfo(const char *url); | 193 | extern struct repoinfo *cgit_get_repoinfo(const char *url); |
192 | extern void cgit_global_config_cb(const char *name, const char *value); | 194 | extern void cgit_global_config_cb(const char *name, const char *value); |