]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/subversion/subversion/libsvn_fs_base/bdb/node-origins-table.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / subversion / subversion / libsvn_fs_base / bdb / node-origins-table.h
1 /* node-origins-table.h : internal interface to ops on `node-origins' table
2  *
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  */
22
23 #ifndef SVN_LIBSVN_FS_NODE_ORIGINS_TABLE_H
24 #define SVN_LIBSVN_FS_NODE_ORIGINS_TABLE_H
25
26 #include "svn_fs.h"
27 #include "svn_error.h"
28 #include "../trail.h"
29 #include "../fs.h"
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34
35 \f
36 /* Open a `node-origins' table in ENV.  If CREATE is non-zero, create
37    one if it doesn't exist.  Set *NODE_ORIGINS_P to the new table.
38    Return a Berkeley DB error code.  */
39 int svn_fs_bdb__open_node_origins_table(DB **node_origins_p,
40                                         DB_ENV *env,
41                                         svn_boolean_t create);
42
43 /* Set *ORIGIN_ID to the node revision ID from which the history of
44    all nodes in FS whose node ID is NODE_ID springs, as determined by
45    a look in the `node-origins' table.  Do this as part of TRAIL.  Use
46    POOL for allocations.
47
48    If no such node revision ID is stored for NODE_ID, return
49    SVN_ERR_FS_NO_SUCH_NODE_ORIGIN.  */
50 svn_error_t *svn_fs_bdb__get_node_origin(const svn_fs_id_t **origin_id,
51                                          svn_fs_t *fs,
52                                          const char *node_id,
53                                          trail_t *trail,
54                                          apr_pool_t *pool);
55
56 /* Store in the `node-origins' table a mapping of NODE_ID to original
57    node revision ID ORIGIN_ID for FS.  Do this as part of TRAIL.  Use
58    POOL for temporary allocations.  */
59 svn_error_t *svn_fs_bdb__set_node_origin(svn_fs_t *fs,
60                                          const char *node_id,
61                                          const svn_fs_id_t *origin_id,
62                                          trail_t *trail,
63                                          apr_pool_t *pool);
64
65 /* Delete from the `node-origins' table the record for NODE_ID in FS.
66    Do this as part of TRAIL.  Use POOL for temporary allocations.  */
67 svn_error_t *svn_fs_bdb__delete_node_origin(svn_fs_t *fs,
68                                             const char *node_id,
69                                             trail_t *trail,
70                                             apr_pool_t *pool);
71
72 #ifdef __cplusplus
73 }
74 #endif /* __cplusplus */
75
76 #endif /* SVN_LIBSVN_FS_NODE_ORIGINS_TABLE_H */