]> git.ipfire.org Git - thirdparty/git.git/blame - userdiff.h
reftable: read reftable files
[thirdparty/git.git] / userdiff.h
CommitLineData
be58e70d
JK
1#ifndef USERDIFF_H
2#define USERDIFF_H
3
d9bae1a1
JK
4#include "notes-cache.h"
5
acd00ea0 6struct index_state;
bd7ad45b 7struct repository;
acd00ea0 8
be58e70d
JK
9struct userdiff_funcname {
10 const char *pattern;
11 int cflags;
12};
13
14struct 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
24enum userdiff_driver_type {
25 USERDIFF_DRIVER_TYPE_BUILTIN = 1<<0,
26 USERDIFF_DRIVER_TYPE_CUSTOM = 1<<1,
27};
28typedef int (*each_userdiff_driver_fn)(struct userdiff_driver *,
29 enum userdiff_driver_type, void *);
be58e70d 30
c7534ef4 31int userdiff_config(const char *k, const char *v);
be58e70d 32struct userdiff_driver *userdiff_find_by_name(const char *name);
acd00ea0
NTND
33struct 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
40struct 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 */
48int for_each_userdiff_driver(each_userdiff_driver_fn, void *);
49
be58e70d 50#endif /* USERDIFF */