4 #include "notes-cache.h"
9 struct userdiff_funcname
{
15 struct external_diff
{
17 unsigned trust_exit_code
:1;
20 struct userdiff_driver
{
22 struct external_diff external
;
23 const char *algorithm
;
24 char *algorithm_owned
;
26 struct userdiff_funcname funcname
;
27 const char *word_regex
;
28 char *word_regex_owned
;
29 const char *word_regex_multi_byte
;
32 struct notes_cache
*textconv_cache
;
33 int textconv_want_cache
;
35 enum userdiff_driver_type
{
36 USERDIFF_DRIVER_TYPE_BUILTIN
= 1<<0,
37 USERDIFF_DRIVER_TYPE_CUSTOM
= 1<<1,
39 typedef int (*each_userdiff_driver_fn
)(struct userdiff_driver
*,
40 enum userdiff_driver_type
, void *);
42 int userdiff_config(const char *k
, const char *v
);
43 struct userdiff_driver
*userdiff_find_by_name(const char *name
);
44 struct userdiff_driver
*userdiff_find_by_path(struct index_state
*istate
,
48 * Initialize any textconv-related fields in the driver and return it, or NULL
49 * if it does not have textconv enabled at all.
51 struct userdiff_driver
*userdiff_get_textconv(struct repository
*r
,
52 struct userdiff_driver
*driver
);
55 * Iterate over all userdiff drivers. The userdiff_driver_type
56 * argument to each_userdiff_driver_fn indicates their type. Return
57 * non-zero to exit early from the loop.
59 int for_each_userdiff_driver(each_userdiff_driver_fn
, void *);