FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/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.
 * Use RESULT_POOL for allocations.
 */
Inialize the representation read state RS for the given REP_HEADER and
p2l index ENTRY.  If not NULL, assign FILE and STREAM to RS.
Use RESULT_POOL for allocations.
Inialize the representation read state RS for the given REP_HEADER and p2l index ENTRY . If not NULL assign FILE and STREAM to RS . Use RESULT_POOL for allocations .
static svn_error_t *
init_rep_state(rep_state_t *rs,
               svn_fs_fs__rep_header_t *rep_header,
               svn_fs_t *fs,
               svn_fs_fs__revision_file_t *file,
               svn_fs_fs__p2l_entry_t* entry,
               apr_pool_t *result_pool)
{
  fs_fs_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_FS__ITEM_TYPE_FILE_REP
                 && entry->type <= SVN_FS_FS__ITEM_TYPE_DIR_PROPS);
  shared_file->rfile = file;
  shared_file->fs = fs;
  shared_file->revision = entry->item.revision;
  shared_file->pool = result_pool;
  rs->sfile = shared_file;
  rs->revision = entry->item.revision;
  rs->item_index = entry->item.number;
  rs->header_size = rep_header->header_size;
  rs->start = entry->offset + rs->header_size;
  rs->current = rep_header->type == svn_fs_fs__rep_plain ? 0 : 4;
  rs->size = entry->size - rep_header->header_size - 7;
  rs->ver = 1;
  rs->chunk_index = 0;
  rs->raw_window_cache = ffd->raw_window_cache;
  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_fs__rep_header_t * rep_header , svn_fs_t * fs , svn_fs_fs__revision_file_t * file , svn_fs_fs__p2l_entry_t * entry , apr_pool_t * result_pool ) { fs_fs_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_FS__ITEM_TYPE_FILE_REP && entry -> type <= SVN_FS_FS__ITEM_TYPE_DIR_PROPS ) ; shared_file -> rfile = file ; shared_file -> fs = fs ; shared_file -> revision = entry -> item . revision ; shared_file -> pool = result_pool ; rs -> sfile = shared_file ; rs -> revision = entry -> item . revision ; rs -> item_index = entry -> item . number ; rs -> header_size = rep_header -> header_size ; rs -> start = entry -> offset + rs -> header_size ; rs -> current = rep_header -> type == svn_fs_fs__rep_plain ? 0 : 4 ; rs -> size = entry -> size - rep_header -> header_size - 7 ; rs -> ver = 1 ; rs -> chunk_index = 0 ; rs -> raw_window_cache = ffd -> raw_window_cache ; 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 */