2 * access.c: shared code to manipulate svn_fs_access_t objects
4 * ====================================================================
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
21 * ====================================================================
28 #include "svn_types.h"
29 #include "svn_pools.h"
31 #include "private/svn_fs_private.h"
33 #include "fs-loader.h"
38 svn_fs_create_access(svn_fs_access_t **access_ctx,
44 SVN_ERR_ASSERT(username != NULL);
46 ac = apr_pcalloc(pool, sizeof(*ac));
47 ac->username = apr_pstrdup(pool, username);
48 ac->lock_tokens = apr_hash_make(pool);
56 svn_fs_set_access(svn_fs_t *fs,
57 svn_fs_access_t *access_ctx)
59 fs->access_ctx = access_ctx;
66 svn_fs_get_access(svn_fs_access_t **access_ctx,
69 *access_ctx = fs->access_ctx;
76 svn_fs_access_get_username(const char **username,
77 svn_fs_access_t *access_ctx)
79 *username = access_ctx->username;
86 svn_fs_access_add_lock_token2(svn_fs_access_t *access_ctx,
90 svn_hash_sets(access_ctx->lock_tokens, token, path);
95 svn_fs_access_add_lock_token(svn_fs_access_t *access_ctx,
98 return svn_fs_access_add_lock_token2(access_ctx, (const char *) 1, token);
102 svn_fs__access_get_lock_tokens(svn_fs_access_t *access_ctx)
104 return access_ctx->lock_tokens;