Subversion
svn_ra_svn.h
Go to the documentation of this file.
1/**
2 * @copyright
3 * ====================================================================
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 * ====================================================================
21 * @endcopyright
22 *
23 * @file svn_ra_svn.h
24 * @brief libsvn_ra_svn functions used by the server
25 */
26
27#ifndef SVN_RA_SVN_H
28#define SVN_RA_SVN_H
29
30#include <apr.h>
31#include <apr_pools.h>
32#include <apr_hash.h>
33#include <apr_tables.h>
34#include <apr_file_io.h> /* for apr_file_t */
35#include <apr_network_io.h> /* for apr_socket_t */
36
37#include "svn_types.h"
38#include "svn_string.h"
39#include "svn_config.h"
40#include "svn_delta.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif /* __cplusplus */
45
46/** The well-known svn port number. */
47#define SVN_RA_SVN_PORT 3690
48
49/** Currently-defined capabilities. */
50#define SVN_RA_SVN_CAP_EDIT_PIPELINE "edit-pipeline"
51#define SVN_RA_SVN_CAP_SVNDIFF1 "svndiff1"
52#define SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED "accepts-svndiff2"
53#define SVN_RA_SVN_CAP_ABSENT_ENTRIES "absent-entries"
54/* maps to SVN_RA_CAPABILITY_COMMIT_REVPROPS: */
55#define SVN_RA_SVN_CAP_COMMIT_REVPROPS "commit-revprops"
56/* maps to SVN_RA_CAPABILITY_MERGEINFO: */
57#define SVN_RA_SVN_CAP_MERGEINFO "mergeinfo"
58/* maps to SVN_RA_CAPABILITY_DEPTH: */
59#define SVN_RA_SVN_CAP_DEPTH "depth"
60/* maps to SVN_RA_CAPABILITY_LOG_REVPROPS */
61#define SVN_RA_SVN_CAP_LOG_REVPROPS "log-revprops"
62/* maps to SVN_RA_CAPABILITY_PARTIAL_REPLAY */
63#define SVN_RA_SVN_CAP_PARTIAL_REPLAY "partial-replay"
64/* maps to SVN_RA_CAPABILITY_ATOMIC_REVPROPS */
65#define SVN_RA_SVN_CAP_ATOMIC_REVPROPS "atomic-revprops"
66/* maps to SVN_RA_CAPABILITY_INHERITED_PROPERTIES: */
67#define SVN_RA_SVN_CAP_INHERITED_PROPS "inherited-props"
68/* maps to SVN_RA_CAPABILITY_EPHEMERAL_TXNPROPS */
69#define SVN_RA_SVN_CAP_EPHEMERAL_TXNPROPS "ephemeral-txnprops"
70/* maps to SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE */
71#define SVN_RA_SVN_CAP_GET_FILE_REVS_REVERSE "file-revs-reverse"
72/* maps to SVN_RA_CAPABILITY_LIST */
73#define SVN_RA_SVN_CAP_LIST "list"
74
75
76/** ra_svn passes @c svn_dirent_t fields over the wire as a list of
77 * words, these are the values used to represent each field.
78 *
79 * @defgroup ra_svn_dirent_fields Definitions of ra_svn dirent fields
80 * @{
81 */
82
83/** The ra_svn way of saying @c SVN_DIRENT_KIND. */
84#define SVN_RA_SVN_DIRENT_KIND "kind"
85
86/** The ra_svn way of saying @c SVN_DIRENT_SIZE. */
87#define SVN_RA_SVN_DIRENT_SIZE "size"
88
89/** The ra_svn way of saying @c SVN_DIRENT_HAS_PROPS. */
90#define SVN_RA_SVN_DIRENT_HAS_PROPS "has-props"
91
92/** The ra_svn way of saying @c SVN_DIRENT_CREATED_REV. */
93#define SVN_RA_SVN_DIRENT_CREATED_REV "created-rev"
94
95/** The ra_svn way of saying @c SVN_DIRENT_TIME. */
96#define SVN_RA_SVN_DIRENT_TIME "time"
97
98/** The ra_svn way of saying @c SVN_DIRENT_LAST_AUTHOR. */
99#define SVN_RA_SVN_DIRENT_LAST_AUTHOR "last-author"
100
101/** @} */
102
103/** A value used to indicate an optional number element in a tuple that was
104 * not received.
105 */
106#define SVN_RA_SVN_UNSPECIFIED_NUMBER ~((apr_uint64_t) 0)
107
108/** A specialized form of @c SVN_ERR to deal with errors which occur in an
109 * svn_ra_svn_command_handler().
110 *
111 * An error returned with this macro will be passed back to the other side
112 * of the connection. Use this macro when performing the requested operation;
113 * use the regular @c SVN_ERR when performing I/O with the client.
114 */
115#define SVN_CMD_ERR(expr) \
116 do { \
117 svn_error_t *svn_err__temp = (expr); \
118 if (svn_err__temp) \
119 return svn_error_create(SVN_ERR_RA_SVN_CMD_ERR, \
120 svn_err__temp, NULL); \
121 } while (0)
122
123/** an ra_svn connection. */
124typedef struct svn_ra_svn_conn_st svn_ra_svn_conn_t;
125
126/** Command handler, used by svn_ra_svn_handle_commands(). */
127typedef svn_error_t *(*svn_ra_svn_command_handler)(svn_ra_svn_conn_t *conn,
128 apr_pool_t *pool,
129 apr_array_header_t *params,
130 void *baton);
131
132/** Command table, used by svn_ra_svn_handle_commands().
133 */
135{
136 /** Name of the command */
137 const char *cmdname;
138
139 /** Handler for the command */
141
142 /** Termination flag. If set, command-handling will cease after
143 * command is processed. */
146
147/** Data types defined by the svn:// protocol.
148 *
149 * @since The typedef name is new in 1.10; the enumerators are not. */
150typedef enum
151{
152 SVN_RA_SVN_NUMBER,
153 SVN_RA_SVN_STRING,
154 SVN_RA_SVN_WORD,
155 SVN_RA_SVN_LIST
157
158/** Memory representation of an on-the-wire data item. */
159typedef struct svn_ra_svn_item_t
160{
161 /** Variant indicator. */
163
164 /** Variant data. */
165 union {
166 apr_uint64_t number;
167 svn_string_t *string;
168 const char *word;
169
170 /** Contains @c svn_ra_svn_item_t's. */
171 apr_array_header_t *list;
172 } u;
174
175typedef svn_error_t *(*svn_ra_svn_edit_callback)(void *baton);
176
177/** Initialize a connection structure for the given socket or
178 * input/output streams.
179 *
180 * Either @a sock or @a in_stream/@a out_stream must be set, not both.
181 * @a compression_level specifies the desired network data compression
182 * level from 0 (no compression) to 9 (best but slowest). The effect
183 * of the parameter depends on the compression algorithm; for example,
184 * it is used verbatim by zlib/deflate but ignored by LZ4.
185 *
186 * If @a zero_copy_limit is not 0, cached file contents smaller than the
187 * given limit may be sent directly to the network socket. Otherwise,
188 * it will be copied into a temporary buffer before being forwarded to
189 * the network stack. Since the zero-copy code path has to enforce strict
190 * time-outs, the receiver must be able to process @a zero_copy_limit
191 * bytes within one second. Even temporary failure to do so may cause
192 * the server to cancel the respective operation with a time-out error.
193 *
194 * To reduce the overhead of checking for cancellation requests from the
195 * data receiver, set @a error_check_interval to some non-zero value.
196 * It defines the number of bytes that must have been sent since the last
197 * check before the next check will be made.
198 *
199 * If @a max_in is not 0, error out and close the connection whenever more
200 * than @a max_in bytes are received for a command (e.g. a client request).
201 * If @a max_out is not 0, error out and close the connection whenever more
202 * than @a max_out bytes have been send as response to some command.
203 *
204 * @note The limits enforced may vary slightly by +/- the I/O buffer size.
205 *
206 * @note If @a out_stream is an wrapped apr_file_t* the backing file will be
207 * used for some operations.
208 *
209 * Allocate the result in @a pool.
210 *
211 * @since New in 1.10
212 */
214 svn_stream_t *in_stream,
215 svn_stream_t *out_stream,
216 int compression_level,
217 apr_size_t zero_copy_limit,
218 apr_size_t error_check_interval,
219 apr_uint64_t max_in,
220 apr_uint64_t max_out,
221 apr_pool_t *result_pool);
222
223
224/** Similar to svn_ra_svn_create_conn5() but with @a max_in and @a max_out
225 * set to 0.
226 *
227 * @since New in 1.9
228 * @deprecated Provided for backward compatibility with the 1.9 API.
229 */
232 svn_stream_t *in_stream,
233 svn_stream_t *out_stream,
234 int compression_level,
235 apr_size_t zero_copy_limit,
236 apr_size_t error_check_interval,
237 apr_pool_t *result_pool);
238
239
240/** Similar to svn_ra_svn_create_conn4() but only supports apr_file_t handles
241 * instead of the more generic streams.
242 *
243 * @since New in 1.8
244 * @deprecated Provided for backward compatibility with the 1.8 API.
245 */
248 apr_file_t *in_file,
249 apr_file_t *out_file,
250 int compression_level,
251 apr_size_t zero_copy_limit,
252 apr_size_t error_check_interval,
253 apr_pool_t *pool);
254
255/** Similar to svn_ra_svn_create_conn3() but disables the zero copy code
256 * path and sets the error checking interval to 0.
257 *
258 * @since New in 1.7.
259 *
260 * @deprecated Provided for backward compatibility with the 1.7 API.
261 */
264svn_ra_svn_create_conn2(apr_socket_t *sock,
265 apr_file_t *in_file,
266 apr_file_t *out_file,
267 int compression_level,
268 apr_pool_t *pool);
269
270/** Similar to svn_ra_svn_create_conn2() but uses the default
271 * compression level (#SVN_DELTA_COMPRESSION_LEVEL_DEFAULT) for network
272 * transmissions.
273 *
274 * @deprecated Provided for backward compatibility with the 1.6 API.
275 */
278svn_ra_svn_create_conn(apr_socket_t *sock,
279 apr_file_t *in_file,
280 apr_file_t *out_file,
281 apr_pool_t *pool);
282
283/** Add the capabilities in @a list to @a conn's capabilities.
284 * @a list contains svn_ra_svn_item_t entries (which should be of type
285 * SVN_RA_SVN_WORD; a malformed data error will result if any are not).
286 *
287 * This is idempotent: if a given capability was already set for
288 * @a conn, it remains set.
289 */
292 const apr_array_header_t *list);
293
294/** Return @c TRUE if @a conn has the capability @a capability, or
295 * @c FALSE if it does not. */
298 const char *capability);
299
300/** Return the data compression level to use for network transmissions.
301 *
302 * @since New in 1.7.
303 */
304int
306
307/** Return the zero-copy data block limit to use for network
308 * transmissions.
309 *
310 * @see http://en.wikipedia.org/wiki/Zero-copy
311 *
312 * @since New in 1.8.
313 */
314apr_size_t
316
317/** Returns the remote address of the connection as a string, if known,
318 * or NULL if inapplicable. */
319const char *
321
322/** Set @a *editor and @a *edit_baton to an editor which will pass editing
323 * operations over the network, using @a conn and @a pool.
324 *
325 * Upon successful completion of the edit, the editor will invoke @a callback
326 * with @a callback_baton as an argument.
327 *
328 * @note The @c copyfrom_path parameter passed to the @c add_file and
329 * @c add_directory methods of the returned editor may be either a URL or a
330 * relative path, and is transferred verbatim to the receiving end of the
331 * connection. See svn_ra_svn_drive_editor2() for information on the
332 * receiving end of the connection.
333 */
334void
336 void **edit_baton,
337 svn_ra_svn_conn_t *conn,
338 apr_pool_t *pool,
339 svn_ra_svn_edit_callback callback,
340 void *callback_baton);
341
342/** Receive edit commands over the network and use them to drive @a editor
343 * with @a edit_baton. On return, @a *aborted will be set if the edit was
344 * aborted. The drive can be terminated with a finish-replay command only
345 * if @a for_replay is TRUE.
346 *
347 * @since New in 1.4.
348 *
349 * @note The @c copyfrom_path parameter passed to the @c add_file and
350 * @c add_directory methods of the receiving editor will be canonicalized
351 * either as a URL or as a relative path (starting with a slash) according
352 * to which kind was sent by the driving end of the connection. See
353 * svn_ra_svn_get_editor() for information on the driving end of the
354 * connection.
355 */
358 apr_pool_t *pool,
359 const svn_delta_editor_t *editor,
360 void *edit_baton,
361 svn_boolean_t *aborted,
362 svn_boolean_t for_replay);
363
364/** Like svn_ra_svn_drive_editor2, but with @a for_replay always FALSE.
365 *
366 * @deprecated Provided for backward compatibility with the 1.3 API.
367 */
371 apr_pool_t *pool,
372 const svn_delta_editor_t *editor,
373 void *edit_baton,
374 svn_boolean_t *aborted);
375
376/** This function is only intended for use by svnserve.
377 *
378 * Perform CRAM-MD5 password authentication. On success, return
379 * SVN_NO_ERROR with *user set to the username and *success set to
380 * TRUE. On an error which can be reported to the client, report the
381 * error and return SVN_NO_ERROR with *success set to FALSE. On
382 * communications failure, return an error.
383 */
386 apr_pool_t *pool,
387 svn_config_t *pwdb,
388 const char **user,
389 svn_boolean_t *success);
390
391/**
392 * Get libsvn_ra_svn version information.
393 * @since New in 1.1.
394 */
395const svn_version_t *
397
398/**
399 * @defgroup ra_svn_deprecated ra_svn low-level functions
400 * @{
401 */
402
403/** Write a number over the net.
404 *
405 * Writes will be buffered until the next read or flush.
406 *
407 * @deprecated Provided for backward compatibility with the 1.7 API.
408 * RA_SVN low-level functions are no longer considered public.
409 */
413 apr_pool_t *pool,
414 apr_uint64_t number);
415
416/** Write a string over the net.
417 *
418 * Writes will be buffered until the next read or flush.
419 *
420 * @deprecated Provided for backward compatibility with the 1.7 API.
421 * RA_SVN low-level functions are no longer considered public.
422 */
426 apr_pool_t *pool,
427 const svn_string_t *str);
428
429/** Write a cstring over the net.
430 *
431 * Writes will be buffered until the next read or flush.
432 *
433 * @deprecated Provided for backward compatibility with the 1.7 API.
434 * RA_SVN low-level functions are no longer considered public.
435 */
439 apr_pool_t *pool,
440 const char *s);
441
442/** Write a word over the net.
443 *
444 * Writes will be buffered until the next read or flush.
445 *
446 * @deprecated Provided for backward compatibility with the 1.7 API.
447 * RA_SVN low-level functions are no longer considered public.
448 */
452 apr_pool_t *pool,
453 const char *word);
454
455/** Write a list of properties over the net. @a props is allowed to be NULL,
456 * in which case an empty list will be written out.
457 *
458 * @since New in 1.5.
459 *
460 * @deprecated Provided for backward compatibility with the 1.7 API.
461 * RA_SVN low-level functions are no longer considered public.
462 */
466 apr_pool_t *pool,
467 apr_hash_t *props);
468
469/** Begin a list. Writes will be buffered until the next read or flush.
470 *
471 * @deprecated Provided for backward compatibility with the 1.7 API.
472 * RA_SVN low-level functions are no longer considered public.
473 */
477 apr_pool_t *pool);
478
479/** End a list. Writes will be buffered until the next read or flush.
480 *
481 * @deprecated Provided for backward compatibility with the 1.7 API.
482 * RA_SVN low-level functions are no longer considered public.
483 */
487 apr_pool_t *pool);
488
489/** Flush the write buffer.
490 *
491 * Normally this shouldn't be necessary, since the write buffer is flushed
492 * when a read is attempted.
493 *
494 * @deprecated Provided for backward compatibility with the 1.7 API.
495 * RA_SVN low-level functions are no longer considered public.
496 */
500 apr_pool_t *pool);
501
502/** Write a tuple, using a printf-like interface.
503 *
504 * The format string @a fmt may contain:
505 *
506 *@verbatim
507 Spec Argument type Item type
508 ---- -------------------- ---------
509 n apr_uint64_t Number
510 r svn_revnum_t Number
511 s const svn_string_t * String
512 c const char * String
513 w const char * Word
514 b svn_boolean_t Word ("true" or "false")
515 ( Begin tuple
516 ) End tuple
517 ? Remaining elements optional
518 ! (at beginning or end) Suppress opening or closing of tuple
519 @endverbatim
520 *
521 * Inside the optional part of a tuple, 'r' values may be @c
522 * SVN_INVALID_REVNUM, 'n' values may be
523 * SVN_RA_SVN_UNSPECIFIED_NUMBER, and 's', 'c', and 'w' values may be
524 * @c NULL; in these cases no data will be written. 'b' and '(' may
525 * not appear in the optional part of a tuple. Either all or none of
526 * the optional values should be valid.
527 *
528 * (If we ever have a need for an optional boolean value, we should
529 * invent a 'B' specifier which stores a boolean into an int, using -1
530 * for unspecified. Right now there is no need for such a thing.)
531 *
532 * Use the '!' format specifier to write partial tuples when you have
533 * to transmit an array or other unusual data. For example, to write
534 * a tuple containing a revision, an array of words, and a boolean:
535 * @code
536 SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "r(!", rev));
537 for (i = 0; i < n; i++)
538 SVN_ERR(svn_ra_svn_write_word(conn, pool, words[i]));
539 SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)b", flag)); @endcode
540 *
541 * @deprecated Provided for backward compatibility with the 1.7 API.
542 * RA_SVN low-level functions are no longer considered public.
543 */
547 apr_pool_t *pool,
548 const char *fmt, ...);
549
550/** Read an item from the network into @a *item.
551 *
552 * @deprecated Provided for backward compatibility with the 1.7 API.
553 * RA_SVN low-level functions are no longer considered public.
554 */
558 apr_pool_t *pool,
559 svn_ra_svn_item_t **item);
560
561/** Scan data on @a conn until we find something which looks like the
562 * beginning of an svn server greeting (an open paren followed by a
563 * whitespace character). This function is appropriate for beginning
564 * a client connection opened in tunnel mode, since people's dotfiles
565 * sometimes write output to stdout. It may only be called at the
566 * beginning of a client connection.
567 *
568 * @deprecated Provided for backward compatibility with the 1.7 API.
569 * RA_SVN low-level functions are no longer considered public.
570 */
574 apr_pool_t *pool);
575
576/** Parse an array of @c svn_sort__item_t structures as a tuple, using a
577 * printf-like interface. The format string @a fmt may contain:
578 *
579 *@verbatim
580 Spec Argument type Item type
581 ---- -------------------- ---------
582 n apr_uint64_t * Number
583 r svn_revnum_t * Number
584 s svn_string_t ** String
585 c const char ** String
586 w const char ** Word
587 b svn_boolean_t * Word ("true" or "false")
588 B apr_uint64_t * Word ("true" or "false")
589 l apr_array_header_t ** List
590 ( Begin tuple
591 ) End tuple
592 ? Tuple is allowed to end here
593 @endverbatim
594 *
595 * Note that a tuple is only allowed to end precisely at a '?', or at
596 * the end of the specification. So if @a fmt is "c?cc" and @a list
597 * contains two elements, an error will result.
598 *
599 * 'B' is similar to 'b', but may be used in the optional tuple specification.
600 * It returns TRUE, FALSE, or SVN_RA_SVN_UNSPECIFIED_NUMBER.
601 *
602 * If an optional part of a tuple contains no data, 'r' values will be
603 * set to @c SVN_INVALID_REVNUM, 'n' and 'B' values will be set to
604 * SVN_RA_SVN_UNSPECIFIED_NUMBER, and 's', 'c', 'w', and 'l' values
605 * will be set to @c NULL. 'b' may not appear inside an optional
606 * tuple specification; use 'B' instead.
607 *
608 * @deprecated Provided for backward compatibility with the 1.7 API.
609 * RA_SVN low-level functions are no longer considered public.
610 */
613svn_ra_svn_parse_tuple(const apr_array_header_t *list,
614 apr_pool_t *pool,
615 const char *fmt, ...);
616
617/** Read a tuple from the network and parse it as a tuple, using the
618 * format string notation from svn_ra_svn_parse_tuple().
619 *
620 * @deprecated Provided for backward compatibility with the 1.7 API.
621 * RA_SVN low-level functions are no longer considered public.
622 */
626 apr_pool_t *pool,
627 const char *fmt, ...);
628
629/** Parse an array of @c svn_ra_svn_item_t structures as a list of
630 * properties, storing the properties in a hash table.
631 *
632 * @since New in 1.5.
633 *
634 * @deprecated Provided for backward compatibility with the 1.7 API.
635 * RA_SVN low-level functions are no longer considered public.
636 */
639svn_ra_svn_parse_proplist(const apr_array_header_t *list,
640 apr_pool_t *pool,
641 apr_hash_t **props);
642
643/** Read a command response from the network and parse it as a tuple, using
644 * the format string notation from svn_ra_svn_parse_tuple().
645 *
646 * @deprecated Provided for backward compatibility with the 1.7 API.
647 * RA_SVN low-level functions are no longer considered public.
648 */
652 apr_pool_t *pool,
653 const char *fmt, ...);
654
655/** Accept commands over the network and handle them according to @a
656 * commands. Command handlers will be passed @a conn, a subpool of @a
657 * pool (cleared after each command is handled), the parameters of the
658 * command, and @a baton. Commands will be accepted until a
659 * terminating command is received (a command with "terminate" set in
660 * the command table). If a command handler returns an error wrapped
661 * in SVN_RA_SVN_CMD_ERR (see the @c SVN_CMD_ERR macro), the error
662 * will be reported to the other side of the connection and the
663 * command loop will continue; any other kind of error (typically a
664 * network or protocol error) is passed through to the caller.
665 *
666 * @since New in 1.6.
667 *
668 * @deprecated Provided for backward compatibility with the 1.7 API.
669 * RA_SVN low-level functions are no longer considered public.
670 */
674 apr_pool_t *pool,
675 const svn_ra_svn_cmd_entry_t *commands,
676 void *baton,
677 svn_boolean_t error_on_disconnect);
678
679/** Similar to svn_ra_svn_handle_commands2 but @a error_on_disconnect
680 * is always @c FALSE.
681 *
682 * @deprecated Provided for backward compatibility with the 1.5 API.
683 */
687 apr_pool_t *pool,
688 const svn_ra_svn_cmd_entry_t *commands,
689 void *baton);
690
691/** Write a command over the network, using the same format string notation
692 * as svn_ra_svn_write_tuple().
693 *
694 * @deprecated Provided for backward compatibility with the 1.7 API.
695 * RA_SVN low-level functions are no longer considered public.
696 */
700 apr_pool_t *pool,
701 const char *cmdname,
702 const char *fmt, ...);
703
704/** Write a successful command response over the network, using the
705 * same format string notation as svn_ra_svn_write_tuple(). Do not use
706 * partial tuples with this function; if you need to use partial
707 * tuples, just write out the "success" and argument tuple by hand.
708 *
709 * @deprecated Provided for backward compatibility with the 1.7 API.
710 * RA_SVN low-level functions are no longer considered public.
711 */
715 apr_pool_t *pool,
716 const char *fmt, ...);
717
718/** Write an unsuccessful command response over the network.
719 *
720 * @deprecated Provided for backward compatibility with the 1.7 API.
721 * RA_SVN low-level functions are no longer considered public.
722 */
726 apr_pool_t *pool,
727 svn_error_t *err);
728
729/**
730 * @}
731 */
732
733#ifdef __cplusplus
734}
735#endif /* __cplusplus */
736
737#endif /* SVN_RA_SVN_H */
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_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...
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_write_number(svn_ra_svn_conn_t *conn, apr_pool_t *pool, apr_uint64_t number)
Write a number over the net.
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_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_flush(svn_ra_svn_conn_t *conn, apr_pool_t *pool)
Flush the write buffer.
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_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...
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.
svn_error_t * svn_ra_svn_end_list(svn_ra_svn_conn_t *conn, apr_pool_t *pool)
End a list.
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_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_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_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_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_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_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.
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_write_word(svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *word)
Write a word over the net.
struct svn_stream_t svn_stream_t
An abstract stream of bytes–either incoming or outgoing or both.
Definition: svn_io.h:863
A structure full of callback functions the delta source will invoke as it produces the delta.
Definition: svn_delta.h:884
Subversion error object.
Definition: svn_types.h:181
Command table, used by svn_ra_svn_handle_commands().
Definition: svn_ra_svn.h:135
const char * cmdname
Name of the command.
Definition: svn_ra_svn.h:137
svn_ra_svn_command_handler handler
Handler for the command.
Definition: svn_ra_svn.h:140
svn_boolean_t terminate
Termination flag.
Definition: svn_ra_svn.h:144
Memory representation of an on-the-wire data item.
Definition: svn_ra_svn.h:160
union svn_ra_svn_item_t::@2 u
Variant data.
svn_ra_svn_item_kind_t kind
Variant indicator.
Definition: svn_ra_svn.h:162
apr_array_header_t * list
Contains svn_ra_svn_item_t's.
Definition: svn_ra_svn.h:171
A simple counted string.
Definition: svn_string.h:97
Version information.
Definition: svn_version.h:148
Accessing SVN configuration files.
struct svn_config_t svn_config_t
Opaque structure describing a set of configuration options.
Definition: svn_config.h:54
Delta-parsing.
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...
struct svn_ra_svn_conn_st svn_ra_svn_conn_t
an ra_svn connection.
Definition: svn_ra_svn.h:124
svn_ra_svn_item_kind_t
Data types defined by the svn:// protocol.
Definition: svn_ra_svn.h:151
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_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().
Definition: svn_ra_svn.h:127
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,...
const svn_version_t * svn_ra_svn_version(void)
Get libsvn_ra_svn version information.
struct svn_ra_svn_item_t svn_ra_svn_item_t
Memory representation of an on-the-wire data item.
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.
struct svn_ra_svn_cmd_entry_t svn_ra_svn_cmd_entry_t
Command table, used by svn_ra_svn_handle_commands().
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.
svn_ra_svn_conn_t * svn_ra_svn_create_conn5(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_uint64_t max_in, apr_uint64_t max_out, apr_pool_t *result_pool)
Initialize a connection structure for the given socket or input/output streams.
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...
int svn_ra_svn_compression_level(svn_ra_svn_conn_t *conn)
Return the data compression level to use for network transmissions.
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)
Similar to svn_ra_svn_create_conn5() but with max_in and max_out set to 0.
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.
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.
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.
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...
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.
Counted-length strings for Subversion, plus some C string goodies.
Subversion's data types.
int svn_boolean_t
YABT: Yet Another Boolean Type.
Definition: svn_types.h:141
#define SVN_DEPRECATED
Macro used to mark deprecated functions.
Definition: svn_types.h:62