📄 svn_diff.h
字号:
* @c svn_diff_fns_t vtable.
*/
typedef struct svn_diff_output_fns_t
{
/* Two-way and three-way diffs both call the first two output functions: */
/**
* If doing a two-way diff, then an *identical* data range was found
* between the "original" and "modified" datasources. Specifically,
* the match starts at @a original_start and goes for @a original_length
* tokens in the original data, and at @a modified_start for
* @a modified_length tokens in the modified data.
*
* If doing a three-way diff, then all three datasources have
* matching data ranges. The range @a latest_start, @a latest_length in
* the "latest" datasource is identical to the range @a original_start,
* @a original_length in the original data, and is also identical to
* the range @a modified_start, @a modified_length in the modified data.
*/
svn_error_t *(*output_common)(void *output_baton,
apr_off_t original_start,
apr_off_t original_length,
apr_off_t modified_start,
apr_off_t modified_length,
apr_off_t latest_start,
apr_off_t latest_length);
/**
* If doing a two-way diff, then an *conflicting* data range was found
* between the "original" and "modified" datasources. Specifically,
* the conflict starts at @a original_start and goes for @a original_length
* tokens in the original data, and at @a modified_start for
* @a modified_length tokens in the modified data.
*
* If doing a three-way diff, then an identical data range was discovered
* between the "original" and "latest" datasources, but this conflicts with
* a range in the "modified" datasource.
*/
svn_error_t *(*output_diff_modified)(void *output_baton,
apr_off_t original_start,
apr_off_t original_length,
apr_off_t modified_start,
apr_off_t modified_length,
apr_off_t latest_start,
apr_off_t latest_length);
/* ------ The following callbacks are used by three-way diffs only --- */
/** An identical data range was discovered between the "original" and
* "modified" datasources, but this conflicts with a range in the
* "latest" datasource.
*/
svn_error_t *(*output_diff_latest)(void *output_baton,
apr_off_t original_start,
apr_off_t original_length,
apr_off_t modified_start,
apr_off_t modified_length,
apr_off_t latest_start,
apr_off_t latest_length);
/** An identical data range was discovered between the "modified" and
* "latest" datasources, but this conflicts with a range in the
* "original" datasource.
*/
svn_error_t *(*output_diff_common)(void *output_baton,
apr_off_t original_start,
apr_off_t original_length,
apr_off_t modified_start,
apr_off_t modified_length,
apr_off_t latest_start,
apr_off_t latest_length);
/** All three datasources have conflicting data ranges. The range
* @a latest_start, @a latest_length in the "latest" datasource conflicts
* with the range @a original_start, @a original_length in the "original"
* datasource, and also conflicts with the range @a modified_start,
* @a modified_length in the "modified" datasource.
* If there are common ranges in the "modified" and "latest" datasources
* in this conflicting range, @a resolved_diff will contain a diff
* which can be used to retrieve the common and conflicting ranges.
*/
svn_error_t *(*output_conflict)(void *output_baton,
apr_off_t original_start,
apr_off_t original_length,
apr_off_t modified_start,
apr_off_t modified_length,
apr_off_t latest_start,
apr_off_t latest_length,
svn_diff_t *resolved_diff);
} svn_diff_output_fns_t;
/** Given a vtable of @a output_fns/@a output_baton for consuming
* differences, output the differences in @a diff.
*/
svn_error_t *
svn_diff_output(svn_diff_t *diff,
void *output_baton,
const svn_diff_output_fns_t *output_fns);
/* Diffs on files */
/** A convenience function to produce a diff between two files.
*
* Return a diff object in @a *diff (allocated from @a pool) that represents
* the difference between an @a original file and @a modified file.
* (The file arguments must be full paths to the files.)
*/
svn_error_t *
svn_diff_file_diff(svn_diff_t **diff,
const char *original,
const char *modified,
apr_pool_t *pool);
/** A convenience function to produce a diff between three files.
*
* Return a diff object in @a *diff (allocated from @a pool) that represents
* the difference between an @a original file, @a modified file, and @a latest
* file. (The file arguments must be full paths to the files.)
*/
svn_error_t *
svn_diff_file_diff3(svn_diff_t **diff,
const char *original,
const char *modified,
const char *latest,
apr_pool_t *pool);
/** A convenience function to produce a diff between four files.
*
* Return a diff object in @a *diff (allocated from @a pool) that represents
* the difference between an @a original file, @a modified file, @a latest
* and @a ancestor file. (The file arguments must be full paths to the files.)
*/
svn_error_t *
svn_diff_file_diff4(svn_diff_t **diff,
const char *original,
const char *modified,
const char *latest,
const char *ancestor,
apr_pool_t *pool);
/** A convenience function to produce unified diff output from the
* diff generated by @c svn_diff_file.
*
* Output a @a diff between @a original_path and @a modified_path in unified
* context diff format to @a output_file. Optionally supply @a original_header
* and/or @a modified_header to be displayed in the header of the output.
* If @a original_header or @a modified_header is @c NULL, a default header
* will be displayed, consisting of path and last modified time.
*/
svn_error_t *
svn_diff_file_output_unified(svn_stream_t *output_stream,
svn_diff_t *diff,
const char *original_path,
const char *modified_path,
const char *original_header,
const char *modified_header,
apr_pool_t *pool);
/** A convenience function to produce diff3 output from the
* diff generated by @c svn_diff3_file.
*
* Output a @a diff between @a original_path, @a modified_path and
* @a latest_path in merged format to @a output_file. Optionally supply
* @a conflict_modified, @a conflict_original, @a conflict_separator and/or
* @a conflict_latest to be displayed as conflict markers in the output.
* If @a conflict_original, @a conflict_modified, @a conflict_latest and/or
* @a conflict_separator is @c NULL, a default marker will be displayed.
* Set @a display_original_in_conflict and @a display_resolved_conflicts
* as desired. Note that these options are mutually exclusive.
*/
svn_error_t *
svn_diff_file_output_merge(svn_stream_t *output_stream,
svn_diff_t *diff,
const char *original_path,
const char *modified_path,
const char *latest_path,
const char *conflict_original,
const char *conflict_modified,
const char *conflict_latest,
const char *conflict_separator,
svn_boolean_t display_original_in_conflict,
svn_boolean_t display_resolved_conflicts,
apr_pool_t *pool);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* SVN_DIFF_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -