📄 wrapper_template.h
字号:
compat_finish_report, compat_abort_report};static void compat_wrap_reporter(const svn_ra_reporter_t **reporter, void **baton, const svn_ra_reporter2_t *wrapped, void *wrapped_baton, apr_pool_t *pool){ struct compat_report_baton *crb = apr_palloc(pool, sizeof(*crb)); crb->reporter = wrapped; crb->baton = wrapped_baton; *reporter = &compat_reporter; *baton = crb;}static svn_error_t *compat_do_update(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, svn_revnum_t revision_to_update_to, const char *update_target, svn_boolean_t recurse, const svn_delta_editor_t *editor, void *update_baton, apr_pool_t *pool){ const svn_ra_reporter2_t *reporter2; void *baton2; SVN_ERR(VTBL.do_update(session_baton, &reporter2, &baton2, revision_to_update_to, update_target, recurse, editor, update_baton, pool)); compat_wrap_reporter(reporter, report_baton, reporter2, baton2, pool); return SVN_NO_ERROR;}static svn_error_t *compat_do_switch(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, svn_revnum_t revision_to_switch_to, const char *switch_target, svn_boolean_t recurse, const char *switch_url, const svn_delta_editor_t *editor, void *switch_baton, apr_pool_t *pool){ const svn_ra_reporter2_t *reporter2; void *baton2; SVN_ERR(VTBL.do_switch(session_baton, &reporter2, &baton2, revision_to_switch_to, switch_target, recurse, switch_url, editor, switch_baton, pool)); compat_wrap_reporter(reporter, report_baton, reporter2, baton2, pool); return SVN_NO_ERROR;}static svn_error_t *compat_do_status(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, const char *status_target, svn_revnum_t revision, svn_boolean_t recurse, const svn_delta_editor_t *editor, void *status_baton, apr_pool_t *pool){ const svn_ra_reporter2_t *reporter2; void *baton2; SVN_ERR(VTBL.do_status(session_baton, &reporter2, &baton2, status_target, revision, recurse, editor, status_baton, pool)); compat_wrap_reporter(reporter, report_baton, reporter2, baton2, pool); return SVN_NO_ERROR;}static svn_error_t *compat_do_diff(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, svn_revnum_t revision, const char *diff_target, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, const char *versus_url, const svn_delta_editor_t *diff_editor, void *diff_baton, apr_pool_t *pool){ const svn_ra_reporter2_t *reporter2; void *baton2; SVN_ERR(VTBL.do_diff(session_baton, &reporter2, &baton2, revision, diff_target, recurse, ignore_ancestry, TRUE, versus_url, diff_editor, diff_baton, pool)); compat_wrap_reporter(reporter, report_baton, reporter2, baton2, pool); return SVN_NO_ERROR;}static svn_error_t *compat_get_log(void *session_baton, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool){ return VTBL.get_log(session_baton, paths, start, end, 0, /* limit */ discover_changed_paths, strict_node_history, receiver, receiver_baton, pool);}static svn_error_t *compat_check_path(void *session_baton, const char *path, svn_revnum_t revision, svn_node_kind_t *kind, apr_pool_t *pool){ return VTBL.check_path(session_baton, path, revision, kind, pool);}static svn_error_t *compat_get_uuid(void *session_baton, const char **uuid, apr_pool_t *pool){ return VTBL.get_uuid(session_baton, uuid, pool);}static svn_error_t *compat_get_repos_root(void *session_baton, const char **url, apr_pool_t *pool){ return VTBL.get_repos_root(session_baton, url, pool);}static svn_error_t *compat_get_locations(void *session_baton, apr_hash_t **locations, const char *path, svn_revnum_t peg_revision, apr_array_header_t *location_revs, apr_pool_t *pool){ return VTBL.get_locations(session_baton, locations, path, peg_revision, location_revs, pool);}static svn_error_t *compat_get_file_revs(void *session_baton, const char *path, svn_revnum_t start, svn_revnum_t end, svn_ra_file_rev_handler_t handler, void *handler_baton, apr_pool_t *pool){ return VTBL.get_file_revs(session_baton, path, start, end, handler, handler_baton, pool);}static const svn_version_t *compat_get_version(void){ return VTBL.get_version();}static const svn_ra_plugin_t compat_plugin = { NAME, DESCRIPTION, compat_open, compat_get_latest_revnum, compat_get_dated_revision, compat_change_rev_prop, compat_rev_proplist, compat_rev_prop, compat_get_commit_editor, compat_get_file, compat_get_dir, compat_do_update, compat_do_switch, compat_do_status, compat_do_diff, compat_get_log, compat_check_path, compat_get_uuid, compat_get_repos_root, compat_get_locations, compat_get_file_revs, compat_get_version};svn_error_t *COMPAT_INITFUNC(int abi_version, apr_pool_t *pool, apr_hash_t *hash){ const svn_ra__vtable_t *vtable; const char * const * schemes; if (abi_version < 1 || abi_version > SVN_RA_ABI_VERSION) return svn_error_createf(SVN_ERR_RA_UNSUPPORTED_ABI_VERSION, NULL, _("Unsupported RA plugin ABI version (%d) " "for %s"), abi_version, NAME); /* We call the new init function so it can check library dependencies or do other initialization things. We fake the loader version, since we rely on the ABI version check instead. */ SVN_ERR(INITFUNC(VTBL.get_version(), &vtable, pool)); schemes = VTBL.get_schemes(pool); for (; *schemes != NULL; ++schemes) apr_hash_set(hash, *schemes, APR_HASH_KEY_STRING, &compat_plugin); return SVN_NO_ERROR;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -