author | Lars Hjemli <hjemli@gmail.com> | 2008-03-23 23:51:19 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-03-23 23:51:19 (UTC) |
commit | f3c1a187fe2bc33f8423cd535d5045899699995b (patch) (side-by-side diff) | |
tree | b5c553da7b108900535fcfcd24b78bdd0ac62387 /shared.c | |
parent | b1f9b9c1459cb9a30ebf80721aff6ef788d1f891 (diff) | |
download | cgit-f3c1a187fe2bc33f8423cd535d5045899699995b.zip cgit-f3c1a187fe2bc33f8423cd535d5045899699995b.tar.gz cgit-f3c1a187fe2bc33f8423cd535d5045899699995b.tar.bz2 |
Add struct cgit_page to cgit_context
This struct is used when generating http headers, and as such is another
small step towards the goal of the whole cleanup series; to invoke each
page/view function with a function pointer.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | shared.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -26,24 +26,27 @@ void cgit_prepare_context(struct cgit_context *ctx) ctx->cfg.cache_static_ttl = -1; ctx->cfg.css = "/cgit.css"; ctx->cfg.logo = "/git-logo.png"; ctx->cfg.max_commit_count = 50; ctx->cfg.max_lock_attempts = 5; ctx->cfg.max_msg_len = 60; ctx->cfg.max_repodesc_len = 60; ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; ctx->cfg.renamelimit = -1; ctx->cfg.robots = "index, nofollow"; ctx->cfg.root_title = "Git repository browser"; ctx->cfg.script_name = CGIT_SCRIPT_NAME; + ctx->page.mimetype = "text/html"; + ctx->page.charset = PAGE_ENCODING; + ctx->page.filename = NULL; } int cgit_get_cmd_index(const char *cmd) { static char *cmds[] = {"log", "commit", "diff", "tree", "blob", "snapshot", "tag", "refs", "patch", NULL}; int i; for(i = 0; cmds[i]; i++) if (!strcmp(cmd, cmds[i])) return i + 1; return 0; |