00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Licensed to the Apache Software Foundation (ASF) under one 00005 * or more contributor license agreements. See the NOTICE file 00006 * distributed with this work for additional information 00007 * regarding copyright ownership. The ASF licenses this file 00008 * to you under the Apache License, Version 2.0 (the 00009 * "License"); you may not use this file except in compliance 00010 * with the License. You may obtain a copy of the License at 00011 * 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, 00015 * software distributed under the License is distributed on an 00016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00017 * KIND, either express or implied. See the License for the 00018 * specific language governing permissions and limitations 00019 * under the License. 00020 * ==================================================================== 00021 * @endcopyright 00022 * 00023 * @file svn_ra_svn.h 00024 * @brief libsvn_ra_svn functions used by the server 00025 */ 00026 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 00046 /** The well-known svn port number. */ 00047 #define SVN_RA_SVN_PORT 3690 00048 00049 /** Currently-defined capabilities. */ 00050 #define SVN_RA_SVN_CAP_EDIT_PIPELINE "edit-pipeline" 00051 #define SVN_RA_SVN_CAP_SVNDIFF1 "svndiff1" 00052 #define SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED "accepts-svndiff2" 00053 #define SVN_RA_SVN_CAP_ABSENT_ENTRIES "absent-entries" 00054 /* maps to SVN_RA_CAPABILITY_COMMIT_REVPROPS: */ 00055 #define SVN_RA_SVN_CAP_COMMIT_REVPROPS "commit-revprops" 00056 /* maps to SVN_RA_CAPABILITY_MERGEINFO: */ 00057 #define SVN_RA_SVN_CAP_MERGEINFO "mergeinfo" 00058 /* maps to SVN_RA_CAPABILITY_DEPTH: */ 00059 #define SVN_RA_SVN_CAP_DEPTH "depth" 00060 /* maps to SVN_RA_CAPABILITY_LOG_REVPROPS */ 00061 #define SVN_RA_SVN_CAP_LOG_REVPROPS "log-revprops" 00062 /* maps to SVN_RA_CAPABILITY_PARTIAL_REPLAY */ 00063 #define SVN_RA_SVN_CAP_PARTIAL_REPLAY "partial-replay" 00064 /* maps to SVN_RA_CAPABILITY_ATOMIC_REVPROPS */ 00065 #define SVN_RA_SVN_CAP_ATOMIC_REVPROPS "atomic-revprops" 00066 /* maps to SVN_RA_CAPABILITY_INHERITED_PROPERTIES: */ 00067 #define SVN_RA_SVN_CAP_INHERITED_PROPS "inherited-props" 00068 /* maps to SVN_RA_CAPABILITY_EPHEMERAL_TXNPROPS */ 00069 #define SVN_RA_SVN_CAP_EPHEMERAL_TXNPROPS "ephemeral-txnprops" 00070 /* maps to SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE */ 00071 #define SVN_RA_SVN_CAP_GET_FILE_REVS_REVERSE "file-revs-reverse" 00072 /* maps to SVN_RA_CAPABILITY_LIST */ 00073 #define SVN_RA_SVN_CAP_LIST "list" 00074 00075 00076 /** ra_svn passes @c svn_dirent_t fields over the wire as a list of 00077 * words, these are the values used to represent each field. 00078 * 00079 * @defgroup ra_svn_dirent_fields Definitions of ra_svn dirent fields 00080 * @{ 00081 */ 00082 00083 /** The ra_svn way of saying @c SVN_DIRENT_KIND. */ 00084 #define SVN_RA_SVN_DIRENT_KIND "kind" 00085 00086 /** The ra_svn way of saying @c SVN_DIRENT_SIZE. */ 00087 #define SVN_RA_SVN_DIRENT_SIZE "size" 00088 00089 /** The ra_svn way of saying @c SVN_DIRENT_HAS_PROPS. */ 00090 #define SVN_RA_SVN_DIRENT_HAS_PROPS "has-props" 00091 00092 /** The ra_svn way of saying @c SVN_DIRENT_CREATED_REV. */ 00093 #define SVN_RA_SVN_DIRENT_CREATED_REV "created-rev" 00094 00095 /** The ra_svn way of saying @c SVN_DIRENT_TIME. */ 00096 #define SVN_RA_SVN_DIRENT_TIME "time" 00097 00098 /** The ra_svn way of saying @c SVN_DIRENT_LAST_AUTHOR. */ 00099 #define SVN_RA_SVN_DIRENT_LAST_AUTHOR "last-author" 00100 00101 /** @} */ 00102 00103 /** A value used to indicate an optional number element in a tuple that was 00104 * not received. 00105 */ 00106 #define SVN_RA_SVN_UNSPECIFIED_NUMBER ~((apr_uint64_t) 0) 00107 00108 /** A specialized form of @c SVN_ERR to deal with errors which occur in an 00109 * svn_ra_svn_command_handler(). 00110 * 00111 * An error returned with this macro will be passed back to the other side 00112 * of the connection. Use this macro when performing the requested operation; 00113 * use the regular @c SVN_ERR when performing I/O with the client. 00114 */ 00115 #define SVN_CMD_ERR(expr) \ 00116 do { \ 00117 svn_error_t *svn_err__temp = (expr); \ 00118 if (svn_err__temp) \ 00119 return svn_error_create(SVN_ERR_RA_SVN_CMD_ERR, \ 00120 svn_err__temp, NULL); \ 00121 } while (0) 00122 00123 /** an ra_svn connection. */ 00124 typedef struct svn_ra_svn_conn_st svn_ra_svn_conn_t; 00125 00126 /** Command handler, used by svn_ra_svn_handle_commands(). */ 00127 typedef svn_error_t *(*svn_ra_svn_command_handler)(svn_ra_svn_conn_t *conn, 00128 apr_pool_t *pool, 00129 apr_array_header_t *params, 00130 void *baton); 00131 00132 /** Command table, used by svn_ra_svn_handle_commands(). 00133 */ 00134 typedef struct svn_ra_svn_cmd_entry_t 00135 { 00136 /** Name of the command */ 00137 const char *cmdname; 00138 00139 /** Handler for the command */ 00140 svn_ra_svn_command_handler handler; 00141 00142 /** Termination flag. If set, command-handling will cease after 00143 * command is processed. */ 00144 svn_boolean_t terminate; 00145 } svn_ra_svn_cmd_entry_t; 00146 00147 /** Data types defined by the svn:// protocol. 00148 * 00149 * @since The typedef name is new in 1.10; the enumerators are not. */ 00150 typedef enum 00151 { 00152 SVN_RA_SVN_NUMBER, 00153 SVN_RA_SVN_STRING, 00154 SVN_RA_SVN_WORD, 00155 SVN_RA_SVN_LIST 00156 } svn_ra_svn_item_kind_t; 00157 00158 /** Memory representation of an on-the-wire data item. */ 00159 typedef struct svn_ra_svn_item_t 00160 { 00161 /** Variant indicator. */ 00162 svn_ra_svn_item_kind_t kind; 00163 00164 /** Variant data. */ 00165 union { 00166 apr_uint64_t number; 00167 svn_string_t *string; 00168 const char *word; 00169 00170 /** Contains @c svn_ra_svn_item_t's. */ 00171 apr_array_header_t *list; 00172 } u; 00173 } svn_ra_svn_item_t; 00174 00175 typedef svn_error_t *(*svn_ra_svn_edit_callback)(void *baton); 00176 00177 /** Initialize a connection structure for the given socket or 00178 * input/output streams. 00179 * 00180 * Either @a sock or @a in_stream/@a out_stream must be set, not both. 00181 * @a compression_level specifies the desired network data compression 00182 * level from 0 (no compression) to 9 (best but slowest). The effect 00183 * of the parameter depends on the compression algorithm; for example, 00184 * it is used verbatim by zlib/deflate but ignored by LZ4. 00185 * 00186 * If @a zero_copy_limit is not 0, cached file contents smaller than the 00187 * given limit may be sent directly to the network socket. Otherwise, 00188 * it will be copied into a temporary buffer before being forwarded to 00189 * the network stack. Since the zero-copy code path has to enforce strict 00190 * time-outs, the receiver must be able to process @a zero_copy_limit 00191 * bytes within one second. Even temporary failure to do so may cause 00192 * the server to cancel the respective operation with a time-out error. 00193 * 00194 * To reduce the overhead of checking for cancellation requests from the 00195 * data receiver, set @a error_check_interval to some non-zero value. 00196 * It defines the number of bytes that must have been sent since the last 00197 * check before the next check will be made. 00198 * 00199 * If @a max_in is not 0, error out and close the connection whenever more 00200 * than @a max_in bytes are received for a command (e.g. a client request). 00201 * If @a max_out is not 0, error out and close the connection whenever more 00202 * than @a max_out bytes have been send as response to some command. 00203 * 00204 * @note The limits enforced may vary slightly by +/- the I/O buffer size. 00205 * 00206 * @note If @a out_stream is an wrapped apr_file_t* the backing file will be 00207 * used for some operations. 00208 * 00209 * Allocate the result in @a pool. 00210 * 00211 * @since New in 1.10 00212 */ 00213 svn_ra_svn_conn_t *svn_ra_svn_create_conn5(apr_socket_t *sock, 00214 svn_stream_t *in_stream, 00215 svn_stream_t *out_stream, 00216 int compression_level, 00217 apr_size_t zero_copy_limit, 00218 apr_size_t error_check_interval, 00219 apr_uint64_t max_in, 00220 apr_uint64_t max_out, 00221 apr_pool_t *result_pool); 00222 00223 00224 /** Similar to svn_ra_svn_create_conn5() but with @a max_in and @a max_out 00225 * set to 0. 00226 * 00227 * @since New in 1.9 00228 * @deprecated Provided for backward compatibility with the 1.9 API. 00229 */ 00230 SVN_DEPRECATED 00231 svn_ra_svn_conn_t *svn_ra_svn_create_conn4(apr_socket_t *sock, 00232 svn_stream_t *in_stream, 00233 svn_stream_t *out_stream, 00234 int compression_level, 00235 apr_size_t zero_copy_limit, 00236 apr_size_t error_check_interval, 00237 apr_pool_t *result_pool); 00238 00239 00240 /** Similar to svn_ra_svn_create_conn4() but only supports apr_file_t handles 00241 * instead of the more generic streams. 00242 * 00243 * @since New in 1.8 00244 * @deprecated Provided for backward compatibility with the 1.8 API. 00245 */ 00246 SVN_DEPRECATED 00247 svn_ra_svn_conn_t *svn_ra_svn_create_conn3(apr_socket_t *sock, 00248 apr_file_t *in_file, 00249 apr_file_t *out_file, 00250 int compression_level, 00251 apr_size_t zero_copy_limit, 00252 apr_size_t error_check_interval, 00253 apr_pool_t *pool); 00254 00255 /** Similar to svn_ra_svn_create_conn3() but disables the zero copy code 00256 * path and sets the error checking interval to 0. 00257 * 00258 * @since New in 1.7. 00259 * 00260 * @deprecated Provided for backward compatibility with the 1.7 API. 00261 */ 00262 SVN_DEPRECATED 00263 svn_ra_svn_conn_t * 00264 svn_ra_svn_create_conn2(apr_socket_t *sock, 00265 apr_file_t *in_file, 00266 apr_file_t *out_file, 00267 int compression_level, 00268 apr_pool_t *pool); 00269 00270 /** Similar to svn_ra_svn_create_conn2() but uses the default 00271 * compression level (#SVN_DELTA_COMPRESSION_LEVEL_DEFAULT) for network 00272 * transmissions. 00273 * 00274 * @deprecated Provided for backward compatibility with the 1.6 API. 00275 */ 00276 SVN_DEPRECATED 00277 svn_ra_svn_conn_t * 00278 svn_ra_svn_create_conn(apr_socket_t *sock, 00279 apr_file_t *in_file, 00280 apr_file_t *out_file, 00281 apr_pool_t *pool); 00282 00283 /** Add the capabilities in @a list to @a conn's capabilities. 00284 * @a list contains svn_ra_svn_item_t entries (which should be of type 00285 * SVN_RA_SVN_WORD; a malformed data error will result if any are not). 00286 * 00287 * This is idempotent: if a given capability was already set for 00288 * @a conn, it remains set. 00289 */ 00290 svn_error_t * 00291 svn_ra_svn_set_capabilities(svn_ra_svn_conn_t *conn, 00292 const apr_array_header_t *list); 00293 00294 /** Return @c TRUE if @a conn has the capability @a capability, or 00295 * @c FALSE if it does not. */ 00296 svn_boolean_t 00297 svn_ra_svn_has_capability(svn_ra_svn_conn_t *conn, 00298 const char *capability); 00299 00300 /** Return the data compression level to use for network transmissions. 00301 * 00302 * @since New in 1.7. 00303 */ 00304 int 00305 svn_ra_svn_compression_level(svn_ra_svn_conn_t *conn); 00306 00307 /** Return the zero-copy data block limit to use for network 00308 * transmissions. 00309 * 00310 * @see http://en.wikipedia.org/wiki/Zero-copy 00311 * 00312 * @since New in 1.8. 00313 */ 00314 apr_size_t 00315 svn_ra_svn_zero_copy_limit(svn_ra_svn_conn_t *conn); 00316 00317 /** Returns the remote address of the connection as a string, if known, 00318 * or NULL if inapplicable. */ 00319 const char * 00320 svn_ra_svn_conn_remote_host(svn_ra_svn_conn_t *conn); 00321 00322 /** Set @a *editor and @a *edit_baton to an editor which will pass editing 00323 * operations over the network, using @a conn and @a pool. 00324 * 00325 * Upon successful completion of the edit, the editor will invoke @a callback 00326 * with @a callback_baton as an argument. 00327 * 00328 * @note The @c copyfrom_path parameter passed to the @c add_file and 00329 * @c add_directory methods of the returned editor may be either a URL or a 00330 * relative path, and is transferred verbatim to the receiving end of the 00331 * connection. See svn_ra_svn_drive_editor2() for information on the 00332 * receiving end of the connection. 00333 */ 00334 void 00335 svn_ra_svn_get_editor(const svn_delta_editor_t **editor, 00336 void **edit_baton, 00337 svn_ra_svn_conn_t *conn, 00338 apr_pool_t *pool, 00339 svn_ra_svn_edit_callback callback, 00340 void *callback_baton); 00341 00342 /** Receive edit commands over the network and use them to drive @a editor 00343 * with @a edit_baton. On return, @a *aborted will be set if the edit was 00344 * aborted. The drive can be terminated with a finish-replay command only 00345 * if @a for_replay is TRUE. 00346 * 00347 * @since New in 1.4. 00348 * 00349 * @note The @c copyfrom_path parameter passed to the @c add_file and 00350 * @c add_directory methods of the receiving editor will be canonicalized 00351 * either as a URL or as a relative path (starting with a slash) according 00352 * to which kind was sent by the driving end of the connection. See 00353 * svn_ra_svn_get_editor() for information on the driving end of the 00354 * connection. 00355 */ 00356 svn_error_t * 00357 svn_ra_svn_drive_editor2(svn_ra_svn_conn_t *conn, 00358 apr_pool_t *pool, 00359 const svn_delta_editor_t *editor, 00360 void *edit_baton, 00361 svn_boolean_t *aborted, 00362 svn_boolean_t for_replay); 00363 00364 /** Like svn_ra_svn_drive_editor2, but with @a for_replay always FALSE. 00365 * 00366 * @deprecated Provided for backward compatibility with the 1.3 API. 00367 */ 00368 SVN_DEPRECATED 00369 svn_error_t * 00370 svn_ra_svn_drive_editor(svn_ra_svn_conn_t *conn, 00371 apr_pool_t *pool, 00372 const svn_delta_editor_t *editor, 00373 void *edit_baton, 00374 svn_boolean_t *aborted); 00375 00376 /** This function is only intended for use by svnserve. 00377 * 00378 * Perform CRAM-MD5 password authentication. On success, return 00379 * SVN_NO_ERROR with *user set to the username and *success set to 00380 * TRUE. On an error which can be reported to the client, report the 00381 * error and return SVN_NO_ERROR with *success set to FALSE. On 00382 * communications failure, return an error. 00383 */ 00384 svn_error_t * 00385 svn_ra_svn_cram_server(svn_ra_svn_conn_t *conn, 00386 apr_pool_t *pool, 00387 svn_config_t *pwdb, 00388 const char **user, 00389 svn_boolean_t *success); 00390 00391 /** 00392 * Get libsvn_ra_svn version information. 00393 * @since New in 1.1. 00394 */ 00395 const svn_version_t * 00396 svn_ra_svn_version(void); 00397 00398 /** 00399 * @defgroup ra_svn_deprecated ra_svn low-level functions 00400 * @{ 00401 */ 00402 00403 /** Write a number over the net. 00404 * 00405 * Writes will be buffered until the next read or flush. 00406 * 00407 * @deprecated Provided for backward compatibility with the 1.7 API. 00408 * RA_SVN low-level functions are no longer considered public. 00409 */ 00410 SVN_DEPRECATED 00411 svn_error_t * 00412 svn_ra_svn_write_number(svn_ra_svn_conn_t *conn, 00413 apr_pool_t *pool, 00414 apr_uint64_t number); 00415 00416 /** Write a string over the net. 00417 * 00418 * Writes will be buffered until the next read or flush. 00419 * 00420 * @deprecated Provided for backward compatibility with the 1.7 API. 00421 * RA_SVN low-level functions are no longer considered public. 00422 */ 00423 SVN_DEPRECATED 00424 svn_error_t * 00425 svn_ra_svn_write_string(svn_ra_svn_conn_t *conn, 00426 apr_pool_t *pool, 00427 const svn_string_t *str); 00428 00429 /** Write a cstring over the net. 00430 * 00431 * Writes will be buffered until the next read or flush. 00432 * 00433 * @deprecated Provided for backward compatibility with the 1.7 API. 00434 * RA_SVN low-level functions are no longer considered public. 00435 */ 00436 SVN_DEPRECATED 00437 svn_error_t * 00438 svn_ra_svn_write_cstring(svn_ra_svn_conn_t *conn, 00439 apr_pool_t *pool, 00440 const char *s); 00441 00442 /** Write a word over the net. 00443 * 00444 * Writes will be buffered until the next read or flush. 00445 * 00446 * @deprecated Provided for backward compatibility with the 1.7 API. 00447 * RA_SVN low-level functions are no longer considered public. 00448 */ 00449 SVN_DEPRECATED 00450 svn_error_t * 00451 svn_ra_svn_write_word(svn_ra_svn_conn_t *conn, 00452 apr_pool_t *pool, 00453 const char *word); 00454 00455 /** Write a list of properties over the net. @a props is allowed to be NULL, 00456 * in which case an empty list will be written out. 00457 * 00458 * @since New in 1.5. 00459 * 00460 * @deprecated Provided for backward compatibility with the 1.7 API. 00461 * RA_SVN low-level functions are no longer considered public. 00462 */ 00463 SVN_DEPRECATED 00464 svn_error_t * 00465 svn_ra_svn_write_proplist(svn_ra_svn_conn_t *conn, 00466 apr_pool_t *pool, 00467 apr_hash_t *props); 00468 00469 /** Begin a list. Writes will be buffered until the next read or flush. 00470 * 00471 * @deprecated Provided for backward compatibility with the 1.7 API. 00472 * RA_SVN low-level functions are no longer considered public. 00473 */ 00474 SVN_DEPRECATED 00475 svn_error_t * 00476 svn_ra_svn_start_list(svn_ra_svn_conn_t *conn, 00477 apr_pool_t *pool); 00478 00479 /** End a list. Writes will be buffered until the next read or flush. 00480 * 00481 * @deprecated Provided for backward compatibility with the 1.7 API. 00482 * RA_SVN low-level functions are no longer considered public. 00483 */ 00484 SVN_DEPRECATED 00485 svn_error_t * 00486 svn_ra_svn_end_list(svn_ra_svn_conn_t *conn, 00487 apr_pool_t *pool); 00488 00489 /** Flush the write buffer. 00490 * 00491 * Normally this shouldn't be necessary, since the write buffer is flushed 00492 * when a read is attempted. 00493 * 00494 * @deprecated Provided for backward compatibility with the 1.7 API. 00495 * RA_SVN low-level functions are no longer considered public. 00496 */ 00497 SVN_DEPRECATED 00498 svn_error_t * 00499 svn_ra_svn_flush(svn_ra_svn_conn_t *conn, 00500 apr_pool_t *pool); 00501 00502 /** Write a tuple, using a printf-like interface. 00503 * 00504 * The format string @a fmt may contain: 00505 * 00506 *@verbatim 00507 Spec Argument type Item type 00508 ---- -------------------- --------- 00509 n apr_uint64_t Number 00510 r svn_revnum_t Number 00511 s const svn_string_t * String 00512 c const char * String 00513 w const char * Word 00514 b svn_boolean_t Word ("true" or "false") 00515 ( Begin tuple 00516 ) End tuple 00517 ? Remaining elements optional 00518 ! (at beginning or end) Suppress opening or closing of tuple 00519 @endverbatim 00520 * 00521 * Inside the optional part of a tuple, 'r' values may be @c 00522 * SVN_INVALID_REVNUM, 'n' values may be 00523 * SVN_RA_SVN_UNSPECIFIED_NUMBER, and 's', 'c', and 'w' values may be 00524 * @c NULL; in these cases no data will be written. 'b' and '(' may 00525 * not appear in the optional part of a tuple. Either all or none of 00526 * the optional values should be valid. 00527 * 00528 * (If we ever have a need for an optional boolean value, we should 00529 * invent a 'B' specifier which stores a boolean into an int, using -1 00530 * for unspecified. Right now there is no need for such a thing.) 00531 * 00532 * Use the '!' format specifier to write partial tuples when you have 00533 * to transmit an array or other unusual data. For example, to write 00534 * a tuple containing a revision, an array of words, and a boolean: 00535 * @code 00536 SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "r(!", rev)); 00537 for (i = 0; i < n; i++) 00538 SVN_ERR(svn_ra_svn_write_word(conn, pool, words[i])); 00539 SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)b", flag)); @endcode 00540 * 00541 * @deprecated Provided for backward compatibility with the 1.7 API. 00542 * RA_SVN low-level functions are no longer considered public. 00543 */ 00544 SVN_DEPRECATED 00545 svn_error_t * 00546 svn_ra_svn_write_tuple(svn_ra_svn_conn_t *conn, 00547 apr_pool_t *pool, 00548 const char *fmt, ...); 00549 00550 /** Read an item from the network into @a *item. 00551 * 00552 * @deprecated Provided for backward compatibility with the 1.7 API. 00553 * RA_SVN low-level functions are no longer considered public. 00554 */ 00555 SVN_DEPRECATED 00556 svn_error_t * 00557 svn_ra_svn_read_item(svn_ra_svn_conn_t *conn, 00558 apr_pool_t *pool, 00559 svn_ra_svn_item_t **item); 00560 00561 /** Scan data on @a conn until we find something which looks like the 00562 * beginning of an svn server greeting (an open paren followed by a 00563 * whitespace character). This function is appropriate for beginning 00564 * a client connection opened in tunnel mode, since people's dotfiles 00565 * sometimes write output to stdout. It may only be called at the 00566 * beginning of a client connection. 00567 * 00568 * @deprecated Provided for backward compatibility with the 1.7 API. 00569 * RA_SVN low-level functions are no longer considered public. 00570 */ 00571 SVN_DEPRECATED 00572 svn_error_t * 00573 svn_ra_svn_skip_leading_garbage(svn_ra_svn_conn_t *conn, 00574 apr_pool_t *pool); 00575 00576 /** Parse an array of @c svn_sort__item_t structures as a tuple, using a 00577 * printf-like interface. The format string @a fmt may contain: 00578 * 00579 *@verbatim 00580 Spec Argument type Item type 00581 ---- -------------------- --------- 00582 n apr_uint64_t * Number 00583 r svn_revnum_t * Number 00584 s svn_string_t ** String 00585 c const char ** String 00586 w const char ** Word 00587 b svn_boolean_t * Word ("true" or "false") 00588 B apr_uint64_t * Word ("true" or "false") 00589 l apr_array_header_t ** List 00590 ( Begin tuple 00591 ) End tuple 00592 ? Tuple is allowed to end here 00593 @endverbatim 00594 * 00595 * Note that a tuple is only allowed to end precisely at a '?', or at 00596 * the end of the specification. So if @a fmt is "c?cc" and @a list 00597 * contains two elements, an error will result. 00598 * 00599 * 'B' is similar to 'b', but may be used in the optional tuple specification. 00600 * It returns TRUE, FALSE, or SVN_RA_SVN_UNSPECIFIED_NUMBER. 00601 * 00602 * If an optional part of a tuple contains no data, 'r' values will be 00603 * set to @c SVN_INVALID_REVNUM, 'n' and 'B' values will be set to 00604 * SVN_RA_SVN_UNSPECIFIED_NUMBER, and 's', 'c', 'w', and 'l' values 00605 * will be set to @c NULL. 'b' may not appear inside an optional 00606 * tuple specification; use 'B' instead. 00607 * 00608 * @deprecated Provided for backward compatibility with the 1.7 API. 00609 * RA_SVN low-level functions are no longer considered public. 00610 */ 00611 SVN_DEPRECATED 00612 svn_error_t * 00613 svn_ra_svn_parse_tuple(const apr_array_header_t *list, 00614 apr_pool_t *pool, 00615 const char *fmt, ...); 00616 00617 /** Read a tuple from the network and parse it as a tuple, using the 00618 * format string notation from svn_ra_svn_parse_tuple(). 00619 * 00620 * @deprecated Provided for backward compatibility with the 1.7 API. 00621 * RA_SVN low-level functions are no longer considered public. 00622 */ 00623 SVN_DEPRECATED 00624 svn_error_t * 00625 svn_ra_svn_read_tuple(svn_ra_svn_conn_t *conn, 00626 apr_pool_t *pool, 00627 const char *fmt, ...); 00628 00629 /** Parse an array of @c svn_ra_svn_item_t structures as a list of 00630 * properties, storing the properties in a hash table. 00631 * 00632 * @since New in 1.5. 00633 * 00634 * @deprecated Provided for backward compatibility with the 1.7 API. 00635 * RA_SVN low-level functions are no longer considered public. 00636 */ 00637 SVN_DEPRECATED 00638 svn_error_t * 00639 svn_ra_svn_parse_proplist(const apr_array_header_t *list, 00640 apr_pool_t *pool, 00641 apr_hash_t **props); 00642 00643 /** Read a command response from the network and parse it as a tuple, using 00644 * the format string notation from svn_ra_svn_parse_tuple(). 00645 * 00646 * @deprecated Provided for backward compatibility with the 1.7 API. 00647 * RA_SVN low-level functions are no longer considered public. 00648 */ 00649 SVN_DEPRECATED 00650 svn_error_t * 00651 svn_ra_svn_read_cmd_response(svn_ra_svn_conn_t *conn, 00652 apr_pool_t *pool, 00653 const char *fmt, ...); 00654 00655 /** Accept commands over the network and handle them according to @a 00656 * commands. Command handlers will be passed @a conn, a subpool of @a 00657 * pool (cleared after each command is handled), the parameters of the 00658 * command, and @a baton. Commands will be accepted until a 00659 * terminating command is received (a command with "terminate" set in 00660 * the command table). If a command handler returns an error wrapped 00661 * in SVN_RA_SVN_CMD_ERR (see the @c SVN_CMD_ERR macro), the error 00662 * will be reported to the other side of the connection and the 00663 * command loop will continue; any other kind of error (typically a 00664 * network or protocol error) is passed through to the caller. 00665 * 00666 * @since New in 1.6. 00667 * 00668 * @deprecated Provided for backward compatibility with the 1.7 API. 00669 * RA_SVN low-level functions are no longer considered public. 00670 */ 00671 SVN_DEPRECATED 00672 svn_error_t * 00673 svn_ra_svn_handle_commands2(svn_ra_svn_conn_t *conn, 00674 apr_pool_t *pool, 00675 const svn_ra_svn_cmd_entry_t *commands, 00676 void *baton, 00677 svn_boolean_t error_on_disconnect); 00678 00679 /** Similar to svn_ra_svn_handle_commands2 but @a error_on_disconnect 00680 * is always @c FALSE. 00681 * 00682 * @deprecated Provided for backward compatibility with the 1.5 API. 00683 */ 00684 SVN_DEPRECATED 00685 svn_error_t * 00686 svn_ra_svn_handle_commands(svn_ra_svn_conn_t *conn, 00687 apr_pool_t *pool, 00688 const svn_ra_svn_cmd_entry_t *commands, 00689 void *baton); 00690 00691 /** Write a command over the network, using the same format string notation 00692 * as svn_ra_svn_write_tuple(). 00693 * 00694 * @deprecated Provided for backward compatibility with the 1.7 API. 00695 * RA_SVN low-level functions are no longer considered public. 00696 */ 00697 SVN_DEPRECATED 00698 svn_error_t * 00699 svn_ra_svn_write_cmd(svn_ra_svn_conn_t *conn, 00700 apr_pool_t *pool, 00701 const char *cmdname, 00702 const char *fmt, ...); 00703 00704 /** Write a successful command response over the network, using the 00705 * same format string notation as svn_ra_svn_write_tuple(). Do not use 00706 * partial tuples with this function; if you need to use partial 00707 * tuples, just write out the "success" and argument tuple by hand. 00708 * 00709 * @deprecated Provided for backward compatibility with the 1.7 API. 00710 * RA_SVN low-level functions are no longer considered public. 00711 */ 00712 SVN_DEPRECATED 00713 svn_error_t * 00714 svn_ra_svn_write_cmd_response(svn_ra_svn_conn_t *conn, 00715 apr_pool_t *pool, 00716 const char *fmt, ...); 00717 00718 /** Write an unsuccessful command response over the network. 00719 * 00720 * @deprecated Provided for backward compatibility with the 1.7 API. 00721 * RA_SVN low-level functions are no longer considered public. 00722 */ 00723 SVN_DEPRECATED 00724 svn_error_t * 00725 svn_ra_svn_write_cmd_failure(svn_ra_svn_conn_t *conn, 00726 apr_pool_t *pool, 00727 svn_error_t *err); 00728 00729 /** 00730 * @} 00731 */ 00732 00733 #ifdef __cplusplus 00734 } 00735 #endif /* __cplusplus */ 00736 00737 #endif /* SVN_RA_SVN_H */
1.6.1