1 /* checksum-reps-table.h : internal interface to ops on `checksum-reps' 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_CHECKSUM_REPS_TABLE_H
24 #define SVN_LIBSVN_FS_CHECKSUM_REPS_TABLE_H
27 #include "svn_error.h"
28 #include "svn_checksum.h"
34 #endif /* __cplusplus */
37 /* Open a `checksum-reps' table in ENV. If CREATE is non-zero, create
38 one if it doesn't exist. Set *CHECKSUM_REPS_P to the new table.
39 Return a Berkeley DB error code. */
40 int svn_fs_bdb__open_checksum_reps_table(DB **checksum_reps_p,
42 svn_boolean_t create);
44 /* Set *REP_KEY to the representation key stored as the value of key
45 CHECKSUM in the `checksum-reps' table. Do this as part of TRAIL.
46 Use POOL for allocations.
48 If no such node revision ID is stored for CHECKSUM, return
49 SVN_ERR_FS_NO_SUCH_CHECKSUM_REP. */
50 svn_error_t *svn_fs_bdb__get_checksum_rep(const char **rep_key,
52 svn_checksum_t *checksum,
56 /* Store in the `checksum-reps' table a mapping of CHECKSUM to
57 representation key REP_KEY in FS. Do this as part of TRAIL. Use
58 POOL for temporary allocations.
60 WARNING: NEVER store a record that maps a checksum to a mutable
61 representation. Ever. Under pain of dismemberment and death. */
62 svn_error_t *svn_fs_bdb__set_checksum_rep(svn_fs_t *fs,
63 svn_checksum_t *checksum,
68 /* Delete from the `checksum-reps' table the mapping of CHECKSUM to a
69 representation key in FS. Do this as part of TRAIL. Use POOL for
70 temporary allocations. */
71 svn_error_t *svn_fs_bdb__delete_checksum_rep(svn_fs_t *fs,
72 svn_checksum_t *checksum,
76 /* Reserve a unique reuse ID in the `checksum-reps' table in FS for a
77 new instance of a re-used representation as part of TRAIL. Return
78 the slot's id in *REUSE_ID_P, allocated in POOL. */
79 svn_error_t *svn_fs_bdb__reserve_rep_reuse_id(const char **reuse_id_p,
87 #endif /* __cplusplus */
89 #endif /* SVN_LIBSVN_FS_CHECKSUM_REPS_TABLE_H */