Subversion
Functions
ra_svn low-level functions

Functions

svn_error_tsvn_ra_svn_write_number (svn_ra_svn_conn_t *conn, apr_pool_t *pool, apr_uint64_t number)
 Write a number over the net. More...
 
svn_error_tsvn_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. More...
 
svn_error_tsvn_ra_svn_write_cstring (svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *s)
 Write a cstring over the net. More...
 
svn_error_tsvn_ra_svn_write_word (svn_ra_svn_conn_t *conn, apr_pool_t *pool, const char *word)
 Write a word over the net. More...
 
svn_error_tsvn_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. More...
 
svn_error_tsvn_ra_svn_start_list (svn_ra_svn_conn_t *conn, apr_pool_t *pool)
 Begin a list. More...
 
svn_error_tsvn_ra_svn_end_list (svn_ra_svn_conn_t *conn, apr_pool_t *pool)
 End a list. More...
 
svn_error_tsvn_ra_svn_flush (svn_ra_svn_conn_t *conn, apr_pool_t *pool)
 Flush the write buffer. More...
 
svn_error_tsvn_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. More...
 
svn_error_tsvn_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. More...
 
svn_error_tsvn_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 (an open paren followed by a whitespace character). More...
 
svn_error_tsvn_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. More...
 
svn_error_tsvn_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_svn_parse_tuple(). More...
 
svn_error_tsvn_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 hash table. More...
 
svn_error_tsvn_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 from svn_ra_svn_parse_tuple(). More...
 
svn_error_tsvn_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. More...
 
svn_error_tsvn_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. More...
 
svn_error_tsvn_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(). More...
 
svn_error_tsvn_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_write_tuple(). More...
 
svn_error_tsvn_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. More...
 

Detailed Description

Function Documentation

svn_error_t* svn_ra_svn_end_list ( svn_ra_svn_conn_t conn,
apr_pool_t *  pool 
)

End a list.

Writes will be buffered until the next read or flush.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
svn_error_t* svn_ra_svn_flush ( svn_ra_svn_conn_t conn,
apr_pool_t *  pool 
)

Flush the write buffer.

Normally this shouldn't be necessary, since the write buffer is flushed when a read is attempted.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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.

Deprecated:
Provided for backward compatibility with the 1.5 API.
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.

Command handlers will be passed conn, a subpool of pool (cleared after each command is handled), the parameters of the command, and baton. Commands will be accepted until a terminating command is received (a command with "terminate" set in the command table). If a command handler returns an error wrapped in SVN_RA_SVN_CMD_ERR (see the SVN_CMD_ERR macro), the error will be reported to the other side of the connection and the command loop will continue; any other kind of error (typically a network or protocol error) is passed through to the caller.

Since
New in 1.6.
Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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 hash table.

Since
New in 1.5.
Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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.

The format string fmt may contain:

   Spec  Argument type          Item type
   ----  --------------------   ---------
   n     apr_uint64_t *         Number
   r     svn_revnum_t *         Number
   s     svn_string_t **        String
   c     const char **          String
   w     const char **          Word
   b     svn_boolean_t *        Word ("true" or "false")
   B     apr_uint64_t *         Word ("true" or "false")
   l     apr_array_header_t **  List
   (                            Begin tuple
   )                            End tuple
   ?                            Tuple is allowed to end here

Note that a tuple is only allowed to end precisely at a '?', or at the end of the specification. So if fmt is "c?cc" and list contains two elements, an error will result.

'B' is similar to 'b', but may be used in the optional tuple specification. It returns TRUE, FALSE, or SVN_RA_SVN_UNSPECIFIED_NUMBER.

If an optional part of a tuple contains no data, 'r' values will be set to SVN_INVALID_REVNUM, 'n' and 'B' values will be set to SVN_RA_SVN_UNSPECIFIED_NUMBER, and 's', 'c', 'w', and 'l' values will be set to NULL. 'b' may not appear inside an optional tuple specification; use 'B' instead.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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 from svn_ra_svn_parse_tuple().

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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_svn_parse_tuple().

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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 (an open paren followed by a whitespace character).

This function is appropriate for beginning a client connection opened in tunnel mode, since people's dotfiles sometimes write output to stdout. It may only be called at the beginning of a client connection.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
svn_error_t* svn_ra_svn_start_list ( svn_ra_svn_conn_t conn,
apr_pool_t *  pool 
)

Begin a list.

Writes will be buffered until the next read or flush.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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().

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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_write_tuple().

Do not use partial tuples with this function; if you need to use partial tuples, just write out the "success" and argument tuple by hand.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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.

Writes will be buffered until the next read or flush.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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.

Writes will be buffered until the next read or flush.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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.

props is allowed to be NULL, in which case an empty list will be written out.

Since
New in 1.5.
Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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.

Writes will be buffered until the next read or flush.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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.

The format string fmt may contain:

   Spec  Argument type         Item type
   ----  --------------------  ---------
   n     apr_uint64_t          Number
   r     svn_revnum_t          Number
   s     const svn_string_t *  String
   c     const char *          String
   w     const char *          Word
   b     svn_boolean_t         Word ("true" or "false")
   (                           Begin tuple
   )                           End tuple
   ?                           Remaining elements optional
   ! (at beginning or end)     Suppress opening or closing of tuple

Inside the optional part of a tuple, 'r' values may be SVN_INVALID_REVNUM, 'n' values may be SVN_RA_SVN_UNSPECIFIED_NUMBER, and 's', 'c', and 'w' values may be NULL; in these cases no data will be written. 'b' and '(' may not appear in the optional part of a tuple. Either all or none of the optional values should be valid.

(If we ever have a need for an optional boolean value, we should invent a 'B' specifier which stores a boolean into an int, using -1 for unspecified. Right now there is no need for such a thing.)

Use the '!' format specifier to write partial tuples when you have to transmit an array or other unusual data. For example, to write a tuple containing a revision, an array of words, and a boolean:

1 SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "r(!", rev));
2 for (i = 0; i < n; i++)
3  SVN_ERR(svn_ra_svn_write_word(conn, pool, words[i]));
4 SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)b", flag));
Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.
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.

Writes will be buffered until the next read or flush.

Deprecated:
Provided for backward compatibility with the 1.7 API. RA_SVN low-level functions are no longer considered public.