aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.h
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2008-02-16 13:07:13 +0100
committerLars Hjemli <hjemli@gmail.com>2008-02-16 13:10:50 +0100
commitb228d4ff82a65fdcd4a7364759fe36a0bdda5978 (patch)
tree33b8cc2ff48113f8d7ad3ba88c7ea19a7cac570a /cgit.h
parentd14d77fe95c3b6224b40df9b101dded0deea913c (diff)
downloadcgit-b228d4ff82a65fdcd4a7364759fe36a0bdda5978.tar.gz
cgit-b228d4ff82a65fdcd4a7364759fe36a0bdda5978.tar.xz
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 {
int ofs;
};
+struct cgit_config {
+ char *agefile;
+ char *cache_root;
+ char *clone_prefix;
+ char *css;
+ char *index_header;
+ char *index_info;
+ char *logo;
+ char *logo_link;
+ char *module_link;
+ char *repo_group;
+ char *robots;
+ char *root_title;
+ char *script_name;
+ char *virtual_root;
+ int cache_dynamic_ttl;
+ int cache_max_create_time;
+ int cache_repo_ttl;
+ int cache_root_ttl;
+ int cache_static_ttl;
+ int enable_index_links;
+ int enable_log_filecount;
+ int enable_log_linecount;
+ int max_commit_count;
+ int max_lock_attempts;
+ int max_msg_len;
+ int max_repodesc_len;
+ int nocache;
+ int renamelimit;
+ int snapshots;
+ int summary_branches;
+ int summary_log;
+ int summary_tags;
+};
+
struct cgit_context {
struct cgit_query qry;
+ struct cgit_config cfg;
};
extern const char *cgit_version;
@@ -150,43 +186,9 @@ extern struct repoinfo *cgit_repo;
extern struct cgit_context ctx;
extern int cgit_cmd;
-extern char *cgit_root_title;
-extern char *cgit_css;
-extern char *cgit_logo;
-extern char *cgit_index_header;
-extern char *cgit_index_info;
-extern char *cgit_logo_link;
-extern char *cgit_module_link;
-extern char *cgit_agefile;
-extern char *cgit_virtual_root;
-extern char *cgit_script_name;
-extern char *cgit_cache_root;
-extern char *cgit_repo_group;
-extern char *cgit_robots;
-extern char *cgit_clone_prefix;
-
-extern int cgit_nocache;
-extern int cgit_snapshots;
-extern int cgit_enable_index_links;
-extern int cgit_enable_log_filecount;
-extern int cgit_enable_log_linecount;
-extern int cgit_max_lock_attempts;
-extern int cgit_cache_root_ttl;
-extern int cgit_cache_repo_ttl;
-extern int cgit_cache_dynamic_ttl;
-extern int cgit_cache_static_ttl;
-extern int cgit_cache_max_create_time;
-extern int cgit_summary_log;
-extern int cgit_summary_tags;
-extern int cgit_summary_branches;
-
-extern int cgit_max_msg_len;
-extern int cgit_max_repodesc_len;
-extern int cgit_max_commit_count;
-
-
extern int htmlfd;
+extern void cgit_prepare_context(struct cgit_context *ctx);
extern int cgit_get_cmd_index(const char *cmd);
extern struct repoinfo *cgit_get_repoinfo(const char *url);
extern void cgit_global_config_cb(const char *name, const char *value);