summaryrefslogtreecommitdiffabout
path: root/shared.c
Unidiff
Diffstat (limited to 'shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--shared.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/shared.c b/shared.c
index e4595fa..dd711a8 100644
--- a/shared.c
+++ b/shared.c
@@ -26,32 +26,33 @@ int cgit_cache_static_ttl = -1;
26int cgit_cache_max_create_time = 5; 26int cgit_cache_max_create_time = 5;
27 27
28char *cgit_repo_name = NULL; 28char *cgit_repo_name = NULL;
29char *cgit_repo_desc = NULL; 29char *cgit_repo_desc = NULL;
30char *cgit_repo_owner = NULL; 30char *cgit_repo_owner = NULL;
31 31
32int cgit_query_has_symref = 0; 32int cgit_query_has_symref = 0;
33int cgit_query_has_sha1 = 0; 33int cgit_query_has_sha1 = 0;
34 34
35char *cgit_querystring = NULL; 35char *cgit_querystring = NULL;
36char *cgit_query_repo = NULL; 36char *cgit_query_repo = NULL;
37char *cgit_query_page = NULL; 37char *cgit_query_page = NULL;
38char *cgit_query_head = NULL; 38char *cgit_query_head = NULL;
39char *cgit_query_search = NULL; 39char *cgit_query_search = NULL;
40char *cgit_query_sha1 = NULL; 40char *cgit_query_sha1 = NULL;
41char *cgit_query_sha2 = NULL; 41char *cgit_query_sha2 = NULL;
42char *cgit_query_path = NULL;
42int cgit_query_ofs = 0; 43int cgit_query_ofs = 0;
43 44
44int htmlfd = 0; 45int htmlfd = 0;
45 46
46void cgit_global_config_cb(const char *name, const char *value) 47void cgit_global_config_cb(const char *name, const char *value)
47{ 48{
48 if (!strcmp(name, "root")) 49 if (!strcmp(name, "root"))
49 cgit_root = xstrdup(value); 50 cgit_root = xstrdup(value);
50 else if (!strcmp(name, "root-title")) 51 else if (!strcmp(name, "root-title"))
51 cgit_root_title = xstrdup(value); 52 cgit_root_title = xstrdup(value);
52 else if (!strcmp(name, "css")) 53 else if (!strcmp(name, "css"))
53 cgit_css = xstrdup(value); 54 cgit_css = xstrdup(value);
54 else if (!strcmp(name, "logo")) 55 else if (!strcmp(name, "logo"))
55 cgit_logo = xstrdup(value); 56 cgit_logo = xstrdup(value);
56 else if (!strcmp(name, "logo-link")) 57 else if (!strcmp(name, "logo-link"))
57 cgit_logo_link = xstrdup(value); 58 cgit_logo_link = xstrdup(value);
@@ -87,32 +88,34 @@ void cgit_querystring_cb(const char *name, const char *value)
87 cgit_query_repo = xstrdup(value); 88 cgit_query_repo = xstrdup(value);
88 } else if (!strcmp(name, "p")) { 89 } else if (!strcmp(name, "p")) {
89 cgit_query_page = xstrdup(value); 90 cgit_query_page = xstrdup(value);
90 } else if (!strcmp(name, "q")) { 91 } else if (!strcmp(name, "q")) {
91 cgit_query_search = xstrdup(value); 92 cgit_query_search = xstrdup(value);
92 } else if (!strcmp(name, "h")) { 93 } else if (!strcmp(name, "h")) {
93 cgit_query_head = xstrdup(value); 94 cgit_query_head = xstrdup(value);
94 cgit_query_has_symref = 1; 95 cgit_query_has_symref = 1;
95 } else if (!strcmp(name, "id")) { 96 } else if (!strcmp(name, "id")) {
96 cgit_query_sha1 = xstrdup(value); 97 cgit_query_sha1 = xstrdup(value);
97 cgit_query_has_sha1 = 1; 98 cgit_query_has_sha1 = 1;
98 } else if (!strcmp(name, "id2")) { 99 } else if (!strcmp(name, "id2")) {
99 cgit_query_sha2 = xstrdup(value); 100 cgit_query_sha2 = xstrdup(value);
100 cgit_query_has_sha1 = 1; 101 cgit_query_has_sha1 = 1;
101 } else if (!strcmp(name, "ofs")) { 102 } else if (!strcmp(name, "ofs")) {
102 cgit_query_ofs = atoi(value); 103 cgit_query_ofs = atoi(value);
104 } else if (!strcmp(name, "path")) {
105 cgit_query_path = xstrdup(value);
103 } 106 }
104} 107}
105 108
106void *cgit_free_commitinfo(struct commitinfo *info) 109void *cgit_free_commitinfo(struct commitinfo *info)
107{ 110{
108 free(info->author); 111 free(info->author);
109 free(info->author_email); 112 free(info->author_email);
110 free(info->committer); 113 free(info->committer);
111 free(info->committer_email); 114 free(info->committer_email);
112 free(info->subject); 115 free(info->subject);
113 free(info); 116 free(info);
114 return NULL; 117 return NULL;
115} 118}
116 119
117int hextoint(char c) 120int hextoint(char c)
118{ 121{