]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/subversion/subversion/svnrdump/svnrdump.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / subversion / subversion / svnrdump / svnrdump.h
1 /*
2  *  svnrdump.h: Internal header file for svnrdump.
3  *
4  * ====================================================================
5  *    Licensed to the Apache Software Foundation (ASF) under one
6  *    or more contributor license agreements.  See the NOTICE file
7  *    distributed with this work for additional information
8  *    regarding copyright ownership.  The ASF licenses this file
9  *    to you under the Apache License, Version 2.0 (the
10  *    "License"); you may not use this file except in compliance
11  *    with the License.  You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  *    Unless required by applicable law or agreed to in writing,
16  *    software distributed under the License is distributed on an
17  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18  *    KIND, either express or implied.  See the License for the
19  *    specific language governing permissions and limitations
20  *    under the License.
21  * ====================================================================
22  */
23
24 \f
25 #ifndef SVNRDUMP_H
26 #define SVNRDUMP_H
27
28 /*** Includes. ***/
29 #include "svn_error.h"
30 #include "svn_pools.h"
31 #include "svn_hash.h"
32 #include "svn_delta.h"
33 #include "svn_ra.h"
34
35 #include "private/svn_editor.h"
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41 \f
42 /**
43  * Get a dump editor @a editor along with a @a edit_baton allocated in
44  * @a pool.  The editor will write output to @a stream.
45  *
46  * @a update_anchor_relpath is the repository relative path of the
47  * anchor of the update-style drive which will happen on @a *editor;
48  * if a replay-style drive will instead be used, it should be passed
49  * as @c NULL.
50  *
51  * Use @a cancel_func and @a cancel_baton to check for user
52  * cancellation of the operation (for timely-but-safe termination).
53  */
54 svn_error_t *
55 svn_rdump__get_dump_editor(const svn_delta_editor_t **editor,
56                            void **edit_baton,
57                            svn_revnum_t revision,
58                            svn_stream_t *stream,
59                            svn_ra_session_t *ra_session,
60                            const char *update_anchor_relpath,
61                            svn_cancel_func_t cancel_func,
62                            void *cancel_baton,
63                            apr_pool_t *pool);
64
65 /* Same as above, only returns an Ev2 editor. */
66 svn_error_t *
67 svn_rdump__get_dump_editor_v2(svn_editor_t **editor,
68                               svn_revnum_t revision,
69                               svn_stream_t *stream,
70                               svn_ra_session_t *ra_session,
71                               const char *edit_root_relpath,
72                               svn_cancel_func_t cancel_func,
73                               void *cancel_baton,
74                               apr_pool_t *scratch_pool,
75                               apr_pool_t *result_pool);
76
77
78 /**
79  * Load the dumpstream carried in @a stream to the location described
80  * by @a session.  Use @a aux_session (which is opened to the same URL
81  * as @a session) for any secondary, out-of-band RA communications
82  * required.  If @a quiet is set, suppress notifications.  Use @a pool
83  * for all memory allocations.  Use @a cancel_func and @a cancel_baton
84  * to check for user cancellation of the operation (for
85  * timely-but-safe termination).
86  */
87 svn_error_t *
88 svn_rdump__load_dumpstream(svn_stream_t *stream,
89                            svn_ra_session_t *session,
90                            svn_ra_session_t *aux_session,
91                            svn_boolean_t quiet,
92                            svn_cancel_func_t cancel_func,
93                            void *cancel_baton,
94                            apr_pool_t *pool);
95
96
97 /* Normalize the line ending style of the values of properties in PROPS
98  * that "need translation" (according to svn_prop_needs_translation(),
99  * currently all svn:* props) so that they contain only LF (\n) line endings.
100  *
101  * Put the normalized props into NORMAL_PROPS, allocated in RESULT_POOL.
102  *
103  * Note: this function does not do a deep copy; it is expected that PROPS has
104  * a longer lifetime than NORMAL_PROPS.
105  */
106 svn_error_t *
107 svn_rdump__normalize_props(apr_hash_t **normal_props,
108                            apr_hash_t *props,
109                            apr_pool_t *result_pool);
110
111 /* Normalize the line ending style of a single property that "needs
112  * translation" (according to svn_prop_needs_translation(),
113  * currently all svn:* props) so that they contain only LF (\n) line endings.
114  * "\r" characters found mid-line are replaced with "\n".
115  * "\r\n" sequences are replaced with "\n"
116  *
117  * NAME is used to check that VALUE should be normalized, and if this is the
118  * case, VALUE is then normalized, allocated from RESULT_POOL
119  */
120 svn_error_t *
121 svn_rdump__normalize_prop(const char *name,
122                           const svn_string_t **value,
123                           apr_pool_t *result_pool);
124
125 #ifdef __cplusplus
126 }
127 #endif /* __cplusplus */
128
129 #endif /* SVNRDUMP_H */