1 /* lock.h : internal interface to lock functions
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_LOCK_H
19 #define SVN_LIBSVN_FS_LOCK_H
23 #endif /* __cplusplus */
27 /* These functions implement some of the calls in the FS loader
28 library's fs vtables. */
30 svn_error_t
*svn_fs_fs__lock(svn_lock_t
**lock
,
35 svn_boolean_t is_dav_comment
,
36 apr_time_t expiration_date
,
37 svn_revnum_t current_rev
,
38 svn_boolean_t steal_lock
,
41 svn_error_t
*svn_fs_fs__generate_lock_token(const char **token
,
45 svn_error_t
*svn_fs_fs__unlock(svn_fs_t
*fs
,
48 svn_boolean_t break_lock
,
51 svn_error_t
*svn_fs_fs__get_lock(svn_lock_t
**lock
,
56 svn_error_t
*svn_fs_fs__get_locks(svn_fs_t
*fs
,
58 svn_fs_get_locks_callback_t get_locks_func
,
59 void *get_locks_baton
,
63 /* Examine PATH for existing locks, and check whether they can be
64 used. Use POOL for temporary allocations.
66 If no locks are present, return SVN_NO_ERROR.
68 If PATH is locked (or contains locks "below" it, when RECURSE is
69 set), then verify that:
71 1. a username has been supplied to TRAIL->fs's access-context,
72 else return SVN_ERR_FS_NO_USER.
74 2. for every lock discovered, the current username in the access
75 context of TRAIL->fs matches the "owner" of the lock, else
76 return SVN_ERR_FS_LOCK_OWNER_MISMATCH.
78 3. for every lock discovered, a matching lock token has been
79 passed into TRAIL->fs's access-context, else return
80 SVN_ERR_FS_BAD_LOCK_TOKEN.
82 If all three conditions are met, return SVN_NO_ERROR.
84 If the caller (directly or indirectly) has the FS write lock,
85 HAVE_WRITE_LOCK should be true.
87 svn_error_t
*svn_fs_fs__allow_locked_operation(const char *path
,
89 svn_boolean_t recurse
,
90 svn_boolean_t have_write_lock
,
95 #endif /* __cplusplus */
97 #endif /* SVN_LIBSVN_FS_LOCK_H */