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) (unidiff) | |
tree | b5c553da7b108900535fcfcd24b78bdd0ac62387 /cgit.h | |
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-- | cgit.h | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -165,28 +165,38 @@ struct cgit_config { | |||
165 | int max_commit_count; | 165 | int max_commit_count; |
166 | int max_lock_attempts; | 166 | int max_lock_attempts; |
167 | int max_msg_len; | 167 | int max_msg_len; |
168 | int max_repodesc_len; | 168 | int max_repodesc_len; |
169 | int nocache; | 169 | int nocache; |
170 | int renamelimit; | 170 | int renamelimit; |
171 | int snapshots; | 171 | int snapshots; |
172 | int summary_branches; | 172 | int summary_branches; |
173 | int summary_log; | 173 | int summary_log; |
174 | int summary_tags; | 174 | int summary_tags; |
175 | }; | 175 | }; |
176 | 176 | ||
177 | struct cgit_page { | ||
178 | time_t modified; | ||
179 | time_t expires; | ||
180 | char *mimetype; | ||
181 | char *charset; | ||
182 | char *filename; | ||
183 | char *title; | ||
184 | }; | ||
185 | |||
177 | struct cgit_context { | 186 | struct cgit_context { |
178 | struct cgit_query qry; | 187 | struct cgit_query qry; |
179 | struct cgit_config cfg; | 188 | struct cgit_config cfg; |
180 | struct cgit_repo *repo; | 189 | struct cgit_repo *repo; |
190 | struct cgit_page page; | ||
181 | }; | 191 | }; |
182 | 192 | ||
183 | extern const char *cgit_version; | 193 | extern const char *cgit_version; |
184 | 194 | ||
185 | extern struct cgit_repolist cgit_repolist; | 195 | extern struct cgit_repolist cgit_repolist; |
186 | extern struct cgit_context ctx; | 196 | extern struct cgit_context ctx; |
187 | extern int cgit_cmd; | 197 | extern int cgit_cmd; |
188 | 198 | ||
189 | extern void cgit_prepare_context(struct cgit_context *ctx); | 199 | extern void cgit_prepare_context(struct cgit_context *ctx); |
190 | extern int cgit_get_cmd_index(const char *cmd); | 200 | extern int cgit_get_cmd_index(const char *cmd); |
191 | extern struct cgit_repo *cgit_get_repoinfo(const char *url); | 201 | extern struct cgit_repo *cgit_get_repoinfo(const char *url); |
192 | extern void cgit_global_config_cb(const char *name, const char *value); | 202 | extern void cgit_global_config_cb(const char *name, const char *value); |
@@ -251,30 +261,28 @@ extern void cgit_commit_link(char *name, char *title, char *class, char *head, | |||
251 | extern void cgit_refs_link(char *name, char *title, char *class, char *head, | 261 | extern void cgit_refs_link(char *name, char *title, char *class, char *head, |
252 | char *rev, char *path); | 262 | char *rev, char *path); |
253 | extern void cgit_snapshot_link(char *name, char *title, char *class, | 263 | extern void cgit_snapshot_link(char *name, char *title, char *class, |
254 | char *head, char *rev, char *archivename); | 264 | char *head, char *rev, char *archivename); |
255 | extern void cgit_diff_link(char *name, char *title, char *class, char *head, | 265 | extern void cgit_diff_link(char *name, char *title, char *class, char *head, |
256 | char *new_rev, char *old_rev, char *path); | 266 | char *new_rev, char *old_rev, char *path); |
257 | 267 | ||
258 | extern void cgit_object_link(struct object *obj); | 268 | extern void cgit_object_link(struct object *obj); |
259 | 269 | ||
260 | extern void cgit_print_error(char *msg); | 270 | extern void cgit_print_error(char *msg); |
261 | extern void cgit_print_date(time_t secs, char *format); | 271 | extern void cgit_print_date(time_t secs, char *format); |
262 | extern void cgit_print_age(time_t t, time_t max_relative, char *format); | 272 | extern void cgit_print_age(time_t t, time_t max_relative, char *format); |
263 | extern void cgit_print_docstart(char *title, struct cacheitem *item); | 273 | extern void cgit_print_http_headers(struct cgit_context *ctx); |
274 | extern void cgit_print_docstart(struct cgit_context *ctx); | ||
264 | extern void cgit_print_docend(); | 275 | extern void cgit_print_docend(); |
265 | extern void cgit_print_pageheader(char *title, int show_search); | 276 | extern void cgit_print_pageheader(struct cgit_context *ctx); |
266 | extern void cgit_print_snapshot_start(const char *mimetype, | ||
267 | const char *filename, | ||
268 | struct cacheitem *item); | ||
269 | extern void cgit_print_filemode(unsigned short mode); | 277 | extern void cgit_print_filemode(unsigned short mode); |
270 | extern void cgit_print_branches(int maxcount); | 278 | extern void cgit_print_branches(int maxcount); |
271 | extern void cgit_print_tags(int maxcount); | 279 | extern void cgit_print_tags(int maxcount); |
272 | 280 | ||
273 | extern void cgit_print_repolist(struct cacheitem *item); | 281 | extern void cgit_print_repolist(struct cacheitem *item); |
274 | extern void cgit_print_summary(); | 282 | extern void cgit_print_summary(); |
275 | extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, | 283 | extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, |
276 | char *pattern, char *path, int pager); | 284 | char *pattern, char *path, int pager); |
277 | extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); | 285 | extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); |
278 | extern void cgit_print_tree(const char *rev, char *path); | 286 | extern void cgit_print_tree(const char *rev, char *path); |
279 | extern void cgit_print_commit(char *hex); | 287 | extern void cgit_print_commit(char *hex); |
280 | extern void cgit_print_refs(); | 288 | extern void cgit_print_refs(); |