From: Lars Hjemli Date: Sun, 9 Aug 2009 11:46:01 +0000 (+0200) Subject: Merge branch 'lh/plugins' X-Git-Tag: v0.8.3~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db6303b58883c4417f5bcc0c1ee34fed6553dca3;p=cgit Merge branch 'lh/plugins' Conflicts: cgit.c cgit.h --- db6303b58883c4417f5bcc0c1ee34fed6553dca3 diff --cc cgit.c index aa1107a,b3a98c1..dbec196 --- a/cgit.c +++ b/cgit.c @@@ -17,14 -17,21 +17,29 @@@ const char *cgit_version = CGIT_VERSION; +void add_mimetype(const char *name, const char *value) +{ + struct string_list_item *item; + + item = string_list_insert(xstrdup(name), &ctx.cfg.mimetypes); + item->util = xstrdup(value); +} + + struct cgit_filter *new_filter(const char *cmd, int extra_args) + { + struct cgit_filter *f; + + if (!cmd || !cmd[0]) + return NULL; + + f = xmalloc(sizeof(struct cgit_filter)); + f->cmd = xstrdup(cmd); + f->argv = xmalloc((2 + extra_args) * sizeof(char *)); + f->argv[0] = f->cmd; + f->argv[1] = NULL; + return f; + } + void config_cb(const char *name, const char *value) { if (!strcmp(name, "root-title")) diff --cc cgit.h index 1194eb0,f10ba05..b8557ac --- a/cgit.h +++ b/cgit.h @@@ -176,7 -185,8 +187,9 @@@ struct cgit_config int summary_branches; int summary_log; int summary_tags; + struct string_list mimetypes; + struct cgit_filter *commit_filter; + struct cgit_filter *source_filter; }; struct cgit_page {