From 632efb25c07c1b014a4e8cfbbea759f517c2aaf6 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sun, 12 Jan 2014 17:13:51 +0000 Subject: filter: add fprintf_filter function This stops the code in cgit.c::print_repo needing to inspect the cgit_filter structure, meaning that we can abstract out different filter types that will have different fields that need to be printed. Signed-off-by: John Keeping --- filter.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'filter.c') diff --git a/filter.c b/filter.c index d8c0116..80cf689 100644 --- a/filter.c +++ b/filter.c @@ -63,6 +63,11 @@ done: } +void cgit_fprintf_filter(struct cgit_filter *filter, FILE *f, const char *prefix) +{ + fprintf(f, "%s%s\n", prefix, filter->cmd); +} + struct cgit_filter *cgit_new_filter(const char *cmd, filter_type filtertype) { struct cgit_filter *f; -- cgit v1.2.3-59-g8ed1b