summaryrefslogtreecommitdiffabout
path: root/cgit.h
authorLars Hjemli <hjemli@gmail.com>2008-03-23 23:51:19 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-03-23 23:51:19 (UTC)
commitf3c1a187fe2bc33f8423cd535d5045899699995b (patch) (unidiff)
treeb5c553da7b108900535fcfcd24b78bdd0ac62387 /cgit.h
parentb1f9b9c1459cb9a30ebf80721aff6ef788d1f891 (diff)
downloadcgit-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>
Diffstat (limited to 'cgit.h') (more/less context) (show whitespace changes)
-rw-r--r--cgit.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/cgit.h b/cgit.h
index 5b7ee1c..8ab8e07 100644
--- a/cgit.h
+++ b/cgit.h
@@ -171,16 +171,26 @@ struct cgit_config {
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
177struct cgit_page {
178 time_t modified;
179 time_t expires;
180 char *mimetype;
181 char *charset;
182 char *filename;
183 char *title;
184};
185
177struct cgit_context { 186struct 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
183extern const char *cgit_version; 193extern const char *cgit_version;
184 194
185extern struct cgit_repolist cgit_repolist; 195extern struct cgit_repolist cgit_repolist;
186extern struct cgit_context ctx; 196extern struct cgit_context ctx;
@@ -257,18 +267,16 @@ extern void cgit_diff_link(char *name, char *title, char *class, char *head,
257 267
258extern void cgit_object_link(struct object *obj); 268extern void cgit_object_link(struct object *obj);
259 269
260extern void cgit_print_error(char *msg); 270extern void cgit_print_error(char *msg);
261extern void cgit_print_date(time_t secs, char *format); 271extern void cgit_print_date(time_t secs, char *format);
262extern void cgit_print_age(time_t t, time_t max_relative, char *format); 272extern void cgit_print_age(time_t t, time_t max_relative, char *format);
263extern void cgit_print_docstart(char *title, struct cacheitem *item); 273extern void cgit_print_http_headers(struct cgit_context *ctx);
274extern void cgit_print_docstart(struct cgit_context *ctx);
264extern void cgit_print_docend(); 275extern void cgit_print_docend();
265extern void cgit_print_pageheader(char *title, int show_search); 276extern void cgit_print_pageheader(struct cgit_context *ctx);
266extern void cgit_print_snapshot_start(const char *mimetype,
267 const char *filename,
268 struct cacheitem *item);
269extern void cgit_print_filemode(unsigned short mode); 277extern void cgit_print_filemode(unsigned short mode);
270extern void cgit_print_branches(int maxcount); 278extern void cgit_print_branches(int maxcount);
271extern void cgit_print_tags(int maxcount); 279extern void cgit_print_tags(int maxcount);
272 280
273extern void cgit_print_repolist(struct cacheitem *item); 281extern void cgit_print_repolist(struct cacheitem *item);
274extern void cgit_print_summary(); 282extern void cgit_print_summary();