1/* lock-tokens-table.h : internal interface to ops on `lock-tokens' table 2 * 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 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 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 19 * under the License. 20 * ==================================================================== 21 */ 22 23#ifndef SVN_LIBSVN_FS_LOCK_TOKENS_TABLE_H 24#define SVN_LIBSVN_FS_LOCK_TOKENS_TABLE_H 25 26#include "svn_fs.h" 27#include "svn_error.h" 28#include "../trail.h" 29#include "../fs.h" 30 31#ifdef __cplusplus 32extern "C" { 33#endif /* __cplusplus */ 34 35 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. */ 39int svn_fs_bdb__open_lock_tokens_table(DB **locks_tokens_p, 40 DB_ENV *env, 41 svn_boolean_t create); 42 43 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. 46 47 Warning: if PATH already exists as a key, then its value will be 48 overwritten. */ 49svn_error_t * 50svn_fs_bdb__lock_token_add(svn_fs_t *fs, 51 const char *path, 52 const char *lock_token, 53 trail_t *trail, 54 apr_pool_t *pool); 55 56 57/* Remove the lock-token whose key is PATH from the `lock-tokens' 58 table of FS, as part of TRAIL. 59 60 If PATH doesn't exist as a key, return SVN_ERR_FS_NO_SUCH_LOCK. 61*/ 62svn_error_t * 63svn_fs_bdb__lock_token_delete(svn_fs_t *fs, 64 const char *path, 65 trail_t *trail, 66 apr_pool_t *pool); 67 68 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 71 allocations in POOL. 72 73 If PATH doesn't exist as a key, return SVN_ERR_FS_NO_SUCH_LOCK. 74 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.) 78 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.) 82 */ 83svn_error_t * 84svn_fs_bdb__lock_token_get(const char **lock_token_p, 85 svn_fs_t *fs, 86 const char *path, 87 trail_t *trail, 88 apr_pool_t *pool); 89 90 91 92#ifdef __cplusplus 93} 94#endif /* __cplusplus */ 95 96#endif /* SVN_LIBSVN_FS_LOCK_TOKENS_TABLE_H */ 97