summaryrefslogtreecommitdiffabout
path: root/cgit.c
Unidiff
Diffstat (limited to 'cgit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index f749b6b..73b1f02 100644
--- a/cgit.c
+++ b/cgit.c
@@ -1,57 +1,58 @@
1/* cgit.c: cgi for the git scm 1/* cgit.c: cgi for the git scm
2 * 2 *
3 * Copyright (C) 2006 Lars Hjemli 3 * Copyright (C) 2006 Lars Hjemli
4 * 4 *
5 * Licensed under GNU General Public License v2 5 * Licensed under GNU General Public License v2
6 * (see COPYING for full license text) 6 * (see COPYING for full license text)
7 */ 7 */
8 8
9#include "cgit.h" 9#include "cgit.h"
10#include "cache.h"
10#include "cmd.h" 11#include "cmd.h"
11#include "ui-shared.h" 12#include "ui-shared.h"
12 13
13const char *cgit_version = CGIT_VERSION; 14const char *cgit_version = CGIT_VERSION;
14 15
15void config_cb(const char *name, const char *value) 16void config_cb(const char *name, const char *value)
16{ 17{
17 if (!strcmp(name, "root-title")) 18 if (!strcmp(name, "root-title"))
18 ctx.cfg.root_title = xstrdup(value); 19 ctx.cfg.root_title = xstrdup(value);
19 else if (!strcmp(name, "css")) 20 else if (!strcmp(name, "css"))
20 ctx.cfg.css = xstrdup(value); 21 ctx.cfg.css = xstrdup(value);
21 else if (!strcmp(name, "logo")) 22 else if (!strcmp(name, "logo"))
22 ctx.cfg.logo = xstrdup(value); 23 ctx.cfg.logo = xstrdup(value);
23 else if (!strcmp(name, "index-header")) 24 else if (!strcmp(name, "index-header"))
24 ctx.cfg.index_header = xstrdup(value); 25 ctx.cfg.index_header = xstrdup(value);
25 else if (!strcmp(name, "index-info")) 26 else if (!strcmp(name, "index-info"))
26 ctx.cfg.index_info = xstrdup(value); 27 ctx.cfg.index_info = xstrdup(value);
27 else if (!strcmp(name, "logo-link")) 28 else if (!strcmp(name, "logo-link"))
28 ctx.cfg.logo_link = xstrdup(value); 29 ctx.cfg.logo_link = xstrdup(value);
29 else if (!strcmp(name, "module-link")) 30 else if (!strcmp(name, "module-link"))
30 ctx.cfg.module_link = xstrdup(value); 31 ctx.cfg.module_link = xstrdup(value);
31 else if (!strcmp(name, "virtual-root")) { 32 else if (!strcmp(name, "virtual-root")) {
32 ctx.cfg.virtual_root = trim_end(value, '/'); 33 ctx.cfg.virtual_root = trim_end(value, '/');
33 if (!ctx.cfg.virtual_root && (!strcmp(value, "/"))) 34 if (!ctx.cfg.virtual_root && (!strcmp(value, "/")))
34 ctx.cfg.virtual_root = ""; 35 ctx.cfg.virtual_root = "";
35 } else if (!strcmp(name, "nocache")) 36 } else if (!strcmp(name, "nocache"))
36 ctx.cfg.nocache = atoi(value); 37 ctx.cfg.nocache = atoi(value);
37 else if (!strcmp(name, "snapshots")) 38 else if (!strcmp(name, "snapshots"))
38 ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); 39 ctx.cfg.snapshots = cgit_parse_snapshots_mask(value);
39 else if (!strcmp(name, "enable-index-links")) 40 else if (!strcmp(name, "enable-index-links"))
40 ctx.cfg.enable_index_links = atoi(value); 41 ctx.cfg.enable_index_links = atoi(value);
41 else if (!strcmp(name, "enable-log-filecount")) 42 else if (!strcmp(name, "enable-log-filecount"))
42 ctx.cfg.enable_log_filecount = atoi(value); 43 ctx.cfg.enable_log_filecount = atoi(value);
43 else if (!strcmp(name, "enable-log-linecount")) 44 else if (!strcmp(name, "enable-log-linecount"))
44 ctx.cfg.enable_log_linecount = atoi(value); 45 ctx.cfg.enable_log_linecount = atoi(value);
45 else if (!strcmp(name, "cache-root")) 46 else if (!strcmp(name, "cache-root"))
46 ctx.cfg.cache_root = xstrdup(value); 47 ctx.cfg.cache_root = xstrdup(value);
47 else if (!strcmp(name, "cache-root-ttl")) 48 else if (!strcmp(name, "cache-root-ttl"))
48 ctx.cfg.cache_root_ttl = atoi(value); 49 ctx.cfg.cache_root_ttl = atoi(value);
49 else if (!strcmp(name, "cache-repo-ttl")) 50 else if (!strcmp(name, "cache-repo-ttl"))
50 ctx.cfg.cache_repo_ttl = atoi(value); 51 ctx.cfg.cache_repo_ttl = atoi(value);
51 else if (!strcmp(name, "cache-static-ttl")) 52 else if (!strcmp(name, "cache-static-ttl"))
52 ctx.cfg.cache_static_ttl = atoi(value); 53 ctx.cfg.cache_static_ttl = atoi(value);
53 else if (!strcmp(name, "cache-dynamic-ttl")) 54 else if (!strcmp(name, "cache-dynamic-ttl"))
54 ctx.cfg.cache_dynamic_ttl = atoi(value); 55 ctx.cfg.cache_dynamic_ttl = atoi(value);
55 else if (!strcmp(name, "max-message-length")) 56 else if (!strcmp(name, "max-message-length"))
56 ctx.cfg.max_msg_len = atoi(value); 57 ctx.cfg.max_msg_len = atoi(value);
57 else if (!strcmp(name, "max-repodesc-length")) 58 else if (!strcmp(name, "max-repodesc-length"))