[PATCH 07/17] ui-shared: add cgit_print_layout_{start,end}()

John Keeping john at keeping.me.uk
Sun Apr 5 17:54:53 CEST 2015


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 at keeping.me.uk>
---
 ui-shared.c | 12 ++++++++++++
 ui-shared.h |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/ui-shared.c b/ui-shared.c
index bcde2bb..e0b3121 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -781,6 +781,18 @@ void cgit_print_error_page(int code, const char *msg, const char *fmt, ...)
 	cgit_print_docend();
 }
 
+void cgit_print_layout_start(void)
+{
+	cgit_print_http_headers();
+	cgit_print_docstart();
+	cgit_print_pageheader();
+}
+
+void cgit_print_layout_end(void)
+{
+	cgit_print_docend();
+}
+
 static void add_clone_urls(void (*fn)(const char *), char *txt, char *suffix)
 {
 	struct strbuf **url_list = strbuf_split_str(txt, ' ', 0);
diff --git a/ui-shared.h b/ui-shared.h
index 6a14858..bc77535 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -54,6 +54,9 @@ extern void cgit_object_link(struct object *obj);
 extern void cgit_submodule_link(const char *class, char *path,
 				const char *rev);
 
+extern void cgit_print_layout_start(void);
+extern void cgit_print_layout_end(void);
+
 __attribute__((format (printf,1,2)))
 extern void cgit_print_error(const char *fmt, ...);
 __attribute__((format (printf,1,0)))
-- 
2.4.0.rc0.173.gb1cefcc



More information about the CGit mailing list