FreeBSD/contrib/subversion/subversion/libsvn_subr/packed_data.c
/* Read a compressed block from STREAM and uncompress it into UNCOMPRESSED.
 * UNCOMPRESSED_LEN is the expected size of the stream.  COMPRESSED is a
 * re-used buffer for temporary data.
 */
Read a compressed block from STREAM and uncompress it into UNCOMPRESSED.
UNCOMPRESSED_LEN is the expected size of the stream.  COMPRESSED is a
re-used buffer for temporary data.
Read a compressed block from STREAM and uncompress it into UNCOMPRESSED . UNCOMPRESSED_LEN is the expected size of the stream . COMPRESSED is a re - used buffer for temporary data .
static svn_error_t *
read_stream_data(svn_stream_t *stream,
                 apr_size_t uncompressed_len,
                 svn_stringbuf_t *uncompressed,
                 svn_stringbuf_t *compressed)
{
  apr_uint64_t len;
  apr_size_t compressed_len;
  SVN_ERR(read_stream_uint(stream, &len));
  compressed_len = (apr_size_t)len;
  svn_stringbuf_ensure(compressed, compressed_len);
  compressed->len = compressed_len;
  SVN_ERR(svn_stream_read_full(stream, compressed->data, &compressed->len));
  compressed->data[compressed_len] = '\0';
  SVN_ERR(svn__decompress(compressed, uncompressed, uncompressed_len));
  return SVN_NO_ERROR;
}
static svn_error_t * read_stream_data ( svn_stream_t * stream , apr_size_t uncompressed_len , svn_stringbuf_t * uncompressed , svn_stringbuf_t * compressed ) { apr_uint64_t len ; apr_size_t compressed_len ; SVN_ERR ( read_stream_uint ( stream , & len ) ) ; compressed_len = ( apr_size_t ) len ; svn_stringbuf_ensure ( compressed , compressed_len ) ; compressed -> len = compressed_len ; SVN_ERR ( svn_stream_read_full ( stream , compressed -> data , & compressed -> len ) ) ; compressed -> data [ compressed_len ] = ' \0 ' ; SVN_ERR ( svn__decompress ( compressed , uncompressed , uncompressed_len ) ) ; return SVN_NO_ERROR ; }
Read a compressed block from STREAM and uncompress it into UNCOMPRESSED.
Read a compressed block from STREAM and uncompress it into UNCOMPRESSED .