@matheusbsbs / matheus-bagliano / commits / a788d7d58b
Fork 0

textconv: make the API public

The textconv functionality allows one to convert a file into text before running diff. But this functionality can be useful to other features such as blame. Signed-off-by: Axel Bonnet <axel.bonnet@ensimag.imag.fr> Signed-off-by: Clément Poulain <clement.poulain@ensimag.imag.fr> Signed-off-by: Diane Gasselin <diane.gasselin@ensimag.imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Axel Bonnet committed Jun 7, 2010 at 17:23 UTC a788d7d58bfbd2772b7ad5d788d8f7f885a651e1
2 files changed +12 -8
diff.c
+4 -8
@@ -43,10 +43,6 @@ static char diff_colors[][COLOR_MAXLEN] = {
43 GIT_COLOR_NORMAL, /* FUNCINFO */
44 };
45
46 -static void diff_filespec_load_driver(struct diff_filespec *one);
47 -static size_t fill_textconv(struct userdiff_driver *driver,
48 - struct diff_filespec *df, char **outbuf);
49 -
46 static int parse_diff_color_slot(const char *var, int ofs)
47 {
48 if (!strcasecmp(var+ofs, "plain"))
@@ -1629,7 +1625,7 @@ void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const
1625 options->b_prefix = b;
1626 }
1627
1632 -static struct userdiff_driver *get_textconv(struct diff_filespec *one)
1628 +struct userdiff_driver *get_textconv(struct diff_filespec *one)
1629 {
1630 if (!DIFF_FILE_VALID(one))
1631 return NULL;
@@ -4002,9 +3998,9 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec,
3998 return strbuf_detach(&buf, outsize);
3999 }
4000
4005 -static size_t fill_textconv(struct userdiff_driver *driver,
4006 - struct diff_filespec *df,
4007 - char **outbuf)
4001 +size_t fill_textconv(struct userdiff_driver *driver,
4002 + struct diff_filespec *df,
4003 + char **outbuf)
4004 {
4005 size_t size;
4006
diff.h
+8
@@ -9,6 +9,8 @@
9 struct rev_info;
10 struct diff_options;
11 struct diff_queue_struct;
12 +struct diff_filespec;
13 +struct userdiff_driver;
14
15 typedef void (*change_fn_t)(struct diff_options *options,
16 unsigned old_mode, unsigned new_mode,
@@ -287,4 +289,10 @@ extern void diff_no_index(struct rev_info *, int, const char **, int, const char
289
290 extern int index_differs_from(const char *def, int diff_flags);
291
292 +extern size_t fill_textconv(struct userdiff_driver *driver,
293 + struct diff_filespec *df,
294 + char **outbuf);
295 +
296 +extern struct userdiff_driver *get_textconv(struct diff_filespec *one);
297 +
298 #endif /* DIFF_H */