In the command-line client, forbid
[svn.git] / subversion / libsvn_fs / access.c
blob8b611570d22ce99b6a6645ff7bfe80dcb01227c8
1 /*
2 * access.c: shared code to manipulate svn_fs_access_t objects
4 * ====================================================================
5 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
20 #include <assert.h>
21 #include <apr_hash.h>
23 #include "svn_types.h"
24 #include "svn_pools.h"
25 #include "svn_fs.h"
27 #include "fs-loader.h"
31 svn_error_t *
32 svn_fs_create_access(svn_fs_access_t **access_ctx,
33 const char *username,
34 apr_pool_t *pool)
36 svn_fs_access_t *ac;
38 assert(username != NULL);
40 ac = apr_pcalloc(pool, sizeof(*ac));
41 ac->username = apr_pstrdup(pool, username);
42 ac->lock_tokens = apr_hash_make(pool);
43 *access_ctx = ac;
45 return SVN_NO_ERROR;
49 svn_error_t *
50 svn_fs_set_access(svn_fs_t *fs,
51 svn_fs_access_t *access_ctx)
53 fs->access_ctx = access_ctx;
55 return SVN_NO_ERROR;
59 svn_error_t *
60 svn_fs_get_access(svn_fs_access_t **access_ctx,
61 svn_fs_t *fs)
63 *access_ctx = fs->access_ctx;
65 return SVN_NO_ERROR;
69 svn_error_t *
70 svn_fs_access_get_username(const char **username,
71 svn_fs_access_t *access_ctx)
73 *username = access_ctx->username;
75 return SVN_NO_ERROR;
79 svn_error_t *
80 svn_fs_access_add_lock_token(svn_fs_access_t *access_ctx,
81 const char *token)
83 apr_hash_set(access_ctx->lock_tokens,
84 token, APR_HASH_KEY_STRING, (void *) 1);
86 return SVN_NO_ERROR;