FreeBSD/contrib/subversion/subversion/libsvn_fs_base/bdb/nodes-table.c
/* Storing and retrieving NODE-REVISIONs.  */
Storing and retrieving NODE-REVISIONs.
Storing and retrieving NODE - REVISIONs .
svn_error_t *
svn_fs_bdb__get_node_revision(node_revision_t **noderev_p,
                              svn_fs_t *fs,
                              const svn_fs_id_t *id,
                              trail_t *trail,
                              apr_pool_t *pool)
{
  base_fs_data_t *bfd = fs->fsap_data;
  node_revision_t *noderev;
  svn_skel_t *skel;
  int db_err;
  DBT key, value;
  svn_fs_base__trail_debug(trail, "nodes", "get");
  db_err = bfd->nodes->get(bfd->nodes, trail->db_txn,
                           svn_fs_base__id_to_dbt(&key, id, pool),
                           svn_fs_base__result_dbt(&value),
                           0);
  svn_fs_base__track_dbt(&value, pool);
  if (db_err == DB_NOTFOUND)
    return svn_fs_base__err_dangling_id(fs, id);
  SVN_ERR(BDB_WRAP(fs, N_("reading node revision"), db_err));
  if (! noderev_p)
    return SVN_NO_ERROR;
  skel = svn_skel__parse(value.data, value.size, pool);
  SVN_ERR(svn_fs_base__parse_node_revision_skel(&noderev, skel, pool));
  *noderev_p = noderev;
  return SVN_NO_ERROR;
}
svn_error_t * svn_fs_bdb__get_node_revision ( node_revision_t * * noderev_p , svn_fs_t * fs , const svn_fs_id_t * id , trail_t * trail , apr_pool_t * pool ) { base_fs_data_t * bfd = fs -> fsap_data ; node_revision_t * noderev ; svn_skel_t * skel ; int db_err ; DBT key , value ; svn_fs_base__trail_debug ( trail , " " , " " ) ; db_err = bfd -> nodes -> get ( bfd -> nodes , trail -> db_txn , svn_fs_base__id_to_dbt ( & key , id , pool ) , svn_fs_base__result_dbt ( & value ) , 0 ) ; svn_fs_base__track_dbt ( & value , pool ) ; if ( db_err == DB_NOTFOUND ) return svn_fs_base__err_dangling_id ( fs , id ) ; SVN_ERR ( BDB_WRAP ( fs , N_ ( " " ) , db_err ) ) ; if ( ! noderev_p ) return SVN_NO_ERROR ; skel = svn_skel__parse ( value . data , value . size , pool ) ; SVN_ERR ( svn_fs_base__parse_node_revision_skel ( & noderev , skel , pool ) ) ; * noderev_p = noderev ; return SVN_NO_ERROR ; }
Storing and retrieving NODE-REVISIONs.
Storing and retrieving NODE - REVISIONs .
/* If there's no such node, return an appropriately specific error.  */ /* Handle any other error conditions.  */ /* If our caller doesn't really care about the return value here,
     just return successfully. */ /* Parse and the NODE-REVISION skel.  */ /* Convert to a native FS type. */