~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to subversion/libsvn_ra/ra_loader.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:26:14 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205012614-qom4xfypgtsqc2xq
Tags: 1.2.3dfsg1-3ubuntu1
Merge with the final Debian release of 1.2.3dfsg1-3, bringing in
fixes to the clean target, better documentation of the libdb4.3
upgrade and build fixes to work with swig1.3_1.3.27.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @copyright
 
3
 * ====================================================================
 
4
 * Copyright (c) 2005 CollabNet.  All rights reserved.
 
5
 *
 
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.
 
11
 *
 
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
 * ====================================================================
 
16
 * @endcopyright
 
17
 *
 
18
 * @file ra_loader.h
 
19
 * @brief structures related to repository access, private to libsvn_ra and the
 
20
 * RA implementation libraries.
 
21
 */
 
22
 
 
23
 
 
24
 
 
25
#ifndef LIBSVN_RA_RA_LOADER_H
 
26
#define LIBSVN_RA_RA_LOADER_H
 
27
 
 
28
#include "svn_ra.h"
 
29
 
 
30
#ifdef __cplusplus
 
31
extern "C" {
 
32
#endif
 
33
 
 
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);
 
38
 
 
39
  /* Return a short description of the RA implementation, as a localized
 
40
   * string. */
 
41
  const char *(*get_description) (void);
 
42
 
 
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);
 
46
 
 
47
  /* Implementations of the public API functions. */
 
48
 
 
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,
 
54
                        void *callback_baton,
 
55
                        apr_hash_t *config,
 
56
                        apr_pool_t *pool);
 
57
  svn_error_t *(*get_latest_revnum) (svn_ra_session_t *session,
 
58
                                     svn_revnum_t *latest_revnum,
 
59
                                     apr_pool_t *pool);
 
60
  svn_error_t *(*get_dated_revision) (svn_ra_session_t *session,
 
61
                                      svn_revnum_t *revision,
 
62
                                      apr_time_t tm,
 
63
                                      apr_pool_t *pool);
 
64
  svn_error_t *(*change_rev_prop) (svn_ra_session_t *session,
 
65
                                   svn_revnum_t rev,
 
66
                                   const char *name,
 
67
                                   const svn_string_t *value,
 
68
                                   apr_pool_t *pool);
 
69
 
 
70
  svn_error_t *(*rev_proplist) (svn_ra_session_t *session,
 
71
                                svn_revnum_t rev,
 
72
                                apr_hash_t **props,
 
73
                                apr_pool_t *pool);
 
74
  svn_error_t *(*rev_prop) (svn_ra_session_t *session,
 
75
                            svn_revnum_t rev,
 
76
                            const char *name,
 
77
                            svn_string_t **value,
 
78
                            apr_pool_t *pool);
 
79
  svn_error_t *(*get_commit_editor) (svn_ra_session_t *session,
 
80
                                     const svn_delta_editor_t **editor,
 
81
                                     void **edit_baton,
 
82
                                     const char *log_msg,
 
83
                                     svn_commit_callback_t callback,
 
84
                                     void *callback_baton,
 
85
                                     apr_hash_t *lock_tokens,
 
86
                                     svn_boolean_t keep_locks,
 
87
                                     apr_pool_t *pool);
 
88
  svn_error_t *(*get_file) (svn_ra_session_t *session,
 
89
                            const char *path,
 
90
                            svn_revnum_t revision,
 
91
                            svn_stream_t *stream,
 
92
                            svn_revnum_t *fetched_rev,
 
93
                            apr_hash_t **props,
 
94
                            apr_pool_t *pool);
 
95
  svn_error_t *(*get_dir) (svn_ra_session_t *session,
 
96
                           const char *path,
 
97
                           svn_revnum_t revision,
 
98
                           apr_hash_t **dirents,
 
99
                           svn_revnum_t *fetched_rev,
 
100
                           apr_hash_t **props,
 
101
                           apr_pool_t *pool);
 
102
  svn_error_t *(*do_update) (svn_ra_session_t *session,
 
103
                             const svn_ra_reporter2_t **reporter,
 
104
                             void **report_baton,
 
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,
 
109
                             void *update_baton,
 
110
                             apr_pool_t *pool);
 
111
  svn_error_t *(*do_switch) (svn_ra_session_t *session,
 
112
                             const svn_ra_reporter2_t **reporter,
 
113
                             void **report_baton,
 
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,
 
119
                             void *switch_baton,
 
120
                             apr_pool_t *pool);
 
121
  svn_error_t *(*do_status) (svn_ra_session_t *session,
 
122
                             const svn_ra_reporter2_t **reporter,
 
123
                             void **report_baton,
 
124
                             const char *status_target,
 
125
                             svn_revnum_t revision,
 
126
                             svn_boolean_t recurse,
 
127
                             const svn_delta_editor_t *status_editor,
 
128
                             void *status_baton,
 
129
                             apr_pool_t *pool);
 
130
  svn_error_t *(*do_diff) (svn_ra_session_t *session,
 
131
                           const svn_ra_reporter2_t **reporter,
 
132
                           void **report_baton,
 
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,
 
139
                           void *diff_baton,
 
140
                           apr_pool_t *pool);
 
141
  svn_error_t *(*get_log) (svn_ra_session_t *session,
 
142
                           const apr_array_header_t *paths,
 
143
                           svn_revnum_t start,
 
144
                           svn_revnum_t end,
 
145
                           int limit,
 
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,
 
150
                           apr_pool_t *pool);
 
151
  svn_error_t *(*check_path) (svn_ra_session_t *session,
 
152
                              const char *path,
 
153
                              svn_revnum_t revision,
 
154
                              svn_node_kind_t *kind,
 
155
                              apr_pool_t *pool);
 
156
  svn_error_t *(*stat) (svn_ra_session_t *session,
 
157
                        const char *path,
 
158
                        svn_revnum_t revision,
 
159
                        svn_dirent_t **dirent,
 
160
                        apr_pool_t *pool);
 
161
  svn_error_t *(*get_uuid) (svn_ra_session_t *session,
 
162
                            const char **uuid,
 
163
                            apr_pool_t *pool);
 
164
  svn_error_t *(*get_repos_root) (svn_ra_session_t *session,
 
165
                                  const char **url,
 
166
                                  apr_pool_t *pool);
 
167
  svn_error_t *(*get_locations) (svn_ra_session_t *session,
 
168
                                 apr_hash_t **locations,
 
169
                                 const char *path,
 
170
                                 svn_revnum_t peg_revision,
 
171
                                 apr_array_header_t *location_revisions,
 
172
                                 apr_pool_t *pool);
 
173
  svn_error_t *(*get_file_revs) (svn_ra_session_t *session,
 
174
                                 const char *path,
 
175
                                 svn_revnum_t start,
 
176
                                 svn_revnum_t end,
 
177
                                 svn_ra_file_rev_handler_t handler,
 
178
                                 void *handler_baton,
 
179
                                 apr_pool_t *pool);
 
180
  svn_error_t *(*lock) (svn_ra_session_t *session,
 
181
                        apr_hash_t *path_revs,
 
182
                        const char *comment,
 
183
                        svn_boolean_t force,
 
184
                        svn_ra_lock_callback_t lock_func, 
 
185
                        void *lock_baton,
 
186
                        apr_pool_t *pool);
 
187
  svn_error_t *(*unlock) (svn_ra_session_t *session,
 
188
                          apr_hash_t *path_tokens,
 
189
                          svn_boolean_t force,
 
190
                          svn_ra_lock_callback_t lock_func, 
 
191
                          void *lock_baton,
 
192
                          apr_pool_t *pool);
 
193
  svn_error_t *(*get_lock) (svn_ra_session_t *session,
 
194
                            svn_lock_t **lock,
 
195
                            const char *path,
 
196
                            apr_pool_t *pool);
 
197
  svn_error_t *(*get_locks) (svn_ra_session_t *session,
 
198
                             apr_hash_t **locks,
 
199
                             const char *path,
 
200
                             apr_pool_t *pool);
 
201
} svn_ra__vtable_t;
 
202
 
 
203
/* The RA session object. */
 
204
struct svn_ra_session_t {
 
205
  const svn_ra__vtable_t *vtable;
 
206
 
 
207
  /* Pool used to manage this session. */
 
208
  apr_pool_t *pool;
 
209
 
 
210
  /* Private data for the RA implementation. */
 
211
  void *priv;
 
212
};
 
213
 
 
214
/* Each libsvn_ra_foo defines a function named svn_ra_foo__init of this type.
 
215
 *
 
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.
 
219
 *
 
220
 * POOL will be available as long as this module is being used.
 
221
 *
 
222
 * ### need to force this to be __cdecl on Windows... how??
 
223
 */
 
224
typedef svn_error_t
 
225
*(*svn_ra__init_func_t)(const svn_version_t *loader_version,
 
226
                        const svn_ra__vtable_t **vtable,
 
227
                        apr_pool_t *pool);
 
228
 
 
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,
 
232
                                apr_pool_t *pool);
 
233
svn_error_t *svn_ra_svn__init(const svn_version_t *loader_version,
 
234
                              const svn_ra__vtable_t **vtable,
 
235
                              apr_pool_t *pool);
 
236
svn_error_t *svn_ra_dav__init(const svn_version_t *loader_version,
 
237
                              const svn_ra__vtable_t **vtable,
 
238
                              apr_pool_t *pool);
 
239
 
 
240
#ifdef __cplusplus
 
241
}
 
242
#endif
 
243
 
 
244
#endif