📄 svn_repos.h
字号:
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *pool);
/**
* @deprecated Provided for backward compatibility with the 1.0.0 API.
*
* Similar to svn_repos_dump_fs2(), but with the @a use_deltas
* parameter always set to @c FALSE.
*/
svn_error_t *svn_repos_dump_fs (svn_repos_t *repos,
svn_stream_t *dumpstream,
svn_stream_t *feedback_stream,
svn_revnum_t start_rev,
svn_revnum_t end_rev,
svn_boolean_t incremental,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *pool);
/** Read and parse dumpfile-formatted @a dumpstream, reconstructing
* filesystem revisions in already-open @a repos, handling uuids
* in accordance with @a uuid_action.
*
* Read and parse dumpfile-formatted @a dumpstream, reconstructing
* filesystem revisions in already-open @a repos. Use @a pool for all
* allocation. If non-@c NULL, send feedback to @a feedback_stream.
*
* If the dumpstream contains copy history that is unavailable in the
* repository, an error will be thrown.
*
* The repository's UUID will be updated iff
* the dumpstream contains a UUID and
* @a uuid_action is not equal to @c svn_repos_load_uuid_ignore and
* either the repository contains no revisions or
* @a uuid_action is equal to @c svn_repos_load_uuid_force.
*
* If the dumpstream contains no UUID, then @a uuid_action is
* ignored and the repository UUID is not touched.
*
* If @a parent_dir is not null, then the parser will reparent all the
* loaded nodes, from root to @a parent_dir. The directory @a parent_dir
* must be an existing directory in the repository.
*
* If @a cancel_func is not @c NULL, it is called periodically with
* @a cancel_baton as argument to see if the client wishes to cancel
* the load.
*/
svn_error_t *svn_repos_load_fs (svn_repos_t *repos,
svn_stream_t *dumpstream,
svn_stream_t *feedback_stream,
enum svn_repos_load_uuid uuid_action,
const char *parent_dir,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *pool);
/**
* @since New in 1.1.
*
* A vtable that is driven by @c svn_repos_parse_dumpstream2. */
typedef struct svn_repos_parse_fns2_t
{
/** The parser has discovered a new revision record within the
* parsing session represented by @a parse_baton. All the headers are
* placed in @a headers (allocated in @a pool), which maps <tt>const
* char *</tt> header-name ==> <tt>const char *</tt> header-value.
* The @a revision_baton received back (also allocated in @a pool)
* represents the revision.
*/
svn_error_t *(*new_revision_record) (void **revision_baton,
apr_hash_t *headers,
void *parse_baton,
apr_pool_t *pool);
/** The parser has discovered a new uuid record within the parsing
* session represented by @a parse_baton. The uuid's value is
* @a uuid, and it is allocated in @a pool.
*/
svn_error_t *(*uuid_record) (const char *uuid,
void *parse_baton,
apr_pool_t *pool);
/** The parser has discovered a new node record within the current
* revision represented by @a revision_baton. All the headers are
* placed in @a headers as above, allocated in @a pool. The
* @a node_baton received back is allocated in @a pool and represents
* the node.
*/
svn_error_t *(*new_node_record) (void **node_baton,
apr_hash_t *headers,
void *revision_baton,
apr_pool_t *pool);
/** For a given @a revision_baton, set a property @a name to @a value. */
svn_error_t *(*set_revision_property) (void *revision_baton,
const char *name,
const svn_string_t *value);
/** For a given @a node_baton, set a property @a name to @a value. */
svn_error_t *(*set_node_property) (void *node_baton,
const char *name,
const svn_string_t *value);
/** For a given @a node_baton, delete property @a name. */
svn_error_t *(*delete_node_property) (void *node_baton, const char *name);
/** For a given @a node_baton, remove all properties. */
svn_error_t *(*remove_node_props) (void *node_baton);
/** For a given @a node_baton, receive a writable @a stream capable of
* receiving the node's fulltext. After writing the fulltext, call
* the stream's @c close() function.
*
* If a @c NULL is returned instead of a stream, the vtable is
* indicating that no text is desired, and the parser will not
* attempt to send it.
*/
svn_error_t *(*set_fulltext) (svn_stream_t **stream,
void *node_baton);
/** For a given @a node_baton, set @a handler and @a handler_baton
* to a window handler and baton capable of receiving a delta
* against the node's previous contents. A NULL window will be
* sent to the handler after all the windows are sent.
*
* If a @c NULL is returned instead of a handler, the vtable is
* indicating that no delta is desired, and the parser will not
* attempt to send it.
*/
svn_error_t *(*apply_textdelta) (svn_txdelta_window_handler_t *handler,
void **handler_baton,
void *node_baton);
/** The parser has reached the end of the current node represented by
* @a node_baton, it can be freed.
*/
svn_error_t *(*close_node) (void *node_baton);
/** The parser has reached the end of the current revision
* represented by @a revision_baton. In other words, there are no more
* changed nodes within the revision. The baton can be freed.
*/
svn_error_t *(*close_revision) (void *revision_baton);
} svn_repos_parser_fns2_t;
/**
* @since New in 1.1.
*
* Read and parse dumpfile-formatted @a stream, calling callbacks in
* @a parse_fns/@a parse_baton, and using @a pool for allocations.
*
* If @a cancel_func is not @c NULL, it is called periodically with
* @a cancel_baton as argument to see if the client wishes to cancel
* the dump.
*
* This parser has built-in knowledge of the dumpfile format, but only
* in a general sense:
*
* * it recognizes revision and node records by looking for either
* a REVISION_NUMBER or NODE_PATH headers.
*
* * it recognizes the CONTENT-LENGTH headers, so it knows if and
* how to suck up the content body.
*
* * it knows how to parse a content body into two parts: props
* and text, and pass the pieces to the vtable.
*
* This is enough knowledge to make it easy on vtable implementors,
* but still allow expansion of the format: most headers are ignored.
*/
svn_error_t *
svn_repos_parse_dumpstream2 (svn_stream_t *stream,
const svn_repos_parser_fns2_t *parse_fns,
void *parse_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *pool);
/**
* @since New in 1.1.
*
* Set @a *parser and @a *parse_baton to a vtable parser which commits new
* revisions to the fs in @a repos. The constructed parser will treat
* UUID records in a manner consistent with @a uuid_action. Use @a pool
* to operate on the fs.
*
* If @a use_history is set, then the parser will require relative
* 'copyfrom' history to exist in the repository when it encounters
* nodes that are added-with-history.
*
* If @a parent_dir is not null, then the parser will reparent all the
* loaded nodes, from root to @a parent_dir. The directory @a parent_dir
* must be an existing directory in the repository.
*
* Print all parsing feedback to @a outstream (if non-@c NULL).
*
*/
svn_error_t *
svn_repos_get_fs_build_parser2 (const svn_repos_parser_fns2_t **parser,
void **parse_baton,
svn_repos_t *repos,
svn_boolean_t use_history,
enum svn_repos_load_uuid uuid_action,
svn_stream_t *outstream,
const char *parent_dir,
apr_pool_t *pool);
/**
* @deprecated Provided for backward compatibility with the 1.0.0 API.
*
* A vtable that is driven by @c svn_repos_parse_dumpstream. Lacks
* the delete_node_property and apply_textdelta callbacks.
*/
typedef struct svn_repos_parse_fns_t
{
svn_error_t *(*new_revision_record) (void **revision_baton,
apr_hash_t *headers,
void *parse_baton,
apr_pool_t *pool);
svn_error_t *(*uuid_record) (const char *uuid,
void *parse_baton,
apr_pool_t *pool);
svn_error_t *(*new_node_record) (void **node_baton,
apr_hash_t *headers,
void *revision_baton,
apr_pool_t *pool);
svn_error_t *(*set_revision_property) (void *revision_baton,
const char *name,
const svn_string_t *value);
svn_error_t *(*set_node_property) (void *node_baton,
const char *name,
const svn_string_t *value);
svn_error_t *(*remove_node_props) (void *node_baton);
svn_error_t *(*set_fulltext) (svn_stream_t **stream,
void *node_baton);
svn_error_t *(*close_node) (void *node_baton);
svn_error_t *(*close_revision) (void *revision_baton);
} svn_repos_parser_fns_t;
/**
* @deprecated Provided for backward compatibility with the 1.0.0 API.
*
* Similar to svn_repos_parse_dumpstream2, but uses the more limited
* svn_repos_parser_fns_t vtable type.
*/
svn_error_t *
svn_repos_parse_dumpstream (svn_stream_t *stream,
const svn_repos_parser_fns_t *parse_fns,
void *parse_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *pool);
/**
* @deprecated Provided for backward compatibility with the 1.0.0 API.
*
* Similar to svn_repos_get_fs_build_parser2, but yields the more
* limited svn_repos_parser_fns_t vtable type.
*/
svn_error_t *
svn_repos_get_fs_build_parser (const svn_repos_parser_fns_t **parser,
void **parse_baton,
svn_repos_t *repos,
svn_boolean_t use_history,
enum svn_repos_load_uuid uuid_action,
svn_stream_t *outstream,
const char *parent_dir,
apr_pool_t *pool);
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* SVN_REPOS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -