Jeff King | be58e70 | 2008-10-05 17:43:21 -0400 | [diff] [blame] | 1 | #ifndef USERDIFF_H |
| 2 | #define USERDIFF_H |
| 3 | |
Jeff King | d9bae1a | 2010-04-01 20:12:15 -0400 | [diff] [blame] | 4 | #include "notes-cache.h" |
| 5 | |
Nguyễn Thái Ngọc Duy | acd00ea | 2018-09-21 17:57:33 +0200 | [diff] [blame] | 6 | struct index_state; |
Nguyễn Thái Ngọc Duy | bd7ad45 | 2018-11-10 06:49:06 +0100 | [diff] [blame] | 7 | struct repository; |
Nguyễn Thái Ngọc Duy | acd00ea | 2018-09-21 17:57:33 +0200 | [diff] [blame] | 8 | |
Jeff King | be58e70 | 2008-10-05 17:43:21 -0400 | [diff] [blame] | 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; |
Jeff King | 122aa6f | 2008-10-05 17:43:36 -0400 | [diff] [blame] | 17 | int binary; |
Jeff King | be58e70 | 2008-10-05 17:43:21 -0400 | [diff] [blame] | 18 | struct userdiff_funcname funcname; |
Thomas Rast | 80c49c3 | 2009-01-17 17:29:48 +0100 | [diff] [blame] | 19 | const char *word_regex; |
Jeff King | 9cb92c3 | 2008-10-05 17:43:45 -0400 | [diff] [blame] | 20 | const char *textconv; |
Jeff King | d9bae1a | 2010-04-01 20:12:15 -0400 | [diff] [blame] | 21 | struct notes_cache *textconv_cache; |
| 22 | int textconv_want_cache; |
Jeff King | be58e70 | 2008-10-05 17:43:21 -0400 | [diff] [blame] | 23 | }; |
| 24 | |
Jeff King | c7534ef | 2008-10-26 00:45:55 -0400 | [diff] [blame] | 25 | int userdiff_config(const char *k, const char *v); |
Jeff King | be58e70 | 2008-10-05 17:43:21 -0400 | [diff] [blame] | 26 | struct userdiff_driver *userdiff_find_by_name(const char *name); |
Nguyễn Thái Ngọc Duy | acd00ea | 2018-09-21 17:57:33 +0200 | [diff] [blame] | 27 | struct userdiff_driver *userdiff_find_by_path(struct index_state *istate, |
| 28 | const char *path); |
Jeff King | be58e70 | 2008-10-05 17:43:21 -0400 | [diff] [blame] | 29 | |
Jeff King | a64e6a4 | 2016-02-22 13:28:54 -0500 | [diff] [blame] | 30 | /* |
| 31 | * Initialize any textconv-related fields in the driver and return it, or NULL |
| 32 | * if it does not have textconv enabled at all. |
| 33 | */ |
Nguyễn Thái Ngọc Duy | bd7ad45 | 2018-11-10 06:49:06 +0100 | [diff] [blame] | 34 | struct userdiff_driver *userdiff_get_textconv(struct repository *r, |
| 35 | struct userdiff_driver *driver); |
Jeff King | 3813e69 | 2011-05-23 16:30:14 -0400 | [diff] [blame] | 36 | |
Jeff King | be58e70 | 2008-10-05 17:43:21 -0400 | [diff] [blame] | 37 | #endif /* USERDIFF */ |