]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/subversion/subversion/include/svn_compat.h
MFC r275385 (by bapt):
[FreeBSD/stable/10.git] / contrib / subversion / subversion / include / svn_compat.h
1 /**
2  * @copyright
3  * ====================================================================
4  *    Licensed to the Apache Software Foundation (ASF) under one
5  *    or more contributor license agreements.  See the NOTICE file
6  *    distributed with this work for additional information
7  *    regarding copyright ownership.  The ASF licenses this file
8  *    to you under the Apache License, Version 2.0 (the
9  *    "License"); you may not use this file except in compliance
10  *    with the License.  You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *    Unless required by applicable law or agreed to in writing,
15  *    software distributed under the License is distributed on an
16  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  *    KIND, either express or implied.  See the License for the
18  *    specific language governing permissions and limitations
19  *    under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_compat.h
24  * @brief Utilities to help applications provide backwards-compatibility
25  */
26
27 #ifndef SVN_COMPAT_H
28 #define SVN_COMPAT_H
29
30 #include <apr_pools.h>
31 #include <apr_hash.h>
32 #include <apr_tables.h>
33
34 #include "svn_types.h"
35 #include "svn_string.h"
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41 /** Return, in @a *callback2 and @a *callback2_baton a function/baton that
42  * will call @a callback/@a callback_baton, allocating the @a *callback2_baton
43  * in @a pool.
44  *
45  * @note This is used by compatibility wrappers, which exist in more than
46  * Subversion core library.
47  *
48  * @since New in 1.4.
49  */
50 void
51 svn_compat_wrap_commit_callback(svn_commit_callback2_t *callback2,
52                                 void **callback2_baton,
53                                 svn_commit_callback_t callback,
54                                 void *callback_baton,
55                                 apr_pool_t *pool);
56
57 /** Clear svn:author, svn:date, and svn:log from @a revprops if not NULL.
58  * Use this if you must handle these three properties separately for
59  * compatibility reasons.
60  *
61  * @since New in 1.5.
62  */
63 void
64 svn_compat_log_revprops_clear(apr_hash_t *revprops);
65
66 /** Return a list to pass to post-1.5 log-retrieval functions in order to
67  * retrieve the pre-1.5 set of revprops: svn:author, svn:date, and svn:log.
68  *
69  * @since New in 1.5.
70  */
71 apr_array_header_t *
72 svn_compat_log_revprops_in(apr_pool_t *pool);
73
74 /** Return, in @a **author, @a **date, and @a **message, the values of the
75  * svn:author, svn:date, and svn:log revprops from @a revprops.  If @a
76  * revprops is NULL, all return values are NULL.  Any return value may be
77  * NULL if the corresponding property is not set in @a revprops.
78  *
79  * @since New in 1.9.
80  */
81 void
82 svn_compat_log_revprops_out_string(const svn_string_t **author,
83                                    const svn_string_t **date,
84                                    const svn_string_t **message,
85                                    apr_hash_t *revprops);
86
87 /** Simiar to svn_compat_log_revprops_out_string() but returns C-style strings
88  * instead of #svn_string_t.
89  *
90  * @since New in 1.5.
91  */
92 void
93 svn_compat_log_revprops_out(const char **author, const char **date,
94                             const char **message, apr_hash_t *revprops);
95
96 /** Return, in @a *receiver2 and @a *receiver2_baton a function/baton that
97  * will call @a receiver/@a receiver_baton, allocating the @a *receiver2_baton
98  * in @a pool.
99  *
100  * @note This is used by compatibility wrappers, which exist in more than
101  * Subversion core library.
102  *
103  * @since New in 1.5.
104  */
105 void
106 svn_compat_wrap_log_receiver(svn_log_entry_receiver_t *receiver2,
107                              void **receiver2_baton,
108                              svn_log_message_receiver_t receiver,
109                              void *receiver_baton,
110                              apr_pool_t *pool);
111
112 #ifdef __cplusplus
113 }
114 #endif /* __cplusplus */
115
116 #endif /* SVN_COMPAT_H */