52 #include <apr_pools.h>
53 #include <apr_tables.h>
113 apr_off_t *prefix_lines,
114 apr_off_t *suffix_lines,
116 apr_size_t datasources_len);
126 svn_error_t *(*datasource_get_next_token)(apr_uint32_t *hash,
void **token,
163 svn_error_t *(*datasource_get_next_token)(apr_uint32_t *hash,
void **token,
172 void (*token_discard)(
void *diff_baton,
175 void (*token_discard_all)(
void *diff_baton);
307 apr_off_t original_start,
308 apr_off_t original_length,
309 apr_off_t modified_start,
310 apr_off_t modified_length,
311 apr_off_t latest_start,
312 apr_off_t latest_length);
326 apr_off_t original_start,
327 apr_off_t original_length,
328 apr_off_t modified_start,
329 apr_off_t modified_length,
330 apr_off_t latest_start,
331 apr_off_t latest_length);
340 apr_off_t original_start,
341 apr_off_t original_length,
342 apr_off_t modified_start,
343 apr_off_t modified_length,
344 apr_off_t latest_start,
345 apr_off_t latest_length);
352 apr_off_t original_start,
353 apr_off_t original_length,
354 apr_off_t modified_start,
355 apr_off_t modified_length,
356 apr_off_t latest_start,
357 apr_off_t latest_length);
369 apr_off_t original_start,
370 apr_off_t original_length,
371 apr_off_t modified_start,
372 apr_off_t modified_length,
373 apr_off_t latest_start,
374 apr_off_t latest_length,
488 const apr_array_header_t *args,
504 const char *original,
505 const char *modified,
517 const char *original,
518 const char *modified,
533 const char *original,
534 const char *modified,
547 const char *original,
548 const char *modified,
564 const char *original,
565 const char *modified,
567 const char *ancestor,
579 const char *original,
580 const char *modified,
582 const char *ancestor,
606 const char *original_path,
607 const char *modified_path,
608 const char *original_header,
609 const char *modified_header,
610 const char *header_encoding,
611 const char *relative_to_dir,
624 const char *original_path,
625 const char *modified_path,
626 const char *original_header,
627 const char *modified_header,
628 const char *header_encoding,
640 const char *original_path,
641 const char *modified_path,
642 const char *original_header,
643 const char *modified_header,
663 const char *original_path,
664 const char *modified_path,
665 const char *latest_path,
666 const char *conflict_original,
667 const char *conflict_modified,
668 const char *conflict_latest,
669 const char *conflict_separator,
692 const char *original_path,
693 const char *modified_path,
694 const char *latest_path,
695 const char *conflict_original,
696 const char *conflict_modified,
697 const char *conflict_latest,
698 const char *conflict_separator,
771 const char *hunk_delimiter,
772 const char *original_header,
773 const char *modified_header,
774 const char *header_encoding,
788 const char *original_header,
789 const char *modified_header,
790 const char *header_encoding,
813 const char *conflict_original,
814 const char *conflict_modified,
815 const char *conflict_latest,
816 const char *conflict_separator,
841 const char *conflict_original,
842 const char *conflict_modified,
843 const char *conflict_latest,
844 const char *conflict_separator,
861 svn_diff_op_unchanged,
939 apr_pool_t *result_pool,
940 apr_pool_t *scratch_pool);
959 apr_pool_t *result_pool,
960 apr_pool_t *scratch_pool);
974 apr_pool_t *result_pool,
975 apr_pool_t *scratch_pool);
1058 const char *new_filename;
1090 const char *local_abspath,
1091 apr_pool_t *result_pool);
1108 apr_pool_t *result_pool,
1109 apr_pool_t *scratch_pool);
1119 apr_pool_t *scratch_pool);
Options to control the behaviour of the file diff routines.
svn_error_t * svn_diff_open_patch_file(svn_patch_file_t **patch_file, const char *local_abspath, apr_pool_t *result_pool)
Open patch_file at local_abspath.
Counted-length strings for Subversion, plus some C string goodies.
struct svn_diff_fns2_t svn_diff_fns2_t
A vtable for reading data from the three datasources.
svn_error_t * svn_diff_hunk_readline_diff_text(svn_diff_hunk_t *hunk, svn_stringbuf_t **stringbuf, const char **eol, svn_boolean_t *eof, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Allocate *stringbuf in result_pool, and read into it one line of the diff text of hunk...
A vtable for displaying (or consuming) differences between datasources.
svn_error_t * svn_diff_mem_string_diff(svn_diff_t **diff, const svn_string_t *original, const svn_string_t *modified, const svn_diff_file_options_t *options, apr_pool_t *pool)
Generate diff output from the original and modified in-memory strings.
svn_linenum_t svn_diff_hunk_get_original_length(const svn_diff_hunk_t *hunk)
Return the number of lines in the original hunk text, as parsed from the hunk header.
struct svn_prop_patch_t svn_prop_patch_t
Data type to manage parsing of properties in patches.
svn_linenum_t svn_diff_hunk_get_trailing_context(const svn_diff_hunk_t *hunk)
Return the number of lines of trailing context of hunk, i.e.
svn_error_t * svn_diff_diff_2(svn_diff_t **diff, void *diff_baton, const svn_diff_fns2_t *diff_fns, apr_pool_t *pool)
Given a vtable of diff_fns/diff_baton for reading datasources, return a diff object in *diff that rep...
Ignore changes in sequences of whitespace characters, treating each sequence of whitespace characters...
svn_boolean_t ignore_eol_style
Whether to treat all end-of-line markers the same when comparing lines.
struct svn_diff_t svn_diff_t
An opaque type that represents a difference between either two or three datasources.
svn_error_t * svn_diff_diff4_2(svn_diff_t **diff, void *diff_baton, const svn_diff_fns2_t *diff_fns, apr_pool_t *pool)
Given a vtable of diff_fns/diff_baton for reading datasources, return a diff object in *diff that rep...
svn_error_t * svn_diff_file_options_parse(svn_diff_file_options_t *options, const apr_array_header_t *args, apr_pool_t *pool)
Parse args, an array of const char * command line switches and adjust options accordingly.
svn_linenum_t svn_diff_hunk_get_modified_start(const svn_diff_hunk_t *hunk)
Return the line offset of the modified hunk text, as parsed from the hunk header. ...
svn_boolean_t show_c_function
Whether the "@@" lines of the unified diff output should include a prefix of the nearest preceding li...
svn_error_t * svn_diff_diff(svn_diff_t **diff, void *diff_baton, const svn_diff_fns_t *diff_fns, apr_pool_t *pool)
Like svn_diff_diff_2() but using svn_diff_fns_t instead of svn_diff_fns2_t.
const char * old_filename
The old and new file names as retrieved from the patch file.
Display modified and latest, with conflict markers.
svn_boolean_t reverse
Indicates whether the patch is being interpreted in reverse.
Display modified, original, and latest, with conflict markers.
General file I/O for Subversion.
svn_diff_file_ignore_space_t ignore_space
To what extent whitespace should be ignored when comparing lines.
struct svn_diff_output_fns_t svn_diff_output_fns_t
A vtable for displaying (or consuming) differences between datasources.
Data type to manage parsing of patches.
svn_diff_datasource_e
There are four types of datasources.
svn_error_t * svn_diff_mem_string_output_merge(svn_stream_t *output_stream, svn_diff_t *diff, const svn_string_t *original, const svn_string_t *modified, const svn_string_t *latest, 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)
Similar to svn_diff_mem_string_output_merge2, but with display_original_in_conflict and display_resol...
Just display modified, with no markers.
void(* token_discard_all)(void *diff_baton)
Free all tokens from memory, they're no longer needed.
The common ancestor of original and modified.
svn_error_t * svn_diff_file_output_unified3(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, const char *header_encoding, const char *relative_to_dir, svn_boolean_t show_c_function, apr_pool_t *pool)
A convenience function to produce unified diff output from the diff generated by svn_diff_file_diff()...
svn_error_t * svn_diff_file_output_merge2(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_diff_conflict_display_style_t conflict_style, apr_pool_t *pool)
A convenience function to produce diff3 output from the diff generated by svn_diff_file_diff3().
struct svn_patch_t svn_patch_t
Data type to manage parsing of patches.
apr_hash_t * prop_patches
A hash table keyed by property names containing svn_prop_patch_t object for each property parsed from...
void svn_diff_hunk_reset_modified_text(svn_diff_hunk_t *hunk)
Reset the modified text of hunk so it can be read again from the start.
svn_error_t * svn_diff_hunk_readline_original_text(svn_diff_hunk_t *hunk, svn_stringbuf_t **stringbuf, const char **eol, svn_boolean_t *eof, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Allocate *stringbuf in result_pool, and read into it one line of the original text of hunk...
apr_array_header_t * hunks
An array containing an svn_diff_hunk_t * for each hunk parsed from the patch.
const svn_version_t * svn_diff_version(void)
Get libsvn_diff version information.
struct svn_diff_file_options_t svn_diff_file_options_t
Options to control the behaviour of the file diff routines.
A vtable for reading data from the three datasources.
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)
Similar to svn_diff_file_output_unified2(), but with header_encoding set to APR_LOCALE_CHARSET.
svn_error_t * svn_diff_mem_string_output_unified(svn_stream_t *output_stream, svn_diff_t *diff, const char *original_header, const char *modified_header, const char *header_encoding, const svn_string_t *original, const svn_string_t *modified, apr_pool_t *pool)
Similar to svn_diff_mem_string_output_unified2() but with with_diff_header always set to TRUE and hun...
svn_diff_file_ignore_space_t
To what extent whitespace should be ignored when comparing lines.
void(* token_discard)(void *diff_baton, void *token)
Free token from memory, the diff algorithm is done with it.
struct svn_diff_fns_t svn_diff_fns_t
Like svn_diff_fns2_t except with datasource_open() instead of datasources_open(). ...
void svn_diff_hunk_reset_original_text(svn_diff_hunk_t *hunk)
Reset the original text of hunk so it can be read again from the start.
struct svn_patch_file_t svn_patch_file_t
An opaque type representing an open patch file.
svn_boolean_t svn_diff_contains_conflicts(svn_diff_t *diff)
Determine if a diff object contains conflicts.
enum svn_diff_operation_kind_e svn_diff_operation_kind_t
Describes what operation has been performed on a file.
The latest version of the data, possibly different than the user's modified version.
svn_error_t * svn_diff_diff3(svn_diff_t **diff, void *diff_baton, const svn_diff_fns_t *diff_fns, apr_pool_t *pool)
Like svn_diff_diff3_2() but using svn_diff_fns_t instead of svn_diff_fns2_t.
svn_error_t * svn_diff_mem_string_diff3(svn_diff_t **diff, const svn_string_t *original, const svn_string_t *modified, const svn_string_t *latest, const svn_diff_file_options_t *options, apr_pool_t *pool)
Generate diff output from the original, modified and latest in-memory strings.
svn_error_t * svn_diff_mem_string_output_merge2(svn_stream_t *output_stream, svn_diff_t *diff, const svn_string_t *original, const svn_string_t *modified, const svn_string_t *latest, const char *conflict_original, const char *conflict_modified, const char *conflict_latest, const char *conflict_separator, svn_diff_conflict_display_style_t style, apr_pool_t *pool)
Output the diff generated by svn_diff_mem_string_diff3() in diff3 format on output_stream, using original, modified and latest for content changes.
svn_error_t * svn_diff_file_diff(svn_diff_t **diff, const char *original, const char *modified, apr_pool_t *pool)
Similar to svn_file_diff_2(), but with options set to a struct with default options.
svn_error_t * svn_diff_file_diff_2(svn_diff_t **diff, const char *original, const char *modified, const svn_diff_file_options_t *options, apr_pool_t *pool)
A convenience function to produce a diff between two files.
unsigned long svn_linenum_t
A line number, such as in a file or a stream.
svn_error_t * svn_diff_diff3_2(svn_diff_t **diff, void *diff_baton, const svn_diff_fns2_t *diff_fns, apr_pool_t *pool)
Given a vtable of diff_fns/diff_baton for reading datasources, return a diff object in *diff that rep...
svn_linenum_t svn_diff_hunk_get_original_start(const svn_diff_hunk_t *hunk)
Return the line offset of the original hunk text, as parsed from the hunk header. ...
Just display latest, with no markers.
struct svn_stream_t svn_stream_t
An abstract stream of bytes–either incoming or outgoing or both.
svn_diff_operation_kind_e
Describes what operation has been performed on a file.
svn_error_t * svn_diff_output(svn_diff_t *diff, void *output_baton, const svn_diff_output_fns_t *output_fns)
Given a vtable of output_fns/output_baton for consuming differences, output the differences in diff...
Subversion's data types.
svn_linenum_t svn_diff_hunk_get_leading_context(const svn_diff_hunk_t *hunk)
Return the number of lines of leading context of hunk, i.e.
svn_error_t * svn_diff_close_patch_file(svn_patch_file_t *patch_file, apr_pool_t *scratch_pool)
Dispose of patch_file.
struct svn_diff_hunk_t svn_diff_hunk_t
A single hunk inside a patch.
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)
Similar to svn_diff_file_output_merge2, but with display_original_in_conflict and display_resolved_co...
Like svn_diff_conflict_display_modified_latest, but with an extra effort to identify common sequences...
svn_error_t * svn_diff_mem_string_diff4(svn_diff_t **diff, const svn_string_t *original, const svn_string_t *modified, const svn_string_t *latest, const svn_string_t *ancestor, const svn_diff_file_options_t *options, apr_pool_t *pool)
Generate diff output from the original, modified and latest in-memory strings, using ancestor...
#define SVN_DEPRECATED
Macro used to mark deprecated functions.
Data type to manage parsing of properties in patches.
svn_error_t * svn_diff_file_diff3_2(svn_diff_t **diff, const char *original, const char *modified, const char *latest, const svn_diff_file_options_t *options, apr_pool_t *pool)
A convenience function to produce a diff between three files.
svn_diff_file_options_t * svn_diff_file_options_create(apr_pool_t *pool)
Allocate a svn_diff_file_options_t structure in pool, initializing it with default values...
svn_boolean_t svn_diff_contains_diffs(svn_diff_t *diff)
Determine if a diff object contains actual differences between the datasources.
svn_error_t * svn_diff_hunk_readline_modified_text(svn_diff_hunk_t *hunk, svn_stringbuf_t **stringbuf, const char **eol, svn_boolean_t *eof, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Like svn_diff_hunk_readline_original_text(), but it returns lines from the modified text of the hunk...
svn_error_t * svn_diff_file_output_unified2(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, const char *header_encoding, apr_pool_t *pool)
Similar to svn_diff_file_output_unified3(), but with relative_to_dir set to NULL and show_c_function ...
Like svn_diff_fns2_t except with datasource_open() instead of datasources_open(). ...
svn_error_t * svn_diff_file_diff4_2(svn_diff_t **diff, const char *original, const char *modified, const char *latest, const char *ancestor, const svn_diff_file_options_t *options, apr_pool_t *pool)
A convenience function to produce a diff between four files.
Like svn_diff_conflict_display_modified_original_latest, but only* showing conflicts.
svn_error_t * svn_diff_mem_string_output_unified2(svn_stream_t *output_stream, svn_diff_t *diff, svn_boolean_t with_diff_header, const char *hunk_delimiter, const char *original_header, const char *modified_header, const char *header_encoding, const svn_string_t *original, const svn_string_t *modified, apr_pool_t *pool)
Outputs the diff object generated by svn_diff_mem_string_diff() in unified diff format on output_stre...
Ignore all whitespace characters.
svn_diff_operation_kind_t operation
Represents the operation performed on the property.
void svn_diff_hunk_reset_diff_text(svn_diff_hunk_t *hunk)
Reset the diff text of hunk so it can be read again from the start.
svn_linenum_t svn_diff_hunk_get_modified_length(const svn_diff_hunk_t *hunk)
Return the number of lines in the modified hunk text, as parsed from the hunk header.
The oldest form of the data.
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)
Similar to svn_file_diff4_2(), but with options set to a struct with default options.
svn_error_t * svn_diff_parse_next_patch(svn_patch_t **patch, svn_patch_file_t *patch_file, svn_boolean_t reverse, svn_boolean_t ignore_whitespace, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Return the next *patch in patch_file.
int svn_boolean_t
YABT: Yet Another Boolean Type.
apr_array_header_t * hunks
An array containing an svn_diff_hunk_t object for each hunk parsed from the patch associated with our...
The same data, but potentially changed by the user.
svn_error_t * svn_diff_file_diff3(svn_diff_t **diff, const char *original, const char *modified, const char *latest, apr_pool_t *pool)
Similar to svn_diff_file_diff3_2(), but with options set to a struct with default options...
svn_error_t * svn_diff_diff4(svn_diff_t **diff, void *diff_baton, const svn_diff_fns_t *diff_fns, apr_pool_t *pool)
Like svn_diff_diff4_2() but using svn_diff_fns_t instead of svn_diff_fns2_t.
svn_diff_conflict_display_style_t
Style for displaying conflicts during diff3 output.
A buffered string, capable of appending without an allocation and copy for each append.
svn_diff_operation_kind_t operation
Represents the operation performed on the file.