]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/subversion/subversion/libsvn_fs_base/util/fs_skels.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / subversion / subversion / libsvn_fs_base / util / fs_skels.h
1 /* fs_skels.h : headers for conversion between fs native types and
2  *              skeletons
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 #ifndef SVN_LIBSVN_FS_FS_SKELS_H
25 #define SVN_LIBSVN_FS_FS_SKELS_H
26
27 #define SVN_WANT_BDB
28 #include "svn_private_config.h"
29
30 #include <apr_pools.h>
31 #include <apr_hash.h>
32
33 #include "svn_fs.h"
34 #include "../fs.h"
35 #include "private/svn_skel.h"
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41 \f
42 /*** Parsing (conversion from skeleton to native FS type) ***/
43
44
45 /* Parse a `REVISION' SKEL and set *REVISION_P to the newly allocated
46    result.  Use POOL for all allocations.  */
47 svn_error_t *
48 svn_fs_base__parse_revision_skel(revision_t **revision_p,
49                                  svn_skel_t *skel,
50                                  apr_pool_t *pool);
51
52 /* Parse a `TRANSACTION' SKEL and set *TRANSACTION_P to the newly allocated
53    result.  Use POOL for all allocations.  */
54 svn_error_t *
55 svn_fs_base__parse_transaction_skel(transaction_t **transaction_p,
56                                     svn_skel_t *skel,
57                                     apr_pool_t *pool);
58
59 /* Parse a `REPRESENTATION' SKEL and set *REP_P to the newly allocated
60    result.  Use POOL for all allocations.  */
61
62 svn_error_t *
63 svn_fs_base__parse_representation_skel(representation_t **rep_p,
64                                        svn_skel_t *skel,
65                                        apr_pool_t *pool);
66
67 /* Parse a `NODE-REVISION' SKEL and set *NODEREV_P to the newly allocated
68    result.  Use POOL for all allocations. */
69 svn_error_t *
70 svn_fs_base__parse_node_revision_skel(node_revision_t **noderev_p,
71                                       svn_skel_t *skel,
72                                       apr_pool_t *pool);
73
74 /* Parse a `COPY' SKEL and set *COPY_P to the newly allocated result.  Use
75    POOL for all allocations. */
76 svn_error_t *
77 svn_fs_base__parse_copy_skel(copy_t **copy_p,
78                              svn_skel_t *skel,
79                              apr_pool_t *pool);
80
81 /* Parse an `ENTRIES' SKEL and set *ENTRIES_P to a new hash with const
82    char * names (the directory entry name) and svn_fs_id_t * values
83    (the node-id of the entry), or NULL if SKEL contains no entries.
84    Use POOL for all allocations. */
85 svn_error_t *
86 svn_fs_base__parse_entries_skel(apr_hash_t **entries_p,
87                                 svn_skel_t *skel,
88                                 apr_pool_t *pool);
89
90 /* Parse a `CHANGE' SKEL and set *CHANGE_P to the newly allocated result.
91    Use POOL for all allocations. */
92 svn_error_t *
93 svn_fs_base__parse_change_skel(change_t **change_p,
94                                svn_skel_t *skel,
95                                apr_pool_t *pool);
96
97 /* Parse a `LOCK' SKEL and set *LOCK_P to the newly allocated result.  Use
98    POOL for all allocations. */
99 svn_error_t *
100 svn_fs_base__parse_lock_skel(svn_lock_t **lock_p,
101                              svn_skel_t *skel,
102                              apr_pool_t *pool);
103
104
105 \f
106 /*** Unparsing (conversion from native FS type to skeleton) ***/
107
108
109 /* Unparse REVISION into a newly allocated `REVISION' skel and set *SKEL_P
110    to the result.  Use POOL for all allocations.  */
111 svn_error_t *
112 svn_fs_base__unparse_revision_skel(svn_skel_t **skel_p,
113                                    const revision_t *revision,
114                                    apr_pool_t *pool);
115
116 /* Unparse TRANSACTION into a newly allocated `TRANSACTION' skel and set
117    *SKEL_P to the result.  Use POOL for all allocations.  */
118 svn_error_t *
119 svn_fs_base__unparse_transaction_skel(svn_skel_t **skel_p,
120                                       const transaction_t *transaction,
121                                       apr_pool_t *pool);
122
123 /* Unparse REP into a newly allocated `REPRESENTATION' skel and set *SKEL_P
124    to the result.  Use POOL for all allocations.  FORMAT is the format
125    version of the filesystem. */
126 svn_error_t *
127 svn_fs_base__unparse_representation_skel(svn_skel_t **skel_p,
128                                          const representation_t *rep,
129                                          int format,
130                                          apr_pool_t *pool);
131
132 /* Unparse NODEREV into a newly allocated `NODE-REVISION' skel and set
133    *SKEL_P to the result.  Use POOL for all allocations.  FORMAT is the
134    format version of the filesystem. */
135 svn_error_t *
136 svn_fs_base__unparse_node_revision_skel(svn_skel_t **skel_p,
137                                         const node_revision_t *noderev,
138                                         int format,
139                                         apr_pool_t *pool);
140
141 /* Unparse COPY into a newly allocated `COPY' skel and set *SKEL_P to the
142    result.  Use POOL for all allocations.  */
143 svn_error_t *
144 svn_fs_base__unparse_copy_skel(svn_skel_t **skel_p,
145                                const copy_t *copy,
146                                apr_pool_t *pool);
147
148 /* Unparse an ENTRIES hash, which has const char * names (the entry
149    name) and svn_fs_id_t * values (the node-id of the entry) into a newly
150    allocated `ENTRIES' skel and set *SKEL_P to the result.  Use POOL for all
151    allocations.  */
152 svn_error_t *
153 svn_fs_base__unparse_entries_skel(svn_skel_t **skel_p,
154                                   apr_hash_t *entries,
155                                   apr_pool_t *pool);
156
157 /* Unparse CHANGE into a newly allocated `CHANGE' skel and set *SKEL_P to
158    the result.  Use POOL for all allocations.  */
159 svn_error_t *
160 svn_fs_base__unparse_change_skel(svn_skel_t **skel_p,
161                                  const change_t *change,
162                                  apr_pool_t *pool);
163
164 /* Unparse LOCK into a newly allocated `LOCK' skel and set *SKEL_P to the
165    result.  Use POOL for all allocations.  */
166 svn_error_t *
167 svn_fs_base__unparse_lock_skel(svn_skel_t **skel_p,
168                                const svn_lock_t *lock,
169                                apr_pool_t *pool);
170
171
172 \f
173 #ifdef __cplusplus
174 }
175 #endif /* __cplusplus */
176
177 #endif /* SVN_LIBSVN_FS_FS_SKELS_H */