Merge branch 'jk/cat-file-batch-optim'
[git/gitweb.git] / line-log.h
blob8bea45fd78f0368fef373be080ea5fa77d428c7f
1 #ifndef LINE_LOG_H
2 #define LINE_LOG_H
4 #include "diffcore.h"
6 struct rev_info;
7 struct commit;
9 /* A range [start,end]. Lines are numbered starting at 0, and the
10 * ranges include start but exclude end. */
11 struct range {
12 long start, end;
15 /* A set of ranges. The ranges must always be disjoint and sorted. */
16 struct range_set {
17 int alloc, nr;
18 struct range *ranges;
21 /* A diff, encoded as the set of pre- and post-image ranges where the
22 * files differ. A pair of ranges corresponds to a hunk. */
23 struct diff_ranges {
24 struct range_set parent;
25 struct range_set target;
28 /* Linked list of interesting files and their associated ranges. The
29 * list must be kept sorted by path.
31 * For simplicity, even though this is highly redundant, each
32 * line_log_data owns its 'path'.
34 struct line_log_data {
35 struct line_log_data *next;
36 char *path;
37 char status;
38 struct range_set ranges;
39 int arg_alloc, arg_nr;
40 const char **args;
41 struct diff_filepair *pair;
42 struct diff_ranges diff;
45 extern void line_log_data_init(struct line_log_data *r);
47 extern void line_log_init(struct rev_info *rev, const char *prefix, struct string_list *args);
49 extern int line_log_filter(struct rev_info *rev);
51 extern int line_log_print(struct rev_info *rev, struct commit *commit);
53 #endif /* LINE_LOG_H */