Fix compiler warning due to missing function prototype.
[svn.git] / subversion / libsvn_fs_base / bdb / locks-table.h
blob87bfaed1f4bbdd02139e336453bf31e52bb103f6
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
21 #include "svn_fs.h"
22 #include "svn_error.h"
23 #include "../trail.h"
24 #include "../fs.h"
26 #ifdef __cplusplus
27 extern "C" {
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,
35 DB_ENV *env,
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,
48 svn_lock_t *lock,
49 trail_t *trail,
50 apr_pool_t *pool);
53 /* Remove the lock whose key is LOCK_TOKEN from the `locks' table of
54 FS, as part of TRAIL.
56 Return SVN_ERR_FS_BAD_LOCK_TOKEN if LOCK_TOKEN does not exist as a
57 table key. */
58 svn_error_t *svn_fs_bdb__lock_delete(svn_fs_t *fs,
59 const char *lock_token,
60 trail_t *trail,
61 apr_pool_t *pool);
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
68 table key.
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,
74 svn_fs_t *fs,
75 const char *lock_token,
76 trail_t *trail,
77 apr_pool_t *pool);
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
82 GET_LOCKS_BATON.
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,
89 const char *path,
90 svn_fs_get_locks_callback_t get_locks_func,
91 void *get_locks_baton,
92 trail_t *trail,
93 apr_pool_t *pool);
97 #ifdef __cplusplus
99 #endif /* __cplusplus */
101 #endif /* SVN_LIBSVN_FS_LOCKS_TABLE_H */