4 #include "notes-cache.h"
9 struct userdiff_funcname
{
14 struct userdiff_driver
{
18 struct userdiff_funcname funcname
;
19 const char *word_regex
;
21 struct notes_cache
*textconv_cache
;
22 int textconv_want_cache
;
24 enum userdiff_driver_type
{
25 USERDIFF_DRIVER_TYPE_BUILTIN
= 1<<0,
26 USERDIFF_DRIVER_TYPE_CUSTOM
= 1<<1,
28 typedef int (*each_userdiff_driver_fn
)(struct userdiff_driver
*,
29 enum userdiff_driver_type
, void *);
31 int userdiff_config(const char *k
, const char *v
);
32 struct userdiff_driver
*userdiff_find_by_name(const char *name
);
33 struct userdiff_driver
*userdiff_find_by_path(struct index_state
*istate
,
37 * Initialize any textconv-related fields in the driver and return it, or NULL
38 * if it does not have textconv enabled at all.
40 struct userdiff_driver
*userdiff_get_textconv(struct repository
*r
,
41 struct userdiff_driver
*driver
);
44 * Iterate over all userdiff drivers. The userdiff_driver_type
45 * argument to each_userdiff_driver_fn indicates their type. Return
46 * non-zero to exit early from the loop.
48 int for_each_userdiff_driver(each_userdiff_driver_fn
, void *);