aboutsummaryrefslogtreecommitdiffstats
path: root/filter.c
diff options
context:
space:
mode:
authorGravatar John Keeping <john@keeping.me.uk>2014-01-13 02:13:51 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2014-01-14 10:00:07 (JST)
commit632efb25c07c1b014a4e8cfbbea759f517c2aaf6 (patch)
treed749ef94576b829a4b8fc5ef330beb27de452bf1 /filter.c
parented3497b0de6634350cd17b320538fba918d4084c (diff)
downloadcgit-632efb25c07c1b014a4e8cfbbea759f517c2aaf6.zip
cgit-632efb25c07c1b014a4e8cfbbea759f517c2aaf6.tar.gz
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 <john@keeping.me.uk>
Diffstat (limited to 'filter.c')
-rw-r--r--filter.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/filter.c b/filter.c
index d8c0116..80cf689 100644
--- a/filter.c
+++ b/filter.c
@@ -63,6 +63,11 @@ done:
63 63
64} 64}
65 65
66void cgit_fprintf_filter(struct cgit_filter *filter, FILE *f, const char *prefix)
67{
68 fprintf(f, "%s%s\n", prefix, filter->cmd);
69}
70
66struct cgit_filter *cgit_new_filter(const char *cmd, filter_type filtertype) 71struct cgit_filter *cgit_new_filter(const char *cmd, filter_type filtertype)
67{ 72{
68 struct cgit_filter *f; 73 struct cgit_filter *f;