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 * ====================================================================
23 #include "svn_types.h"
24 #include "svn_pools.h"
27 #include "fs-loader.h"
32 svn_fs_create_access(svn_fs_access_t
**access_ctx
,
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
);
50 svn_fs_set_access(svn_fs_t
*fs
,
51 svn_fs_access_t
*access_ctx
)
53 fs
->access_ctx
= access_ctx
;
60 svn_fs_get_access(svn_fs_access_t
**access_ctx
,
63 *access_ctx
= fs
->access_ctx
;
70 svn_fs_access_get_username(const char **username
,
71 svn_fs_access_t
*access_ctx
)
73 *username
= access_ctx
->username
;
80 svn_fs_access_add_lock_token(svn_fs_access_t
*access_ctx
,
83 apr_hash_set(access_ctx
->lock_tokens
,
84 token
, APR_HASH_KEY_STRING
, (void *) 1);