1251881Speter/* node-rev.h : interface to node revision retrieval and storage
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_NODE_REV_H
24251881Speter#define SVN_LIBSVN_FS_NODE_REV_H
25251881Speter
26251881Speter#define SVN_WANT_BDB
27251881Speter#include "svn_private_config.h"
28251881Speter
29251881Speter#include "svn_fs.h"
30251881Speter#include "trail.h"
31251881Speter
32251881Speter#ifdef __cplusplus
33251881Speterextern "C" {
34251881Speter#endif /* __cplusplus */
35251881Speter
36251881Speter
37251881Speter/*** Functions. ***/
38251881Speter
39251881Speter/* Create an entirely new, mutable node in the filesystem FS, whose
40251881Speter   NODE-REVISION is NODEREV, as part of TRAIL.  Set *ID_P to the new
41251881Speter   node revision's ID.  Use POOL for any temporary allocation.
42251881Speter
43251881Speter   COPY_ID is the copy_id to use in the node revision ID returned in
44251881Speter   *ID_P.
45251881Speter
46251881Speter   TXN_ID is the Subversion transaction under which this occurs.
47251881Speter
48251881Speter   After this call, the node table manager assumes that the new node's
49251881Speter   contents will change frequently.  */
50251881Spetersvn_error_t *svn_fs_base__create_node(const svn_fs_id_t **id_p,
51251881Speter                                      svn_fs_t *fs,
52251881Speter                                      node_revision_t *noderev,
53251881Speter                                      const char *copy_id,
54251881Speter                                      const char *txn_id,
55251881Speter                                      trail_t *trail,
56251881Speter                                      apr_pool_t *pool);
57251881Speter
58251881Speter/* Create a node revision in FS which is an immediate successor of
59251881Speter   OLD_ID, whose contents are NEW_NR, as part of TRAIL.  Set *NEW_ID_P
60251881Speter   to the new node revision's ID.  Use POOL for any temporary
61251881Speter   allocation.
62251881Speter
63251881Speter   COPY_ID, if non-NULL, is a key into the `copies' table, and
64251881Speter   indicates that this new node is being created as the result of a
65251881Speter   copy operation, and specifically which operation that was.
66251881Speter
67251881Speter   TXN_ID is the Subversion transaction under which this occurs.
68251881Speter
69251881Speter   After this call, the deltification code assumes that the new node's
70251881Speter   contents will change frequently, and will avoid representing other
71251881Speter   nodes as deltas against this node's contents.  */
72251881Spetersvn_error_t *svn_fs_base__create_successor(const svn_fs_id_t **new_id_p,
73251881Speter                                           svn_fs_t *fs,
74251881Speter                                           const svn_fs_id_t *old_id,
75251881Speter                                           node_revision_t *new_nr,
76251881Speter                                           const char *copy_id,
77251881Speter                                           const char *txn_id,
78251881Speter                                           trail_t *trail,
79251881Speter                                           apr_pool_t *pool);
80251881Speter
81251881Speter
82251881Speter/* Delete node revision ID from FS's `nodes' table, as part of TRAIL.
83251881Speter   If ORIGIN_ALSO is set, also delete the record for this ID's node ID
84251881Speter   from the `node-origins' index table (which is typically only done
85251881Speter   if the caller thinks that ID points to the only node revision ID in
86251881Speter   its line of history).
87251881Speter
88251881Speter   WARNING: This does not check that the node revision is mutable!
89251881Speter   Callers should do that check themselves.  */
90251881Spetersvn_error_t *svn_fs_base__delete_node_revision(svn_fs_t *fs,
91251881Speter                                               const svn_fs_id_t *id,
92251881Speter                                               svn_boolean_t origin_also,
93251881Speter                                               trail_t *trail,
94251881Speter                                               apr_pool_t *pool);
95251881Speter
96251881Speter
97251881Speter#ifdef __cplusplus
98251881Speter}
99251881Speter#endif /* __cplusplus */
100251881Speter
101251881Speter#endif /* SVN_LIBSVN_FS_NODE_REV_H */
102