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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
20 * ====================================================================
23 * @file svn_ra_svn_private.h
24 * @brief Functions used by the server - Internal routines
27 #ifndef SVN_RA_SVN_PRIVATE_H
28 #define SVN_RA_SVN_PRIVATE_H
30 #include "svn_ra_svn.h"
31 #include "svn_editor.h"
35 #endif /* __cplusplus */
37 /** Memory representation of an on-the-wire data item. */
38 typedef struct svn_ra_svn__item_t svn_ra_svn__item_t;
40 /* A list of svn_ra_svn__item_t objects. */
41 typedef struct svn_ra_svn__list_t
43 /* List contents (array). May be NULL if NELTS is 0. */
44 struct svn_ra_svn__item_t *items;
46 /* Number of elements in ITEMS. */
50 /* List element access macro. */
51 #define SVN_RA_SVN__LIST_ITEM(list, idx) (list)->items[idx]
53 /** Memory representation of an on-the-wire data item. */
54 struct svn_ra_svn__item_t
56 /** Variant indicator. */
57 svn_ra_svn_item_kind_t kind;
64 svn_ra_svn__list_t list;
68 /** Command handler, used by svn_ra_svn__handle_commands(). */
69 typedef svn_error_t *(*svn_ra_svn__command_handler)(svn_ra_svn_conn_t *conn,
71 svn_ra_svn__list_t *params,
74 /** Command table, used by svn_ra_svn_handle_commands().
76 typedef struct svn_ra_svn__cmd_entry_t
78 /** Name of the command */
81 /** Handler for the command */
82 svn_ra_svn__command_handler handler;
84 /** Only set when used through a deprecated API.
85 * HANDLER is NULL in that case. */
86 svn_ra_svn_command_handler deprecated_handler;
88 /** Termination flag. If set, command-handling will cease after
89 * command is processed. */
90 svn_boolean_t terminate;
91 } svn_ra_svn__cmd_entry_t;
94 /* Return a deep copy of the SOURCE array containing private API
95 * svn_ra_svn__item_t SOURCE to public API *TARGET, allocating
96 * sub-structures in RESULT_POOL. */
98 svn_ra_svn__to_public_array(const svn_ra_svn__list_t *source,
99 apr_pool_t *result_pool);
101 /* Deep copy contents from private API *SOURCE to public API *TARGET,
102 * allocating sub-structures in RESULT_POOL. */
104 svn_ra_svn__to_public_item(svn_ra_svn_item_t *target,
105 const svn_ra_svn__item_t *source,
106 apr_pool_t *result_pool);
109 svn_ra_svn__to_private_array(const apr_array_header_t *source,
110 apr_pool_t *result_pool);
112 /* Deep copy contents from public API *SOURCE to private API *TARGET,
113 * allocating sub-structures in RESULT_POOL. */
115 svn_ra_svn__to_private_item(svn_ra_svn__item_t *target,
116 const svn_ra_svn_item_t *source,
117 apr_pool_t *result_pool);
119 /** Add the capabilities in @a list to @a conn's capabilities.
120 * @a list contains svn_ra_svn__item_t entries (which should be of type
121 * SVN_RA_SVN_WORD; a malformed data error will result if any are not).
123 * This is idempotent: if a given capability was already set for
124 * @a conn, it remains set.
127 svn_ra_svn__set_capabilities(svn_ra_svn_conn_t *conn,
128 const svn_ra_svn__list_t *list);
130 /** Returns the preferred svndiff version to be used with connection @a conn.
133 svn_ra_svn__svndiff_version(svn_ra_svn_conn_t *conn);
137 * Set the shim callbacks to be used by @a conn to @a shim_callbacks.
140 svn_ra_svn__set_shim_callbacks(svn_ra_svn_conn_t *conn,
141 svn_delta_shim_callbacks_t *shim_callbacks);
144 * Return the memory pool used to allocate @a conn.
147 svn_ra_svn__get_pool(svn_ra_svn_conn_t *conn);
150 * @defgroup ra_svn_deprecated ra_svn low-level functions
154 /** Write a number over the net.
156 * Writes will be buffered until the next read or flush.
159 svn_ra_svn__write_number(svn_ra_svn_conn_t *conn,
161 apr_uint64_t number);
163 /** Write a string over the net.
165 * Writes will be buffered until the next read or flush.
168 svn_ra_svn__write_string(svn_ra_svn_conn_t *conn,
170 const svn_string_t *str);
172 /** Write a cstring over the net.
174 * Writes will be buffered until the next read or flush.
177 svn_ra_svn__write_cstring(svn_ra_svn_conn_t *conn,
181 /** Write a word over the net.
183 * Writes will be buffered until the next read or flush.
186 svn_ra_svn__write_word(svn_ra_svn_conn_t *conn,
190 /** Write a boolean over the net.
192 * Writes will be buffered until the next read or flush.
195 svn_ra_svn__write_boolean(svn_ra_svn_conn_t *conn,
197 svn_boolean_t value);
199 /** Write a list of properties over the net. @a props is allowed to be NULL,
200 * in which case an empty list will be written out.
205 svn_ra_svn__write_proplist(svn_ra_svn_conn_t *conn,
209 /** Begin a list. Writes will be buffered until the next read or flush. */
211 svn_ra_svn__start_list(svn_ra_svn_conn_t *conn,
214 /** End a list. Writes will be buffered until the next read or flush. */
216 svn_ra_svn__end_list(svn_ra_svn_conn_t *conn,
219 /** Flush the write buffer.
221 * Normally this shouldn't be necessary, since the write buffer is flushed
222 * when a read is attempted.
225 svn_ra_svn__flush(svn_ra_svn_conn_t *conn,
228 /** Write a tuple, using a printf-like interface.
230 * The format string @a fmt may contain:
233 Spec Argument type Item type
234 ---- -------------------- ---------
235 n apr_uint64_t Number
236 r svn_revnum_t Number
237 s const svn_string_t * String
238 c const char * String
240 b svn_boolean_t Word ("true" or "false")
243 ? Remaining elements optional
244 ! (at beginning or end) Suppress opening or closing of tuple
247 * Inside the optional part of a tuple, 'r' values may be @c
248 * SVN_INVALID_REVNUM, 'n' values may be
249 * SVN_RA_SVN_UNSPECIFIED_NUMBER, and 's', 'c', and 'w' values may be
250 * @c NULL; in these cases no data will be written. 'b' and '(' may
251 * not appear in the optional part of a tuple. Either all or none of
252 * the optional values should be valid.
254 * (If we ever have a need for an optional boolean value, we should
255 * invent a 'B' specifier which stores a boolean into an int, using -1
256 * for unspecified. Right now there is no need for such a thing.)
258 * Use the '!' format specifier to write partial tuples when you have
259 * to transmit an array or other unusual data. For example, to write
260 * a tuple containing a revision, an array of words, and a boolean:
262 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "r(!", rev));
263 for (i = 0; i < n; i++)
264 SVN_ERR(svn_ra_svn__write_word(conn, pool, words[i]));
265 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!)b", flag)); @endcode
268 svn_ra_svn__write_tuple(svn_ra_svn_conn_t *conn,
270 const char *fmt, ...);
272 /** Read an item from the network into @a *item. */
274 svn_ra_svn__read_item(svn_ra_svn_conn_t *conn,
276 svn_ra_svn__item_t **item);
278 /** Scan data on @a conn until we find something which looks like the
279 * beginning of an svn server greeting (an open paren followed by a
280 * whitespace character). This function is appropriate for beginning
281 * a client connection opened in tunnel mode, since people's dotfiles
282 * sometimes write output to stdout. It may only be called at the
283 * beginning of a client connection.
286 svn_ra_svn__skip_leading_garbage(svn_ra_svn_conn_t *conn,
289 /** Parse an array of @c svn_sort__item_t structures as a tuple, using a
290 * printf-like interface. The format string @a fmt may contain:
293 Spec Argument type Item type
294 ---- -------------------- ---------
295 n apr_uint64_t * Number
296 r svn_revnum_t * Number
297 s svn_string_t ** String
298 c const char ** String
300 b svn_boolean_t * Word ("true" or "false")
301 B apr_uint64_t * Word ("true" or "false")
302 3 svn_tristate_t * Word ("true" or "false")
303 l apr_array_header_t ** List
306 ? Tuple is allowed to end here
309 * Note that a tuple is only allowed to end precisely at a '?', or at
310 * the end of the specification. So if @a fmt is "c?cc" and @a list
311 * contains two elements, an error will result.
313 * '3' is similar to 'b', but may be used in the optional tuple specification.
314 * It returns #svn_tristate_true, #svn_tristate_false or #svn_tristate_unknown.
316 * 'B' is similar to '3', but it returns @c TRUE, @c FALSE, or
317 * #SVN_RA_SVN_UNSPECIFIED_NUMBER. 'B' is deprecated; new code should
320 * If an optional part of a tuple contains no data, 'r' values will be
321 * set to @c SVN_INVALID_REVNUM; 'n' and 'B' values will be set to
322 * #SVN_RA_SVN_UNSPECIFIED_NUMBER; 's', 'c', 'w', and 'l' values will
323 * be set to @c NULL; '3' values will be set to #svn_tristate_unknown;
324 * and 'b' values will be set to @c FALSE.
327 svn_ra_svn__parse_tuple(const svn_ra_svn__list_t *list,
328 const char *fmt, ...);
330 /** Read a tuple from the network and parse it as a tuple, using the
331 * format string notation from svn_ra_svn_parse_tuple().
334 svn_ra_svn__read_tuple(svn_ra_svn_conn_t *conn,
336 const char *fmt, ...);
338 /** Parse an array of @c svn_ra_svn__item_t structures as a list of
339 * properties, storing the properties in a hash table.
344 svn_ra_svn__parse_proplist(const svn_ra_svn__list_t *list,
348 /** Read a command response from the network and parse it as a tuple, using
349 * the format string notation from svn_ra_svn_parse_tuple().
352 svn_ra_svn__read_cmd_response(svn_ra_svn_conn_t *conn,
354 const char *fmt, ...);
356 /** Check the receive buffer and socket of @a conn whether there is some
357 * unprocessed incoming data without waiting for new data to come in.
358 * If data is found, set @a *has_command to TRUE. If the connection does
359 * not contain any more data and has been closed, set @a *terminated to
363 svn_ra_svn__has_command(svn_boolean_t *has_command,
364 svn_boolean_t *terminated,
365 svn_ra_svn_conn_t *conn,
368 /** Accept a single command from @a conn and handle them according
369 * to @a cmd_hash. Command handlers will be passed @a conn, @a pool,
370 * the parameters of the command, and @a baton. @a *terminate will be
371 * set if either @a error_on_disconnect is FALSE and the connection got
372 * closed, or if the command being handled has the "terminate" flag set
373 * in the command table.
376 svn_ra_svn__handle_command(svn_boolean_t *terminate,
377 apr_hash_t *cmd_hash,
379 svn_ra_svn_conn_t *conn,
380 svn_boolean_t error_on_disconnect,
383 /** Accept commands over the network and handle them according to @a
384 * commands. Command handlers will be passed @a conn, a subpool of @a
385 * pool (cleared after each command is handled), the parameters of the
386 * command, and @a baton. Commands will be accepted until a
387 * terminating command is received (a command with "terminate" set in
388 * the command table). If a command handler returns an error wrapped
389 * in SVN_RA_SVN_CMD_ERR (see the @c SVN_CMD_ERR macro), the error
390 * will be reported to the other side of the connection and the
391 * command loop will continue; any other kind of error (typically a
392 * network or protocol error) is passed through to the caller.
398 svn_ra_svn__handle_commands2(svn_ra_svn_conn_t *conn,
400 const svn_ra_svn__cmd_entry_t *commands,
402 svn_boolean_t error_on_disconnect);
404 /** Write a successful command response over the network, using the
405 * same format string notation as svn_ra_svn_write_tuple(). Do not use
406 * partial tuples with this function; if you need to use partial
407 * tuples, just write out the "success" and argument tuple by hand.
410 svn_ra_svn__write_cmd_response(svn_ra_svn_conn_t *conn,
412 const char *fmt, ...);
414 /** Write an unsuccessful command response over the network.
416 * @note This does not clear @a err. */
418 svn_ra_svn__write_cmd_failure(svn_ra_svn_conn_t *conn,
420 const svn_error_t *err);
427 * @defgroup svn_commands sending ra_svn commands
431 /** Sets the target revision of connection @a conn to @a rev. Use @a pool
435 svn_ra_svn__write_cmd_target_rev(svn_ra_svn_conn_t *conn,
439 /** Send a "open-root" command over connection @a conn. Open the
440 * repository root at revision @a rev and associate it with @a token.
441 * Use @a pool for allocations.
444 svn_ra_svn__write_cmd_open_root(svn_ra_svn_conn_t *conn,
447 const svn_string_t *token);
449 /** Send a "delete-entry" command over connection @a conn. Delete the
450 * @a path at optional revision @a rev below @a parent_token.
451 * Use @a pool for allocations.
454 svn_ra_svn__write_cmd_delete_entry(svn_ra_svn_conn_t *conn,
458 const svn_string_t *parent_token);
460 /** Send a "add-dir" command over connection @a conn. Add a new directory
461 * node named @a path under the directory identified by @a parent_token.
462 * Associate the new directory with the given @a token. * @a copy_path
463 * and @a copy_rev are optional and describe the copy source.
464 * Use @a pool for allocations.
467 svn_ra_svn__write_cmd_add_dir(svn_ra_svn_conn_t *conn,
470 const svn_string_t *parent_token,
471 const svn_string_t *token,
472 const char *copy_path,
473 svn_revnum_t copy_rev);
475 /** Send a "open-dir" command over connection @a conn. Associate to
476 * @a token the directory node named @a path under the directory
477 * identified by @a parent_token in revision @a rev.
478 * Use @a pool for allocations.
481 svn_ra_svn__write_cmd_open_dir(svn_ra_svn_conn_t *conn,
484 const svn_string_t *parent_token,
485 const svn_string_t *token,
488 /** Send a "change-dir-prop" command over connection @a conn. Set the
489 * property @a name to the optional @a value on the directory identified
490 * to @a token. Use @a pool for allocations.
493 svn_ra_svn__write_cmd_change_dir_prop(svn_ra_svn_conn_t *conn,
495 const svn_string_t *token,
497 const svn_string_t *value);
499 /** Send a "close-dir" command over connection @a conn. Identify the node
500 * to close with @a token. The latter will then no longer be associated
501 * with that node. Use @a pool for allocations.
504 svn_ra_svn__write_cmd_close_dir(svn_ra_svn_conn_t *conn,
506 const svn_string_t *token);
508 /** Send a "absent-dir" command over connection @a conn. Directory node
509 * named @a path under the directory identified by @a parent_token is
510 * absent. Use @a pool for allocations.
513 svn_ra_svn__write_cmd_absent_dir(svn_ra_svn_conn_t *conn,
516 const svn_string_t *parent_token);
518 /** Send a "add-file" command over connection @a conn. Add a new file
519 * node named @a path under the directory identified by @a parent_token.
520 * Associate the new file with the given @a token. * @a copy_path and
521 * @a copy_rev are optional and describe the copy source.
522 * Use @a pool for allocations.
525 svn_ra_svn__write_cmd_add_file(svn_ra_svn_conn_t *conn,
528 const svn_string_t *parent_token,
529 const svn_string_t *token,
530 const char *copy_path,
531 svn_revnum_t copy_rev);
533 /** Send a "open-file" command over connection @a conn. Associate to
534 * @a token the file node named @a path under the directory identified by
535 * @a parent_token in revision @a rev.
536 * Use @a pool for allocations.
539 svn_ra_svn__write_cmd_open_file(svn_ra_svn_conn_t *conn,
542 const svn_string_t *parent_token,
543 const svn_string_t *token,
546 /** Send a "change-file-prop" command over connection @a conn. Set the
547 * property @a name to the optional @a value on the file identified to
548 * @a token. Use @a pool for allocations.
551 svn_ra_svn__write_cmd_change_file_prop(svn_ra_svn_conn_t *conn,
553 const svn_string_t *token,
555 const svn_string_t *value);
557 /** Send a "close-dir" command over connection @a conn. Identify the node
558 * to close with @a token and provide an optional @a check_sum. The token
559 * will then no longer be associated with that node.
560 * Use @a pool for allocations.
563 svn_ra_svn__write_cmd_close_file(svn_ra_svn_conn_t *conn,
565 const svn_string_t *token,
566 const char *text_checksum);
568 /** Send a "absent-file" command over connection @a conn. File node
569 * named @a path in the directory identified by @a parent_token is
570 * absent. Use @a pool for allocations.
573 svn_ra_svn__write_cmd_absent_file(svn_ra_svn_conn_t *conn,
576 const svn_string_t *parent_token);
578 /** Send a "apply-textdelta" command over connection @a conn. Starts a
579 * series of text deltas to be applied to the file identified by @a token.
580 * Optionally, specify the file's current checksum in @a base_checksum.
581 * Use @a pool for allocations.
584 svn_ra_svn__write_cmd_apply_textdelta(svn_ra_svn_conn_t *conn,
586 const svn_string_t *token,
587 const char *base_checksum);
589 /** Send a "textdelta-chunk" command over connection @a conn. Apply
590 * textdelta @a chunk to the file identified by @a token.
591 * Use @a pool for allocations.
594 svn_ra_svn__write_cmd_textdelta_chunk(svn_ra_svn_conn_t *conn,
596 const svn_string_t *token,
597 const svn_string_t *chunk);
599 /** Send a "textdelta-end" command over connection @a conn. Ends the
600 * series of text deltas to be applied to the file identified by @a token.
601 * Use @a pool for allocations.
604 svn_ra_svn__write_cmd_textdelta_end(svn_ra_svn_conn_t *conn,
606 const svn_string_t *token);
608 /** Send a "close-edit" command over connection @a conn. Ends the editor
609 * drive (successfully). Use @a pool for allocations.
612 svn_ra_svn__write_cmd_close_edit(svn_ra_svn_conn_t *conn,
615 /** Send a "abort-edit" command over connection @a conn. Prematurely ends
616 * the editor drive, e.g. due to some problem on the other side.
617 * Use @a pool for allocations.
620 svn_ra_svn__write_cmd_abort_edit(svn_ra_svn_conn_t *conn,
623 /** Send a "set-path" command over connection @a conn.
624 * Use @a pool for allocations.
626 * @see set_path() in #svn_ra_reporter3_t for a description.
629 svn_ra_svn__write_cmd_set_path(svn_ra_svn_conn_t *conn,
633 svn_boolean_t start_empty,
634 const char *lock_token,
637 /** Send a "delete-path" command over connection @a conn.
638 * Use @a pool for allocations.
640 * @see delete_path() in #svn_ra_reporter3_t for a description.
643 svn_ra_svn__write_cmd_delete_path(svn_ra_svn_conn_t *conn,
647 /** Send a "link-path" command over connection @a conn.
648 * Use @a pool for allocations.
650 * @see link_path() in #svn_ra_reporter3_t for a description.
653 svn_ra_svn__write_cmd_link_path(svn_ra_svn_conn_t *conn,
658 svn_boolean_t start_empty,
659 const char *lock_token,
662 /** Send a "finish-report" command over connection @a conn.
663 * Use @a pool for allocations.
665 * @see finish_report() in #svn_ra_reporter3_t for a description.
668 svn_ra_svn__write_cmd_finish_report(svn_ra_svn_conn_t *conn,
671 /** Send a "abort-report" command over connection @a conn.
672 * Use @a pool for allocations.
674 * @see abort_report() in #svn_ra_reporter3_t for a description.
677 svn_ra_svn__write_cmd_abort_report(svn_ra_svn_conn_t *conn,
680 /** Send a "reparent" command over connection @a conn.
681 * Use @a pool for allocations.
683 * @see #svn_ra_reparent for a description.
686 svn_ra_svn__write_cmd_reparent(svn_ra_svn_conn_t *conn,
690 /** Send a "get-latest-rev" command over connection @a conn.
691 * Use @a pool for allocations.
693 * @see #svn_ra_get_latest_revnum for a description.
696 svn_ra_svn__write_cmd_get_latest_rev(svn_ra_svn_conn_t *conn,
699 /** Send a "get-dated-rev" command over connection @a conn.
700 * Use @a pool for allocations.
702 * @see #svn_ra_get_dated_revision for a description.
705 svn_ra_svn__write_cmd_get_dated_rev(svn_ra_svn_conn_t *conn,
709 /** Send a "change-rev-prop2" command over connection @a conn.
710 * Use @a pool for allocations.
712 * If @a dont_care is false then check that the old value matches
713 * @a old_value. If @a dont_care is true then do not check the old
714 * value; in this case @a old_value must be NULL.
716 * @see #svn_ra_change_rev_prop2 for the rest of the description.
719 svn_ra_svn__write_cmd_change_rev_prop2(svn_ra_svn_conn_t *conn,
723 const svn_string_t *value,
724 svn_boolean_t dont_care,
725 const svn_string_t *old_value);
727 /** Send a "change-rev-prop" command over connection @a conn.
728 * Use @a pool for allocations.
730 * @see #svn_ra_change_rev_prop for a description.
733 svn_ra_svn__write_cmd_change_rev_prop(svn_ra_svn_conn_t *conn,
737 const svn_string_t *value);
739 /** Send a "rev-proplist" command over connection @a conn.
740 * Use @a pool for allocations.
742 * @see #svn_ra_rev_proplist for a description.
745 svn_ra_svn__write_cmd_rev_proplist(svn_ra_svn_conn_t *conn,
749 /** Send a "rev-prop" command over connection @a conn.
750 * Use @a pool for allocations.
752 * @see #svn_ra_rev_prop for a description.
755 svn_ra_svn__write_cmd_rev_prop(svn_ra_svn_conn_t *conn,
760 /** Send a "get-file" command over connection @a conn.
761 * Use @a pool for allocations.
763 * @see #svn_ra_get_file for a description.
766 svn_ra_svn__write_cmd_get_file(svn_ra_svn_conn_t *conn,
771 svn_boolean_t stream);
773 /** Send a "update" command over connection @a conn.
774 * Use @a pool for allocations.
776 * @see #svn_ra_do_update3 for a description.
779 svn_ra_svn__write_cmd_update(svn_ra_svn_conn_t *conn,
783 svn_boolean_t recurse,
785 svn_boolean_t send_copyfrom_args,
786 svn_boolean_t ignore_ancestry);
788 /** Send a "switch" command over connection @a conn.
789 * Use @a pool for allocations.
791 * @see #svn_ra_do_switch3 for a description.
794 svn_ra_svn__write_cmd_switch(svn_ra_svn_conn_t *conn,
798 svn_boolean_t recurse,
799 const char *switch_url,
801 svn_boolean_t send_copyfrom_args,
802 svn_boolean_t ignore_ancestry);
804 /** Send a "status" command over connection @a conn.
805 * Use @a pool for allocations.
807 * @see #svn_ra_do_status2 for a description.
810 svn_ra_svn__write_cmd_status(svn_ra_svn_conn_t *conn,
813 svn_boolean_t recurse,
817 /** Send a "diff" command over connection @a conn.
818 * Use @a pool for allocations.
820 * @see #svn_ra_do_diff3 for a description.
823 svn_ra_svn__write_cmd_diff(svn_ra_svn_conn_t *conn,
827 svn_boolean_t recurse,
828 svn_boolean_t ignore_ancestry,
829 const char *versus_url,
830 svn_boolean_t text_deltas,
833 /** Send a "check-path" command over connection @a conn.
834 * Use @a pool for allocations.
836 * @see #svn_ra_check_path for a description.
839 svn_ra_svn__write_cmd_check_path(svn_ra_svn_conn_t *conn,
844 /** Send a "stat" command over connection @a conn.
845 * Use @a pool for allocations.
847 * @see #svn_ra_stat for a description.
850 svn_ra_svn__write_cmd_stat(svn_ra_svn_conn_t *conn,
855 /** Send a "get-file-revs" command over connection @a conn.
856 * Use @a pool for allocations.
858 * @see #svn_ra_get_file_revs2 for a description.
861 svn_ra_svn__write_cmd_get_file_revs(svn_ra_svn_conn_t *conn,
866 svn_boolean_t include_merged_revisions);
868 /** Send a "lock" command over connection @a conn.
869 * Use @a pool for allocations.
871 * @see #svn_ra_lock for a description.
874 svn_ra_svn__write_cmd_lock(svn_ra_svn_conn_t *conn,
878 svn_boolean_t steal_lock,
879 svn_revnum_t revnum);
881 /** Send a "unlock" command over connection @a conn.
882 * Use @a pool for allocations.
884 * @see #svn_ra_unlock for a description.
887 svn_ra_svn__write_cmd_unlock(svn_ra_svn_conn_t *conn,
890 const svn_string_t *token,
891 svn_boolean_t break_lock);
893 /** Send a "get-lock" command over connection @a conn.
894 * Use @a pool for allocations.
896 * @see #svn_ra_get_lock for a description.
899 svn_ra_svn__write_cmd_get_lock(svn_ra_svn_conn_t *conn,
903 /** Send a "get-locks" command over connection @a conn.
904 * Use @a pool for allocations.
906 * @see #svn_ra_get_locks2 for a description.
909 svn_ra_svn__write_cmd_get_locks(svn_ra_svn_conn_t *conn,
914 /** Send a "replay" command over connection @a conn.
915 * Use @a pool for allocations.
917 * @see #svn_ra_replay for a description.
920 svn_ra_svn__write_cmd_replay(svn_ra_svn_conn_t *conn,
923 svn_revnum_t low_water_mark,
924 svn_boolean_t send_deltas);
926 /** Send a "replay-range" command over connection @a conn.
927 * Use @a pool for allocations.
929 * @see #svn_ra_replay_range for a description.
932 svn_ra_svn__write_cmd_replay_range(svn_ra_svn_conn_t *conn,
934 svn_revnum_t start_revision,
935 svn_revnum_t end_revision,
936 svn_revnum_t low_water_mark,
937 svn_boolean_t send_deltas);
939 /** Send a "get-deleted-rev" command over connection @a conn.
940 * Use @a pool for allocations.
942 * @see #svn_ra_get_deleted_rev for a description.
945 svn_ra_svn__write_cmd_get_deleted_rev(svn_ra_svn_conn_t *conn,
948 svn_revnum_t peg_revision,
949 svn_revnum_t end_revision);
951 /** Send a "get-iprops" command over connection @a conn.
952 * Use @a pool for allocations.
954 * @see #svn_ra_get_inherited_props for a description.
957 svn_ra_svn__write_cmd_get_iprops(svn_ra_svn_conn_t *conn,
960 svn_revnum_t revision);
962 /** Send a "finish-replay" command over connection @a conn.
963 * Use @a pool for allocations.
966 svn_ra_svn__write_cmd_finish_replay(svn_ra_svn_conn_t *conn,
974 * @defgroup svn_send_data sending data structures over ra_svn
978 /** Send a changed path (as part of transmitting a log entry) over connection
979 * @a conn. Use @a pool for allocations.
981 * @see svn_log_changed_path2_t for a description of the other parameters.
984 svn_ra_svn__write_data_log_changed_path(svn_ra_svn_conn_t *conn,
986 const svn_string_t *path,
988 const char *copyfrom_path,
989 svn_revnum_t copyfrom_rev,
990 svn_node_kind_t node_kind,
991 svn_boolean_t text_modified,
992 svn_boolean_t props_modified);
994 /** Send a the details of a log entry (as part of transmitting a log entry
995 * and without revprops and changed paths) over connection @a conn.
996 * Use @a pool for allocations.
998 * @a author, @a date and @a message have been extracted and removed from
999 * the revprops to follow. @a has_children is taken directly from the
1000 * #svn_log_entry_t struct. @a revision is too, except when it equals
1001 * #SVN_INVALID_REVNUM. In that case, @a revision must be 0 and
1002 * @a invalid_revnum be set to TRUE. @a revprop_count is the number of
1003 * revprops that will follow in the revprops list.
1006 svn_ra_svn__write_data_log_entry(svn_ra_svn_conn_t *conn,
1008 svn_revnum_t revision,
1009 const svn_string_t *author,
1010 const svn_string_t *date,
1011 const svn_string_t *message,
1012 svn_boolean_t has_children,
1013 svn_boolean_t invalid_revnum,
1014 unsigned revprop_count);
1016 /** Send a directory entry @a dirent for @a path over connection @a conn.
1017 * Use @a pool for allocations.
1019 * Depending on the flags in @a dirent_fields, only selected elements will
1023 svn_ra_svn__write_dirent(svn_ra_svn_conn_t *conn,
1026 svn_dirent_t *dirent,
1027 apr_uint32_t dirent_fields);
1034 * @defgroup svn_read_data reading data structures from ra_svn
1038 /** Take the data tuple ITEMS received over ra_svn and convert it to the
1039 * a changed path (as part of receiving a log entry).
1041 * @see svn_log_changed_path2_t for a description of the output parameters.
1044 svn_ra_svn__read_data_log_changed_entry(const svn_ra_svn__list_t *items,
1045 svn_string_t **cpath,
1046 const char **action,
1047 const char **copy_path,
1048 svn_revnum_t *copy_rev,
1049 const char **kind_str,
1050 apr_uint64_t *text_mods,
1051 apr_uint64_t *prop_mods);
1058 #endif /* __cplusplus */
1060 #endif /* SVN_RA_SVN_PRIVATE_H */