1 /* lock-tokens-table.h : internal interface to ops on `lock-tokens' 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_LOCK_TOKENS_TABLE_H
24 #define SVN_LIBSVN_FS_LOCK_TOKENS_TABLE_H
27 #include "svn_error.h"
33 #endif /* __cplusplus */
36 /* Open a `lock-tokens' table in ENV. If CREATE is non-zero, create
37 one if it doesn't exist. Set *LOCK_TOKENS_P to the new table.
38 Return a Berkeley DB error code. */
39 int svn_fs_bdb__open_lock_tokens_table(DB **locks_tokens_p,
41 svn_boolean_t create);
44 /* Add a lock-token to the `lock-tokens' table in FS, as part of TRAIL.
45 Use PATH as the key and LOCK_TOKEN as the value.
47 Warning: if PATH already exists as a key, then its value will be
50 svn_fs_bdb__lock_token_add(svn_fs_t *fs,
52 const char *lock_token,
57 /* Remove the lock-token whose key is PATH from the `lock-tokens'
58 table of FS, as part of TRAIL.
60 If PATH doesn't exist as a key, return SVN_ERR_FS_NO_SUCH_LOCK.
63 svn_fs_bdb__lock_token_delete(svn_fs_t *fs,
69 /* Retrieve the lock-token *LOCK_TOKEN_P pointed to by PATH from the
70 `lock-tokens' table of FS, as part of TRAIL. Perform all
73 If PATH doesn't exist as a key, return SVN_ERR_FS_NO_SUCH_LOCK.
75 If PATH points to a token which points to an expired lock, return
76 SVN_ERR_FS_LOCK_EXPIRED. (After this, both the token and lock are
77 gone from their respective tables.)
79 If PATH points to a token which points to a non-existent lock,
80 return SVN_ERR_FS_BAD_LOCK_TOKEN. (After this, the token is also
81 removed from the `lock-tokens' table.)
84 svn_fs_bdb__lock_token_get(const char **lock_token_p,
94 #endif /* __cplusplus */
96 #endif /* SVN_LIBSVN_FS_LOCK_TOKENS_TABLE_H */