author | Lars Hjemli <hjemli@gmail.com> | 2007-05-14 21:40:33 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-14 21:40:33 (UTC) |
commit | 5ec6e02bd1cc0c05b7cfd0d53371e7d176daec39 (patch) (unidiff) | |
tree | 5c844c0ba53cfd2e838368ffbbd4583ac63d3608 /shared.c | |
parent | 9ecde6568a9e39c942f4c5585ffa494c5df870e4 (diff) | |
download | cgit-5ec6e02bd1cc0c05b7cfd0d53371e7d176daec39.zip cgit-5ec6e02bd1cc0c05b7cfd0d53371e7d176daec39.tar.gz cgit-5ec6e02bd1cc0c05b7cfd0d53371e7d176daec39.tar.bz2 |
Add include-parameter to config files
This parameter can be used to include another config-file, like
a standalone repository listing.
Suggested in a patch by Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | shared.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -116,48 +116,50 @@ void cgit_global_config_cb(const char *name, const char *value) | |||
116 | else if (!strcmp(name, "cache-repo-ttl")) | 116 | else if (!strcmp(name, "cache-repo-ttl")) |
117 | cgit_cache_repo_ttl = atoi(value); | 117 | cgit_cache_repo_ttl = atoi(value); |
118 | else if (!strcmp(name, "cache-static-ttl")) | 118 | else if (!strcmp(name, "cache-static-ttl")) |
119 | cgit_cache_static_ttl = atoi(value); | 119 | cgit_cache_static_ttl = atoi(value); |
120 | else if (!strcmp(name, "cache-dynamic-ttl")) | 120 | else if (!strcmp(name, "cache-dynamic-ttl")) |
121 | cgit_cache_dynamic_ttl = atoi(value); | 121 | cgit_cache_dynamic_ttl = atoi(value); |
122 | else if (!strcmp(name, "max-message-length")) | 122 | else if (!strcmp(name, "max-message-length")) |
123 | cgit_max_msg_len = atoi(value); | 123 | cgit_max_msg_len = atoi(value); |
124 | else if (!strcmp(name, "max-commit-count")) | 124 | else if (!strcmp(name, "max-commit-count")) |
125 | cgit_max_commit_count = atoi(value); | 125 | cgit_max_commit_count = atoi(value); |
126 | else if (!strcmp(name, "repo.url")) | 126 | else if (!strcmp(name, "repo.url")) |
127 | cgit_repo = add_repo(value); | 127 | cgit_repo = add_repo(value); |
128 | else if (!strcmp(name, "repo.name")) | 128 | else if (!strcmp(name, "repo.name")) |
129 | cgit_repo->name = xstrdup(value); | 129 | cgit_repo->name = xstrdup(value); |
130 | else if (cgit_repo && !strcmp(name, "repo.path")) | 130 | else if (cgit_repo && !strcmp(name, "repo.path")) |
131 | cgit_repo->path = xstrdup(value); | 131 | cgit_repo->path = xstrdup(value); |
132 | else if (cgit_repo && !strcmp(name, "repo.desc")) | 132 | else if (cgit_repo && !strcmp(name, "repo.desc")) |
133 | cgit_repo->desc = xstrdup(value); | 133 | cgit_repo->desc = xstrdup(value); |
134 | else if (cgit_repo && !strcmp(name, "repo.owner")) | 134 | else if (cgit_repo && !strcmp(name, "repo.owner")) |
135 | cgit_repo->owner = xstrdup(value); | 135 | cgit_repo->owner = xstrdup(value); |
136 | else if (cgit_repo && !strcmp(name, "repo.snapshots")) | 136 | else if (cgit_repo && !strcmp(name, "repo.snapshots")) |
137 | cgit_repo->snapshots = atoi(value); | 137 | cgit_repo->snapshots = atoi(value); |
138 | else if (cgit_repo && !strcmp(name, "repo.module-link")) | 138 | else if (cgit_repo && !strcmp(name, "repo.module-link")) |
139 | cgit_repo->module_link= xstrdup(value); | 139 | cgit_repo->module_link= xstrdup(value); |
140 | else if (!strcmp(name, "include")) | ||
141 | cgit_read_config(value, cgit_global_config_cb); | ||
140 | } | 142 | } |
141 | 143 | ||
142 | void cgit_repo_config_cb(const char *name, const char *value) | 144 | void cgit_repo_config_cb(const char *name, const char *value) |
143 | { | 145 | { |
144 | if (!strcmp(name, "name")) | 146 | if (!strcmp(name, "name")) |
145 | cgit_repo_name = xstrdup(value); | 147 | cgit_repo_name = xstrdup(value); |
146 | else if (!strcmp(name, "desc")) | 148 | else if (!strcmp(name, "desc")) |
147 | cgit_repo_desc = xstrdup(value); | 149 | cgit_repo_desc = xstrdup(value); |
148 | else if (!strcmp(name, "owner")) | 150 | else if (!strcmp(name, "owner")) |
149 | cgit_repo_owner = xstrdup(value); | 151 | cgit_repo_owner = xstrdup(value); |
150 | } | 152 | } |
151 | 153 | ||
152 | void cgit_querystring_cb(const char *name, const char *value) | 154 | void cgit_querystring_cb(const char *name, const char *value) |
153 | { | 155 | { |
154 | if (!strcmp(name,"r")) { | 156 | if (!strcmp(name,"r")) { |
155 | cgit_query_repo = xstrdup(value); | 157 | cgit_query_repo = xstrdup(value); |
156 | } else if (!strcmp(name, "p")) { | 158 | } else if (!strcmp(name, "p")) { |
157 | cgit_query_page = xstrdup(value); | 159 | cgit_query_page = xstrdup(value); |
158 | } else if (!strcmp(name, "q")) { | 160 | } else if (!strcmp(name, "q")) { |
159 | cgit_query_search = xstrdup(value); | 161 | cgit_query_search = xstrdup(value); |
160 | } else if (!strcmp(name, "h")) { | 162 | } else if (!strcmp(name, "h")) { |
161 | cgit_query_head = xstrdup(value); | 163 | cgit_query_head = xstrdup(value); |
162 | cgit_query_has_symref = 1; | 164 | cgit_query_has_symref = 1; |
163 | } else if (!strcmp(name, "id")) { | 165 | } else if (!strcmp(name, "id")) { |