diff options
author | John Keeping | 2015-08-14 12:47:11 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2015-08-14 15:46:51 +0200 |
commit | 764987980ec0e806205b8e075feafd4e010dcbd9 (patch) | |
tree | 3615d20fa53c80a46338fd97278a6279a15fc476 | |
parent | html: remove html_status() (diff) | |
download | cgit-764987980ec0e806205b8e075feafd4e010dcbd9.tar.gz cgit-764987980ec0e806205b8e075feafd4e010dcbd9.zip |
ui-shared: add cgit_print_layout_{start,end}()
These will avoid needing to call three functions to start page layout in subsequent patches when we move the layout setup into each individual page. Signed-off-by: John Keeping <john@keeping.me.uk>
-rw-r--r-- | ui-shared.c | 12 | ||||
-rw-r--r-- | ui-shared.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c index 06dd0a8..de06256 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -802,6 +802,18 @@ void cgit_print_error_page(int code, const char *msg, const char *fmt, ...) | |||
802 | cgit_print_docend(); | 802 | cgit_print_docend(); |
803 | } | 803 | } |
804 | 804 | ||
805 | void cgit_print_layout_start(void) | ||
806 | { | ||
807 | cgit_print_http_headers(); | ||
808 | cgit_print_docstart(); | ||
809 | cgit_print_pageheader(); | ||
810 | } | ||
811 | |||
812 | void cgit_print_layout_end(void) | ||
813 | { | ||
814 | cgit_print_docend(); | ||
815 | } | ||
816 | |||
805 | static void add_clone_urls(void (*fn)(const char *), char *txt, char *suffix) | 817 | static void add_clone_urls(void (*fn)(const char *), char *txt, char *suffix) |
806 | { | 818 | { |
807 | struct strbuf **url_list = strbuf_split_str(txt, ' ', 0); | 819 | struct strbuf **url_list = strbuf_split_str(txt, ' ', 0); |
diff --git a/ui-shared.h b/ui-shared.h index 652685e..246678b 100644 --- a/ui-shared.h +++ b/ui-shared.h | |||
@@ -54,6 +54,9 @@ extern void cgit_object_link(struct object *obj); | |||
54 | extern void cgit_submodule_link(const char *class, char *path, | 54 | extern void cgit_submodule_link(const char *class, char *path, |
55 | const char *rev); | 55 | const char *rev); |
56 | 56 | ||
57 | extern void cgit_print_layout_start(void); | ||
58 | extern void cgit_print_layout_end(void); | ||
59 | |||
57 | __attribute__((format (printf,1,2))) | 60 | __attribute__((format (printf,1,2))) |
58 | extern void cgit_print_error(const char *fmt, ...); | 61 | extern void cgit_print_error(const char *fmt, ...); |
59 | __attribute__((format (printf,1,0))) | 62 | __attribute__((format (printf,1,0))) |