2 * deprecated.c: holding file for all deprecated APIs.
3 * "we can't lose 'em, but we can shun 'em!"
5 * ====================================================================
6 * Licensed to the Apache Software Foundation (ASF) under one
7 * or more contributor license agreements. See the NOTICE file
8 * distributed with this work for additional information
9 * regarding copyright ownership. The ASF licenses this file
10 * to you under the Apache License, Version 2.0 (the
11 * "License"); you may not use this file except in compliance
12 * with the License. You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing,
17 * software distributed under the License is distributed on an
18 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19 * KIND, either express or implied. See the License for the
20 * specific language governing permissions and limitations
22 * ====================================================================
25 /* We define this here to remove any further warnings about the usage of
26 deprecated functions in this file. */
27 #define SVN_DEPRECATED
29 #include "svn_delta.h"
30 #include "svn_sorts.h"
33 struct path_driver_2_to_3_baton_t
35 svn_delta_path_driver_cb_func_t callback_func;
37 svn_boolean_t slash_prefix;
40 /* Convert from a newer to older callback
43 path_driver_2_to_3_func(void **dir_baton,
44 const svn_delta_editor_t *editor,
51 struct path_driver_2_to_3_baton_t *b = callback_baton;
54 path = apr_pstrcat(pool, "/", path, SVN_VA_NULL);
56 /* Just drop the 'editor' parameters */
57 SVN_ERR(b->callback_func(dir_baton, parent_baton,
64 svn_delta_path_driver2(const svn_delta_editor_t *editor,
66 const apr_array_header_t *paths,
67 svn_boolean_t sort_paths,
68 svn_delta_path_driver_cb_func_t callback_func,
72 struct path_driver_2_to_3_baton_t b;
75 b.callback_func = callback_func;
76 b.callback_baton = callback_baton;
77 b.slash_prefix = FALSE;
79 /* Remove any '/' prefix from incoming paths. Arrange to add a '/'
80 prefix to all paths for the callback, if any incoming path had one. */
81 for (i = 0; i < paths->nelts; i++)
83 const char *path = APR_ARRAY_IDX(paths, i, const char *);
87 /* Re-allocate the array and note that we found a '/' prefix. */
90 paths = apr_array_copy(pool, paths);
91 b.slash_prefix = TRUE;
94 /* Modify each array element that had a '/' prefix */
95 APR_ARRAY_IDX(paths, i, const char *) = path + 1;
99 SVN_ERR(svn_delta_path_driver3(editor, edit_baton,
101 path_driver_2_to_3_func, &b,
107 svn_delta_path_driver(const svn_delta_editor_t *editor,
109 svn_revnum_t revision,
110 const apr_array_header_t *paths,
111 svn_delta_path_driver_cb_func_t callback_func,
112 void *callback_baton,
113 apr_pool_t *scratch_pool)
115 /* REVISION is dropped on the floor. */
117 return svn_error_trace(svn_delta_path_driver2(editor, edit_baton, paths,
119 callback_func, callback_baton,