2 * compat.c : Wrappers and callbacks for compatibility.
4 * ====================================================================
5 * Copyright (c) 2007 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
19 #include <apr_pools.h>
21 #include "svn_types.h"
22 #include "svn_error.h"
23 #include "svn_delta.h"
26 struct file_rev_handler_wrapper_baton
{
28 svn_file_rev_handler_old_t handler
;
31 /* This implements svn_repos_file_rev_handler2_t. */
33 file_rev_handler_wrapper(void *baton
,
36 apr_hash_t
*rev_props
,
37 svn_boolean_t result_of_merge
,
38 svn_txdelta_window_handler_t
*delta_handler
,
40 apr_array_header_t
*prop_diffs
,
43 struct file_rev_handler_wrapper_baton
*fwb
= baton
;
46 return fwb
->handler(fwb
->baton
,
59 svn_compat_wrap_file_rev_handler(svn_file_rev_handler_t
*handler2
,
60 void **handler2_baton
,
61 svn_file_rev_handler_old_t handler
,
65 struct file_rev_handler_wrapper_baton
*fwb
= apr_palloc(pool
, sizeof(*fwb
));
67 /* Set the user provided old format callback in the baton. */
68 fwb
->baton
= handler_baton
;
69 fwb
->handler
= handler
;
71 *handler2_baton
= fwb
;
72 *handler2
= file_rev_handler_wrapper
;