1251881Speter/* tree.h : internal interface to tree node functions
2251881Speter *
3251881Speter * ====================================================================
4251881Speter *    Licensed to the Apache Software Foundation (ASF) under one
5251881Speter *    or more contributor license agreements.  See the NOTICE file
6251881Speter *    distributed with this work for additional information
7251881Speter *    regarding copyright ownership.  The ASF licenses this file
8251881Speter *    to you under the Apache License, Version 2.0 (the
9251881Speter *    "License"); you may not use this file except in compliance
10251881Speter *    with the License.  You may obtain a copy of the License at
11251881Speter *
12251881Speter *      http://www.apache.org/licenses/LICENSE-2.0
13251881Speter *
14251881Speter *    Unless required by applicable law or agreed to in writing,
15251881Speter *    software distributed under the License is distributed on an
16251881Speter *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17251881Speter *    KIND, either express or implied.  See the License for the
18251881Speter *    specific language governing permissions and limitations
19251881Speter *    under the License.
20251881Speter * ====================================================================
21251881Speter */
22251881Speter
23251881Speter#ifndef SVN_LIBSVN_FS_TREE_H
24251881Speter#define SVN_LIBSVN_FS_TREE_H
25251881Speter
26251881Speter#include "fs.h"
27251881Speter
28251881Speter#ifdef __cplusplus
29251881Speterextern "C" {
30251881Speter#endif /* __cplusplus */
31251881Speter
32251881Speter
33251881Speter
34251881Speter/* In POOL, create an instance of a DAG node 1st level cache.
35251881Speter   The POOL will be cleared at regular intervals. */
36251881Speterfs_fs_dag_cache_t*
37251881Spetersvn_fs_fs__create_dag_cache(apr_pool_t *pool);
38251881Speter
39251881Speter/* Set *ROOT_P to the root directory of revision REV in filesystem FS.
40251881Speter   Allocate the structure in POOL. */
41251881Spetersvn_error_t *svn_fs_fs__revision_root(svn_fs_root_t **root_p, svn_fs_t *fs,
42251881Speter                                      svn_revnum_t rev, apr_pool_t *pool);
43251881Speter
44251881Speter/* Does nothing, but included for Subversion 1.0.x compatibility. */
45251881Spetersvn_error_t *svn_fs_fs__deltify(svn_fs_t *fs, svn_revnum_t rev,
46251881Speter                                apr_pool_t *pool);
47251881Speter
48251881Speter/* Commit the transaction TXN as a new revision.  Return the new
49251881Speter   revision in *NEW_REV.  If the transaction conflicts with other
50251881Speter   changes return SVN_ERR_FS_CONFLICT and set *CONFLICT_P to a string
51251881Speter   that details the cause of the conflict.  Perform temporary
52251881Speter   allocations in POOL. */
53251881Spetersvn_error_t *svn_fs_fs__commit_txn(const char **conflict_p,
54251881Speter                                   svn_revnum_t *new_rev, svn_fs_txn_t *txn,
55251881Speter                                   apr_pool_t *pool);
56251881Speter
57251881Speter/* Set ROOT_P to the root directory of transaction TXN.  Allocate the
58251881Speter   structure in POOL. */
59251881Spetersvn_error_t *svn_fs_fs__txn_root(svn_fs_root_t **root_p, svn_fs_txn_t *txn,
60251881Speter                                 apr_pool_t *pool);
61251881Speter
62251881Speter
63251881Speter/* Set KIND_P to the node kind of the node at PATH in ROOT.
64251881Speter   Allocate the structure in POOL. */
65251881Spetersvn_error_t *
66251881Spetersvn_fs_fs__check_path(svn_node_kind_t *kind_p,
67251881Speter                      svn_fs_root_t *root,
68251881Speter                      const char *path,
69251881Speter                      apr_pool_t *pool);
70251881Speter
71251881Speter/* Implement root_vtable_t.node_id(). */
72251881Spetersvn_error_t *
73251881Spetersvn_fs_fs__node_id(const svn_fs_id_t **id_p,
74251881Speter                   svn_fs_root_t *root,
75251881Speter                   const char *path,
76251881Speter                   apr_pool_t *pool);
77251881Speter
78251881Speter/* Set *REVISION to the revision in which PATH under ROOT was created.
79251881Speter   Use POOL for any temporary allocations.  If PATH is in an
80251881Speter   uncommitted transaction, *REVISION will be set to
81251881Speter   SVN_INVALID_REVNUM. */
82251881Spetersvn_error_t *
83251881Spetersvn_fs_fs__node_created_rev(svn_revnum_t *revision,
84251881Speter                            svn_fs_root_t *root,
85251881Speter                            const char *path,
86251881Speter                            apr_pool_t *pool);
87251881Speter
88251881Speter/* Verify metadata for ROOT.
89251881Speter   ### Currently only implemented for revision roots. */
90251881Spetersvn_error_t *
91251881Spetersvn_fs_fs__verify_root(svn_fs_root_t *root,
92251881Speter                       apr_pool_t *pool);
93251881Speter
94251881Speter#ifdef __cplusplus
95251881Speter}
96251881Speter#endif /* __cplusplus */
97251881Speter
98251881Speter#endif /* SVN_LIBSVN_FS_TREE_H */
99