From 9240a828d13fa8f6a9e379b94b2061ca83e6199c Mon Sep 17 00:00:00 2001 From: Ferry Huberts Date: Wed, 23 Mar 2011 11:57:41 +0100 Subject: new_filter: determine extra_args from filter type Currently the number of extra arguments is linked hard to the type of the filter. This is also logical since it would be confusing to have a different number of arguments for the same type of filter depending on the context under which the filter is run (unless ofcourse one the parameters would make the context clear, which is currently not the case). Signed-off-by: Ferry Huberts Signed-off-by: Lars Hjemli --- cgit.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index b5f00fc..1f8b1be 100644 --- a/cgit.h +++ b/cgit.h @@ -51,6 +51,10 @@ typedef void (*configfn)(const char *name, const char *value); typedef void (*filepair_fn)(struct diff_filepair *pair); typedef void (*linediff_fn)(char *line, int len); +typedef enum { + ABOUT, COMMIT, SOURCE +} filter_type; + struct cgit_filter { char *cmd; char **argv; -- cgit v1.2.1 From d87bba846d368e560193a1f75de6d66bffe986cf Mon Sep 17 00:00:00 2001 From: Ferry Huberts Date: Wed, 23 Mar 2011 11:57:42 +0100 Subject: cgit_open_filter: also take the repo as a parameter To prepare for handing repo configuration to the filter script that is executed. Signed-off-by: Ferry Huberts Signed-off-by: Lars Hjemli --- cgit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index 1f8b1be..3b0eaf5 100644 --- a/cgit.h +++ b/cgit.h @@ -318,7 +318,7 @@ extern const char *cgit_repobasename(const char *reponame); extern int cgit_parse_snapshots_mask(const char *str); -extern int cgit_open_filter(struct cgit_filter *filter); +extern int cgit_open_filter(struct cgit_filter *filter, struct cgit_repo * repo); extern int cgit_close_filter(struct cgit_filter *filter); extern int readfile(const char *path, char **buf, size_t *size); -- cgit v1.2.1