1/* rev-table.h : internal interface to revision table operations
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_REV_TABLE_H
24#define SVN_LIBSVN_FS_REV_TABLE_H
25
26#define SVN_WANT_BDB
27#include "svn_private_config.h"
28
29#include "svn_fs.h"
30
31#include "../fs.h"
32#include "../trail.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif /* __cplusplus */
37
38
39/* Creating and opening the `revisions' table.  */
40
41/* Open a `revisions' table in ENV.  If CREATE is non-zero, create one
42   if it doesn't exist.  Set *REVS_P to the new table.  Return a
43   Berkeley DB error code.  */
44int svn_fs_bdb__open_revisions_table(DB **revisions_p,
45                                     DB_ENV *env,
46                                     svn_boolean_t create);
47
48
49
50/* Storing and retrieving filesystem revisions.  */
51
52
53/* Set *REVISION_P to point to the revision structure for the
54   filesystem revision REV in FS, as part of TRAIL.  Perform all
55   allocations in POOL.  */
56svn_error_t *svn_fs_bdb__get_rev(revision_t **revision_p,
57                                 svn_fs_t *fs,
58                                 svn_revnum_t rev,
59                                 trail_t *trail,
60                                 apr_pool_t *pool);
61
62/* Store REVISION in FS as revision *REV as part of TRAIL.  If *REV is
63   an invalid revision number, create a brand new revision and return
64   its revision number as *REV to the caller.  Do any necessary
65   temporary allocation in POOL.  */
66svn_error_t *svn_fs_bdb__put_rev(svn_revnum_t *rev,
67                                 svn_fs_t *fs,
68                                 const revision_t *revision,
69                                 trail_t *trail,
70                                 apr_pool_t *pool);
71
72
73/* Set *YOUNGEST_P to the youngest revision in filesystem FS,
74   as part of TRAIL.  Use POOL for all temporary allocation. */
75svn_error_t *svn_fs_bdb__youngest_rev(svn_revnum_t *youngest_p,
76                                      svn_fs_t *fs,
77                                      trail_t *trail,
78                                      apr_pool_t *pool);
79
80
81#ifdef __cplusplus
82}
83#endif /* __cplusplus */
84
85#endif /* SVN_LIBSVN_FS_REV_TABLE_H */
86