1 /* nodes-table.h : interface to `nodes' table
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
20 * ====================================================================
23 #ifndef SVN_LIBSVN_FS_NODES_TABLE_H
24 #define SVN_LIBSVN_FS_NODES_TABLE_H
27 #include "svn_private_config.h"
34 #endif /* __cplusplus */
37 /* Creating and opening the `nodes' table. */
40 /* Open a `nodes' table in ENV. If CREATE is non-zero, create
41 one if it doesn't exist. Set *NODES_P to the new table.
42 Return a Berkeley DB error code. */
43 int svn_fs_bdb__open_nodes_table(DB **nodes_p,
45 svn_boolean_t create);
48 /* Check FS's `nodes' table to find an unused node number, and set
49 *ID_P to the ID of the first revision of an entirely new node in
50 FS, with copy_id COPY_ID, created in transaction TXN_ID, as part
51 of TRAIL. Allocate the new ID, and do all temporary allocation,
53 svn_error_t *svn_fs_bdb__new_node_id(svn_fs_id_t **id_p,
61 /* Delete node revision ID from FS's `nodes' table, as part of TRAIL.
62 WARNING: This does not check that the node revision is mutable!
63 Callers should do that check themselves.
65 todo: Jim and Karl are both not sure whether it would be better for
66 this to check mutability or not. On the one hand, having the
67 lowest level do that check would seem intuitively good. On the
68 other hand, we'll need a way to delete even immutable nodes someday
69 -- for example, someone accidentally commits NDA-protected data to
70 a public repository and wants to remove it. Thoughts? */
71 svn_error_t *svn_fs_bdb__delete_nodes_entry(svn_fs_t *fs,
72 const svn_fs_id_t *id,
77 /* Set *SUCCESSOR_P to the ID of an immediate successor to node
78 revision ID in FS that does not exist yet, as part of TRAIL.
79 Allocate *SUCCESSOR_P in POOL.
81 Use the current Subversion transaction name TXN_ID, and optionally
82 a copy id COPY_ID, in the determination of the new node revision
84 svn_error_t *svn_fs_bdb__new_successor_id(svn_fs_id_t **successor_p,
86 const svn_fs_id_t *id,
93 /* Set *NODEREV_P to the node-revision for the node ID in FS, as
94 part of TRAIL. Do any allocations in POOL. Allow NODEREV_P
95 to be NULL, in which case it is not used, and this function acts as
96 an existence check for ID in FS. */
97 svn_error_t *svn_fs_bdb__get_node_revision(node_revision_t **noderev_p,
99 const svn_fs_id_t *id,
104 /* Store NODEREV as the node-revision for the node whose id
105 is ID in FS, as part of TRAIL. Do any necessary temporary
108 After this call, the node table manager assumes that NODE's
109 contents will change frequently. */
110 svn_error_t *svn_fs_bdb__put_node_revision(svn_fs_t *fs,
111 const svn_fs_id_t *id,
112 node_revision_t *noderev,
119 #endif /* __cplusplus */
121 #endif /* SVN_LIBSVN_FS_NODES_TABLE_H */