On Fri, Jul 8, 2011 at 16:12, <hwright_at_apache.org> wrote:
> +++ subversion/branches/revprop-packing/subversion/include/svn_io.h Fri Jul 8 20:12:48 2011
> @@ -1183,6 +1183,12 @@ svn_stream_readline(svn_stream_t *stream
> * Read the contents of the readable stream @a from and write them to the
> * writable stream @a to calling @a cancel_func before copying each chunk.
> + * If @a len is -1, then the entire source stream will be copied, otherwise,
> + * up to @a len bytes will be copied from @a from to @a to.
> + *
> + * @todo ### Should this API return the number of bytes actually copied,
> + * a la svn_stream_read()?
> + *
> * @a cancel_func may be @c NULL.
> * @note both @a from and @a to will be closed upon successful completion of
> @@ -1191,8 +1197,23 @@ svn_stream_readline(svn_stream_t *stream
> * svn_stream_disown() to protect either or both of the streams from
> * being closed.
> + * @since New in 1.7.
> + */
> +svn_error_t *
> +svn_stream_copy4(svn_stream_t *from,
> + svn_stream_t *to,
> + apr_ssize_t len,
> + svn_cancel_func_t cancel_func,
> + void *cancel_baton,
> + apr_pool_t *pool);
I'm not sure of your intended usage, but note that apr_ssize_t may not
be large enough for a file checked into Subversion. For that, we use
svn_filesize_t (guaranteed 63-bit length). And you could also use
SVN_INVALID_FILESIZE as your "copy all" discriminator. Though that
looks pretty ugly, I would suggset:
#define SVN_STREAM_COPYALL SVN_INVALID_FILESIZE
and tell people to use that define for clarity.
Received on 2011-07-13 23:27:40 CEST