Typedefs | |
typedef svn_stream_t | svn_stream_t |
An abstract stream of bytes--either incoming or outgoing or both. | |
typedef svn_error_t *(* | svn_read_fn_t )(void *baton, char *buffer, apr_size_t *len) |
Read handler function for a generic stream. | |
typedef svn_error_t *(* | svn_write_fn_t )(void *baton, const char *data, apr_size_t *len) |
Write handler function for a generic stream. | |
typedef svn_error_t *(* | svn_close_fn_t )(void *baton) |
Close handler function for a generic stream. | |
Functions | |
svn_stream_t * | svn_stream_create (void *baton, apr_pool_t *pool) |
Creating a generic stream. | |
void | svn_stream_set_baton (svn_stream_t *stream, void *baton) |
Set stream's baton to baton. | |
void | svn_stream_set_read (svn_stream_t *stream, svn_read_fn_t read_fn) |
Set stream's read function to read_fn. | |
void | svn_stream_set_write (svn_stream_t *stream, svn_write_fn_t write_fn) |
Set stream's write function to write_fn. | |
void | svn_stream_set_close (svn_stream_t *stream, svn_close_fn_t close_fn) |
Set stream's close function to close_fn. | |
svn_stream_t * | svn_stream_empty (apr_pool_t *pool) |
Convenience function to create a generic stream which is empty. | |
svn_stream_t * | svn_stream_from_aprfile (apr_file_t *file, apr_pool_t *pool) |
Convenience function for creating streams which operate on APR files. | |
svn_error_t * | svn_stream_for_stdout (svn_stream_t **out, apr_pool_t *pool) |
Set *out to a generic stream connected to stdout, allocated in pool. | |
svn_stream_t * | svn_stream_from_stringbuf (svn_stringbuf_t *str, apr_pool_t *pool) |
Return a generic stream connected to stringbuf str. | |
svn_stream_t * | svn_stream_compressed (svn_stream_t *stream, apr_pool_t *pool) |
Return a stream that decompresses all data read and compresses all data written. | |
svn_error_t * | svn_stream_read (svn_stream_t *stream, char *buffer, apr_size_t *len) |
Read from a generic stream. | |
svn_error_t * | svn_stream_write (svn_stream_t *stream, const char *data, apr_size_t *len) |
Write to a generic stream. | |
svn_error_t * | svn_stream_close (svn_stream_t *stream) |
Close a generic stream. | |
svn_error_t * | svn_stream_printf (svn_stream_t *stream, apr_pool_t *pool, const char *fmt,...) __attribute__((format(printf |
Write to stream using a printf-style fmt specifier, passed through apr_psprintf using memory from pool. | |
svn_error_t * | svn_stream_readline (svn_stream_t *stream, svn_stringbuf_t **stringbuf, const char *eol, svn_boolean_t *eof, apr_pool_t *pool) |
Allocate *stringbuf in pool, and read into it one line (terminated by eol) from stream. |
|
An abstract stream of bytes--either incoming or outgoing or both. The creator of a stream sets functions to handle read and write. Both of these handlers accept a baton whose value is determined at stream creation time; this baton can point to a structure containing data associated with the stream. If a caller attempts to invoke a handler which has not been set, it will generate a runtime assertion failure. The creator can also set a handler for close requests so that it can flush buffered data or whatever; if a close handler is not specified, a close request on the stream will simply be ignored. Note that svn_stream_close() does not deallocate the memory used to allocate the stream structure; free the pool you created the stream in to free that memory. The read and write handlers accept length arguments via pointer. On entry to the handler, the pointed-to value should be the amount of data which can be read or the amount of data to write. When the handler returns, the value is reset to the amount of data actually read or written. Handlers are obliged to complete a read or write to the maximum extent possible; thus, a short read with no associated error implies the end of the input stream, and a short write should never occur without an associated error. |
|
Return a stream that decompresses all data read and compresses all data written.
The stream stream is used to read and write all compressed data. All compression data structures are allocated on pool. If compression support is not compiled in then |
|
Set *out to a generic stream connected to stdout, allocated in pool. The stream and its underlying APR handle will be closed when pool is cleared or destroyed. |
|
Convenience function for creating streams which operate on APR files.
For convenience, if file is NULL then |
|
Return a generic stream connected to stringbuf str. Allocate the stream in pool. |
|
Allocate *stringbuf in pool, and read into it one line (terminated by eol) from stream. The line-terminator is read from the stream, but is not added to the end of the stringbuf. Instead, the stringbuf ends with a usual '\0'.
If stream runs out of bytes before encountering a line-terminator, then set *eof to |