3
* ====================================================================
4
* Copyright (c) 2005 CollabNet. All rights reserved.
6
* This software is licensed as described in the file COPYING, which
7
* you should have received as part of this distribution. The terms
8
* are also available at http://subversion.tigris.org/license-1.html.
9
* If newer versions of this license are posted there, you may use a
10
* newer version instead, at your option.
12
* This software consists of voluntary contributions made by many
13
* individuals. For exact contribution history, see the revision
14
* history and logs, available at http://subversion.tigris.org/.
15
* ====================================================================
19
* @brief structures related to repository access, private to libsvn_ra and the
20
* RA implementation libraries.
25
#ifndef LIBSVN_RA_RA_LOADER_H
26
#define LIBSVN_RA_RA_LOADER_H
34
/* The RA layer vtable. */
35
typedef struct svn_ra__vtable_t {
36
/* This field should always remain first in the vtable. */
37
const svn_version_t *(*get_version) (void);
39
/* Return a short description of the RA implementation, as a localized
41
const char *(*get_description) (void);
43
/* Return a list of actual URI schemes supported by this implementation.
44
* The returned array is NULL-terminated. */
45
const char * const *(*get_schemes)(apr_pool_t *pool);
47
/* Implementations of the public API functions. */
49
/* All fields in SESSION, except priv, have been initialized by the
50
time this is called. SESSION->priv may be set by this function. */
51
svn_error_t *(*open) (svn_ra_session_t *session,
52
const char *repos_URL,
53
const svn_ra_callbacks_t *callbacks,
57
svn_error_t *(*get_latest_revnum) (svn_ra_session_t *session,
58
svn_revnum_t *latest_revnum,
60
svn_error_t *(*get_dated_revision) (svn_ra_session_t *session,
61
svn_revnum_t *revision,
64
svn_error_t *(*change_rev_prop) (svn_ra_session_t *session,
67
const svn_string_t *value,
70
svn_error_t *(*rev_proplist) (svn_ra_session_t *session,
74
svn_error_t *(*rev_prop) (svn_ra_session_t *session,
79
svn_error_t *(*get_commit_editor) (svn_ra_session_t *session,
80
const svn_delta_editor_t **editor,
83
svn_commit_callback_t callback,
85
apr_hash_t *lock_tokens,
86
svn_boolean_t keep_locks,
88
svn_error_t *(*get_file) (svn_ra_session_t *session,
90
svn_revnum_t revision,
92
svn_revnum_t *fetched_rev,
95
svn_error_t *(*get_dir) (svn_ra_session_t *session,
97
svn_revnum_t revision,
99
svn_revnum_t *fetched_rev,
102
svn_error_t *(*do_update) (svn_ra_session_t *session,
103
const svn_ra_reporter2_t **reporter,
105
svn_revnum_t revision_to_update_to,
106
const char *update_target,
107
svn_boolean_t recurse,
108
const svn_delta_editor_t *update_editor,
111
svn_error_t *(*do_switch) (svn_ra_session_t *session,
112
const svn_ra_reporter2_t **reporter,
114
svn_revnum_t revision_to_switch_to,
115
const char *switch_target,
116
svn_boolean_t recurse,
117
const char *switch_url,
118
const svn_delta_editor_t *switch_editor,
121
svn_error_t *(*do_status) (svn_ra_session_t *session,
122
const svn_ra_reporter2_t **reporter,
124
const char *status_target,
125
svn_revnum_t revision,
126
svn_boolean_t recurse,
127
const svn_delta_editor_t *status_editor,
130
svn_error_t *(*do_diff) (svn_ra_session_t *session,
131
const svn_ra_reporter2_t **reporter,
133
svn_revnum_t revision,
134
const char *diff_target,
135
svn_boolean_t recurse,
136
svn_boolean_t ignore_ancestry,
137
const char *versus_url,
138
const svn_delta_editor_t *diff_editor,
141
svn_error_t *(*get_log) (svn_ra_session_t *session,
142
const apr_array_header_t *paths,
146
svn_boolean_t discover_changed_paths,
147
svn_boolean_t strict_node_history,
148
svn_log_message_receiver_t receiver,
149
void *receiver_baton,
151
svn_error_t *(*check_path) (svn_ra_session_t *session,
153
svn_revnum_t revision,
154
svn_node_kind_t *kind,
156
svn_error_t *(*stat) (svn_ra_session_t *session,
158
svn_revnum_t revision,
159
svn_dirent_t **dirent,
161
svn_error_t *(*get_uuid) (svn_ra_session_t *session,
164
svn_error_t *(*get_repos_root) (svn_ra_session_t *session,
167
svn_error_t *(*get_locations) (svn_ra_session_t *session,
168
apr_hash_t **locations,
170
svn_revnum_t peg_revision,
171
apr_array_header_t *location_revisions,
173
svn_error_t *(*get_file_revs) (svn_ra_session_t *session,
177
svn_ra_file_rev_handler_t handler,
180
svn_error_t *(*lock) (svn_ra_session_t *session,
181
apr_hash_t *path_revs,
184
svn_ra_lock_callback_t lock_func,
187
svn_error_t *(*unlock) (svn_ra_session_t *session,
188
apr_hash_t *path_tokens,
190
svn_ra_lock_callback_t lock_func,
193
svn_error_t *(*get_lock) (svn_ra_session_t *session,
197
svn_error_t *(*get_locks) (svn_ra_session_t *session,
203
/* The RA session object. */
204
struct svn_ra_session_t {
205
const svn_ra__vtable_t *vtable;
207
/* Pool used to manage this session. */
210
/* Private data for the RA implementation. */
214
/* Each libsvn_ra_foo defines a function named svn_ra_foo__init of this type.
216
* The LOADER_VERSION parameter must remain first in the list, and the
217
* function must use the C calling convention on all platforms, so that
218
* the init functions can safely read the version parameter.
220
* POOL will be available as long as this module is being used.
222
* ### need to force this to be __cdecl on Windows... how??
225
*(*svn_ra__init_func_t)(const svn_version_t *loader_version,
226
const svn_ra__vtable_t **vtable,
229
/* Declarations of the init functions for the available RA libraries. */
230
svn_error_t *svn_ra_local__init(const svn_version_t *loader_version,
231
const svn_ra__vtable_t **vtable,
233
svn_error_t *svn_ra_svn__init(const svn_version_t *loader_version,
234
const svn_ra__vtable_t **vtable,
236
svn_error_t *svn_ra_dav__init(const svn_version_t *loader_version,
237
const svn_ra__vtable_t **vtable,