blob: 2ef0ce545278ea2f40526c42303c541736643bd5 [file] [log] [blame]
Jeff Kingbe58e702008-10-05 17:43:21 -04001#ifndef USERDIFF_H
2#define USERDIFF_H
3
Jeff Kingd9bae1a2010-04-01 20:12:15 -04004#include "notes-cache.h"
5
Jeff Kingbe58e702008-10-05 17:43:21 -04006struct userdiff_funcname {
7 const char *pattern;
8 int cflags;
9};
10
11struct userdiff_driver {
12 const char *name;
13 const char *external;
Jeff King122aa6f2008-10-05 17:43:36 -040014 int binary;
Jeff Kingbe58e702008-10-05 17:43:21 -040015 struct userdiff_funcname funcname;
Thomas Rast80c49c32009-01-17 17:29:48 +010016 const char *word_regex;
Jeff King9cb92c32008-10-05 17:43:45 -040017 const char *textconv;
Jeff Kingd9bae1a2010-04-01 20:12:15 -040018 struct notes_cache *textconv_cache;
19 int textconv_want_cache;
Jeff Kingbe58e702008-10-05 17:43:21 -040020};
21
Jeff Kingc7534ef2008-10-26 00:45:55 -040022int userdiff_config(const char *k, const char *v);
Jeff Kingbe58e702008-10-05 17:43:21 -040023struct userdiff_driver *userdiff_find_by_name(const char *name);
24struct userdiff_driver *userdiff_find_by_path(const char *path);
25
Jeff Kinga64e6a42016-02-22 13:28:54 -050026/*
27 * Initialize any textconv-related fields in the driver and return it, or NULL
28 * if it does not have textconv enabled at all.
29 */
Jeff King3813e692011-05-23 16:30:14 -040030struct userdiff_driver *userdiff_get_textconv(struct userdiff_driver *driver);
31
Jeff Kingbe58e702008-10-05 17:43:21 -040032#endif /* USERDIFF */