name-rev: include taggerdate in considering the best name
[gitweb.git] / diff.h
diff --git a/diff.h b/diff.h
index ce123fa06fee6fb6e5e76d6a92ea8284a5bbbcf1..561635b2b9be13c19874152a2185ad2b6d867834 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -15,6 +15,10 @@ struct diff_filespec;
 struct userdiff_driver;
 struct sha1_array;
 struct commit;
+struct combine_diff_path;
+
+typedef int (*pathchange_fn_t)(struct diff_options *options,
+                struct combine_diff_path *path);
 
 typedef void (*change_fn_t)(struct diff_options *options,
                 unsigned old_mode, unsigned new_mode,
@@ -157,6 +161,7 @@ struct diff_options {
        int close_file;
 
        struct pathspec pathspec;
+       pathchange_fn_t pathchange;
        change_fn_t change;
        add_remove_fn_t add_remove;
        diff_format_fn_t format_callback;
@@ -170,7 +175,7 @@ struct diff_options {
 
 enum color_diff {
        DIFF_RESET = 0,
-       DIFF_PLAIN = 1,
+       DIFF_CONTEXT = 1,
        DIFF_METAINFO = 2,
        DIFF_FRAGINFO = 3,
        DIFF_FILE_OLD = 4,
@@ -189,8 +194,10 @@ const char *diff_line_prefix(struct diff_options *);
 
 extern const char mime_boundary_leader[];
 
-extern int diff_tree(struct tree_desc *t1, struct tree_desc *t2,
-                    const char *base, struct diff_options *opt);
+extern struct combine_diff_path *diff_tree_paths(
+       struct combine_diff_path *p, const unsigned char *sha1,
+       const unsigned char **parent_sha1, int nparent,
+       struct strbuf *base, struct diff_options *opt);
 extern int diff_tree_sha1(const unsigned char *old, const unsigned char *new,
                          const char *base, struct diff_options *opt);
 extern int diff_root_tree_sha1(const unsigned char *new, const char *base,
@@ -198,7 +205,6 @@ extern int diff_root_tree_sha1(const unsigned char *new, const char *base,
 
 struct combine_diff_path {
        struct combine_diff_path *next;
-       int len;
        char *path;
        unsigned int mode;
        unsigned char sha1[20];
@@ -209,8 +215,8 @@ struct combine_diff_path {
        } parent[FLEX_ARRAY];
 };
 #define combine_diff_path_size(n, l) \
-       (sizeof(struct combine_diff_path) + \
-        sizeof(struct combine_diff_parent) * (n) + (l) + 1)
+       st_add4(sizeof(struct combine_diff_path), (l), 1, \
+               st_mult(sizeof(struct combine_diff_parent), (n)))
 
 extern void show_combined_diff(struct combine_diff_path *elem, int num_parent,
                              int dense, struct rev_info *);
@@ -346,8 +352,6 @@ extern int parse_rename_score(const char **cp_p);
 
 extern long parse_algorithm_value(const char *value);
 
-extern void handle_deprecated_show_diff_q(struct diff_options *);
-
 extern int print_stat_summary(FILE *fp, int files,
                              int insertions, int deletions);
 extern void setup_diff_pager(struct diff_options *);