Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Typedefs | Functions
Filesystem access contexts

Filesystem Access Contexts. More...

Typedefs

typedef struct svn_fs_access_t svn_fs_access_t
 An opaque object representing temporary user data. More...
 

Functions

svn_error_tsvn_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. More...
 
svn_error_tsvn_fs_set_access (svn_fs_t *fs, svn_fs_access_t *access_ctx)
 Associate access_ctx with an open fs. More...
 
svn_error_tsvn_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_tsvn_fs_access_get_username (const char **username, svn_fs_access_t *access_ctx)
 Accessors for the access context: More...
 
svn_error_tsvn_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. More...
 
svn_error_tsvn_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. More...
 

Detailed Description

Filesystem Access Contexts.

Since
New in 1.2.

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 Documentation

An opaque object representing temporary user data.

Definition at line 777 of file svn_fs.h.

Function Documentation

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.

Deprecated:
Provided for backward compatibility with the 1.5 API.
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.

Since
New in 1.6.
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.