FreeBSD/contrib/subversion/subversion/libsvn_fs_x/cached_data.c
/* Inialize the representation read state RS for the given REP_HEADER and
 * p2l index ENTRY.  If not NULL, assign FILE and STREAM to RS.
 * Allocate all sub-structures of RS in RESULT_POOL.
 */
Inialize the representation read state RS for the given REP_HEADER and
p2l index ENTRY.  If not NULL, assign FILE and STREAM to RS.
Allocate all sub-structures of RS in RESULT_POOL.
Inialize the representation read state RS for the given REP_HEADER and p2l index ENTRY . If not NULL assign FILE and STREAM to RS . Allocate all sub - structures of RS in RESULT_POOL .
static svn_error_t *
init_rep_state(rep_state_t *rs,
               svn_fs_x__rep_header_t *rep_header,
               svn_fs_t *fs,
               svn_fs_x__revision_file_t *rev_file,
               svn_fs_x__p2l_entry_t* entry,
               apr_pool_t *result_pool)
{
  svn_fs_x__data_t *ffd = fs->fsap_data;
  shared_file_t *shared_file = apr_pcalloc(result_pool, sizeof(*shared_file));
  SVN_ERR_ASSERT(entry->type >= SVN_FS_X__ITEM_TYPE_FILE_REP
                 && entry->type <= SVN_FS_X__ITEM_TYPE_DIR_PROPS);
  SVN_ERR_ASSERT(entry->item_count == 1);
  shared_file->rfile = rev_file;
  shared_file->fs = fs;
  shared_file->revision = svn_fs_x__get_revnum(entry->items[0].change_set);
  shared_file->pool = result_pool;
  rs->sfile = shared_file;
  rs->rep_id = entry->items[0];
  rs->header_size = rep_header->header_size;
  rs->start = entry->offset + rs->header_size;
  rs->current = 4;
  rs->size = entry->size - rep_header->header_size - 7;
  rs->ver = 1;
  rs->chunk_index = 0;
  rs->window_cache = ffd->txdelta_window_cache;
  rs->combined_cache = ffd->combined_window_cache;
  return SVN_NO_ERROR;
}
static svn_error_t * init_rep_state ( rep_state_t * rs , svn_fs_x__rep_header_t * rep_header , svn_fs_t * fs , svn_fs_x__revision_file_t * rev_file , svn_fs_x__p2l_entry_t * entry , apr_pool_t * result_pool ) { svn_fs_x__data_t * ffd = fs -> fsap_data ; shared_file_t * shared_file = apr_pcalloc ( result_pool , sizeof ( * shared_file ) ) ; SVN_ERR_ASSERT ( entry -> type >= SVN_FS_X__ITEM_TYPE_FILE_REP && entry -> type <= SVN_FS_X__ITEM_TYPE_DIR_PROPS ) ; SVN_ERR_ASSERT ( entry -> item_count == 1 ) ; shared_file -> rfile = rev_file ; shared_file -> fs = fs ; shared_file -> revision = svn_fs_x__get_revnum ( entry -> items [ 0 ] . change_set ) ; shared_file -> pool = result_pool ; rs -> sfile = shared_file ; rs -> rep_id = entry -> items [ 0 ] ; rs -> header_size = rep_header -> header_size ; rs -> start = entry -> offset + rs -> header_size ; rs -> current = 4 ; rs -> size = entry -> size - rep_header -> header_size - 7 ; rs -> ver = 1 ; rs -> chunk_index = 0 ; rs -> window_cache = ffd -> txdelta_window_cache ; rs -> combined_cache = ffd -> combined_window_cache ; return SVN_NO_ERROR ; }
Inialize the representation read state RS for the given REP_HEADER and
 p2l index ENTRY.
Inialize the representation read state RS for the given REP_HEADER and p2l index ENTRY .
/* this function does not apply to representation containers */