]>
Commit | Line | Data |
---|---|---|
be58e70d JK |
1 | #ifndef USERDIFF_H |
2 | #define USERDIFF_H | |
3 | ||
d9bae1a1 JK |
4 | #include "notes-cache.h" |
5 | ||
acd00ea0 | 6 | struct index_state; |
bd7ad45b | 7 | struct repository; |
acd00ea0 | 8 | |
be58e70d JK |
9 | struct userdiff_funcname { |
10 | const char *pattern; | |
11 | int cflags; | |
12 | }; | |
13 | ||
14 | struct userdiff_driver { | |
15 | const char *name; | |
16 | const char *external; | |
122aa6f9 | 17 | int binary; |
be58e70d | 18 | struct userdiff_funcname funcname; |
80c49c3d | 19 | const char *word_regex; |
9cb92c39 | 20 | const char *textconv; |
d9bae1a1 JK |
21 | struct notes_cache *textconv_cache; |
22 | int textconv_want_cache; | |
be58e70d | 23 | }; |
f12fa9ee ÆAB |
24 | enum userdiff_driver_type { |
25 | USERDIFF_DRIVER_TYPE_BUILTIN = 1<<0, | |
26 | USERDIFF_DRIVER_TYPE_CUSTOM = 1<<1, | |
27 | }; | |
28 | typedef int (*each_userdiff_driver_fn)(struct userdiff_driver *, | |
29 | enum userdiff_driver_type, void *); | |
be58e70d | 30 | |
c7534ef4 | 31 | int userdiff_config(const char *k, const char *v); |
be58e70d | 32 | struct userdiff_driver *userdiff_find_by_name(const char *name); |
acd00ea0 NTND |
33 | struct userdiff_driver *userdiff_find_by_path(struct index_state *istate, |
34 | const char *path); | |
be58e70d | 35 | |
a64e6a44 JK |
36 | /* |
37 | * Initialize any textconv-related fields in the driver and return it, or NULL | |
38 | * if it does not have textconv enabled at all. | |
39 | */ | |
bd7ad45b NTND |
40 | struct userdiff_driver *userdiff_get_textconv(struct repository *r, |
41 | struct userdiff_driver *driver); | |
3813e690 | 42 | |
f12fa9ee ÆAB |
43 | /* |
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. | |
47 | */ | |
48 | int for_each_userdiff_driver(each_userdiff_driver_fn, void *); | |
49 | ||
be58e70d | 50 | #endif /* USERDIFF */ |