1 /* locks-table.h : internal interface to ops on `locks' table
3 * ====================================================================
4 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
18 #ifndef SVN_LIBSVN_FS_LOCKS_TABLE_H
19 #define SVN_LIBSVN_FS_LOCKS_TABLE_H
22 #include "svn_error.h"
28 #endif /* __cplusplus */
31 /* Open a `locks' table in ENV. If CREATE is non-zero, create
32 one if it doesn't exist. Set *LOCKS_P to the new table.
33 Return a Berkeley DB error code. */
34 int svn_fs_bdb__open_locks_table(DB
**locks_p
,
36 svn_boolean_t create
);
39 /* Add a lock to the `locks' table in FS, as part of TRAIL.
41 Use LOCK_TOKEN as the key, presumably a string form of an apr_uuid_t.
42 Convert LOCK into a skel and store it as the value.
44 Warning: if LOCK_TOKEN already exists as a key, then its value
45 will be overwritten. */
46 svn_error_t
*svn_fs_bdb__lock_add(svn_fs_t
*fs
,
47 const char *lock_token
,
53 /* Remove the lock whose key is LOCK_TOKEN from the `locks' table of
56 Return SVN_ERR_FS_BAD_LOCK_TOKEN if LOCK_TOKEN does not exist as a
58 svn_error_t
*svn_fs_bdb__lock_delete(svn_fs_t
*fs
,
59 const char *lock_token
,
64 /* Retrieve the lock *LOCK_P pointed to by LOCK_TOKEN from the `locks'
65 table of FS, as part of TRAIL. Perform all allocations in POOL.
67 Return SVN_ERR_FS_BAD_LOCK_TOKEN if LOCK_TOKEN does not exist as a
70 Before returning LOCK_P, check its expiration date. If expired,
71 remove the row from the `locks' table and return SVN_ERR_FS_LOCK_EXPIRED.
73 svn_error_t
*svn_fs_bdb__lock_get(svn_lock_t
**lock_p
,
75 const char *lock_token
,
80 /* Retrieve locks representing all locks that exist at or below PATH
81 in FS. Pass each lock to GET_LOCKS_FUNC callback along with
84 This function promises to auto-expire any locks encountered while
85 building the hash. That means that the caller can trust that each
86 returned lock hasn't yet expired.
88 svn_error_t
*svn_fs_bdb__locks_get(svn_fs_t
*fs
,
90 svn_fs_get_locks_callback_t get_locks_func
,
91 void *get_locks_baton
,
99 #endif /* __cplusplus */
101 #endif /* SVN_LIBSVN_FS_LOCKS_TABLE_H */