31 #include <apr_pools.h>
33 #include <apr_tables.h>
34 #include <apr_file_io.h>
35 #include <apr_network_io.h>
47 #define SVN_RA_SVN_PORT 3690
50 #define SVN_RA_SVN_CAP_EDIT_PIPELINE "edit-pipeline"
51 #define SVN_RA_SVN_CAP_SVNDIFF1 "svndiff1"
52 #define SVN_RA_SVN_CAP_ABSENT_ENTRIES "absent-entries"
54 #define SVN_RA_SVN_CAP_COMMIT_REVPROPS "commit-revprops"
56 #define SVN_RA_SVN_CAP_MERGEINFO "mergeinfo"
58 #define SVN_RA_SVN_CAP_DEPTH "depth"
60 #define SVN_RA_SVN_CAP_LOG_REVPROPS "log-revprops"
62 #define SVN_RA_SVN_CAP_PARTIAL_REPLAY "partial-replay"
64 #define SVN_RA_SVN_CAP_ATOMIC_REVPROPS "atomic-revprops"
66 #define SVN_RA_SVN_CAP_INHERITED_PROPS "inherited-props"
68 #define SVN_RA_SVN_CAP_EPHEMERAL_TXNPROPS "ephemeral-txnprops"
70 #define SVN_RA_SVN_CAP_GET_FILE_REVS_REVERSE "file-revs-reverse"
81 #define SVN_RA_SVN_DIRENT_KIND "kind"
84 #define SVN_RA_SVN_DIRENT_SIZE "size"
87 #define SVN_RA_SVN_DIRENT_HAS_PROPS "has-props"
90 #define SVN_RA_SVN_DIRENT_CREATED_REV "created-rev"
93 #define SVN_RA_SVN_DIRENT_TIME "time"
96 #define SVN_RA_SVN_DIRENT_LAST_AUTHOR "last-author"
103 #define SVN_RA_SVN_UNSPECIFIED_NUMBER ~((apr_uint64_t) 0)
112 #define SVN_CMD_ERR(expr) \
114 svn_error_t *svn_err__temp = (expr); \
116 return svn_error_create(SVN_ERR_RA_SVN_CMD_ERR, \
117 svn_err__temp, NULL); \
126 apr_array_header_t *params,
165 typedef svn_error_t *(*svn_ra_svn_edit_callback)(
void *baton);
197 int compression_level,
198 apr_size_t zero_copy_limit,
199 apr_size_t error_check_interval,
200 apr_pool_t *result_pool);
212 apr_file_t *out_file,
213 int compression_level,
214 apr_size_t zero_copy_limit,
215 apr_size_t error_check_interval,
229 apr_file_t *out_file,
230 int compression_level,
243 apr_file_t *out_file,
255 const apr_array_header_t *list);
261 const char *capability);
302 svn_ra_svn_edit_callback callback,
303 void *callback_baton);
377 apr_uint64_t number);
511 const char *fmt, ...);
578 const char *fmt, ...);
590 const char *fmt, ...);
616 const char *fmt, ...);
665 const char *fmt, ...);
679 const char *fmt, ...);
Counted-length strings for Subversion, plus some C string goodies.
struct svn_ra_svn_conn_st svn_ra_svn_conn_t
an ra_svn connection.
struct svn_ra_svn_item_t svn_ra_svn_item_t
Memory representation of an on-the-wire data item.
svn_error_t * svn_ra_svn_handle_commands(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const svn_ra_svn_cmd_entry_t *commands, void *baton)
Similar to svn_ra_svn_handle_commands2 but error_on_disconnect is always FALSE.
svn_ra_svn_conn_t * svn_ra_svn_create_conn2(apr_socket_t *sock, apr_file_t *in_file, apr_file_t *out_file, int compression_level, apr_pool_t *pool)
Similar to svn_ra_svn_create_conn3() but disables the zero copy code path and sets the error checking...
svn_error_t * svn_ra_svn_write_cmd(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *cmdname, const char *fmt,...)
Write a command over the network, using the same format string notation as svn_ra_svn_write_tuple().
svn_error_t * svn_ra_svn_write_cstring(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *s)
Write a cstring over the net.
svn_error_t * svn_ra_svn_write_number(svn_ra_svn_conn_t *conn, apr_pool_t *pool, apr_uint64_t number)
Write a number over the net.
svn_ra_svn_command_handler handler
Handler for the command.
svn_error_t * svn_ra_svn_write_cmd_response(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *fmt,...)
Write a successful command response over the network, using the same format string notation as svn_ra...
void svn_ra_svn_get_editor(const svn_delta_editor_t **editor, void **edit_baton, svn_ra_svn_conn_t *conn, apr_pool_t *pool, svn_ra_svn_edit_callback callback, void *callback_baton)
Set *editor and *edit_baton to an editor which will pass editing operations over the network...
A structure full of callback functions the delta source will invoke as it produces the delta...
svn_error_t * svn_ra_svn_write_string(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const svn_string_t *str)
Write a string over the net.
svn_error_t * svn_ra_svn_write_proplist(svn_ra_svn_conn_t *conn, apr_pool_t *pool, apr_hash_t *props)
Write a list of properties over the net.
svn_ra_svn_conn_t * svn_ra_svn_create_conn4(apr_socket_t *sock, svn_stream_t *in_stream, svn_stream_t *out_stream, int compression_level, apr_size_t zero_copy_limit, apr_size_t error_check_interval, apr_pool_t *result_pool)
Initialize a connection structure for the given socket or input/output streams.
svn_error_t * svn_ra_svn_handle_commands2(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const svn_ra_svn_cmd_entry_t *commands, void *baton, svn_boolean_t error_on_disconnect)
Accept commands over the network and handle them according to commands.
struct svn_ra_svn_cmd_entry_t svn_ra_svn_cmd_entry_t
Command table, used by svn_ra_svn_handle_commands().
const char * cmdname
Name of the command.
enum svn_ra_svn_item_t::@1 kind
Variant indicator.
struct svn_config_t svn_config_t
Opaque structure describing a set of configuration options.
svn_error_t * svn_ra_svn_read_tuple(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *fmt,...)
Read a tuple from the network and parse it as a tuple, using the format string notation from svn_ra_s...
svn_error_t *(* svn_ra_svn_command_handler)(svn_ra_svn_conn_t *conn, apr_pool_t *pool, apr_array_header_t *params, void *baton)
Command handler, used by svn_ra_svn_handle_commands().
svn_error_t * svn_ra_svn_parse_tuple(const apr_array_header_t *list, apr_pool_t *pool, const char *fmt,...)
Parse an array of svn_sort__item_t structures as a tuple, using a printf-like interface.
Command table, used by svn_ra_svn_handle_commands().
svn_error_t * svn_ra_svn_skip_leading_garbage(svn_ra_svn_conn_t *conn, apr_pool_t *pool)
Scan data on conn until we find something which looks like the beginning of an svn server greeting (a...
apr_array_header_t * list
Contains svn_ra_svn_item_t's.
svn_error_t * svn_ra_svn_parse_proplist(const apr_array_header_t *list, apr_pool_t *pool, apr_hash_t **props)
Parse an array of svn_ra_svn_item_t structures as a list of properties, storing the properties in a h...
svn_ra_svn_conn_t * svn_ra_svn_create_conn3(apr_socket_t *sock, apr_file_t *in_file, apr_file_t *out_file, int compression_level, apr_size_t zero_copy_limit, apr_size_t error_check_interval, apr_pool_t *pool)
Similar to svn_ra_svn_create_conn4() but only supports apr_file_t handles instead of the more generic...
struct svn_stream_t svn_stream_t
An abstract stream of bytes–either incoming or outgoing or both.
apr_size_t svn_ra_svn_zero_copy_limit(svn_ra_svn_conn_t *conn)
Return the zero-copy data block limit to use for network transmissions.
Subversion's data types.
const svn_version_t * svn_ra_svn_version(void)
Get libsvn_ra_svn version information.
svn_error_t * svn_ra_svn_read_cmd_response(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *fmt,...)
Read a command response from the network and parse it as a tuple, using the format string notation fr...
svn_error_t * svn_ra_svn_write_word(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *word)
Write a word over the net.
#define SVN_DEPRECATED
Macro used to mark deprecated functions.
svn_error_t * svn_ra_svn_end_list(svn_ra_svn_conn_t *conn, apr_pool_t *pool)
End a list.
svn_boolean_t svn_ra_svn_has_capability(svn_ra_svn_conn_t *conn, const char *capability)
Return TRUE if conn has the capability capability, or FALSE if it does not.
const char * svn_ra_svn_conn_remote_host(svn_ra_svn_conn_t *conn)
Returns the remote address of the connection as a string, if known, or NULL if inapplicable.
int svn_ra_svn_compression_level(svn_ra_svn_conn_t *conn)
Return the data compression level to use for network transmissions.
Memory representation of an on-the-wire data item.
svn_error_t * svn_ra_svn_cram_server(svn_ra_svn_conn_t *conn, apr_pool_t *pool, svn_config_t *pwdb, const char **user, svn_boolean_t *success)
This function is only intended for use by svnserve.
Accessing SVN configuration files.
svn_error_t * svn_ra_svn_drive_editor(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const svn_delta_editor_t *editor, void *edit_baton, svn_boolean_t *aborted)
Like svn_ra_svn_drive_editor2, but with for_replay always FALSE.
union svn_ra_svn_item_t::@2 u
Variant data.
int svn_boolean_t
YABT: Yet Another Boolean Type.
svn_ra_svn_conn_t * svn_ra_svn_create_conn(apr_socket_t *sock, apr_file_t *in_file, apr_file_t *out_file, apr_pool_t *pool)
Similar to svn_ra_svn_create_conn2() but uses the default compression level (SVN_DELTA_COMPRESSION_LE...
svn_boolean_t terminate
Termination flag.
svn_error_t * svn_ra_svn_write_cmd_failure(svn_ra_svn_conn_t *conn, apr_pool_t *pool, svn_error_t *err)
Write an unsuccessful command response over the network.
svn_error_t * svn_ra_svn_write_tuple(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *fmt,...)
Write a tuple, using a printf-like interface.
svn_error_t * svn_ra_svn_start_list(svn_ra_svn_conn_t *conn, apr_pool_t *pool)
Begin a list.
svn_error_t * svn_ra_svn_read_item(svn_ra_svn_conn_t *conn, apr_pool_t *pool, svn_ra_svn_item_t **item)
Read an item from the network into *item.
svn_error_t * svn_ra_svn_flush(svn_ra_svn_conn_t *conn, apr_pool_t *pool)
Flush the write buffer.
svn_error_t * svn_ra_svn_set_capabilities(svn_ra_svn_conn_t *conn, const apr_array_header_t *list)
Add the capabilities in list to conn's capabilities.
svn_error_t * svn_ra_svn_drive_editor2(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const svn_delta_editor_t *editor, void *edit_baton, svn_boolean_t *aborted, svn_boolean_t for_replay)
Receive edit commands over the network and use them to drive editor with edit_baton.