1#ifndef LINE_LOG_H 2#define LINE_LOG_H 3 4#include"diffcore.h" 5 6struct rev_info; 7struct commit; 8 9/* A range [start,end]. Lines are numbered starting at 0, and the 10 * ranges include start but exclude end. */ 11struct range { 12long start, end; 13}; 14 15/* A set of ranges. The ranges must always be disjoint and sorted. */ 16struct range_set { 17int alloc, nr; 18struct range *ranges; 19}; 20 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. */ 23struct diff_ranges { 24struct range_set parent; 25struct range_set target; 26}; 27 28/* Linked list of interesting files and their associated ranges. The 29 * list must be kept sorted by path. 30 * 31 * For simplicity, even though this is highly redundant, each 32 * line_log_data owns its 'path'. 33 */ 34struct line_log_data { 35struct line_log_data *next; 36char*path; 37char status; 38struct range_set ranges; 39int arg_alloc, arg_nr; 40const char**args; 41struct diff_filepair *pair; 42struct diff_ranges diff; 43}; 44 45externvoidline_log_data_init(struct line_log_data *r); 46 47externvoidline_log_init(struct rev_info *rev,const char*prefix,struct string_list *args); 48 49externintline_log_filter(struct rev_info *rev); 50 51externintline_log_print(struct rev_info *rev,struct commit *commit); 52 53#endif/* LINE_LOG_H */