2 * Copyright (C) the libgit2 contributors. All rights reserved.
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
7 #ifndef INCLUDE_diff_h__
8 #define INCLUDE_diff_h__
10 #include "git2/diff.h"
11 #include "git2/sys/diff.h"
18 #include "repository.h"
22 #define DIFF_OLD_PREFIX_DEFAULT "a/"
23 #define DIFF_NEW_PREFIX_DEFAULT "b/"
26 GIT_DIFF_TYPE_UNKNOWN
= 0,
27 GIT_DIFF_TYPE_GENERATED
= 1,
28 GIT_DIFF_TYPE_PARSED
= 2,
34 git_diff_origin_t type
;
35 git_diff_options opts
;
36 git_vector deltas
; /* vector of git_diff_delta */
38 git_iterator_type_t old_src
;
39 git_iterator_type_t new_src
;
40 git_diff_perfdata perf
;
42 int (*strcomp
)(const char *, const char *);
43 int (*strncomp
)(const char *, const char *, size_t);
44 int (*pfxcomp
)(const char *str
, const char *pfx
);
45 int (*entrycomp
)(const void *a
, const void *b
);
47 void (*free_fn
)(git_diff
*diff
);
50 extern int git_diff_delta__format_file_header(
52 const git_diff_delta
*delta
,
57 extern int git_diff_delta__cmp(const void *a
, const void *b
);
58 extern int git_diff_delta__casecmp(const void *a
, const void *b
);
60 extern int git_diff__entry_cmp(const void *a
, const void *b
);
61 extern int git_diff__entry_icmp(const void *a
, const void *b
);