FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c
/* Read SIZE bytes from the representation RS and return it in *NWIN. */
Read SIZE bytes from the representation RS and return it in *NWIN.
Read SIZE bytes from the representation RS and return it in * NWIN .
static svn_error_t *
read_plain_window(svn_stringbuf_t **nwin, rep_state_t *rs,
                  apr_size_t size, apr_pool_t *result_pool,
                  apr_pool_t *scratch_pool)
{
  apr_off_t offset;
  SVN_ERR(auto_open_shared_file(rs->sfile));
  SVN_ERR(auto_set_start_offset(rs, scratch_pool));
  offset = rs->start + rs->current;
  SVN_ERR(rs_aligned_seek(rs, NULL, offset, scratch_pool));
  *nwin = svn_stringbuf_create_ensure(size, result_pool);
  SVN_ERR(svn_io_file_read_full2(rs->sfile->rfile->file, (*nwin)->data, size,
                                 NULL, NULL, result_pool));
  (*nwin)->data[size] = 0;
  rs->current += (apr_off_t)size;
  return SVN_NO_ERROR;
}
static svn_error_t * read_plain_window ( svn_stringbuf_t * * nwin , rep_state_t * rs , apr_size_t size , apr_pool_t * result_pool , apr_pool_t * scratch_pool ) { apr_off_t offset ; SVN_ERR ( auto_open_shared_file ( rs -> sfile ) ) ; SVN_ERR ( auto_set_start_offset ( rs , scratch_pool ) ) ; offset = rs -> start + rs -> current ; SVN_ERR ( rs_aligned_seek ( rs , NULL , offset , scratch_pool ) ) ; * nwin = svn_stringbuf_create_ensure ( size , result_pool ) ; SVN_ERR ( svn_io_file_read_full2 ( rs -> sfile -> rfile -> file , ( * nwin ) -> data , size , NULL , NULL , result_pool ) ) ; ( * nwin ) -> data [ size ] = 0 ; rs -> current += ( apr_off_t ) size ; return SVN_NO_ERROR ; }
Read SIZE bytes from the representation RS and return it in *NWIN.
Read SIZE bytes from the representation RS and return it in * NWIN .
/* RS->FILE may be shared between RS instances -> make sure we point
   * to the right data. */ /* Read the plain data. */ /* Update RS. */