# svn_wc_diff_callbacks4_t Struct Reference
[Working copy management]

A callback vtable invoked by our diff-editors, as they receive diffs from the server. More...

`#include <svn_wc.h>`

## Data Fields
svn_error_t *(* | file_opened )(svn_boolean_t *tree_conflicted, svn_boolean_t *skip, const char *path, svn_revnum_t rev, void *diff_baton, apr_pool_t *scratch_pool)
| This function is called before file_changed to allow callbacks to skip the most expensive processing of retrieving the file data.
svn_error_t *(* | file_changed )(svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, const char *tmpfile1, const char *tmpfile2, svn_revnum_t rev1, svn_revnum_t rev2, const char *mimetype1, const char *mimetype2, const apr_array_header_t *propchanges, apr_hash_t *originalprops, void *diff_baton, apr_pool_t *scratch_pool)
| A file path has changed.
svn_error_t *(* | file_added )(svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, const char *tmpfile1, const char *tmpfile2, svn_revnum_t rev1, svn_revnum_t rev2, const char *mimetype1, const char *mimetype2, const char *copyfrom_path, svn_revnum_t copyfrom_revision, const apr_array_header_t *propchanges, apr_hash_t *originalprops, void *diff_baton, apr_pool_t *scratch_pool)
| A file path was added.
svn_error_t *(* | file_deleted )(svn_wc_notify_state_t *state, svn_boolean_t *tree_conflicted, const char *path, const char *tmpfile1, const char *tmpfile2, const char *mimetype1, const char *mimetype2, apr_hash_t *originalprops, void *diff_baton, apr_pool_t *scratch_pool)
| A file path was deleted.
svn_error_t *(* | dir_deleted )(svn_wc_notify_state_t *state, svn_boolean_t *tree_conflicted, const char *path, void *diff_baton, apr_pool_t *scratch_pool)
| A directory path was deleted.
svn_error_t *(* | dir_opened )(svn_boolean_t *tree_conflicted, svn_boolean_t *skip, svn_boolean_t *skip_children, const char *path, svn_revnum_t rev, void *diff_baton, apr_pool_t *scratch_pool)
| A directory path has been opened.
svn_error_t *(* | dir_added )(svn_wc_notify_state_t *state, svn_boolean_t *tree_conflicted, svn_boolean_t *skip, svn_boolean_t *skip_children, const char *path, svn_revnum_t rev, const char *copyfrom_path, svn_revnum_t copyfrom_revision, void *diff_baton, apr_pool_t *scratch_pool)
| A directory path was added.
svn_error_t *(* | dir_props_changed )(svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, svn_boolean_t dir_was_added, const apr_array_header_t *propchanges, apr_hash_t *original_props, void *diff_baton, apr_pool_t *scratch_pool)
| A list of property changes (propchanges) was applied to the directory path.
svn_error_t *(* | dir_closed )(svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, svn_boolean_t dir_was_added, void *diff_baton, apr_pool_t *scratch_pool)
| A directory path which has been opened with dir_opened or dir_added has been closed.

## Detailed Description

A callback vtable invoked by our diff-editors, as they receive diffs from the server.

'svn diff' and 'svn merge' implement their own versions of this vtable.

Common parameters:

If state is non-NULL, set *state to the state of the item after the operation has been performed. (In practice, this is only useful with merge, not diff; diff callbacks will probably set *state to svn_wc_notify_state_unknown, since they do not change the state and therefore do not bother to know the state after the operation.) By default, state refers to the item's content state. Functions concerned with property state have separate contentstate and propstate arguments.

If tree_conflicted is non-NULL, set *tree_conflicted to true if this operation caused a tree conflict, else to false. (Like with state, this is only useful with merge, not diff; diff callbacks should set this to false.)

Since:
  New in 1.7.

Definition at line 2122 of file svn_wc.h.

## Field Documentation

svn_error_t*(* svn_wc_diff_callbacks4_t::dir_added)(svn_wc_notify_state_t *state, svn_boolean_t *tree_conflicted, svn_boolean_t *skip, svn_boolean_t *skip_children, const char *path, svn_revnum_t rev, const char *copyfrom_path, svn_revnum_t copyfrom_revision, void *diff_baton, apr_pool_t *scratch_pool)

A directory path was added.

rev is the revision that the directory came from.

This function is called for any new directory path before any of the callbacks are called for a child of path.

If copyfrom_path is non-`NULL`, this add has history (i.e., is a copy), and the origin of the copy may be recorded as copyfrom_path under copyfrom_revision.

Definition at line 2263 of file svn_wc.h.

svn_error_t*(* svn_wc_diff_callbacks4_t::dir_closed)(svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, svn_boolean_t dir_was_added, void *diff_baton, apr_pool_t *scratch_pool)

A directory path which has been opened with dir_opened or dir_added has been closed.

dir_was_added is set to TRUE if the directory was added, and to FALSE if the directory pre-existed.

Definition at line 2299 of file svn_wc.h.

svn_error_t*(* svn_wc_diff_callbacks4_t::dir_opened)(svn_boolean_t *tree_conflicted, svn_boolean_t *skip, svn_boolean_t *skip_children, const char *path, svn_revnum_t rev, void *diff_baton, apr_pool_t *scratch_pool)

A directory path has been opened.

rev is the revision that the directory came from.

This function is called for any existing directory path before any of the callbacks are called for a child of path.

If the callback returns `TRUE` in *skip_children, children of this directory will be skipped.

Definition at line 2244 of file svn_wc.h.

svn_error_t*(* svn_wc_diff_callbacks4_t::dir_props_changed)(svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, svn_boolean_t dir_was_added, const apr_array_header_t *propchanges, apr_hash_t *original_props, void *diff_baton, apr_pool_t *scratch_pool)

A list of property changes (propchanges) was applied to the directory path.

The array is a list of (svn_prop_t) structures.

dir_was_added is set to TRUE if the directory was added, and to FALSE if the directory pre-existed.

Definition at line 2283 of file svn_wc.h.

svn_error_t*(* svn_wc_diff_callbacks4_t::file_added)(svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, const char *tmpfile1, const char *tmpfile2, svn_revnum_t rev1, svn_revnum_t rev2, const char *mimetype1, const char *mimetype2, const char *copyfrom_path, svn_revnum_t copyfrom_revision, const apr_array_header_t *propchanges, apr_hash_t *originalprops, void *diff_baton, apr_pool_t *scratch_pool)

A file path was added.

The contents can be seen by comparing tmpfile1 and tmpfile2, which represent rev1 and rev2 of the file, respectively. (If either file is empty, the rev will be 0.)

If known, the `svn:mime-type` value of each file is passed into mimetype1 and mimetype2; either or both of the values can be NULL. The implementor can use this information to decide if (or how) to generate differences.

propchanges is an array of (svn_prop_t) structures. If it contains any elements, the original list of properties is provided in originalprops, which is a hash of svn_string_t values, keyed on the property name. If copyfrom_path is non-`NULL`, this add has history (i.e., is a copy), and the origin of the copy may be recorded as copyfrom_path under copyfrom_revision.

Definition at line 2187 of file svn_wc.h.

svn_error_t*(* svn_wc_diff_callbacks4_t::file_changed)(svn_wc_notify_state_t *contentstate, svn_wc_notify_state_t *propstate, svn_boolean_t *tree_conflicted, const char *path, const char *tmpfile1, const char *tmpfile2, svn_revnum_t rev1, svn_revnum_t rev2, const char *mimetype1, const char *mimetype2, const apr_array_header_t *propchanges, apr_hash_t *originalprops, void *diff_baton, apr_pool_t *scratch_pool)

A file path has changed.

If tmpfile2 is non-NULL, the contents have changed and those changes can be seen by comparing tmpfile1 and tmpfile2, which represent rev1 and rev2 of the file, respectively.

If known, the `svn:mime-type` value of each file is passed into mimetype1 and mimetype2; either or both of the values can be NULL. The implementor can use this information to decide if (or how) to generate differences.

propchanges is an array of (svn_prop_t) structures. If it contains any elements, the original list of properties is provided in originalprops, which is a hash of svn_string_t values, keyed on the property name.

Definition at line 2153 of file svn_wc.h.

svn_error_t*(* svn_wc_diff_callbacks4_t::file_deleted)(svn_wc_notify_state_t *state, svn_boolean_t *tree_conflicted, const char *path, const char *tmpfile1, const char *tmpfile2, const char *mimetype1, const char *mimetype2, apr_hash_t *originalprops, void *diff_baton, apr_pool_t *scratch_pool)

A file path was deleted.

The [loss of] contents can be seen by comparing tmpfile1 and tmpfile2. originalprops provides the properties of the file. ### Some existing callers include WC "entry props" in originalprops.

If known, the `svn:mime-type` value of each file is passed into mimetype1 and mimetype2; either or both of the values can be NULL. The implementor can use this information to decide if (or how) to generate differences.

Definition at line 2215 of file svn_wc.h.

The documentation for this struct was generated from the following file:

- svn_wc.h

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines