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>
这个提交包含在:
John Keeping
2014-01-12 17:13:51 +00:00
提交者 Jason A. Donenfeld
父节点 ed3497b0de
当前提交 632efb25c0
修改 3 个文件,包含 9 行新增3 行删除

查看文件

@@ -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;