Loading...
Searching...
No Matches
svn_delta.h File Reference

Delta-parsing. More...

`#include <apr.h>`
`#include <apr_pools.h>`
`#include <apr_hash.h>`
`#include <apr_tables.h>`
`#include <apr_file_io.h>`
`#include "svn_types.h"`
`#include "svn_string.h"`
`#include "svn_io.h"`
`#include "svn_checksum.h"`

Go to the source code of this file.

## Data Structures

struct | svn_txdelta_op_t
| A single text delta instruction. More...
struct | svn_txdelta_window_t
| An svn_txdelta_window_t object describes how to reconstruct a contiguous section of the target string (the "target view") using a specified contiguous region of the source string (the "source view"). More...

## Macros

#define | SVN_DELTA_COMPRESSION_LEVEL_NONE 0
| This compression level effectively disables data compression.
#define | SVN_DELTA_COMPRESSION_LEVEL_MAX 9
| This is the maximum compression level we can pass to zlib.
#define | SVN_DELTA_COMPRESSION_LEVEL_DEFAULT 5
| This is the default compression level we pass to zlib.

## Typedefs

typedef struct svn_txdelta_op_t | svn_txdelta_op_t
| A single text delta instruction.
typedef 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 (the "target view") using a specified contiguous region of the source string (the "source view").
typedef 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.
typedef 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, which, taken in order, describe the entire target string.
typedef 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.
typedef 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_stream_t object.
typedef 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.
typedef svn_error_t *(* | svn_delta_path_driver_cb_func2_t) (void **dir_baton, const svn_delta_editor_t *editor, void *edit_baton, void *parent_baton, void *callback_baton, const char *relpath, apr_pool_t *pool)
| Callback function type for svn_delta_path_driver().
typedef 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)
| Like svn_delta_path_driver_cb_func2_t but without the editor and edit_baton parameters.
typedef struct svn_delta_path_driver_state_t | svn_delta_path_driver_state_t
| A state object for the path driver that is obtained from svn_delta_path_driver_start() and driven by svn_delta_path_driver_step() and svn_delta_path_driver_finish().
typedef 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_file_revs2().
typedef 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.

## Enumerations

enum | svn_delta_action { svn_txdelta_source , svn_txdelta_target , svn_txdelta_new }
| Action codes for text delta instructions. More...

## Functions

const svn_version_t * | svn_delta_version (void)
| Get libsvn_delta version information.
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.
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.
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.
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 into the handler window handler callback (passing handler_baton to each invocation).
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.
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.
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 returned its final `NULL` window.
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 stream from target.
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.
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_baton which transform the data in source to the target data.
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.
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.
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.
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 handler/handler_baton.
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.
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.
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_COMPRESSION_LEVEL_DEFAULT).
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.
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 txstream.
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, invoking handler with handler_baton whenever a new window is ready.
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 *window, allocating the result in pool.
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_delta_editor_t * | svn_delta_default_editor (apr_pool_t *pool)
| Return a default delta editor template, allocated in pool.
svn_error_t * | svn_delta_noop_window_handler (svn_txdelta_window_t *window, void *baton)
| A text-delta window handler which does nothing.
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_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_baton.
svn_error_t * | svn_delta_path_driver3 (const svn_delta_editor_t *editor, void *edit_baton, const apr_array_header_t *relpaths, svn_boolean_t sort_paths, svn_delta_path_driver_cb_func2_t callback_func, void *callback_baton, apr_pool_t *pool)
| Drive editor (with its edit_baton) to visit each path in relpaths.
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)
| Like svn_delta_path_driver3() but with a different callback function signature.
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 using svn_sort_compare_paths.
svn_error_t * | svn_delta_path_driver_start (svn_delta_path_driver_state_t **state_p, const svn_delta_editor_t *editor, void *edit_baton, svn_delta_path_driver_cb_func2_t callback_func, void *callback_baton, apr_pool_t *result_pool)
| Return a path driver object that can drive editor (with its edit_baton) to visit a series of paths.
svn_error_t * | svn_delta_path_driver_step (svn_delta_path_driver_state_t *state, const char *relpath, apr_pool_t *scratch_pool)
| Visit relpath.
svn_error_t * | svn_delta_path_driver_finish (svn_delta_path_driver_state_t *state, apr_pool_t *scratch_pool)
| Finish driving the editor.
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.

## Variables

svn_error_t *(* | set_target_revision )(void *edit_baton, svn_revnum_t target_revision, apr_pool_t *scratch_pool)
| A structure full of callback functions the delta source will invoke as it produces the delta.
svn_error_t *(* | open_root )(void *edit_baton, svn_revnum_t base_revision, apr_pool_t *result_pool, void **root_baton)
| Set *root_baton to a baton for the top directory of the change.
svn_error_t *(* | delete_entry )(const char *path, svn_revnum_t revision, void *parent_baton, apr_pool_t *scratch_pool)
| Remove the directory entry at path, a child of the directory represented by parent_baton.
svn_error_t *(* | add_directory )(const char *path, void *parent_baton, const char *copyfrom_path, svn_revnum_t copyfrom_revision, apr_pool_t *result_pool, void **child_baton)
| We are going to add a new subdirectory at path, a child of the directory represented by parent_baton.
svn_error_t *(* | open_directory )(const char *path, void *parent_baton, svn_revnum_t base_revision, apr_pool_t *result_pool, void **child_baton)
| We are going to make changes in the subdirectory at path, a child of the directory represented by parent_baton.
svn_error_t *(* | change_dir_prop )(void *dir_baton, const char *name, const svn_string_t *value, apr_pool_t *scratch_pool)
| Change the value of a directory's property.
svn_error_t *(* | close_directory )(void *dir_baton, apr_pool_t *scratch_pool)
| We are done processing a subdirectory, whose baton is dir_baton (set by `add_directory` or `open_directory`).
svn_error_t *(* | absent_directory )(const char *path, void *parent_baton, apr_pool_t *scratch_pool)
| In the directory represented by parent_baton, indicate that path is present as a subdirectory in the edit source, but cannot be conveyed to the edit consumer.
svn_error_t *(* | add_file )(const char *path, void *parent_baton, const char *copyfrom_path, svn_revnum_t copyfrom_revision, apr_pool_t *result_pool, void **file_baton)
| We are going to add a new file at path, a child of the directory represented by parent_baton.
svn_error_t *(* | open_file )(const char *path, void *parent_baton, svn_revnum_t base_revision, apr_pool_t *result_pool, void **file_baton)
| We are going to make changes to a file at path, a child of the directory represented by parent_baton.
svn_error_t *(* | apply_textdelta )(void *file_baton, const char *base_checksum, apr_pool_t *result_pool, svn_txdelta_window_handler_t *handler, void **handler_baton)
| Apply a text delta, yielding the new revision of a file.
svn_error_t *(* | change_file_prop )(void *file_baton, const char *name, const svn_string_t *value, apr_pool_t *scratch_pool)
| Change the value of a file's property.
svn_error_t *(* | close_file )(void *file_baton, const char *text_checksum, apr_pool_t *scratch_pool)
| We are done processing a file, whose baton is file_baton (set by `add_file` or `open_file`).
svn_error_t *(* | absent_file )(const char *path, void *parent_baton, apr_pool_t *scratch_pool)
| In the directory represented by parent_baton, indicate that path is present as a file in the edit source, but cannot be cannot be conveyed to the edit consumer.
svn_error_t *(* | close_edit )(void *edit_baton, apr_pool_t *scratch_pool)
| All delta processing is done.
svn_error_t *(* | abort_edit )(void *edit_baton, apr_pool_t *scratch_pool)
| The editor-driver has decided to bail out.
svn_error_t *(* | apply_textdelta_stream )(const struct svn_delta_editor_t *editor, void *file_baton, const char *base_checksum, svn_txdelta_stream_open_func_t open_func, void *open_baton, apr_pool_t *scratch_pool)
| Apply a text delta stream, yielding the new revision of a file.
| svn_delta_editor_t

## Detailed Description

Delta-parsing.

# autotoc_md37

Definition in file svn_delta.h.

## Macro Definition Documentation

## SVN_DELTA_COMPRESSION_LEVEL_DEFAULT

#define SVN_DELTA_COMPRESSION_LEVEL_DEFAULT 5

This is the default compression level we pass to zlib.

It should be between 0 and 9, with higher numbers resulting in better compression rates but slower operation.

Since
  New in 1.7.

Definition at line 70 of file svn_delta.h.

## SVN_DELTA_COMPRESSION_LEVEL_MAX

#define SVN_DELTA_COMPRESSION_LEVEL_MAX 9

This is the maximum compression level we can pass to zlib.

Since
  New in 1.7.

Definition at line 62 of file svn_delta.h.

## SVN_DELTA_COMPRESSION_LEVEL_NONE

#define SVN_DELTA_COMPRESSION_LEVEL_NONE 0

This compression level effectively disables data compression.

However, the data pre-processing costs may still not be zero.

Since
  New in 1.7.

Definition at line 56 of file svn_delta.h.

## Function Documentation

## svn_delta_version()

const svn_version_t * svn_delta_version | ( | void |  | ) |

Get libsvn_delta version information.

Since
  New in 1.1.