GME  13
svn_ra_svn.h
Go to the documentation of this file.
00001 
00027 #ifndef SVN_RA_SVN_H
00028 #define SVN_RA_SVN_H
00029 
00030 #include <apr.h>
00031 #include <apr_pools.h>
00032 #include <apr_hash.h>
00033 #include <apr_tables.h>
00034 #include <apr_file_io.h>     /* for apr_file_t */
00035 #include <apr_network_io.h>  /* for apr_socket_t */
00036 
00037 #include "svn_types.h"
00038 #include "svn_string.h"
00039 #include "svn_config.h"
00040 #include "svn_delta.h"
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif /* __cplusplus */
00045 
00047 #define SVN_RA_SVN_PORT 3690
00048 
00050 #define SVN_RA_SVN_CAP_EDIT_PIPELINE "edit-pipeline"
00051 #define SVN_RA_SVN_CAP_SVNDIFF1 "svndiff1"
00052 #define SVN_RA_SVN_CAP_ABSENT_ENTRIES "absent-entries"
00053 /* maps to SVN_RA_CAPABILITY_COMMIT_REVPROPS: */
00054 #define SVN_RA_SVN_CAP_COMMIT_REVPROPS "commit-revprops"
00055 /* maps to SVN_RA_CAPABILITY_MERGEINFO: */
00056 #define SVN_RA_SVN_CAP_MERGEINFO "mergeinfo"
00057 /* maps to SVN_RA_CAPABILITY_DEPTH: */
00058 #define SVN_RA_SVN_CAP_DEPTH "depth"
00059 /* maps to SVN_RA_CAPABILITY_LOG_REVPROPS */
00060 #define SVN_RA_SVN_CAP_LOG_REVPROPS "log-revprops"
00061 /* maps to SVN_RA_CAPABILITY_PARTIAL_REPLAY */
00062 #define SVN_RA_SVN_CAP_PARTIAL_REPLAY "partial-replay"
00063 /* maps to SVN_RA_CAPABILITY_ATOMIC_REVPROPS */
00064 #define SVN_RA_SVN_CAP_ATOMIC_REVPROPS "atomic-revprops"
00065 /* maps to SVN_RA_CAPABILITY_INHERITED_PROPERTIES: */
00066 #define SVN_RA_SVN_CAP_INHERITED_PROPS "inherited-props"
00067 /* maps to SVN_RA_CAPABILITY_EPHEMERAL_TXNPROPS */
00068 #define SVN_RA_SVN_CAP_EPHEMERAL_TXNPROPS "ephemeral-txnprops"
00069 /* maps to SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE */
00070 #define SVN_RA_SVN_CAP_GET_FILE_REVS_REVERSE "file-revs-reverse"
00071 
00072 
00081 #define SVN_RA_SVN_DIRENT_KIND "kind"
00082 
00084 #define SVN_RA_SVN_DIRENT_SIZE "size"
00085 
00087 #define SVN_RA_SVN_DIRENT_HAS_PROPS "has-props"
00088 
00090 #define SVN_RA_SVN_DIRENT_CREATED_REV "created-rev"
00091 
00093 #define SVN_RA_SVN_DIRENT_TIME "time"
00094 
00096 #define SVN_RA_SVN_DIRENT_LAST_AUTHOR "last-author"
00097 
00103 #define SVN_RA_SVN_UNSPECIFIED_NUMBER ~((apr_uint64_t) 0)
00104 
00112 #define SVN_CMD_ERR(expr)                                     \
00113   do {                                                        \
00114     svn_error_t *svn_err__temp = (expr);                      \
00115     if (svn_err__temp)                                        \
00116       return svn_error_create(SVN_ERR_RA_SVN_CMD_ERR,         \
00117                               svn_err__temp, NULL);           \
00118   } while (0)
00119 
00121 typedef struct svn_ra_svn_conn_st svn_ra_svn_conn_t;
00122 
00124 typedef svn_error_t *(*svn_ra_svn_command_handler)(svn_ra_svn_conn_t *conn,
00125                                                    apr_pool_t *pool,
00126                                                    apr_array_header_t *params,
00127                                                    void *baton);
00128 
00131 typedef struct svn_ra_svn_cmd_entry_t
00132 {
00134   const char *cmdname;
00135 
00137   svn_ra_svn_command_handler handler;
00138 
00141   svn_boolean_t terminate;
00142 } svn_ra_svn_cmd_entry_t;
00143 
00145 typedef struct svn_ra_svn_item_t
00146 {
00148   enum {
00149     SVN_RA_SVN_NUMBER,
00150     SVN_RA_SVN_STRING,
00151     SVN_RA_SVN_WORD,
00152     SVN_RA_SVN_LIST
00153   } kind;
00155   union {
00156     apr_uint64_t number;
00157     svn_string_t *string;
00158     const char *word;
00159 
00161     apr_array_header_t *list;
00162   } u;
00163 } svn_ra_svn_item_t;
00164 
00165 typedef svn_error_t *(*svn_ra_svn_edit_callback)(void *baton);
00166 
00191 svn_ra_svn_conn_t *svn_ra_svn_create_conn3(apr_socket_t *sock,
00192                                            apr_file_t *in_file,
00193                                            apr_file_t *out_file,
00194                                            int compression_level,
00195                                            apr_size_t zero_copy_limit,
00196                                            apr_size_t error_check_interval,
00197                                            apr_pool_t *pool);
00198 
00206 SVN_DEPRECATED
00207 svn_ra_svn_conn_t *
00208 svn_ra_svn_create_conn2(apr_socket_t *sock,
00209                         apr_file_t *in_file,
00210                         apr_file_t *out_file,
00211                         int compression_level,
00212                         apr_pool_t *pool);
00213 
00220 SVN_DEPRECATED
00221 svn_ra_svn_conn_t *
00222 svn_ra_svn_create_conn(apr_socket_t *sock,
00223                        apr_file_t *in_file,
00224                        apr_file_t *out_file,
00225                        apr_pool_t *pool);
00226 
00234 svn_error_t *
00235 svn_ra_svn_set_capabilities(svn_ra_svn_conn_t *conn,
00236                             const apr_array_header_t *list);
00237 
00240 svn_boolean_t
00241 svn_ra_svn_has_capability(svn_ra_svn_conn_t *conn,
00242                           const char *capability);
00243 
00248 int
00249 svn_ra_svn_compression_level(svn_ra_svn_conn_t *conn);
00250 
00258 apr_size_t
00259 svn_ra_svn_zero_copy_limit(svn_ra_svn_conn_t *conn);
00260 
00263 const char *
00264 svn_ra_svn_conn_remote_host(svn_ra_svn_conn_t *conn);
00265 
00272 void
00273 svn_ra_svn_get_editor(const svn_delta_editor_t **editor,
00274                       void **edit_baton,
00275                       svn_ra_svn_conn_t *conn,
00276                       apr_pool_t *pool,
00277                       svn_ra_svn_edit_callback callback,
00278                       void *callback_baton);
00279 
00287 svn_error_t *
00288 svn_ra_svn_drive_editor2(svn_ra_svn_conn_t *conn,
00289                          apr_pool_t *pool,
00290                          const svn_delta_editor_t *editor,
00291                          void *edit_baton,
00292                          svn_boolean_t *aborted,
00293                          svn_boolean_t for_replay);
00294 
00299 SVN_DEPRECATED
00300 svn_error_t *
00301 svn_ra_svn_drive_editor(svn_ra_svn_conn_t *conn,
00302                         apr_pool_t *pool,
00303                         const svn_delta_editor_t *editor,
00304                         void *edit_baton,
00305                         svn_boolean_t *aborted);
00306 
00315 svn_error_t *
00316 svn_ra_svn_cram_server(svn_ra_svn_conn_t *conn,
00317                        apr_pool_t *pool,
00318                        svn_config_t *pwdb,
00319                        const char **user,
00320                        svn_boolean_t *success);
00321 
00326 const svn_version_t *
00327 svn_ra_svn_version(void);
00328 
00341 SVN_DEPRECATED
00342 svn_error_t *
00343 svn_ra_svn_write_number(svn_ra_svn_conn_t *conn,
00344                         apr_pool_t *pool,
00345                         apr_uint64_t number);
00346 
00354 SVN_DEPRECATED
00355 svn_error_t *
00356 svn_ra_svn_write_string(svn_ra_svn_conn_t *conn,
00357                         apr_pool_t *pool,
00358                         const svn_string_t *str);
00359 
00367 SVN_DEPRECATED
00368 svn_error_t *
00369 svn_ra_svn_write_cstring(svn_ra_svn_conn_t *conn,
00370                          apr_pool_t *pool,
00371                          const char *s);
00372 
00380 SVN_DEPRECATED
00381 svn_error_t *
00382 svn_ra_svn_write_word(svn_ra_svn_conn_t *conn,
00383                       apr_pool_t *pool,
00384                       const char *word);
00385 
00394 SVN_DEPRECATED
00395 svn_error_t *
00396 svn_ra_svn_write_proplist(svn_ra_svn_conn_t *conn,
00397                           apr_pool_t *pool,
00398                           apr_hash_t *props);
00399 
00405 SVN_DEPRECATED
00406 svn_error_t *
00407 svn_ra_svn_start_list(svn_ra_svn_conn_t *conn,
00408                       apr_pool_t *pool);
00409 
00415 SVN_DEPRECATED
00416 svn_error_t *
00417 svn_ra_svn_end_list(svn_ra_svn_conn_t *conn,
00418                     apr_pool_t *pool);
00419 
00428 SVN_DEPRECATED
00429 svn_error_t *
00430 svn_ra_svn_flush(svn_ra_svn_conn_t *conn,
00431                  apr_pool_t *pool);
00432 
00475 SVN_DEPRECATED
00476 svn_error_t *
00477 svn_ra_svn_write_tuple(svn_ra_svn_conn_t *conn,
00478                        apr_pool_t *pool,
00479                        const char *fmt, ...);
00480 
00486 SVN_DEPRECATED
00487 svn_error_t *
00488 svn_ra_svn_read_item(svn_ra_svn_conn_t *conn,
00489                      apr_pool_t *pool,
00490                      svn_ra_svn_item_t **item);
00491 
00502 SVN_DEPRECATED
00503 svn_error_t *
00504 svn_ra_svn_skip_leading_garbage(svn_ra_svn_conn_t *conn,
00505                                 apr_pool_t *pool);
00506 
00542 SVN_DEPRECATED
00543 svn_error_t *
00544 svn_ra_svn_parse_tuple(const apr_array_header_t *list,
00545                        apr_pool_t *pool,
00546                        const char *fmt, ...);
00547 
00554 SVN_DEPRECATED
00555 svn_error_t *
00556 svn_ra_svn_read_tuple(svn_ra_svn_conn_t *conn,
00557                       apr_pool_t *pool,
00558                       const char *fmt, ...);
00559 
00568 SVN_DEPRECATED
00569 svn_error_t *
00570 svn_ra_svn_parse_proplist(const apr_array_header_t *list,
00571                           apr_pool_t *pool,
00572                           apr_hash_t **props);
00573 
00580 SVN_DEPRECATED
00581 svn_error_t *
00582 svn_ra_svn_read_cmd_response(svn_ra_svn_conn_t *conn,
00583                              apr_pool_t *pool,
00584                              const char *fmt, ...);
00585 
00602 SVN_DEPRECATED
00603 svn_error_t *
00604 svn_ra_svn_handle_commands2(svn_ra_svn_conn_t *conn,
00605                             apr_pool_t *pool,
00606                             const svn_ra_svn_cmd_entry_t *commands,
00607                             void *baton,
00608                             svn_boolean_t error_on_disconnect);
00609 
00615 SVN_DEPRECATED
00616 svn_error_t *
00617 svn_ra_svn_handle_commands(svn_ra_svn_conn_t *conn,
00618                            apr_pool_t *pool,
00619                            const svn_ra_svn_cmd_entry_t *commands,
00620                            void *baton);
00621 
00628 SVN_DEPRECATED
00629 svn_error_t *
00630 svn_ra_svn_write_cmd(svn_ra_svn_conn_t *conn,
00631                      apr_pool_t *pool,
00632                      const char *cmdname,
00633                      const char *fmt, ...);
00634 
00643 SVN_DEPRECATED
00644 svn_error_t *
00645 svn_ra_svn_write_cmd_response(svn_ra_svn_conn_t *conn,
00646                               apr_pool_t *pool,
00647                               const char *fmt, ...);
00648 
00654 SVN_DEPRECATED
00655 svn_error_t *
00656 svn_ra_svn_write_cmd_failure(svn_ra_svn_conn_t *conn,
00657                              apr_pool_t *pool,
00658                              svn_error_t *err);
00659 
00664 #ifdef __cplusplus
00665 }
00666 #endif /* __cplusplus */
00667 
00668 #endif  /* SVN_RA_SVN_H */