Mark many merge tests as skip-against-old-server.
[svn.git] / subversion / libsvn_fs_base / lock.h
blob6f417b5b7ec5d5c727dade10d6d4a21308377259
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
21 #include "trail.h"
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* __cplusplus */
30 /* These functions implement part of the FS loader library's fs
31 vtables. See the public svn_fs.h for docstrings.*/
33 svn_error_t *svn_fs_base__lock(svn_lock_t **lock,
34 svn_fs_t *fs,
35 const char *path,
36 const char *token,
37 const char *comment,
38 svn_boolean_t is_dav_comment,
39 apr_time_t expiration_date,
40 svn_revnum_t current_rev,
41 svn_boolean_t steal_lock,
42 apr_pool_t *pool);
44 svn_error_t *svn_fs_base__generate_lock_token(const char **token,
45 svn_fs_t *fs,
46 apr_pool_t *pool);
48 svn_error_t *svn_fs_base__unlock(svn_fs_t *fs,
49 const char *path,
50 const char *token,
51 svn_boolean_t break_lock,
52 apr_pool_t *pool);
54 svn_error_t *svn_fs_base__get_lock(svn_lock_t **lock,
55 svn_fs_t *fs,
56 const char *path,
57 apr_pool_t *pool);
59 svn_error_t *
60 svn_fs_base__get_locks(svn_fs_t *fs,
61 const char *path,
62 svn_fs_get_locks_callback_t get_locks_func,
63 void *get_locks_baton,
64 apr_pool_t *pool);
68 /* These next functions are 'helpers' for internal fs use:
69 if a fs function's txn_body needs to enforce existing locks, it
70 should use these routines:
74 /* Implements main logic of 'svn_fs_get_lock' (or in this
75 case, svn_fs_base__get_lock() above.) See svn_fs.h. */
76 svn_error_t *
77 svn_fs_base__get_lock_helper(svn_lock_t **lock_p,
78 const char *path,
79 trail_t *trail,
80 apr_pool_t *pool);
83 /* Examine PATH for existing locks, and check whether they can be
84 used. Do all work in the context of TRAIL, using POOL for
85 temporary allocations.
87 If no locks are present, return SVN_NO_ERROR.
89 If PATH is locked (or contains locks "below" it, when RECURSE is
90 set), then verify that:
92 1. a username has been supplied to TRAIL->fs's access-context,
93 else return SVN_ERR_FS_NO_USER.
95 2. for every lock discovered, the current username in the access
96 context of TRAIL->fs matches the "owner" of the lock, else
97 return SVN_ERR_FS_LOCK_OWNER_MISMATCH.
99 3. for every lock discovered, a matching lock token has been
100 passed into TRAIL->fs's access-context, else return
101 SVN_ERR_FS_BAD_LOCK_TOKEN.
103 If all three conditions are met, return SVN_NO_ERROR.
105 svn_error_t *svn_fs_base__allow_locked_operation(const char *path,
106 svn_boolean_t recurse,
107 trail_t *trail,
108 apr_pool_t *pool);
110 #ifdef __cplusplus
112 #endif /* __cplusplus */
114 #endif /* SVN_LIBSVN_FS_LOCK_H */