Subversion 1.6.16
|
Filesystem Access Contexts. More...
Typedefs | |
typedef struct svn_fs_access_t | svn_fs_access_t |
An opaque object representing temporary user data. | |
Functions | |
svn_error_t * | svn_fs_create_access (svn_fs_access_t **access_ctx, const char *username, apr_pool_t *pool) |
Set *access_ctx to a new svn_fs_access_t object representing username, allocated in pool. | |
svn_error_t * | svn_fs_set_access (svn_fs_t *fs, svn_fs_access_t *access_ctx) |
Associate access_ctx with an open fs. | |
svn_error_t * | svn_fs_get_access (svn_fs_access_t **access_ctx, svn_fs_t *fs) |
Set *access_ctx to the current fs access context, or NULL if there is no current fs access context. | |
svn_error_t * | svn_fs_access_get_username (const char **username, svn_fs_access_t *access_ctx) |
Accessors for the access context: | |
svn_error_t * | svn_fs_access_add_lock_token2 (svn_fs_access_t *access_ctx, const char *path, const char *token) |
Push a lock-token token associated with path path into the context access_ctx. | |
svn_error_t * | svn_fs_access_add_lock_token (svn_fs_access_t *access_ctx, const char *token) |
Same as svn_fs_access_add_lock_token2(), but with path set to value 1. |
Filesystem Access Contexts.
At certain times, filesystem functions need access to temporary user data. For example, which user is changing a file? If the file is locked, has an appropriate lock-token been supplied?
This temporary user data is stored in an "access context" object, and the access context is then connected to the filesystem object. Whenever a filesystem function requires information, it can pull things out of the context as needed.
typedef struct svn_fs_access_t svn_fs_access_t |
svn_error_t* svn_fs_access_add_lock_token | ( | svn_fs_access_t * | access_ctx, |
const char * | token | ||
) |
Same as svn_fs_access_add_lock_token2(), but with path set to value 1.
svn_error_t* svn_fs_access_add_lock_token2 | ( | svn_fs_access_t * | access_ctx, |
const char * | path, | ||
const char * | token | ||
) |
Push a lock-token token associated with path path into the context access_ctx.
The context remembers all tokens it receives, and makes them available to fs functions. The token and path are not duplicated into access_ctx's pool; make sure the token's lifetime is at least as long as access_ctx.
svn_error_t* svn_fs_access_get_username | ( | const char ** | username, |
svn_fs_access_t * | access_ctx | ||
) |
Accessors for the access context:
Set *username to the name represented by access_ctx.
svn_error_t* svn_fs_create_access | ( | svn_fs_access_t ** | access_ctx, |
const char * | username, | ||
apr_pool_t * | pool | ||
) |
Set *access_ctx to a new svn_fs_access_t
object representing username, allocated in pool.
username is presumed to have been authenticated by the caller.
Make a deep copy of username.
svn_error_t* svn_fs_set_access | ( | svn_fs_t * | fs, |
svn_fs_access_t * | access_ctx | ||
) |
Associate access_ctx with an open fs.
This function can be run multiple times on the same open filesystem, in order to change the filesystem access context for different filesystem operations. Pass a NULL value for access_ctx to disassociate the current access context from the filesystem.