summaryrefslogtreecommitdiffabout
path: root/ui-tree.c
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) (unidiff)
tree7e0d9c8f2c0f86b8946aea0bb823085c33b164b3 /ui-tree.c
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 'ui-tree.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-tree.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ui-tree.c b/ui-tree.c
index c138877..7cae85a 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -36,3 +36,3 @@ static void print_object(const unsigned char *sha1, char *path)
36 html(" blob: <a href='"); 36 html(" blob: <a href='");
37 html_attr(cgit_pageurl(cgit_query_repo, "blob", fmt("id=%s", sha1_to_hex(sha1)))); 37 html_attr(cgit_pageurl(ctx.qry.repo, "blob", fmt("id=%s", sha1_to_hex(sha1))));
38 htmlf("'>%s</a>",sha1_to_hex(sha1)); 38 htmlf("'>%s</a>",sha1_to_hex(sha1));
@@ -69,4 +69,4 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
69 name = xstrdup(pathname); 69 name = xstrdup(pathname);
70 fullpath = fmt("%s%s%s", cgit_query_path ? cgit_query_path : "", 70 fullpath = fmt("%s%s%s", ctx.qry.path ? ctx.qry.path : "",
71 cgit_query_path ? "/" : "", name); 71 ctx.qry.path ? "/" : "", name);
72 72
@@ -92,6 +92,6 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
92 } else if (S_ISDIR(mode)) { 92 } else if (S_ISDIR(mode)) {
93 cgit_tree_link(name, NULL, "ls-dir", cgit_query_head, 93 cgit_tree_link(name, NULL, "ls-dir", ctx.qry.head,
94 curr_rev, fullpath); 94 curr_rev, fullpath);
95 } else { 95 } else {
96 cgit_tree_link(name, NULL, "ls-blob", cgit_query_head, 96 cgit_tree_link(name, NULL, "ls-blob", ctx.qry.head,
97 curr_rev, fullpath); 97 curr_rev, fullpath);
@@ -101,3 +101,3 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
101 html("<td>"); 101 html("<td>");
102 cgit_log_link("log", NULL, "button", cgit_query_head, curr_rev, 102 cgit_log_link("log", NULL, "button", ctx.qry.head, curr_rev,
103 fullpath, 0, NULL, NULL); 103 fullpath, 0, NULL, NULL);
@@ -155,6 +155,6 @@ static int walk_tree(const unsigned char *sha1, const char *base, int baselen,
155 strcpy(buffer+baselen, pathname); 155 strcpy(buffer+baselen, pathname);
156 url = cgit_pageurl(cgit_query_repo, "tree", 156 url = cgit_pageurl(ctx.qry.repo, "tree",
157 fmt("h=%s&amp;path=%s", curr_rev, buffer)); 157 fmt("h=%s&amp;path=%s", curr_rev, buffer));
158 html("/"); 158 html("/");
159 cgit_tree_link(xstrdup(pathname), NULL, NULL, cgit_query_head, 159 cgit_tree_link(xstrdup(pathname), NULL, NULL, ctx.qry.head,
160 curr_rev, buffer); 160 curr_rev, buffer);
@@ -190,3 +190,3 @@ void cgit_print_tree(const char *rev, char *path)
190 if (!rev) 190 if (!rev)
191 rev = cgit_query_head; 191 rev = ctx.qry.head;
192 192
@@ -204,3 +204,3 @@ void cgit_print_tree(const char *rev, char *path)
204 html("path: <a href='"); 204 html("path: <a href='");
205 html_attr(cgit_pageurl(cgit_query_repo, "tree", fmt("h=%s", rev))); 205 html_attr(cgit_pageurl(ctx.qry.repo, "tree", fmt("h=%s", rev)));
206 html("'>root</a>"); 206 html("'>root</a>");