35 #include <apr_pools.h> 37 #include <apr_tables.h> 38 #include <apr_file_io.h> 56 #define SVN_DELTA_COMPRESSION_LEVEL_NONE 0 62 #define SVN_DELTA_COMPRESSION_LEVEL_MAX 9 70 #define SVN_DELTA_COMPRESSION_LEVEL_DEFAULT 5 256 const char *sbuf,
char *tbuf,
296 apr_pool_t *result_pool,
297 apr_pool_t *scratch_pool);
330 typedef const unsigned char *
331 (*svn_txdelta_md5_digest_fn_t)(
void *baton);
342 apr_pool_t *result_pool,
343 apr_pool_t *scratch_pool);
374 const unsigned char *
452 unsigned char *digest,
504 unsigned char *result_digest,
505 const char *error_info,
508 void **handler_baton);
529 void **handler_baton,
532 int compression_level,
544 void **handler_baton,
559 void **handler_baton);
572 int compression_level,
893 apr_pool_t *scratch_pool);
909 apr_pool_t *result_pool,
931 apr_pool_t *scratch_pool);
949 const char *copyfrom_path,
951 apr_pool_t *result_pool,
968 apr_pool_t *result_pool,
985 apr_pool_t *scratch_pool);
995 apr_pool_t *scratch_pool);
1008 apr_pool_t *scratch_pool);
1036 const char *copyfrom_path,
1038 apr_pool_t *result_pool,
1059 apr_pool_t *result_pool,
1086 const char *base_checksum,
1087 apr_pool_t *result_pool,
1089 void **handler_baton);
1105 apr_pool_t *scratch_pool);
1121 const char *text_checksum,
1122 apr_pool_t *scratch_pool);
1134 apr_pool_t *scratch_pool);
1142 apr_pool_t *scratch_pool);
1150 apr_pool_t *scratch_pool);
1179 const char *base_checksum,
1182 apr_pool_t *scratch_pool);
1202 svn_delta_editor_t *
1227 const svn_delta_editor_t *wrapped_editor,
1228 void *wrapped_baton,
1229 const svn_delta_editor_t **editor,
1270 const svn_delta_editor_t *wrapped_editor,
1271 void *wrapped_edit_baton,
1310 void *callback_baton,
1335 const apr_array_header_t *paths,
1338 void *callback_baton,
1339 apr_pool_t *scratch_pool);
1356 const apr_array_header_t *paths,
1358 void *callback_baton,
1359 apr_pool_t *scratch_pool);
1395 apr_hash_t *rev_props,
1399 apr_array_header_t *prop_diffs,
1417 apr_hash_t *rev_props,
1420 apr_array_header_t *prop_diffs,
1438 void **handler2_baton,
1440 void *handler_baton,
Counted-length strings for Subversion, plus some C string goodies.
svn_error_t * svn_txdelta_send_contents(const unsigned char *contents, apr_size_t len, svn_txdelta_window_handler_t handler, void *handler_baton, apr_pool_t *pool)
Send the contents of length len as a txdelta against an empty source directly to window-handler handl...
svn_depth_t
The concept of depth for directories.
void svn_txdelta_to_svndiff3(svn_txdelta_window_handler_t *handler, void **handler_baton, svn_stream_t *output, int svndiff_version, int compression_level, apr_pool_t *pool)
Prepare to produce an svndiff-format diff from text delta windows.
svn_checksum_kind_t
Various types of checksums.
void svn_txdelta_apply_instructions(svn_txdelta_window_t *window, const char *sbuf, char *tbuf, apr_size_t *tlen)
Apply the instructions from window to a source view sbuf to produce a target view tbuf...
int num_ops
The number of instructions in this window.
struct svn_delta_editor_t svn_delta_editor_t
A structure full of callback functions the delta source will invoke as it produces the delta...
void svn_txdelta2(svn_txdelta_stream_t **stream, svn_stream_t *source, svn_stream_t *target, svn_boolean_t calculate_checksum, apr_pool_t *pool)
Set *stream to a pointer to a delta stream that will turn the byte string from source into the byte s...
apr_size_t offset
Offset of delta, see svn_delta_action for more details.
General file I/O for Subversion.
Subversion checksum routines.
apr_size_t tview_len
The length of the target view for this window, i.e.
int src_ops
The number of svn_txdelta_source instructions in this window.
svn_error_t * svn_txdelta_send_txstream(svn_txdelta_stream_t *txstream, svn_txdelta_window_handler_t handler, void *handler_baton, apr_pool_t *pool)
Send the contents of txstream to window-handler handler/baton.
enum svn_delta_action action_code
Action code of delta instruction.
svn_stream_t * svn_txdelta_target_push(svn_txdelta_window_handler_t handler, void *handler_baton, svn_stream_t *source, apr_pool_t *pool)
Return a writable stream which, when fed target data, will send delta windows to handler/handler_bato...
A structure full of callback functions the delta source will invoke as it produces the delta...
const svn_txdelta_op_t * ops
The instructions for this window.
svn_stream_t * svn_txdelta_parse_svndiff(svn_txdelta_window_handler_t handler, void *handler_baton, svn_boolean_t error_on_early_close, apr_pool_t *pool)
Return a writable generic stream which will parse svndiff-format data into a text delta...
svn_error_t *(* svn_txdelta_stream_open_func_t)(svn_txdelta_stream_t **txdelta_stream, void *baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
A typedef for a function that opens an svn_txdelta_stream_t object, allocated in result_pool.
svn_error_t * svn_txdelta_next_window(svn_txdelta_window_t **window, svn_txdelta_stream_t *stream, apr_pool_t *pool)
Set *window to a pointer to the next window from the delta stream stream.
svn_delta_action
Action codes for text delta instructions.
svn_error_t * svn_txdelta_read_svndiff_window(svn_txdelta_window_t **window, svn_stream_t *stream, int svndiff_version, apr_pool_t *pool)
Read and parse one delta window in svndiff format from the readable stream stream and place it in *wi...
void svn_txdelta(svn_txdelta_stream_t **stream, svn_stream_t *source, svn_stream_t *target, apr_pool_t *pool)
Similar to svn_txdelta2 but always calculating the target checksum.
Append the length bytes at offset in the window's new string to the target.
struct svn_txdelta_window_t svn_txdelta_window_t
An svn_txdelta_window_t object describes how to reconstruct a contiguous section of the target string...
struct svn_txdelta_stream_t svn_txdelta_stream_t
A delta stream — this is the hat from which we pull a series of svn_txdelta_window_t objects...
A single text delta instruction.
apr_int64_t svn_filesize_t
The size of a file in the Subversion FS.
svn_error_t *(* svn_txdelta_window_handler_t)(svn_txdelta_window_t *window, void *baton)
A typedef for functions that consume a series of delta windows, for use in caller-pushes interfaces...
apr_size_t length
Number of bytes of delta, see svn_delta_action for more details.
apr_size_t sview_len
The length of the source view for this window.
svn_delta_editor_t * svn_delta_default_editor(apr_pool_t *pool)
Return a default delta editor template, allocated in pool.
Append the length bytes at offset in the target view, to the target.
svn_error_t * svn_txdelta_skip_svndiff_window(apr_file_t *file, int svndiff_version, apr_pool_t *pool)
Read and skip one delta window in svndiff format from the file file.
svn_error_t * svn_delta_get_cancellation_editor(svn_cancel_func_t cancel_func, void *cancel_baton, const svn_delta_editor_t *wrapped_editor, void *wrapped_baton, const svn_delta_editor_t **editor, void **edit_baton, apr_pool_t *pool)
Set *editor and *edit_baton to a cancellation editor that wraps wrapped_editor and wrapped_baton...
svn_error_t *(* svn_txdelta_next_window_fn_t)(svn_txdelta_window_t **window, void *baton, apr_pool_t *pool)
A typedef for a function that will set *window to the next window from a svn_txdelta_stream_t object...
svn_error_t *(* svn_delta_path_driver_cb_func_t)(void **dir_baton, void *parent_baton, void *callback_baton, const char *path, apr_pool_t *pool)
Callback function type for svn_delta_path_driver().
struct svn_txdelta_op_t svn_txdelta_op_t
A single text delta instruction.
svn_error_t *(* svn_file_rev_handler_old_t)(void *baton, const char *path, svn_revnum_t rev, apr_hash_t *rev_props, svn_txdelta_window_handler_t *delta_handler, void **delta_baton, apr_array_header_t *prop_diffs, apr_pool_t *pool)
The old file rev handler interface.
svn_error_t * svn_delta_noop_window_handler(svn_txdelta_window_t *window, void *baton)
A text-delta window handler which does nothing.
struct svn_stream_t svn_stream_t
An abstract stream of bytes–either incoming or outgoing or both.
svn_error_t * svn_delta_depth_filter_editor(const svn_delta_editor_t **editor, void **edit_baton, const svn_delta_editor_t *wrapped_editor, void *wrapped_edit_baton, svn_depth_t requested_depth, svn_boolean_t has_target, apr_pool_t *pool)
Set *editor and *edit_baton to an depth-based filtering editor that wraps wrapped_editor and wrapped_...
svn_txdelta_window_t * svn_txdelta_compose_windows(const svn_txdelta_window_t *window_A, const svn_txdelta_window_t *window_B, apr_pool_t *pool)
Compose two delta windows, yielding a third, allocated in pool.
Subversion's data types.
svn_txdelta_window_t * svn_txdelta_window_dup(const svn_txdelta_window_t *window, apr_pool_t *pool)
Return a deep copy of window, allocated in pool.
A generic checksum representation.
#define SVN_DEPRECATED
Macro used to mark deprecated functions.
svn_error_t *(* svn_cancel_func_t)(void *cancel_baton)
A user defined callback that subversion will call with a user defined baton to see if the current ope...
svn_stream_t * svn_txdelta_to_svndiff_stream(svn_txdelta_stream_t *txstream, int svndiff_version, int compression_level, apr_pool_t *pool)
Return a readable generic stream which will produce svndiff-encoded text delta from the delta stream ...
svn_filesize_t sview_offset
The offset of the source view for this window.
const unsigned char *(* svn_txdelta_md5_digest_fn_t)(void *baton)
A typedef for a function that will return the md5 checksum of the fulltext deltified by a svn_txdelta...
const svn_string_t * new_data
New data, for use by any `svn_txdelta_new' instructions.
long int svn_revnum_t
About Special Files in Subversion.
svn_error_t * svn_txdelta_send_string(const svn_string_t *string, svn_txdelta_window_handler_t handler, void *handler_baton, apr_pool_t *pool)
Send the contents of string to window-handler handler/baton.
Append the length bytes at offset in the source view to the target.
const svn_version_t * svn_delta_version(void)
Get libsvn_delta version information.
svn_error_t * svn_delta_path_driver(const svn_delta_editor_t *editor, void *edit_baton, svn_revnum_t revision, const apr_array_header_t *paths, svn_delta_path_driver_cb_func_t callback_func, void *callback_baton, apr_pool_t *scratch_pool)
Similar to svn_delta_path_driver2, but takes an (unused) revision, and will sort the provided paths u...
svn_error_t * svn_delta_path_driver2(const svn_delta_editor_t *editor, void *edit_baton, const apr_array_header_t *paths, svn_boolean_t sort_paths, svn_delta_path_driver_cb_func_t callback_func, void *callback_baton, apr_pool_t *scratch_pool)
Drive editor (with its edit_baton) to visit each path in paths.
svn_error_t *(* svn_file_rev_handler_t)(void *baton, const char *path, svn_revnum_t rev, apr_hash_t *rev_props, svn_boolean_t result_of_merge, svn_txdelta_window_handler_t *delta_handler, void **delta_baton, apr_array_header_t *prop_diffs, apr_pool_t *pool)
The callback invoked by file rev loopers, such as svn_ra_plugin_t.get_file_revs2() and svn_repos_get_...
svn_error_t * svn_txdelta_send_stream(svn_stream_t *stream, svn_txdelta_window_handler_t handler, void *handler_baton, unsigned char *digest, apr_pool_t *pool)
Send the contents of stream to window-handler handler/baton.
int svn_boolean_t
YABT: Yet Another Boolean Type.
const unsigned char * svn_txdelta_md5_digest(svn_txdelta_stream_t *stream)
Return the md5 digest for the complete fulltext deltified by stream, or NULL if stream has not yet re...
void svn_txdelta_to_svndiff(svn_stream_t *output, apr_pool_t *pool, svn_txdelta_window_handler_t *handler, void **handler_baton)
Similar to svn_txdelta_to_svndiff2, but always using svndiff version 0.
An svn_txdelta_window_t object describes how to reconstruct a contiguous section of the target string...
void svn_txdelta_apply(svn_stream_t *source, svn_stream_t *target, unsigned char *result_digest, const char *error_info, apr_pool_t *pool, svn_txdelta_window_handler_t *handler, void **handler_baton)
Prepare to apply a text delta.
svn_error_t * svn_txdelta_run(svn_stream_t *source, svn_stream_t *target, svn_txdelta_window_handler_t handler, void *handler_baton, svn_checksum_kind_t checksum_kind, svn_checksum_t **checksum, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
This function will generate delta windows that turn source into target, and pushing these windows int...
void svn_txdelta_to_svndiff2(svn_txdelta_window_handler_t *handler, void **handler_baton, svn_stream_t *output, int svndiff_version, apr_pool_t *pool)
Similar to svn_txdelta_to_svndiff3(), but always using the SVN default compression level (SVN_DELTA_C...
svn_txdelta_stream_t * svn_txdelta_stream_create(void *baton, svn_txdelta_next_window_fn_t next_window, svn_txdelta_md5_digest_fn_t md5_digest, apr_pool_t *pool)
Create and return a generic text delta stream with baton, next_window and md5_digest.
void svn_compat_wrap_file_rev_handler(svn_file_rev_handler_t *handler2, void **handler2_baton, svn_file_rev_handler_old_t handler, void *handler_baton, apr_pool_t *pool)
Return, in *handler2 and *handler2_baton a function/baton that will call handler/handler_baton, allocating the *handler2_baton in pool.