FreeBSD/contrib/subversion/subversion/libsvn_fs_base/bdb/reps-table.c
/*** Creating and opening the representations table. ***/
Creating and opening the representations table.
Creating and opening the representations table .
int
svn_fs_bdb__open_reps_table(DB **reps_p,
                            DB_ENV *env,
                            svn_boolean_t create)
{
  const u_int32_t open_flags = (create ? (DB_CREATE | DB_EXCL) : 0);
  DB *reps;
  BDB_ERR(svn_fs_bdb__check_version());
  BDB_ERR(db_create(&reps, env, 0));
  BDB_ERR((reps->open)(SVN_BDB_OPEN_PARAMS(reps, NULL),
                       "representations", 0, DB_BTREE,
                       open_flags, 0666));
  if (create)
  {
    DBT key, value;
    BDB_ERR(reps->put
            (reps, 0,
             svn_fs_base__str_to_dbt(&key, NEXT_KEY_KEY),
             svn_fs_base__str_to_dbt(&value, "0"), 0));
  }
  *reps_p = reps;
  return 0;
}
int svn_fs_bdb__open_reps_table ( DB * * reps_p , DB_ENV * env , svn_boolean_t create ) { const u_int32_t open_flags = ( create ? ( DB_CREATE | DB_EXCL ) : 0 ) ; DB * reps ; BDB_ERR ( svn_fs_bdb__check_version ( ) ) ; BDB_ERR ( db_create ( & reps , env , 0 ) ) ; BDB_ERR ( ( reps -> open ) ( SVN_BDB_OPEN_PARAMS ( reps , NULL ) , " " , 0 , DB_BTREE , open_flags , 0666 ) ) ; if ( create ) { DBT key , value ; BDB_ERR ( reps -> put ( reps , 0 , svn_fs_base__str_to_dbt ( & key , NEXT_KEY_KEY ) , svn_fs_base__str_to_dbt ( & value , " " ) , 0 ) ) ; } * reps_p = reps ; return 0 ; }
Creating and opening the representations table.
Creating and opening the representations table .
/* Create the `next-key' table entry.  */