Subversion 1.6.16

svn_delta.h

Go to the documentation of this file.
00001 /**
00002  * @copyright
00003  * ====================================================================
00004  * Copyright (c) 2000-2008 CollabNet.  All rights reserved.
00005  *
00006  * This software is licensed as described in the file COPYING, which
00007  * you should have received as part of this distribution.  The terms
00008  * are also available at http://subversion.tigris.org/license-1.html.
00009  * If newer versions of this license are posted there, you may use a
00010  * newer version instead, at your option.
00011  *
00012  * This software consists of voluntary contributions made by many
00013  * individuals.  For exact contribution history, see the revision
00014  * history and logs, available at http://subversion.tigris.org/.
00015  * ====================================================================
00016  * @endcopyright
00017  *
00018  * @file svn_delta.h
00019  * @brief Delta-parsing
00020  */
00021 
00022 /* ==================================================================== */
00023 
00024 
00025 
00026 #ifndef SVN_DELTA_H
00027 #define SVN_DELTA_H
00028 
00029 #include <apr.h>
00030 #include <apr_pools.h>
00031 #include <apr_hash.h>
00032 #include <apr_tables.h>
00033 #include <apr_file_io.h>  /* for apr_file_t */
00034 
00035 #include "svn_types.h"
00036 #include "svn_string.h"
00037 #include "svn_io.h"
00038 #include "svn_version.h"
00039 #include "svn_checksum.h"
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif /* __cplusplus */
00044 
00045 
00046 
00047 /**
00048  * Get libsvn_delta version information.
00049  *
00050  * @since New in 1.1.
00051  */
00052 const svn_version_t *
00053 svn_delta_version(void);
00054 
00055 /**
00056  * @defgroup delta_support Delta generation and handling
00057  *
00058  * @{
00059  */
00060 
00061 /**  Text deltas.
00062  *
00063  * A text delta represents the difference between two strings of
00064  * bytes, the `source' string and the `target' string.  Given a source
00065  * string and a target string, we can compute a text delta; given a
00066  * source string and a delta, we can reconstruct the target string.
00067  * However, note that deltas are not reversible: you cannot always
00068  * reconstruct the source string given the target string and delta.
00069  *
00070  * Since text deltas can be very large, the interface here allows us
00071  * to produce and consume them in pieces.  Each piece, represented by
00072  * an @c svn_txdelta_window_t structure, describes how to produce the
00073  * next section of the target string.
00074  *
00075  * To compute a new text delta:
00076  *
00077  * - We call svn_txdelta() on the streams we want to compare.  That
00078  *   returns us an @c svn_txdelta_stream_t object.
00079  *
00080  * - We then call svn_txdelta_next_window() on the stream object
00081  *   repeatedly.  Each call returns a new @c svn_txdelta_window_t
00082  *   object, which describes the next portion of the target string.
00083  *   When svn_txdelta_next_window() returns zero, we are done building
00084  *   the target string.
00085  *
00086  * @defgroup svn_delta_txt_delta Text deltas
00087  * @{
00088  */
00089 
00090 /** Action codes for text delta instructions. */
00091 enum svn_delta_action {
00092     /** Append the @a length bytes at @a offset in the source view to the
00093      * target.
00094      *
00095      * It must be the case that 0 <= @a offset < @a offset +
00096      * @a length <= size of source view.
00097      */
00098     svn_txdelta_source,
00099 
00100     /** Append the @a length bytes at @a offset in the target view, to the
00101      * target.
00102      *
00103      * It must be the case that 0 <= @a offset < current position in the
00104      * target view.
00105      *
00106      * However!  @a offset + @a length may be *beyond* the end of the existing
00107      * target data.  "Where the heck does the text come from, then?"
00108      * If you start at @a offset, and append @a length bytes one at a time,
00109      * it'll work out --- you're adding new bytes to the end at the
00110      * same rate you're reading them from the middle.  Thus, if your
00111      * current target text is "abcdefgh", and you get an @c svn_txdelta_target
00112      * instruction whose @a offset is 6 and whose @a length is 7,
00113      * the resulting string is "abcdefghghghghg".  This trick is actually
00114      * useful in encoding long runs of consecutive characters, long runs
00115      * of CR/LF pairs, etc.
00116      */
00117     svn_txdelta_target,
00118 
00119     /** Append the @a length bytes at @a offset in the window's @a new string
00120      * to the target.
00121      *
00122      * It must be the case that 0 <= @a offset < @a offset +
00123      * @a length <= length of @a new.  Windows MUST use new data in ascending
00124      * order with no overlap at the moment; svn_txdelta_to_svndiff()
00125      * depends on this.
00126      */
00127     svn_txdelta_new
00128 };
00129 
00130 /** A single text delta instruction.  */
00131 typedef struct svn_txdelta_op_t
00132 {
00133   /** Action code of delta instruction */
00134   enum svn_delta_action action_code;
00135   /** Offset of delta, see #svn_delta_action for more details. */
00136   apr_size_t offset;
00137    /** Number of bytes of delta, see #svn_delta_action for more details. */
00138   apr_size_t length;
00139 } svn_txdelta_op_t;
00140 
00141 
00142 /** An @c svn_txdelta_window_t object describes how to reconstruct a
00143  * contiguous section of the target string (the "target view") using a
00144  * specified contiguous region of the source string (the "source
00145  * view").  It contains a series of instructions which assemble the
00146  * new target string text by pulling together substrings from:
00147  *
00148  *   - the source view,
00149  *
00150  *   - the previously constructed portion of the target view,
00151  *
00152  *   - a string of new data contained within the window structure
00153  *
00154  * The source view must always slide forward from one window to the
00155  * next; that is, neither the beginning nor the end of the source view
00156  * may move to the left as we read from a window stream.  This
00157  * property allows us to apply deltas to non-seekable source streams
00158  * without making a full copy of the source stream.
00159  */
00160 typedef struct svn_txdelta_window_t
00161 {
00162 
00163   /** The offset of the source view for this window.  */
00164   svn_filesize_t sview_offset;
00165 
00166   /** The length of the source view for this window.  */
00167   apr_size_t sview_len;
00168 
00169   /** The length of the target view for this window, i.e. the number of
00170    * bytes which will be reconstructed by the instruction stream.  */
00171   apr_size_t tview_len;
00172 
00173   /** The number of instructions in this window.  */
00174   int num_ops;
00175 
00176   /** The number of svn_txdelta_source instructions in this window. If
00177    * this number is 0, we don't need to read the source in order to
00178    * reconstruct the target view.
00179    */
00180   int src_ops;
00181 
00182   /** The instructions for this window.  */
00183   const svn_txdelta_op_t *ops;
00184 
00185   /** New data, for use by any `svn_txdelta_new' instructions.  */
00186   const svn_string_t *new_data;
00187 
00188 } svn_txdelta_window_t;
00189 
00190 /**
00191  * Return a deep copy of @a window, allocated in @a pool.
00192  *
00193  * @since New in 1.3.
00194  */
00195 svn_txdelta_window_t *
00196 svn_txdelta_window_dup(const svn_txdelta_window_t *window,
00197                        apr_pool_t *pool);
00198 
00199 /**
00200  * Compose two delta windows, yielding a third, allocated in @a pool.
00201  *
00202  * @since New in 1.4
00203  *
00204  */
00205 svn_txdelta_window_t *
00206 svn_txdelta_compose_windows(const svn_txdelta_window_t *window_A,
00207                             const svn_txdelta_window_t *window_B,
00208                             apr_pool_t *pool);
00209 
00210 /**
00211  * Apply the instructions from @a window to a source view @a sbuf to
00212  *  produce a target view @a tbuf.
00213  *
00214  * @a sbuf is assumed to have @a window->sview_len bytes of data and
00215  * @a tbuf is assumed to have room for @a tlen bytes of output.  @a
00216  * tlen may be more than @a window->tview_len, so return the actual
00217  * number of bytes written.  @a sbuf is not touched and may be NULL if
00218  * @a window contains no source-copy operations. This is purely a
00219  * memory operation; nothing can go wrong as long as we have a valid
00220  * window.
00221  *
00222  * @since New in 1.4
00223  *
00224  */
00225 void
00226 svn_txdelta_apply_instructions(svn_txdelta_window_t *window,
00227                                const char *sbuf, char *tbuf,
00228                                apr_size_t *tlen);
00229 
00230 /** A typedef for functions that consume a series of delta windows, for
00231  * use in caller-pushes interfaces.  Such functions will typically
00232  * apply the delta windows to produce some file, or save the windows
00233  * somewhere.  At the end of the delta window stream, you must call
00234  * this function passing zero for the @a window argument.
00235  */
00236 typedef svn_error_t *(*svn_txdelta_window_handler_t)
00237   (svn_txdelta_window_t *window, void *baton);
00238 
00239 
00240 /** This function will generate delta windows that turn @a source into
00241  * @a target, and pushing these windows into the @a handler window handler
00242  * callback (passing @a handler_baton to each invocation).
00243  *
00244  * If @a checksum is not NULL, then a checksum (of kind @a checksum_kind)
00245  * will be computed for the target stream, and placed into *checksum.
00246  *
00247  * If @a cancel_func is not NULL, then it should refer to a cancellation
00248  * function (along with @a cancel_baton).
00249  *
00250  * Results (the checksum) will be allocated from @a result_pool, and all
00251  * temporary allocations will be performed in @a scratch_pool.
00252  *
00253  * Note: this function replaces the combination of svn_txdelta() and
00254  *   svn_txdelta_send_txstream().
00255  *
00256  * @since New in 1.6.
00257  */
00258 svn_error_t *
00259 svn_txdelta_run(svn_stream_t *source,
00260                 svn_stream_t *target,
00261                 svn_txdelta_window_handler_t handler,
00262                 void *handler_baton,
00263                 svn_checksum_kind_t checksum_kind,
00264                 svn_checksum_t **checksum,
00265                 svn_cancel_func_t cancel_func,
00266                 void *cancel_baton,
00267                 apr_pool_t *result_pool,
00268                 apr_pool_t *scratch_pool);
00269 
00270 
00271 /** A delta stream --- this is the hat from which we pull a series of
00272  * svn_txdelta_window_t objects, which, taken in order, describe the
00273  * entire target string.  This type is defined within libsvn_delta, and
00274  * opaque outside that library.
00275  */
00276 typedef struct svn_txdelta_stream_t svn_txdelta_stream_t;
00277 
00278 
00279 /** A typedef for a function that will set @a *window to the next
00280  * window from a @c svn_txdelta_stream_t object.  If there are no more
00281  * delta windows, NULL will be used.  The returned window, if any,
00282  * will be allocated in @a pool.  @a baton is the baton specified
00283  * when the stream was created.
00284  *
00285  * @since New in 1.4.
00286  */
00287 typedef svn_error_t *
00288 (*svn_txdelta_next_window_fn_t)(svn_txdelta_window_t **window,
00289                                 void *baton,
00290                                 apr_pool_t *pool);
00291 
00292 /** A typedef for a function that will return the md5 checksum of the
00293  * fulltext deltified by a @c svn_txdelta_stream_t object.  Will
00294  * return NULL if the final null window hasn't yet been returned by
00295  * the stream.  The returned value will be allocated in the same pool
00296  * as the stream.  @a baton is the baton specified when the stream was
00297  * created.
00298  *
00299  * @since New in 1.4.
00300  */
00301 typedef const unsigned char *
00302 (*svn_txdelta_md5_digest_fn_t)(void *baton);
00303 
00304 /** Create and return a generic text delta stream with @a baton, @a
00305  * next_window and @a md5_digest.  Allocate the new stream in @a
00306  * pool.
00307  *
00308  * @since New in 1.4.
00309  */
00310 svn_txdelta_stream_t *
00311 svn_txdelta_stream_create(void *baton,
00312                           svn_txdelta_next_window_fn_t next_window,
00313                           svn_txdelta_md5_digest_fn_t md5_digest,
00314                           apr_pool_t *pool);
00315 
00316 /** Set @a *window to a pointer to the next window from the delta stream
00317  * @a stream.  When we have completely reconstructed the target string,
00318  * set @a *window to zero.
00319  *
00320  * The window will be allocated in @a pool.
00321  */
00322 svn_error_t *
00323 svn_txdelta_next_window(svn_txdelta_window_t **window,
00324                         svn_txdelta_stream_t *stream,
00325                         apr_pool_t *pool);
00326 
00327 
00328 /** Return the md5 digest for the complete fulltext deltified by
00329  * @a stream, or @c NULL if @a stream has not yet returned its final
00330  * @c NULL window.  The digest is allocated in the same memory as @a
00331  * STREAM.
00332  */
00333 const unsigned char *
00334 svn_txdelta_md5_digest(svn_txdelta_stream_t *stream);
00335 
00336 /** Set @a *stream to a pointer to a delta stream that will turn the byte
00337  * string from @a source into the byte stream from @a target.
00338  *
00339  * @a source and @a target are both readable generic streams.  When we call
00340  * svn_txdelta_next_window() on @a *stream, it will read from @a source and
00341  * @a target to gather as much data as it needs.
00342  *
00343  * Do any necessary allocation in a sub-pool of @a pool.
00344  */
00345 void
00346 svn_txdelta(svn_txdelta_stream_t **stream,
00347             svn_stream_t *source,
00348             svn_stream_t *target,
00349             apr_pool_t *pool);
00350 
00351 
00352 /**
00353  * Return a writable stream which, when fed target data, will send
00354  * delta windows to @a handler/@a handler_baton which transform the
00355  * data in @a source to the target data.  As usual, the window handler
00356  * will receive a NULL window to signify the end of the window stream.
00357  * The stream handler functions will read data from @a source as
00358  * necessary.
00359  *
00360  * @since New in 1.1.
00361  */
00362 svn_stream_t *
00363 svn_txdelta_target_push(svn_txdelta_window_handler_t handler,
00364                         void *handler_baton,
00365                         svn_stream_t *source,
00366                         apr_pool_t *pool);
00367 
00368 
00369 /** Send the contents of @a string to window-handler @a handler/@a baton.
00370  * This is effectively a 'copy' operation, resulting in delta windows that
00371  * make the target equivalent to the value of @a string.
00372  *
00373  * All temporary allocation is performed in @a pool.
00374  */
00375 svn_error_t *
00376 svn_txdelta_send_string(const svn_string_t *string,
00377                         svn_txdelta_window_handler_t handler,
00378                         void *handler_baton,
00379                         apr_pool_t *pool);
00380 
00381 /** Send the contents of @a stream to window-handler @a handler/@a baton.
00382  * This is effectively a 'copy' operation, resulting in delta windows that
00383  * make the target equivalent to the stream.
00384  *
00385  * If @a digest is non-NULL, populate it with the md5 checksum for the
00386  * fulltext that was deltified (@a digest must be at least
00387  * @c APR_MD5_DIGESTSIZE bytes long).
00388  *
00389  * All temporary allocation is performed in @a pool.
00390  */
00391 svn_error_t *
00392 svn_txdelta_send_stream(svn_stream_t *stream,
00393                         svn_txdelta_window_handler_t handler,
00394                         void *handler_baton,
00395                         unsigned char *digest,
00396                         apr_pool_t *pool);
00397 
00398 /** Send the contents of @a txstream to window-handler @a handler/@a baton.
00399  * Windows will be extracted from the stream and delivered to the handler.
00400  *
00401  * All temporary allocation is performed in @a pool.
00402  */
00403 svn_error_t *
00404 svn_txdelta_send_txstream(svn_txdelta_stream_t *txstream,
00405                           svn_txdelta_window_handler_t handler,
00406                           void *handler_baton,
00407                           apr_pool_t *pool);
00408 
00409 
00410 /** Prepare to apply a text delta.  @a source is a readable generic stream
00411  * yielding the source data, @a target is a writable generic stream to
00412  * write target data to, and allocation takes place in a sub-pool of
00413  * @a pool.  On return, @a *handler is set to a window handler function and
00414  * @a *handler_baton is set to the value to pass as the @a baton argument to
00415  * @a *handler.
00416  *
00417  * If @a result_digest is non-NULL, it points to APR_MD5_DIGESTSIZE bytes
00418  * of storage, and the final call to @a handler populates it with the
00419  * MD5 digest of the resulting fulltext.
00420  *
00421  * If @a error_info is non-NULL, it is inserted parenthetically into
00422  * the error string for any error returned by svn_txdelta_apply() or
00423  * @a *handler.  (It is normally used to provide path information,
00424  * since there's nothing else in the delta application's context to
00425  * supply a path for error messages.)
00426  *
00427  * @note To avoid lifetime issues, @a error_info is copied into
00428  * @a pool or a subpool thereof.
00429  */
00430 void
00431 svn_txdelta_apply(svn_stream_t *source,
00432                   svn_stream_t *target,
00433                   unsigned char *result_digest,
00434                   const char *error_info,
00435                   apr_pool_t *pool,
00436                   svn_txdelta_window_handler_t *handler,
00437                   void **handler_baton);
00438 
00439 
00440 
00441 /*** Producing and consuming svndiff-format text deltas.  ***/
00442 
00443 /** Prepare to produce an svndiff-format diff from text delta windows.
00444  * @a output is a writable generic stream to write the svndiff data to.
00445  * Allocation takes place in a sub-pool of @a pool.  On return, @a *handler
00446  * is set to a window handler function and @a *handler_baton is set to
00447  * the value to pass as the @a baton argument to @a *handler. The svndiff
00448  * version is @a svndiff_version.
00449  *
00450  * @since New in 1.4.
00451  */
00452 void
00453 svn_txdelta_to_svndiff2(svn_txdelta_window_handler_t *handler,
00454                         void **handler_baton,
00455                         svn_stream_t *output,
00456                         int svndiff_version,
00457                         apr_pool_t *pool);
00458 
00459 /** Similar to svn_txdelta_to_svndiff2, but always using svndiff
00460  * version 0.
00461  *
00462  * @deprecated Provided for backward compatibility with the 1.3 API.
00463  */
00464 SVN_DEPRECATED
00465 void
00466 svn_txdelta_to_svndiff(svn_stream_t *output,
00467                        apr_pool_t *pool,
00468                        svn_txdelta_window_handler_t *handler,
00469                        void **handler_baton);
00470 
00471 /** Return a writable generic stream which will parse svndiff-format
00472  * data into a text delta, invoking @a handler with @a handler_baton
00473  * whenever a new window is ready.  If @a error_on_early_close is @c
00474  * TRUE, attempting to close this stream before it has handled the entire
00475  * svndiff data set will result in @c SVN_ERR_SVNDIFF_UNEXPECTED_END,
00476  * else this error condition will be ignored.
00477  */
00478 svn_stream_t *
00479 svn_txdelta_parse_svndiff(svn_txdelta_window_handler_t handler,
00480                           void *handler_baton,
00481                           svn_boolean_t error_on_early_close,
00482                           apr_pool_t *pool);
00483 
00484 /**
00485  * Read and parse one delta window in svndiff format from the
00486  * readable stream @a stream and place it in @a *window, allocating
00487  * the result in @a pool.  The caller must take responsibility for
00488  * stripping off the four-byte 'SVN@<ver@>' header at the beginning of
00489  * the svndiff document before reading the first window, and must
00490  * provide the version number (the value of the fourth byte) to each
00491  * invocation of this routine with the @a svndiff_version argument.
00492  *
00493  * @since New in 1.1.
00494  */
00495 svn_error_t *
00496 svn_txdelta_read_svndiff_window(svn_txdelta_window_t **window,
00497                                 svn_stream_t *stream,
00498                                 int svndiff_version,
00499                                 apr_pool_t *pool);
00500 
00501 /**
00502  * Read and skip one delta window in svndiff format from the
00503  * file @a file.  @a pool is used for temporary allocations.  The
00504  * caller must take responsibility for stripping off the four-byte
00505  * 'SVN@<ver@>' header at the beginning of the svndiff document before
00506  * reading or skipping the first window, and must provide the version
00507  * number (the value of the fourth byte) to each invocation of this
00508  * routine with the @a svndiff_version argument.
00509  *
00510  * @since New in 1.1.
00511  */
00512 svn_error_t *
00513 svn_txdelta_skip_svndiff_window(apr_file_t *file,
00514                                 int svndiff_version,
00515                                 apr_pool_t *pool);
00516 
00517 /** @} */
00518 
00519 
00520 /** Traversing tree deltas.
00521  *
00522  * In Subversion, we've got various producers and consumers of tree
00523  * deltas.
00524  *
00525  * In processing a `commit' command:
00526  * - The client examines its working copy data, and produces a tree
00527  *   delta describing the changes to be committed.
00528  * - The client networking library consumes that delta, and sends them
00529  *   across the wire as an equivalent series of network requests (for
00530  *   example, to svnserve as an ra_svn protocol stream, or to an
00531  *   Apache httpd server as WebDAV commands)
00532  * - The server receives those requests and produces a tree delta ---
00533  *   hopefully equivalent to the one the client produced above.
00534  * - The Subversion server module consumes that delta and commits an
00535  *   appropriate transaction to the filesystem.
00536  *
00537  * In processing an `update' command, the process is reversed:
00538  * - The Subversion server module talks to the filesystem and produces
00539  *   a tree delta describing the changes necessary to bring the
00540  *   client's working copy up to date.
00541  * - The server consumes this delta, and assembles a reply
00542  *   representing the appropriate changes.
00543  * - The client networking library receives that reply, and produces a
00544  *   tree delta --- hopefully equivalent to the one the Subversion
00545  *   server produced above.
00546  * - The working copy library consumes that delta, and makes the
00547  *   appropriate changes to the working copy.
00548  *
00549  * The simplest approach would be to represent tree deltas using the
00550  * obvious data structure.  To do an update, the server would
00551  * construct a delta structure, and the working copy library would
00552  * apply that structure to the working copy; the network layer's job
00553  * would simply be to get the structure across the net intact.
00554  *
00555  * However, we expect that these deltas will occasionally be too large
00556  * to fit in a typical workstation's swap area.  For example, in
00557  * checking out a 200Mb source tree, the entire source tree is
00558  * represented by a single tree delta.  So it's important to handle
00559  * deltas that are too large to fit in swap all at once.
00560  *
00561  * So instead of representing the tree delta explicitly, we define a
00562  * standard way for a consumer to process each piece of a tree delta
00563  * as soon as the producer creates it.  The @c svn_delta_editor_t
00564  * structure is a set of callback functions to be defined by a delta
00565  * consumer, and invoked by a delta producer.  Each invocation of a
00566  * callback function describes a piece of the delta --- a file's
00567  * contents changing, something being renamed, etc.
00568  *
00569  * @defgroup svn_delta_tree_deltas Tree deltas
00570  * @{
00571  */
00572 
00573 /** A structure full of callback functions the delta source will invoke
00574  * as it produces the delta.
00575  *
00576  * Note: Don't try to allocate one of these yourself.  Instead, always
00577  * use svn_delta_default_editor() or some other constructor, to ensure
00578  * that unused slots are filled in with no-op functions.
00579  *
00580  * <h3>Function Usage</h3>
00581  *
00582  * Here's how to use these functions to express a tree delta.
00583  *
00584  * The delta consumer implements the callback functions described in
00585  * this structure, and the delta producer invokes them.  So the
00586  * caller (producer) is pushing tree delta data at the callee
00587  * (consumer).
00588  *
00589  * At the start of traversal, the consumer provides @a edit_baton, a
00590  * baton global to the entire delta edit.  If there is a target
00591  * revision that needs to be set for this operation, the producer
00592  * should call the @c set_target_revision function at this point.
00593  *
00594  * Next, if there are any tree deltas to express, the producer should
00595  * pass the @a edit_baton to the @c open_root function, to get a baton
00596  * representing root of the tree being edited.
00597  *
00598  * Most of the callbacks work in the obvious way:
00599  *
00600  *     @c delete_entry
00601  *     @c add_file
00602  *     @c add_directory
00603  *     @c open_file
00604  *     @c open_directory
00605  *
00606  * Each of these takes a directory baton, indicating the directory
00607  * in which the change takes place, and a @a path argument, giving the
00608  * path (relative to the root of the edit) of the file,
00609  * subdirectory, or directory entry to change. Editors will usually
00610  * want to join this relative path with some base stored in the edit
00611  * baton (e.g. a URL, a location in the OS filesystem).
00612  *
00613  * Since every call requires a parent directory baton, including
00614  * @c add_directory and @c open_directory, where do we ever get our
00615  * initial directory baton, to get things started?  The @c open_root
00616  * function returns a baton for the top directory of the change.  In
00617  * general, the producer needs to invoke the editor's @c open_root
00618  * function before it can get anything of interest done.
00619  *
00620  * While @c open_root provides a directory baton for the root of
00621  * the tree being changed, the @c add_directory and @c open_directory
00622  * callbacks provide batons for other directories.  Like the
00623  * callbacks above, they take a @a parent_baton and a relative path
00624  * @a path, and then return a new baton for the subdirectory being
00625  * created / modified --- @a child_baton.  The producer can then use
00626  * @a child_baton to make further changes in that subdirectory.
00627  *
00628  * So, if we already have subdirectories named `foo' and `foo/bar',
00629  * then the producer can create a new file named `foo/bar/baz.c' by
00630  * calling:
00631  *
00632  *    - @c open_root () --- yielding a baton @a root for the top directory
00633  *
00634  *    - @c open_directory (@a root, "foo") --- yielding a baton @a f for `foo'
00635  *
00636  *    - @c open_directory (@a f, "foo/bar") --- yielding a baton @a b for
00637  *      `foo/bar'
00638  *
00639  *    - @c add_file (@a b, "foo/bar/baz.c")
00640  *
00641  * When the producer is finished making changes to a directory, it
00642  * should call @c close_directory.  This lets the consumer do any
00643  * necessary cleanup, and free the baton's storage.
00644  *
00645  * The @c add_file and @c open_file callbacks each return a baton
00646  * for the file being created or changed.  This baton can then be
00647  * passed to @c apply_textdelta to change the file's contents, or
00648  * @c change_file_prop to change the file's properties.  When the
00649  * producer is finished making changes to a file, it should call
00650  * @c close_file, to let the consumer clean up and free the baton.
00651  *
00652  * The @c add_file and @c add_directory functions each take arguments
00653  * @a copyfrom_path and @a copyfrom_revision.  If @a copyfrom_path is
00654  * non-@c NULL, then @a copyfrom_path and @a copyfrom_revision indicate where
00655  * the file or directory should be copied from (to create the file
00656  * or directory being added).  In that case, @a copyfrom_path must be
00657  * either a path relative to the root of the edit, or a URI from the
00658  * repository being edited.  If @a copyfrom_path is @c NULL, then @a
00659  * copyfrom_revision must be @c SVN_INVALID_REVNUM; it is invalid to
00660  * pass a mix of valid and invalid copyfrom arguments.
00661  *
00662  *
00663  * <h3>Function Call Ordering</h3>
00664  *
00665  * There are six restrictions on the order in which the producer
00666  * may use the batons:
00667  *
00668  * 1. The producer may call @c open_directory, @c add_directory,
00669  *    @c open_file, @c add_file at most once on any given directory
00670  *    entry.  @c delete_entry may be called at most once on any given
00671  *    directory entry and may later be followed by @c add_directory or
00672  *    @c add_file on the same directory entry.  @c delete_entry may
00673  *    not be called on any directory entry after @c open_directory,
00674  *    @c add_directory, @c open_file or @c add_file has been called on
00675  *    that directory entry.
00676  *
00677  * 2. The producer may not close a directory baton until it has
00678  *    closed all batons for its subdirectories.
00679  *
00680  * 3. When a producer calls @c open_directory or @c add_directory,
00681  *    it must specify the most recently opened of the currently open
00682  *    directory batons.  Put another way, the producer cannot have
00683  *    two sibling directory batons open at the same time.
00684  *
00685  * 4. A producer must call @c change_dir_prop on a directory either
00686  *    before opening any of the directory's subdirs or after closing
00687  *    them, but not in the middle.
00688  *
00689  * 5. When the producer calls @c open_file or @c add_file, either:
00690  *
00691  *    (a) The producer must follow with any changes to the file
00692  *    (@c change_file_prop and/or @c apply_textdelta, as applicable),
00693  *    followed by a @c close_file call, before issuing any other file
00694  *    or directory calls, or
00695  *
00696  *    (b) The producer must follow with a @c change_file_prop call if
00697  *    it is applicable, before issuing any other file or directory
00698  *    calls; later, after all directory batons including the root
00699  *    have been closed, the producer must issue @c apply_textdelta
00700  *    and @c close_file calls.
00701  *
00702  * 6. When the producer calls @c apply_textdelta, it must make all of
00703  *    the window handler calls (including the @c NULL window at the
00704  *    end) before issuing any other @c svn_delta_editor_t calls.
00705  *
00706  * So, the producer needs to use directory and file batons as if it
00707  * is doing a single depth-first traversal of the tree, with the
00708  * exception that the producer may keep file batons open in order to
00709  * make @c apply_textdelta calls at the end.
00710  *
00711  *
00712  * <h3>Pool Usage</h3>
00713  *
00714  * Many editor functions are invoked multiple times, in a sequence
00715  * determined by the editor "driver". The driver is responsible for
00716  * creating a pool for use on each iteration of the editor function,
00717  * and clearing that pool between each iteration. The driver passes
00718  * the appropriate pool on each function invocation.
00719  *
00720  * Based on the requirement of calling the editor functions in a
00721  * depth-first style, it is usually customary for the driver to similarly
00722  * nest the pools. However, this is only a safety feature to ensure
00723  * that pools associated with deeper items are always cleared when the
00724  * top-level items are also cleared. The interface does not assume, nor
00725  * require, any particular organization of the pools passed to these
00726  * functions. In fact, if "postfix deltas" are used for files, the file
00727  * pools definitely need to live outside the scope of their parent
00728  * directories' pools.
00729  *
00730  * Note that close_directory can be called *before* a file in that
00731  * directory has been closed. That is, the directory's baton is
00732  * closed before the file's baton. The implication is that
00733  * @c apply_textdelta and @c close_file should not refer to a parent
00734  * directory baton UNLESS the editor has taken precautions to
00735  * allocate it in a pool of the appropriate lifetime (the @a dir_pool
00736  * passed to @c open_directory and @c add_directory definitely does not
00737  * have the proper lifetime). In general, it is recommended to simply
00738  * avoid keeping a parent directory baton in a file baton.
00739  *
00740  *
00741  * <h3>Errors</h3>
00742  *
00743  * At least one implementation of the editor interface is
00744  * asynchronous; an error from one operation may be detected some
00745  * number of operations later.  As a result, an editor driver must not
00746  * assume that an error from an editing function resulted from the
00747  * particular operation being detected.  Moreover, once an editing
00748  * function returns an error, the edit is dead; the only further
00749  * operation which may be called on the editor is abort_edit.
00750  */
00751 typedef struct svn_delta_editor_t
00752 {
00753   /** Set the target revision for this edit to @a target_revision.  This
00754    * call, if used, should precede all other editor calls.
00755    *
00756    * @note This is typically used only for server->client update-type
00757    * operations.  It doesn't really make much sense for commit-type
00758    * operations, because the revision of a commit isn't known until
00759    * the commit is finalized.
00760    */
00761   svn_error_t *(*set_target_revision)(void *edit_baton,
00762                                       svn_revnum_t target_revision,
00763                                       apr_pool_t *pool);
00764 
00765   /** Set @a *root_baton to a baton for the top directory of the change.
00766    * (This is the top of the subtree being changed, not necessarily
00767    * the root of the filesystem.)  As with any other directory baton, the
00768    * producer should call @c close_directory on @a root_baton when done.
00769    * And as with other @c open_* calls, the @a base_revision here is the
00770    * current revision of the directory (before getting bumped up to the
00771    * new target revision set with @c set_target_revision).
00772    *
00773    * Allocations for the returned @a root_baton should be performed in
00774    * @a dir_pool. It is also typical to (possibly) save this pool for later
00775    * usage by @c close_directory.
00776    */
00777   svn_error_t *(*open_root)(void *edit_baton,
00778                             svn_revnum_t base_revision,
00779                             apr_pool_t *dir_pool,
00780                             void **root_baton);
00781 
00782 
00783   /** Remove the directory entry named @a path, a child of the directory
00784    * represented by @a parent_baton.  If @a revision is a valid
00785    * revision number, it is used as a sanity check to ensure that you
00786    * are really removing the revision of @a path that you think you are.
00787    *
00788    * All allocations should be performed in @a pool.
00789    *
00790    * @note The @a revision parameter is typically used only for
00791    * client->server commit-type operations, allowing the server to
00792    * verify that it is deleting what the client thinks it should be
00793    * deleting.  It only really makes sense in the opposite direction
00794    * (during server->client update-type operations) when the trees
00795    * whose delta is being described are ancestrally related (that is,
00796    * one tree is an ancestor of the other).
00797    */
00798   svn_error_t *(*delete_entry)(const char *path,
00799                                svn_revnum_t revision,
00800                                void *parent_baton,
00801                                apr_pool_t *pool);
00802 
00803 
00804   /** We are going to add a new subdirectory named @a path.  We will use
00805    * the value this callback stores in @a *child_baton as the
00806    * @a parent_baton for further changes in the new subdirectory.
00807    *
00808    * If @a copyfrom_path is non-@c NULL, this add has history (i.e., is a
00809    * copy), and the origin of the copy may be recorded as
00810    * @a copyfrom_path under @a copyfrom_revision.
00811    *
00812    * Allocations for the returned @a child_baton should be performed in
00813    * @a dir_pool. It is also typical to (possibly) save this pool for later
00814    * usage by @c close_directory.
00815    */
00816   svn_error_t *(*add_directory)(const char *path,
00817                                 void *parent_baton,
00818                                 const char *copyfrom_path,
00819                                 svn_revnum_t copyfrom_revision,
00820                                 apr_pool_t *dir_pool,
00821                                 void **child_baton);
00822 
00823   /** We are going to make changes in a subdirectory (of the directory
00824    * identified by @a parent_baton). The subdirectory is specified by
00825    * @a path. The callback must store a value in @a *child_baton that
00826    * should be used as the @a parent_baton for subsequent changes in this
00827    * subdirectory.  If a valid revnum, @a base_revision is the current
00828    * revision of the subdirectory.
00829    *
00830    * Allocations for the returned @a child_baton should be performed in
00831    * @a dir_pool. It is also typical to (possibly) save this pool for later
00832    * usage by @c close_directory.
00833    */
00834   svn_error_t *(*open_directory)(const char *path,
00835                                  void *parent_baton,
00836                                  svn_revnum_t base_revision,
00837                                  apr_pool_t *dir_pool,
00838                                  void **child_baton);
00839 
00840   /** Change the value of a directory's property.
00841    * - @a dir_baton specifies the directory whose property should change.
00842    * - @a name is the name of the property to change.
00843    * - @a value is the new (final) value of the property, or @c NULL if the
00844    *   property should be removed altogether.
00845    *
00846    * The callback is guaranteed to be called exactly once for each property
00847    * whose value differs between the start and the end of the edit.
00848    *
00849    * All allocations should be performed in @a pool.
00850    */
00851   svn_error_t *(*change_dir_prop)(void *dir_baton,
00852                                   const char *name,
00853                                   const svn_string_t *value,
00854                                   apr_pool_t *pool);
00855 
00856   /** We are done processing a subdirectory, whose baton is @a dir_baton
00857    * (set by @c add_directory or @c open_directory).  We won't be using
00858    * the baton any more, so whatever resources it refers to may now be
00859    * freed.
00860    */
00861   svn_error_t *(*close_directory)(void *dir_baton,
00862                                   apr_pool_t *pool);
00863 
00864 
00865   /** In the directory represented by @a parent_baton, indicate that
00866    * @a path is present as a subdirectory in the edit source, but
00867    * cannot be conveyed to the edit consumer (perhaps because of
00868    * authorization restrictions).
00869    */
00870   svn_error_t *(*absent_directory)(const char *path,
00871                                    void *parent_baton,
00872                                    apr_pool_t *pool);
00873 
00874   /** We are going to add a new file named @a path.  The callback can
00875    * store a baton for this new file in @a **file_baton; whatever value
00876    * it stores there should be passed through to @c apply_textdelta.
00877    *
00878    * If @a copyfrom_path is non-@c NULL, this add has history (i.e., is a
00879    * copy), and the origin of the copy may be recorded as
00880    * @a copyfrom_path under @a copyfrom_revision.
00881    *
00882    * Allocations for the returned @a file_baton should be performed in
00883    * @a file_pool. It is also typical to save this pool for later usage
00884    * by @c apply_textdelta and possibly @c close_file.
00885    */
00886   svn_error_t *(*add_file)(const char *path,
00887                            void *parent_baton,
00888                            const char *copyfrom_path,
00889                            svn_revnum_t copyfrom_revision,
00890                            apr_pool_t *file_pool,
00891                            void **file_baton);
00892 
00893   /** We are going to make change to a file named @a path, which resides
00894    * in the directory identified by @a parent_baton.
00895    *
00896    * The callback can store a baton for this new file in @a **file_baton;
00897    * whatever value it stores there should be passed through to
00898    * @c apply_textdelta.  If a valid revnum, @a base_revision is the
00899    * current revision of the file.
00900    *
00901    * Allocations for the returned @a file_baton should be performed in
00902    * @a file_pool. It is also typical to save this pool for later usage
00903    * by @c apply_textdelta and possibly @c close_file.
00904    */
00905   svn_error_t *(*open_file)(const char *path,
00906                             void *parent_baton,
00907                             svn_revnum_t base_revision,
00908                             apr_pool_t *file_pool,
00909                             void **file_baton);
00910 
00911   /** Apply a text delta, yielding the new revision of a file.
00912    *
00913    * @a file_baton indicates the file we're creating or updating, and the
00914    * ancestor file on which it is based; it is the baton set by some
00915    * prior @c add_file or @c open_file callback.
00916    *
00917    * The callback should set @a *handler to a text delta window
00918    * handler; we will then call @a *handler on successive text
00919    * delta windows as we receive them.  The callback should set
00920    * @a *handler_baton to the value we should pass as the @a baton
00921    * argument to @a *handler.
00922    *
00923    * @a base_checksum is the hex MD5 digest for the base text against
00924    * which the delta is being applied; it is ignored if NULL, and may
00925    * be ignored even if not NULL.  If it is not ignored, it must match
00926    * the checksum of the base text against which svndiff data is being
00927    * applied; if it does not, @c apply_textdelta or the @a *handler call
00928    * which detects the mismatch will return the error
00929    * SVN_ERR_CHECKSUM_MISMATCH (if there is no base text, there may
00930    * still be an error if @a base_checksum is neither NULL nor the hex
00931    * MD5 checksum of the empty string).
00932    */
00933   svn_error_t *(*apply_textdelta)(void *file_baton,
00934                                   const char *base_checksum,
00935                                   apr_pool_t *pool,
00936                                   svn_txdelta_window_handler_t *handler,
00937                                   void **handler_baton);
00938 
00939   /** Change the value of a file's property.
00940    * - @a file_baton specifies the file whose property should change.
00941    * - @a name is the name of the property to change.
00942    * - @a value is the new (final) value of the property, or @c NULL if the
00943    *   property should be removed altogether.
00944    *
00945    * The callback is guaranteed to be called exactly once for each property
00946    * whose value differs between the start and the end of the edit.
00947    *
00948    * All allocations should be performed in @a pool.
00949    */
00950   svn_error_t *(*change_file_prop)(void *file_baton,
00951                                    const char *name,
00952                                    const svn_string_t *value,
00953                                    apr_pool_t *pool);
00954 
00955   /** We are done processing a file, whose baton is @a file_baton (set by
00956    * @c add_file or @c open_file).  We won't be using the baton any
00957    * more, so whatever resources it refers to may now be freed.
00958    *
00959    * @a text_checksum is the hex MD5 digest for the fulltext that
00960    * resulted from a delta application, see @c apply_textdelta.  The
00961    * checksum is ignored if NULL.  If not null, it is compared to the
00962    * checksum of the new fulltext, and the error
00963    * SVN_ERR_CHECKSUM_MISMATCH is returned if they do not match.  If
00964    * there is no new fulltext, @a text_checksum is ignored.
00965    */
00966   svn_error_t *(*close_file)(void *file_baton,
00967                              const char *text_checksum,
00968                              apr_pool_t *pool);
00969 
00970   /** In the directory represented by @a parent_baton, indicate that
00971    * @a path is present as a file in the edit source, but cannot be
00972    * conveyed to the edit consumer (perhaps because of authorization
00973    * restrictions).
00974    */
00975   svn_error_t *(*absent_file)(const char *path,
00976                               void *parent_baton,
00977                               apr_pool_t *pool);
00978 
00979   /** All delta processing is done.  Call this, with the @a edit_baton for
00980    * the entire edit.
00981    */
00982   svn_error_t *(*close_edit)(void *edit_baton,
00983                              apr_pool_t *pool);
00984 
00985   /** The editor-driver has decided to bail out.  Allow the editor to
00986    * gracefully clean up things if it needs to.
00987    */
00988   svn_error_t *(*abort_edit)(void *edit_baton,
00989                              apr_pool_t *pool);
00990 
00991   /* Be sure to update svn_delta_get_cancellation_editor() and
00992    * svn_delta_default_editor() if you add a new callback here. */
00993 } svn_delta_editor_t;
00994 
00995 
00996 /** Return a default delta editor template, allocated in @a pool.
00997  *
00998  * The editor functions in the template do only the most basic
00999  * baton-swapping: each editor function that produces a baton does so
01000  * by copying its incoming baton into the outgoing baton reference.
01001  *
01002  * This editor is not intended to be useful by itself, but is meant to
01003  * be the basis for a useful editor.  After getting a default editor,
01004  * you substitute in your own implementations for the editor functions
01005  * you care about.  The ones you don't care about, you don't have to
01006  * implement -- you can rely on the template's implementation to
01007  * safely do nothing of consequence.
01008  */
01009 svn_delta_editor_t *
01010 svn_delta_default_editor(apr_pool_t *pool);
01011 
01012 /** A text-delta window handler which does nothing.
01013  *
01014  * Editors can return this handler from @c apply_textdelta if they don't
01015  * care about text delta windows.
01016  */
01017 svn_error_t *
01018 svn_delta_noop_window_handler(svn_txdelta_window_t *window,
01019                               void *baton);
01020 
01021 /** Set @a *editor and @a *edit_baton to a cancellation editor that
01022  * wraps @a wrapped_editor and @a wrapped_baton.
01023  *
01024  * The @a editor will call @a cancel_func with @a cancel_baton when each of
01025  * its functions is called, continuing on to call the corresponding wrapped
01026  * function if @a cancel_func returns @c SVN_NO_ERROR.
01027  *
01028  * If @a cancel_func is @c NULL, set @a *editor to @a wrapped_editor and
01029  * @a *edit_baton to @a wrapped_baton.
01030  */
01031 svn_error_t *
01032 svn_delta_get_cancellation_editor(svn_cancel_func_t cancel_func,
01033                                   void *cancel_baton,
01034                                   const svn_delta_editor_t *wrapped_editor,
01035                                   void *wrapped_baton,
01036                                   const svn_delta_editor_t **editor,
01037                                   void **edit_baton,
01038                                   apr_pool_t *pool);
01039 
01040 /** Set @a *editor and @a *edit_baton to an depth-based filtering
01041  * editor that wraps @a wrapped_editor and @a wrapped_baton.
01042  *
01043  * The @a editor will track the depth of this drive against the @a
01044  * requested_depth, taking into account whether not the edit drive is
01045  * making use of a target (via @a has_target), and forward editor
01046  * calls which operate "within" the request depth range through to @a
01047  * wrapped_editor.
01048  *
01049  * @a requested_depth must be one of the following depth values:
01050  * @c svn_depth_infinity, @c svn_depth_empty, @c svn_depth_files,
01051  * @c svn_depth_immediates, or @c svn_depth_unknown.
01052  *
01053  * If filtering is deemed unncessary (or if @a requested_depth is @c
01054  * svn_depth_unknown), @a *editor and @a *edit_baton will be set to @a
01055  * wrapped_editor and @a wrapped_baton, respectively; otherwise,
01056  * they'll be set to new objects allocated from @a pool.
01057  *
01058  * @note Because the svn_delta_editor_t interface's @c delete_entry()
01059  * function doesn't carry node kind information, a depth-based
01060  * filtering editor being asked to filter for @c svn_depth_files but
01061  * receiving a @c delete_entry() call on an immediate child of the
01062  * editor's target is unable to know if that deletion should be
01063  * allowed or filtered out -- a delete of a top-level file is okay in
01064  * this case, a delete of a top-level subdirectory is not.  As such,
01065  * this filtering editor takes a conservative approach, and ignores
01066  * top-level deletion requests when filtering for @c svn_depth_files.
01067  * Fortunately, most non-depth-aware (pre-1.5) Subversion editor
01068  * drivers can be told to drive non-recursively (where non-recursive
01069  * means essentially @c svn_depth_files), which means they won't
01070  * transmit out-of-scope editor commands anyway.
01071  *
01072  * @since New in 1.5.
01073  */
01074 svn_error_t *
01075 svn_delta_depth_filter_editor(const svn_delta_editor_t **editor,
01076                               void **edit_baton,
01077                               const svn_delta_editor_t *wrapped_editor,
01078                               void *wrapped_edit_baton,
01079                               svn_depth_t requested_depth,
01080                               svn_boolean_t has_target,
01081                               apr_pool_t *pool);
01082 
01083 /** @} */
01084 
01085 
01086 /** Path-based editor drives.
01087  *
01088  * @defgroup svn_delta_path_delta_drivers Path-based delta drivers
01089  * @{
01090  */
01091 
01092 /** Callback function type for svn_delta_path_driver().
01093  *
01094  * The handler of this callback is given the callback baton @a
01095  * callback_baton, @a path, and the @a parent_baton which represents
01096  * path's parent directory as created by the editor passed to
01097  * svn_delta_path_driver().
01098  *
01099  * If @a path represents a directory, the handler must return a @a
01100  * *dir_baton for @a path, generated from the same editor (so that the
01101  * driver can later close that directory).
01102  *
01103  * If, however, @a path represents a file, the handler should NOT
01104  * return any file batons.  It can close any opened or added files
01105  * immediately, or delay that close until the end of the edit when
01106  * svn_delta_path_driver() returns.
01107  *
01108  * Finally, if @a parent_baton is @c NULL, then the root of the edit
01109  * is also one of the paths passed to svn_delta_path_driver().  The
01110  * handler of this callback must call the editor's open_root()
01111  * function and return the top-level root dir baton in @a *dir_baton.
01112  */
01113 typedef svn_error_t *(*svn_delta_path_driver_cb_func_t)
01114   (void **dir_baton,
01115    void *parent_baton,
01116    void *callback_baton,
01117    const char *path,
01118    apr_pool_t *pool);
01119 
01120 
01121 /** Drive @a editor (with its @a edit_baton) in such a way that
01122  * each path in @a paths is traversed in a depth-first fashion.  As
01123  * each path is hit as part of the editor drive, use @a
01124  * callback_func and @a callback_baton to allow the caller to handle
01125  * the portion of the editor drive related to that path.
01126  *
01127  * Use @a revision as the revision number passed to intermediate
01128  * directory openings.
01129  *
01130  * Use @a pool for all necessary allocations.
01131  */
01132 svn_error_t *
01133 svn_delta_path_driver(const svn_delta_editor_t *editor,
01134                       void *edit_baton,
01135                       svn_revnum_t revision,
01136                       apr_array_header_t *paths,
01137                       svn_delta_path_driver_cb_func_t callback_func,
01138                       void *callback_baton,
01139                       apr_pool_t *pool);
01140 
01141 /** @} */
01142 
01143 
01144 /*** File revision iterator types ***/
01145 
01146 /**
01147  * The callback invoked by file rev loopers, such as
01148  * svn_ra_plugin_t.get_file_revs2() and svn_repos_get_file_revs2().
01149  *
01150  * @a baton is provided by the caller, @a path is the pathname of the file
01151  * in revision @a rev and @a rev_props are the revision properties.
01152  *
01153  * If @a delta_handler and @a delta_baton are non-NULL, they may be set to a
01154  * handler/baton which will be called with the delta between the previous
01155  * revision and this one after the return of this callback.  They may be
01156  * left as NULL/NULL.
01157  *
01158  * @a result_of_merge will be @c TRUE if the revision being returned was
01159  * included as the result of a merge.
01160  *
01161  * @a prop_diffs is an array of svn_prop_t elements indicating the property
01162  * delta for this and the previous revision.
01163  *
01164  * @a pool may be used for temporary allocations, but you can't rely
01165  * on objects allocated to live outside of this particular call and
01166  * the immediately following calls to @a *delta_handler if any.  (Pass
01167  * in a pool via @a baton if need be.)
01168  *
01169  * @since New in 1.5.
01170  */
01171 typedef svn_error_t *(*svn_file_rev_handler_t)
01172   (void *baton,
01173    const char *path,
01174    svn_revnum_t rev,
01175    apr_hash_t *rev_props,
01176    svn_boolean_t result_of_merge,
01177    svn_txdelta_window_handler_t *delta_handler,
01178    void **delta_baton,
01179    apr_array_header_t *prop_diffs,
01180    apr_pool_t *pool);
01181 
01182 /**
01183  * The old file rev handler interface.
01184  *
01185  * @note @c svn_file_rev_handler_old_t is a placeholder type for both
01186  * @c svn_repos_file_rev_handler_t and @c svn_ra_file_rev_handler_t.  It is
01187  * reproduced here for dependency reasons.
01188  *
01189  * @deprecated This type is provided for the svn_compat_wrap_file_rev_handler()
01190  * compatibilty wrapper, and should not be used for new development.
01191  * @since New in 1.5.
01192  */
01193 typedef svn_error_t *(*svn_file_rev_handler_old_t)
01194   (void *baton,
01195    const char *path,
01196    svn_revnum_t rev,
01197    apr_hash_t *rev_props,
01198    svn_txdelta_window_handler_t *delta_handler,
01199    void **delta_baton,
01200    apr_array_header_t *prop_diffs,
01201    apr_pool_t *pool);
01202 
01203 /** Return, in @a *handler2 and @a *handler2_baton a function/baton that
01204  * will call @a handler/@a handler_baton, allocating the @a *handler2_baton
01205  * in @a pool.
01206  *
01207  * @note This is used by compatibility wrappers, which exist in more than
01208  * Subversion core library.
01209  *
01210  * @note @c svn_file_rev_handler_old_t is a placeholder type for both
01211  * @c svn_repos_file_rev_handler_t and @c svn_ra_file_rev_handler_t.  It is
01212  * reproduced here for dependency reasons.
01213  *
01214  * @since New in 1.5.
01215  */
01216 void
01217 svn_compat_wrap_file_rev_handler(svn_file_rev_handler_t *handler2,
01218                                  void **handler2_baton,
01219                                  svn_file_rev_handler_old_t handler,
01220                                  void *handler_baton,
01221                                  apr_pool_t *pool);
01222 
01223 /** @} end group: delta_support */
01224 
01225 
01226 #ifdef __cplusplus
01227 }
01228 #endif /* __cplusplus */
01229 
01230 #endif /* SVN_DELTA_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines