summaryrefslogtreecommitdiffabout
path: root/cgit.h
authorLars Hjemli <hjemli@gmail.com>2008-02-16 10:53:40 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-02-16 11:07:28 (UTC)
commitd14d77fe95c3b6224b40df9b101dded0deea913c (patch) (side-by-side diff)
tree7e0d9c8f2c0f86b8946aea0bb823085c33b164b3 /cgit.h
parente5ed227ef0da561e2bde8646ec816842392377ee (diff)
downloadcgit-d14d77fe95c3b6224b40df9b101dded0deea913c.zip
cgit-d14d77fe95c3b6224b40df9b101dded0deea913c.tar.gz
cgit-d14d77fe95c3b6224b40df9b101dded0deea913c.tar.bz2
Introduce struct cgit_context
This struct will hold all the cgit runtime information currently found in a multitude of global variables. The first cleanup removes all querystring-related variables. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h35
1 files changed, 21 insertions, 14 deletions
diff --git a/cgit.h b/cgit.h
index 66c40b9..4576efb 100644
--- a/cgit.h
+++ b/cgit.h
@@ -118,20 +118,41 @@ struct refinfo {
};
struct reflist {
struct refinfo **refs;
int alloc;
int count;
};
+struct cgit_query {
+ int has_symref;
+ int has_sha1;
+ char *raw;
+ char *repo;
+ char *page;
+ char *search;
+ char *grep;
+ char *head;
+ char *sha1;
+ char *sha2;
+ char *path;
+ char *name;
+ int ofs;
+};
+
+struct cgit_context {
+ struct cgit_query qry;
+};
+
extern const char *cgit_version;
extern struct repolist cgit_repolist;
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;
@@ -158,30 +179,16 @@ 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 cgit_query_has_symref;
-extern int cgit_query_has_sha1;
-
-extern char *cgit_querystring;
-extern char *cgit_query_repo;
-extern char *cgit_query_page;
-extern char *cgit_query_search;
-extern char *cgit_query_grep;
-extern char *cgit_query_head;
-extern char *cgit_query_sha1;
-extern char *cgit_query_sha2;
-extern char *cgit_query_path;
-extern char *cgit_query_name;
-extern int cgit_query_ofs;
extern int htmlfd;
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);
extern void cgit_repo_config_cb(const char *name, const char *value);
extern void cgit_querystring_cb(const char *name, const char *value);