1 /* locks-table.h : internal interface to ops on `locks' 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_LOCKS_TABLE_H
24 #define SVN_LIBSVN_FS_LOCKS_TABLE_H
27 #include "svn_error.h"
33 #endif /* __cplusplus */
36 /* Open a `locks' table in ENV. If CREATE is non-zero, create
37 one if it doesn't exist. Set *LOCKS_P to the new table.
38 Return a Berkeley DB error code. */
39 int svn_fs_bdb__open_locks_table(DB **locks_p,
41 svn_boolean_t create);
44 /* Add a lock to the `locks' table in FS, as part of TRAIL.
46 Use LOCK_TOKEN as the key, presumably a string form of an apr_uuid_t.
47 Convert LOCK into a skel and store it as the value.
49 Warning: if LOCK_TOKEN already exists as a key, then its value
50 will be overwritten. */
51 svn_error_t *svn_fs_bdb__lock_add(svn_fs_t *fs,
52 const char *lock_token,
58 /* Remove the lock whose key is LOCK_TOKEN from the `locks' table of
61 Return SVN_ERR_FS_BAD_LOCK_TOKEN if LOCK_TOKEN does not exist as a
63 svn_error_t *svn_fs_bdb__lock_delete(svn_fs_t *fs,
64 const char *lock_token,
69 /* Retrieve the lock *LOCK_P pointed to by LOCK_TOKEN from the `locks'
70 table of FS, as part of TRAIL. Perform all allocations in POOL.
72 Return SVN_ERR_FS_BAD_LOCK_TOKEN if LOCK_TOKEN does not exist as a
75 Before returning LOCK_P, check its expiration date. If expired,
76 remove the row from the `locks' table and return SVN_ERR_FS_LOCK_EXPIRED.
78 svn_error_t *svn_fs_bdb__lock_get(svn_lock_t **lock_p,
80 const char *lock_token,
85 /* Retrieve locks representing all locks that exist at or below PATH
86 in FS. Pass each lock to GET_LOCKS_FUNC callback along with
89 Use DEPTH to filter the reported locks to only those within the
90 requested depth of PATH.
92 This function promises to auto-expire any locks encountered while
93 building the hash. That means that the caller can trust that each
94 returned lock hasn't yet expired.
96 svn_error_t *svn_fs_bdb__locks_get(svn_fs_t *fs,
99 svn_fs_get_locks_callback_t get_locks_func,
100 void *get_locks_baton,
108 #endif /* __cplusplus */
110 #endif /* SVN_LIBSVN_FS_LOCKS_TABLE_H */