FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c
/* Create a rep_read_baton structure for node revision NODEREV in
   filesystem FS and store it in *RB_P.  Perform all allocations in
   POOL.  If rep is mutable, it must be for file contents. */
Create a rep_read_baton structure for node revision NODEREV in
filesystem FS and store it in *RB_P.  Perform all allocations in
POOL.  If rep is mutable, it must be for file contents.
Create a rep_read_baton structure for node revision NODEREV in filesystem FS and store it in * RB_P . Perform all allocations in POOL . If rep is mutable it must be for file contents .
static svn_error_t *
rep_read_get_baton(struct rep_read_baton **rb_p,
                   svn_fs_t *fs,
                   representation_t *rep,
                   pair_cache_key_t fulltext_cache_key,
                   apr_pool_t *pool)
{
  struct rep_read_baton *b;
  b = apr_pcalloc(pool, sizeof(*b));
  b->fs = fs;
  b->rep = *rep;
  b->base_window = NULL;
  b->chunk_index = 0;
  b->buf = NULL;
  b->md5_checksum_ctx = svn_checksum_ctx_create(svn_checksum_md5, pool);
  b->checksum_finalized = FALSE;
  memcpy(b->md5_digest, rep->md5_digest, sizeof(rep->md5_digest));
  b->len = rep->expanded_size;
  b->off = 0;
  b->fulltext_cache_key = fulltext_cache_key;
  b->pool = svn_pool_create(pool);
  b->filehandle_pool = svn_pool_create(pool);
  b->fulltext_cache = NULL;
  b->fulltext_delivered = 0;
  b->current_fulltext = NULL;
  *rb_p = b;
  return SVN_NO_ERROR;
}
static svn_error_t * rep_read_get_baton ( struct rep_read_baton * * rb_p , svn_fs_t * fs , representation_t * rep , pair_cache_key_t fulltext_cache_key , apr_pool_t * pool ) { struct rep_read_baton * b ; b = apr_pcalloc ( pool , sizeof ( * b ) ) ; b -> fs = fs ; b -> rep = * rep ; b -> base_window = NULL ; b -> chunk_index = 0 ; b -> buf = NULL ; b -> md5_checksum_ctx = svn_checksum_ctx_create ( svn_checksum_md5 , pool ) ; b -> checksum_finalized = FALSE ; memcpy ( b -> md5_digest , rep -> md5_digest , sizeof ( rep -> md5_digest ) ) ; b -> len = rep -> expanded_size ; b -> off = 0 ; b -> fulltext_cache_key = fulltext_cache_key ; b -> pool = svn_pool_create ( pool ) ; b -> filehandle_pool = svn_pool_create ( pool ) ; b -> fulltext_cache = NULL ; b -> fulltext_delivered = 0 ; b -> current_fulltext = NULL ; * rb_p = b ; return SVN_NO_ERROR ; }
Create a rep_read_baton structure for node revision NODEREV in
filesystem FS and store it in *RB_P.
Create a rep_read_baton structure for node revision NODEREV in filesystem FS and store it in * RB_P .
/* Save our output baton. */